1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[doc = " The kinds of offers that can target the children in a collection.\n"]
8 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9 #[repr(u32)]
10 pub enum AllowedOffers {
11 StaticOnly = 1,
12 StaticAndDynamic = 2,
13 }
14 impl ::core::convert::TryFrom<u32> for AllowedOffers {
15 type Error = ::fidl_next::UnknownStrictEnumMemberError;
16 fn try_from(
17 value: u32,
18 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
19 match value {
20 1 => Ok(Self::StaticOnly),
21 2 => Ok(Self::StaticAndDynamic),
22
23 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
24 }
25 }
26 }
27
28 unsafe impl<___E> ::fidl_next::Encode<crate::wire::AllowedOffers, ___E> for AllowedOffers
29 where
30 ___E: ?Sized,
31 {
32 #[inline]
33 fn encode(
34 self,
35 encoder: &mut ___E,
36 out: &mut ::core::mem::MaybeUninit<crate::wire::AllowedOffers>,
37 _: (),
38 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
39 ::fidl_next::Encode::encode(&self, encoder, out, ())
40 }
41 }
42
43 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::AllowedOffers, ___E> for &'a AllowedOffers
44 where
45 ___E: ?Sized,
46 {
47 #[inline]
48 fn encode(
49 self,
50 encoder: &mut ___E,
51 out: &mut ::core::mem::MaybeUninit<crate::wire::AllowedOffers>,
52 _: (),
53 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
54 ::fidl_next::munge!(let crate::wire::AllowedOffers { value } = out);
55 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
56 AllowedOffers::StaticOnly => 1,
57
58 AllowedOffers::StaticAndDynamic => 2,
59 }));
60
61 Ok(())
62 }
63 }
64
65 impl ::core::convert::From<crate::wire::AllowedOffers> for AllowedOffers {
66 fn from(wire: crate::wire::AllowedOffers) -> Self {
67 match u32::from(wire.value) {
68 1 => Self::StaticOnly,
69
70 2 => Self::StaticAndDynamic,
71
72 _ => unsafe { ::core::hint::unreachable_unchecked() },
73 }
74 }
75 }
76
77 impl ::fidl_next::FromWire<crate::wire::AllowedOffers> for AllowedOffers {
78 #[inline]
79 fn from_wire(wire: crate::wire::AllowedOffers) -> Self {
80 Self::from(wire)
81 }
82 }
83
84 impl ::fidl_next::FromWireRef<crate::wire::AllowedOffers> for AllowedOffers {
85 #[inline]
86 fn from_wire_ref(wire: &crate::wire::AllowedOffers) -> Self {
87 Self::from(*wire)
88 }
89 }
90
91 #[doc = " Describes the expected availability of the capability.\n\n Some capabilities may not be present on all system configurations. In those\n cases, the availability will be declared as `OPTIONAL` along the chains of\n exposes/offers/uses, and the capability would be routed from `void` on\n system configurations where it does not make sense to route or provide a\n particular capability (e.g. graphical capabilities on a headless system).\n"]
92 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
93 #[repr(u32)]
94 pub enum Availability {
95 Required = 1,
96 Optional = 2,
97 SameAsTarget = 3,
98 Transitional = 4,
99 }
100 impl ::core::convert::TryFrom<u32> for Availability {
101 type Error = ::fidl_next::UnknownStrictEnumMemberError;
102 fn try_from(
103 value: u32,
104 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
105 match value {
106 1 => Ok(Self::Required),
107 2 => Ok(Self::Optional),
108 3 => Ok(Self::SameAsTarget),
109 4 => Ok(Self::Transitional),
110
111 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
112 }
113 }
114 }
115
116 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Availability, ___E> for Availability
117 where
118 ___E: ?Sized,
119 {
120 #[inline]
121 fn encode(
122 self,
123 encoder: &mut ___E,
124 out: &mut ::core::mem::MaybeUninit<crate::wire::Availability>,
125 _: (),
126 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
127 ::fidl_next::Encode::encode(&self, encoder, out, ())
128 }
129 }
130
131 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Availability, ___E> for &'a Availability
132 where
133 ___E: ?Sized,
134 {
135 #[inline]
136 fn encode(
137 self,
138 encoder: &mut ___E,
139 out: &mut ::core::mem::MaybeUninit<crate::wire::Availability>,
140 _: (),
141 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
142 ::fidl_next::munge!(let crate::wire::Availability { value } = out);
143 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
144 Availability::Required => 1,
145
146 Availability::Optional => 2,
147
148 Availability::SameAsTarget => 3,
149
150 Availability::Transitional => 4,
151 }));
152
153 Ok(())
154 }
155 }
156
157 impl ::core::convert::From<crate::wire::Availability> for Availability {
158 fn from(wire: crate::wire::Availability) -> Self {
159 match u32::from(wire.value) {
160 1 => Self::Required,
161
162 2 => Self::Optional,
163
164 3 => Self::SameAsTarget,
165
166 4 => Self::Transitional,
167
168 _ => unsafe { ::core::hint::unreachable_unchecked() },
169 }
170 }
171 }
172
173 impl ::fidl_next::FromWire<crate::wire::Availability> for Availability {
174 #[inline]
175 fn from_wire(wire: crate::wire::Availability) -> Self {
176 Self::from(wire)
177 }
178 }
179
180 impl ::fidl_next::FromWireRef<crate::wire::Availability> for Availability {
181 #[inline]
182 fn from_wire_ref(wire: &crate::wire::Availability) -> Self {
183 Self::from(*wire)
184 }
185 }
186
187 pub type Name = ::std::string::String;
188
189 #[doc = " Declares a service capability backed by this component.\n\n To learn more about services, see:\n https://fuchsia.dev/fuchsia-src/glossary#service\n"]
190 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
191 pub struct Service {
192 pub name: ::core::option::Option<::std::string::String>,
193
194 pub source_path: ::core::option::Option<::std::string::String>,
195 }
196
197 impl Service {
198 fn __max_ordinal(&self) -> usize {
199 if self.source_path.is_some() {
200 return 2;
201 }
202
203 if self.name.is_some() {
204 return 1;
205 }
206
207 0
208 }
209 }
210
211 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Service<'static>, ___E> for Service
212 where
213 ___E: ::fidl_next::Encoder + ?Sized,
214 {
215 #[inline]
216 fn encode(
217 mut self,
218 encoder: &mut ___E,
219 out: &mut ::core::mem::MaybeUninit<crate::wire::Service<'static>>,
220 _: (),
221 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
222 ::fidl_next::munge!(let crate::wire::Service { table } = out);
223
224 let max_ord = self.__max_ordinal();
225
226 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
227 ::fidl_next::Wire::zero_padding(&mut out);
228
229 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
230 ::fidl_next::wire::Envelope,
231 >(encoder, max_ord);
232
233 for i in 1..=max_ord {
234 match i {
235 2 => {
236 if let Some(value) = self.source_path.take() {
237 ::fidl_next::wire::Envelope::encode_value::<
238 ::fidl_next::wire::String<'static>,
239 ___E,
240 >(
241 value, preallocated.encoder, &mut out, 1024
242 )?;
243 } else {
244 ::fidl_next::wire::Envelope::encode_zero(&mut out)
245 }
246 }
247
248 1 => {
249 if let Some(value) = self.name.take() {
250 ::fidl_next::wire::Envelope::encode_value::<
251 ::fidl_next::wire::String<'static>,
252 ___E,
253 >(
254 value, preallocated.encoder, &mut out, 100
255 )?;
256 } else {
257 ::fidl_next::wire::Envelope::encode_zero(&mut out)
258 }
259 }
260
261 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
262 }
263 unsafe {
264 preallocated.write_next(out.assume_init_ref());
265 }
266 }
267
268 ::fidl_next::wire::Table::encode_len(table, max_ord);
269
270 Ok(())
271 }
272 }
273
274 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Service<'static>, ___E> for &'a Service
275 where
276 ___E: ::fidl_next::Encoder + ?Sized,
277 {
278 #[inline]
279 fn encode(
280 self,
281 encoder: &mut ___E,
282 out: &mut ::core::mem::MaybeUninit<crate::wire::Service<'static>>,
283 _: (),
284 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
285 ::fidl_next::munge!(let crate::wire::Service { table } = out);
286
287 let max_ord = self.__max_ordinal();
288
289 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
290 ::fidl_next::Wire::zero_padding(&mut out);
291
292 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
293 ::fidl_next::wire::Envelope,
294 >(encoder, max_ord);
295
296 for i in 1..=max_ord {
297 match i {
298 2 => {
299 if let Some(value) = &self.source_path {
300 ::fidl_next::wire::Envelope::encode_value::<
301 ::fidl_next::wire::String<'static>,
302 ___E,
303 >(
304 value, preallocated.encoder, &mut out, 1024
305 )?;
306 } else {
307 ::fidl_next::wire::Envelope::encode_zero(&mut out)
308 }
309 }
310
311 1 => {
312 if let Some(value) = &self.name {
313 ::fidl_next::wire::Envelope::encode_value::<
314 ::fidl_next::wire::String<'static>,
315 ___E,
316 >(
317 value, preallocated.encoder, &mut out, 100
318 )?;
319 } else {
320 ::fidl_next::wire::Envelope::encode_zero(&mut out)
321 }
322 }
323
324 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
325 }
326 unsafe {
327 preallocated.write_next(out.assume_init_ref());
328 }
329 }
330
331 ::fidl_next::wire::Table::encode_len(table, max_ord);
332
333 Ok(())
334 }
335 }
336
337 impl<'de> ::fidl_next::FromWire<crate::wire::Service<'de>> for Service {
338 #[inline]
339 fn from_wire(wire_: crate::wire::Service<'de>) -> Self {
340 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
341
342 let name = wire_.table.get(1);
343
344 let source_path = wire_.table.get(2);
345
346 Self {
347 name: name.map(|envelope| {
348 ::fidl_next::FromWire::from_wire(unsafe {
349 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
350 })
351 }),
352
353 source_path: source_path.map(|envelope| {
354 ::fidl_next::FromWire::from_wire(unsafe {
355 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
356 })
357 }),
358 }
359 }
360 }
361
362 impl<'de> ::fidl_next::FromWireRef<crate::wire::Service<'de>> for Service {
363 #[inline]
364 fn from_wire_ref(wire: &crate::wire::Service<'de>) -> Self {
365 Self {
366 name: wire.table.get(1).map(|envelope| {
367 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
368 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
369 })
370 }),
371
372 source_path: wire.table.get(2).map(|envelope| {
373 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
374 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
375 })
376 }),
377 }
378 }
379 }
380
381 #[doc = " Declares a directory capability backed by this component.\n\n To learn more about directories, see:\n https://fuchsia.dev/fuchsia-src/glossary#directory\n"]
382 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
383 pub struct Directory {
384 pub name: ::core::option::Option<::std::string::String>,
385
386 pub source_path: ::core::option::Option<::std::string::String>,
387
388 pub rights: ::core::option::Option<::fidl_next_common_fuchsia_io::natural::Operations>,
389 }
390
391 impl Directory {
392 fn __max_ordinal(&self) -> usize {
393 if self.rights.is_some() {
394 return 3;
395 }
396
397 if self.source_path.is_some() {
398 return 2;
399 }
400
401 if self.name.is_some() {
402 return 1;
403 }
404
405 0
406 }
407 }
408
409 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Directory<'static>, ___E> for Directory
410 where
411 ___E: ::fidl_next::Encoder + ?Sized,
412 {
413 #[inline]
414 fn encode(
415 mut self,
416 encoder: &mut ___E,
417 out: &mut ::core::mem::MaybeUninit<crate::wire::Directory<'static>>,
418 _: (),
419 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
420 ::fidl_next::munge!(let crate::wire::Directory { table } = out);
421
422 let max_ord = self.__max_ordinal();
423
424 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
425 ::fidl_next::Wire::zero_padding(&mut out);
426
427 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
428 ::fidl_next::wire::Envelope,
429 >(encoder, max_ord);
430
431 for i in 1..=max_ord {
432 match i {
433 3 => {
434 if let Some(value) = self.rights.take() {
435 ::fidl_next::wire::Envelope::encode_value::<
436 ::fidl_next_common_fuchsia_io::wire::Operations,
437 ___E,
438 >(
439 value, preallocated.encoder, &mut out, ()
440 )?;
441 } else {
442 ::fidl_next::wire::Envelope::encode_zero(&mut out)
443 }
444 }
445
446 2 => {
447 if let Some(value) = self.source_path.take() {
448 ::fidl_next::wire::Envelope::encode_value::<
449 ::fidl_next::wire::String<'static>,
450 ___E,
451 >(
452 value, preallocated.encoder, &mut out, 1024
453 )?;
454 } else {
455 ::fidl_next::wire::Envelope::encode_zero(&mut out)
456 }
457 }
458
459 1 => {
460 if let Some(value) = self.name.take() {
461 ::fidl_next::wire::Envelope::encode_value::<
462 ::fidl_next::wire::String<'static>,
463 ___E,
464 >(
465 value, preallocated.encoder, &mut out, 100
466 )?;
467 } else {
468 ::fidl_next::wire::Envelope::encode_zero(&mut out)
469 }
470 }
471
472 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
473 }
474 unsafe {
475 preallocated.write_next(out.assume_init_ref());
476 }
477 }
478
479 ::fidl_next::wire::Table::encode_len(table, max_ord);
480
481 Ok(())
482 }
483 }
484
485 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Directory<'static>, ___E> for &'a Directory
486 where
487 ___E: ::fidl_next::Encoder + ?Sized,
488 {
489 #[inline]
490 fn encode(
491 self,
492 encoder: &mut ___E,
493 out: &mut ::core::mem::MaybeUninit<crate::wire::Directory<'static>>,
494 _: (),
495 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
496 ::fidl_next::munge!(let crate::wire::Directory { table } = out);
497
498 let max_ord = self.__max_ordinal();
499
500 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
501 ::fidl_next::Wire::zero_padding(&mut out);
502
503 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
504 ::fidl_next::wire::Envelope,
505 >(encoder, max_ord);
506
507 for i in 1..=max_ord {
508 match i {
509 3 => {
510 if let Some(value) = &self.rights {
511 ::fidl_next::wire::Envelope::encode_value::<
512 ::fidl_next_common_fuchsia_io::wire::Operations,
513 ___E,
514 >(
515 value, preallocated.encoder, &mut out, ()
516 )?;
517 } else {
518 ::fidl_next::wire::Envelope::encode_zero(&mut out)
519 }
520 }
521
522 2 => {
523 if let Some(value) = &self.source_path {
524 ::fidl_next::wire::Envelope::encode_value::<
525 ::fidl_next::wire::String<'static>,
526 ___E,
527 >(
528 value, preallocated.encoder, &mut out, 1024
529 )?;
530 } else {
531 ::fidl_next::wire::Envelope::encode_zero(&mut out)
532 }
533 }
534
535 1 => {
536 if let Some(value) = &self.name {
537 ::fidl_next::wire::Envelope::encode_value::<
538 ::fidl_next::wire::String<'static>,
539 ___E,
540 >(
541 value, preallocated.encoder, &mut out, 100
542 )?;
543 } else {
544 ::fidl_next::wire::Envelope::encode_zero(&mut out)
545 }
546 }
547
548 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
549 }
550 unsafe {
551 preallocated.write_next(out.assume_init_ref());
552 }
553 }
554
555 ::fidl_next::wire::Table::encode_len(table, max_ord);
556
557 Ok(())
558 }
559 }
560
561 impl<'de> ::fidl_next::FromWire<crate::wire::Directory<'de>> for Directory {
562 #[inline]
563 fn from_wire(wire_: crate::wire::Directory<'de>) -> Self {
564 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
565
566 let name = wire_.table.get(1);
567
568 let source_path = wire_.table.get(2);
569
570 let rights = wire_.table.get(3);
571
572 Self {
573 name: name.map(|envelope| {
574 ::fidl_next::FromWire::from_wire(unsafe {
575 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
576 })
577 }),
578
579 source_path: source_path.map(|envelope| {
580 ::fidl_next::FromWire::from_wire(unsafe {
581 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
582 })
583 }),
584
585 rights: rights.map(|envelope| {
586 ::fidl_next::FromWire::from_wire(unsafe {
587 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
588 })
589 }),
590 }
591 }
592 }
593
594 impl<'de> ::fidl_next::FromWireRef<crate::wire::Directory<'de>> for Directory {
595 #[inline]
596 fn from_wire_ref(wire: &crate::wire::Directory<'de>) -> Self {
597 Self {
598 name: wire.table.get(1).map(|envelope| {
599 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
600 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
601 })
602 }),
603
604 source_path: wire.table.get(2).map(|envelope| {
605 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
606 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
607 })
608 }),
609
610 rights: wire.table.get(3).map(|envelope| {
611 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
612 envelope
613 .deref_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
614 })
615 }),
616 }
617 }
618 }
619
620 #[doc = " A reference to a component\'s parent instance.\n"]
621 pub type ParentRef = ();
622
623 #[doc = " A reference to the component itself.\n"]
624 pub type SelfRef = ();
625
626 pub type ChildName = ::std::string::String;
627
628 #[doc = " A reference to one of the component\'s child instances.\n"]
629 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
630 pub struct ChildRef {
631 pub name: ::std::string::String,
632
633 pub collection: ::core::option::Option<::std::string::String>,
634 }
635
636 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ChildRef<'static>, ___E> for ChildRef
637 where
638 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
639 ___E: ::fidl_next::Encoder,
640 {
641 #[inline]
642 fn encode(
643 self,
644 encoder_: &mut ___E,
645 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChildRef<'static>>,
646 _: (),
647 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
648 ::fidl_next::munge! {
649 let crate::wire::ChildRef {
650 name,
651 collection,
652
653 } = out_;
654 }
655
656 ::fidl_next::Encode::encode(self.name, encoder_, name, 1024)?;
657
658 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
659 ::fidl_next::Constrained::validate(_field, 1024)?;
660
661 ::fidl_next::Encode::encode(self.collection, encoder_, collection, 100)?;
662
663 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(collection.as_mut_ptr()) };
664 ::fidl_next::Constrained::validate(_field, 100)?;
665
666 Ok(())
667 }
668 }
669
670 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ChildRef<'static>, ___E> for &'a ChildRef
671 where
672 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
673 ___E: ::fidl_next::Encoder,
674 {
675 #[inline]
676 fn encode(
677 self,
678 encoder_: &mut ___E,
679 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChildRef<'static>>,
680 _: (),
681 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
682 ::fidl_next::munge! {
683 let crate::wire::ChildRef {
684 name,
685 collection,
686
687 } = out_;
688 }
689
690 ::fidl_next::Encode::encode(&self.name, encoder_, name, 1024)?;
691
692 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
693 ::fidl_next::Constrained::validate(_field, 1024)?;
694
695 ::fidl_next::Encode::encode(&self.collection, encoder_, collection, 100)?;
696
697 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(collection.as_mut_ptr()) };
698 ::fidl_next::Constrained::validate(_field, 100)?;
699
700 Ok(())
701 }
702 }
703
704 unsafe impl<___E>
705 ::fidl_next::EncodeOption<
706 ::fidl_next::wire::Box<'static, crate::wire::ChildRef<'static>>,
707 ___E,
708 > for ChildRef
709 where
710 ___E: ::fidl_next::Encoder + ?Sized,
711 ChildRef: ::fidl_next::Encode<crate::wire::ChildRef<'static>, ___E>,
712 {
713 #[inline]
714 fn encode_option(
715 this: ::core::option::Option<Self>,
716 encoder: &mut ___E,
717 out: &mut ::core::mem::MaybeUninit<
718 ::fidl_next::wire::Box<'static, crate::wire::ChildRef<'static>>,
719 >,
720 _: (),
721 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
722 if let Some(inner) = this {
723 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
724 ::fidl_next::wire::Box::encode_present(out);
725 } else {
726 ::fidl_next::wire::Box::encode_absent(out);
727 }
728
729 Ok(())
730 }
731 }
732
733 unsafe impl<'a, ___E>
734 ::fidl_next::EncodeOption<
735 ::fidl_next::wire::Box<'static, crate::wire::ChildRef<'static>>,
736 ___E,
737 > for &'a ChildRef
738 where
739 ___E: ::fidl_next::Encoder + ?Sized,
740 &'a ChildRef: ::fidl_next::Encode<crate::wire::ChildRef<'static>, ___E>,
741 {
742 #[inline]
743 fn encode_option(
744 this: ::core::option::Option<Self>,
745 encoder: &mut ___E,
746 out: &mut ::core::mem::MaybeUninit<
747 ::fidl_next::wire::Box<'static, crate::wire::ChildRef<'static>>,
748 >,
749 _: (),
750 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
751 if let Some(inner) = this {
752 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
753 ::fidl_next::wire::Box::encode_present(out);
754 } else {
755 ::fidl_next::wire::Box::encode_absent(out);
756 }
757
758 Ok(())
759 }
760 }
761
762 impl<'de> ::fidl_next::FromWire<crate::wire::ChildRef<'de>> for ChildRef {
763 #[inline]
764 fn from_wire(wire: crate::wire::ChildRef<'de>) -> Self {
765 Self {
766 name: ::fidl_next::FromWire::from_wire(wire.name),
767
768 collection: ::fidl_next::FromWire::from_wire(wire.collection),
769 }
770 }
771 }
772
773 impl<'de> ::fidl_next::FromWireRef<crate::wire::ChildRef<'de>> for ChildRef {
774 #[inline]
775 fn from_wire_ref(wire: &crate::wire::ChildRef<'de>) -> Self {
776 Self {
777 name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
778
779 collection: ::fidl_next::FromWireRef::from_wire_ref(&wire.collection),
780 }
781 }
782 }
783
784 #[doc = " A reference to one of the component\'s collections.\n"]
785 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
786 pub struct CollectionRef {
787 pub name: ::std::string::String,
788 }
789
790 unsafe impl<___E> ::fidl_next::Encode<crate::wire::CollectionRef<'static>, ___E> for CollectionRef
791 where
792 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
793 ___E: ::fidl_next::Encoder,
794 {
795 #[inline]
796 fn encode(
797 self,
798 encoder_: &mut ___E,
799 out_: &mut ::core::mem::MaybeUninit<crate::wire::CollectionRef<'static>>,
800 _: (),
801 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
802 ::fidl_next::munge! {
803 let crate::wire::CollectionRef {
804 name,
805
806 } = out_;
807 }
808
809 ::fidl_next::Encode::encode(self.name, encoder_, name, 100)?;
810
811 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
812 ::fidl_next::Constrained::validate(_field, 100)?;
813
814 Ok(())
815 }
816 }
817
818 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::CollectionRef<'static>, ___E>
819 for &'a CollectionRef
820 where
821 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
822 ___E: ::fidl_next::Encoder,
823 {
824 #[inline]
825 fn encode(
826 self,
827 encoder_: &mut ___E,
828 out_: &mut ::core::mem::MaybeUninit<crate::wire::CollectionRef<'static>>,
829 _: (),
830 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
831 ::fidl_next::munge! {
832 let crate::wire::CollectionRef {
833 name,
834
835 } = out_;
836 }
837
838 ::fidl_next::Encode::encode(&self.name, encoder_, name, 100)?;
839
840 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
841 ::fidl_next::Constrained::validate(_field, 100)?;
842
843 Ok(())
844 }
845 }
846
847 unsafe impl<___E>
848 ::fidl_next::EncodeOption<
849 ::fidl_next::wire::Box<'static, crate::wire::CollectionRef<'static>>,
850 ___E,
851 > for CollectionRef
852 where
853 ___E: ::fidl_next::Encoder + ?Sized,
854 CollectionRef: ::fidl_next::Encode<crate::wire::CollectionRef<'static>, ___E>,
855 {
856 #[inline]
857 fn encode_option(
858 this: ::core::option::Option<Self>,
859 encoder: &mut ___E,
860 out: &mut ::core::mem::MaybeUninit<
861 ::fidl_next::wire::Box<'static, crate::wire::CollectionRef<'static>>,
862 >,
863 _: (),
864 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
865 if let Some(inner) = this {
866 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
867 ::fidl_next::wire::Box::encode_present(out);
868 } else {
869 ::fidl_next::wire::Box::encode_absent(out);
870 }
871
872 Ok(())
873 }
874 }
875
876 unsafe impl<'a, ___E>
877 ::fidl_next::EncodeOption<
878 ::fidl_next::wire::Box<'static, crate::wire::CollectionRef<'static>>,
879 ___E,
880 > for &'a CollectionRef
881 where
882 ___E: ::fidl_next::Encoder + ?Sized,
883 &'a CollectionRef: ::fidl_next::Encode<crate::wire::CollectionRef<'static>, ___E>,
884 {
885 #[inline]
886 fn encode_option(
887 this: ::core::option::Option<Self>,
888 encoder: &mut ___E,
889 out: &mut ::core::mem::MaybeUninit<
890 ::fidl_next::wire::Box<'static, crate::wire::CollectionRef<'static>>,
891 >,
892 _: (),
893 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
894 if let Some(inner) = this {
895 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
896 ::fidl_next::wire::Box::encode_present(out);
897 } else {
898 ::fidl_next::wire::Box::encode_absent(out);
899 }
900
901 Ok(())
902 }
903 }
904
905 impl<'de> ::fidl_next::FromWire<crate::wire::CollectionRef<'de>> for CollectionRef {
906 #[inline]
907 fn from_wire(wire: crate::wire::CollectionRef<'de>) -> Self {
908 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
909 }
910 }
911
912 impl<'de> ::fidl_next::FromWireRef<crate::wire::CollectionRef<'de>> for CollectionRef {
913 #[inline]
914 fn from_wire_ref(wire: &crate::wire::CollectionRef<'de>) -> Self {
915 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
916 }
917 }
918
919 #[doc = " A reference to the component framework itself.\n"]
920 pub type FrameworkRef = ();
921
922 #[doc = " A reference to a capability declared in this component.\n"]
923 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
924 pub struct CapabilityRef {
925 pub name: ::std::string::String,
926 }
927
928 unsafe impl<___E> ::fidl_next::Encode<crate::wire::CapabilityRef<'static>, ___E> for CapabilityRef
929 where
930 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
931 ___E: ::fidl_next::Encoder,
932 {
933 #[inline]
934 fn encode(
935 self,
936 encoder_: &mut ___E,
937 out_: &mut ::core::mem::MaybeUninit<crate::wire::CapabilityRef<'static>>,
938 _: (),
939 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
940 ::fidl_next::munge! {
941 let crate::wire::CapabilityRef {
942 name,
943
944 } = out_;
945 }
946
947 ::fidl_next::Encode::encode(self.name, encoder_, name, 100)?;
948
949 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
950 ::fidl_next::Constrained::validate(_field, 100)?;
951
952 Ok(())
953 }
954 }
955
956 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::CapabilityRef<'static>, ___E>
957 for &'a CapabilityRef
958 where
959 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
960 ___E: ::fidl_next::Encoder,
961 {
962 #[inline]
963 fn encode(
964 self,
965 encoder_: &mut ___E,
966 out_: &mut ::core::mem::MaybeUninit<crate::wire::CapabilityRef<'static>>,
967 _: (),
968 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
969 ::fidl_next::munge! {
970 let crate::wire::CapabilityRef {
971 name,
972
973 } = out_;
974 }
975
976 ::fidl_next::Encode::encode(&self.name, encoder_, name, 100)?;
977
978 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
979 ::fidl_next::Constrained::validate(_field, 100)?;
980
981 Ok(())
982 }
983 }
984
985 unsafe impl<___E>
986 ::fidl_next::EncodeOption<
987 ::fidl_next::wire::Box<'static, crate::wire::CapabilityRef<'static>>,
988 ___E,
989 > for CapabilityRef
990 where
991 ___E: ::fidl_next::Encoder + ?Sized,
992 CapabilityRef: ::fidl_next::Encode<crate::wire::CapabilityRef<'static>, ___E>,
993 {
994 #[inline]
995 fn encode_option(
996 this: ::core::option::Option<Self>,
997 encoder: &mut ___E,
998 out: &mut ::core::mem::MaybeUninit<
999 ::fidl_next::wire::Box<'static, crate::wire::CapabilityRef<'static>>,
1000 >,
1001 _: (),
1002 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1003 if let Some(inner) = this {
1004 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1005 ::fidl_next::wire::Box::encode_present(out);
1006 } else {
1007 ::fidl_next::wire::Box::encode_absent(out);
1008 }
1009
1010 Ok(())
1011 }
1012 }
1013
1014 unsafe impl<'a, ___E>
1015 ::fidl_next::EncodeOption<
1016 ::fidl_next::wire::Box<'static, crate::wire::CapabilityRef<'static>>,
1017 ___E,
1018 > for &'a CapabilityRef
1019 where
1020 ___E: ::fidl_next::Encoder + ?Sized,
1021 &'a CapabilityRef: ::fidl_next::Encode<crate::wire::CapabilityRef<'static>, ___E>,
1022 {
1023 #[inline]
1024 fn encode_option(
1025 this: ::core::option::Option<Self>,
1026 encoder: &mut ___E,
1027 out: &mut ::core::mem::MaybeUninit<
1028 ::fidl_next::wire::Box<'static, crate::wire::CapabilityRef<'static>>,
1029 >,
1030 _: (),
1031 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1032 if let Some(inner) = this {
1033 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1034 ::fidl_next::wire::Box::encode_present(out);
1035 } else {
1036 ::fidl_next::wire::Box::encode_absent(out);
1037 }
1038
1039 Ok(())
1040 }
1041 }
1042
1043 impl<'de> ::fidl_next::FromWire<crate::wire::CapabilityRef<'de>> for CapabilityRef {
1044 #[inline]
1045 fn from_wire(wire: crate::wire::CapabilityRef<'de>) -> Self {
1046 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
1047 }
1048 }
1049
1050 impl<'de> ::fidl_next::FromWireRef<crate::wire::CapabilityRef<'de>> for CapabilityRef {
1051 #[inline]
1052 fn from_wire_ref(wire: &crate::wire::CapabilityRef<'de>) -> Self {
1053 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
1054 }
1055 }
1056
1057 #[doc = " A reference to the environment\'s debug capabilities.\n"]
1058 pub type DebugRef = ();
1059
1060 #[doc = " A reference to an intentionally missing offer source.\n"]
1061 pub type VoidRef = ();
1062
1063 #[doc = " Declares which identifier to use to key a component\'s isolated storage\n directory.\n"]
1064 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1065 #[repr(u32)]
1066 pub enum StorageId {
1067 StaticInstanceId = 1,
1068 StaticInstanceIdOrMoniker = 2,
1069 }
1070 impl ::core::convert::TryFrom<u32> for StorageId {
1071 type Error = ::fidl_next::UnknownStrictEnumMemberError;
1072 fn try_from(
1073 value: u32,
1074 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
1075 match value {
1076 1 => Ok(Self::StaticInstanceId),
1077 2 => Ok(Self::StaticInstanceIdOrMoniker),
1078
1079 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
1080 }
1081 }
1082 }
1083
1084 unsafe impl<___E> ::fidl_next::Encode<crate::wire::StorageId, ___E> for StorageId
1085 where
1086 ___E: ?Sized,
1087 {
1088 #[inline]
1089 fn encode(
1090 self,
1091 encoder: &mut ___E,
1092 out: &mut ::core::mem::MaybeUninit<crate::wire::StorageId>,
1093 _: (),
1094 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1095 ::fidl_next::Encode::encode(&self, encoder, out, ())
1096 }
1097 }
1098
1099 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::StorageId, ___E> for &'a StorageId
1100 where
1101 ___E: ?Sized,
1102 {
1103 #[inline]
1104 fn encode(
1105 self,
1106 encoder: &mut ___E,
1107 out: &mut ::core::mem::MaybeUninit<crate::wire::StorageId>,
1108 _: (),
1109 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1110 ::fidl_next::munge!(let crate::wire::StorageId { value } = out);
1111 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
1112 StorageId::StaticInstanceId => 1,
1113
1114 StorageId::StaticInstanceIdOrMoniker => 2,
1115 }));
1116
1117 Ok(())
1118 }
1119 }
1120
1121 impl ::core::convert::From<crate::wire::StorageId> for StorageId {
1122 fn from(wire: crate::wire::StorageId) -> Self {
1123 match u32::from(wire.value) {
1124 1 => Self::StaticInstanceId,
1125
1126 2 => Self::StaticInstanceIdOrMoniker,
1127
1128 _ => unsafe { ::core::hint::unreachable_unchecked() },
1129 }
1130 }
1131 }
1132
1133 impl ::fidl_next::FromWire<crate::wire::StorageId> for StorageId {
1134 #[inline]
1135 fn from_wire(wire: crate::wire::StorageId) -> Self {
1136 Self::from(wire)
1137 }
1138 }
1139
1140 impl ::fidl_next::FromWireRef<crate::wire::StorageId> for StorageId {
1141 #[inline]
1142 fn from_wire_ref(wire: &crate::wire::StorageId) -> Self {
1143 Self::from(*wire)
1144 }
1145 }
1146
1147 #[doc = " Declares a runner capability backed by a service.\n"]
1148 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1149 pub struct Runner {
1150 pub name: ::core::option::Option<::std::string::String>,
1151
1152 pub source_path: ::core::option::Option<::std::string::String>,
1153 }
1154
1155 impl Runner {
1156 fn __max_ordinal(&self) -> usize {
1157 if self.source_path.is_some() {
1158 return 2;
1159 }
1160
1161 if self.name.is_some() {
1162 return 1;
1163 }
1164
1165 0
1166 }
1167 }
1168
1169 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Runner<'static>, ___E> for Runner
1170 where
1171 ___E: ::fidl_next::Encoder + ?Sized,
1172 {
1173 #[inline]
1174 fn encode(
1175 mut self,
1176 encoder: &mut ___E,
1177 out: &mut ::core::mem::MaybeUninit<crate::wire::Runner<'static>>,
1178 _: (),
1179 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1180 ::fidl_next::munge!(let crate::wire::Runner { table } = out);
1181
1182 let max_ord = self.__max_ordinal();
1183
1184 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1185 ::fidl_next::Wire::zero_padding(&mut out);
1186
1187 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1188 ::fidl_next::wire::Envelope,
1189 >(encoder, max_ord);
1190
1191 for i in 1..=max_ord {
1192 match i {
1193 2 => {
1194 if let Some(value) = self.source_path.take() {
1195 ::fidl_next::wire::Envelope::encode_value::<
1196 ::fidl_next::wire::String<'static>,
1197 ___E,
1198 >(
1199 value, preallocated.encoder, &mut out, 1024
1200 )?;
1201 } else {
1202 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1203 }
1204 }
1205
1206 1 => {
1207 if let Some(value) = self.name.take() {
1208 ::fidl_next::wire::Envelope::encode_value::<
1209 ::fidl_next::wire::String<'static>,
1210 ___E,
1211 >(
1212 value, preallocated.encoder, &mut out, 100
1213 )?;
1214 } else {
1215 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1216 }
1217 }
1218
1219 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1220 }
1221 unsafe {
1222 preallocated.write_next(out.assume_init_ref());
1223 }
1224 }
1225
1226 ::fidl_next::wire::Table::encode_len(table, max_ord);
1227
1228 Ok(())
1229 }
1230 }
1231
1232 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Runner<'static>, ___E> for &'a Runner
1233 where
1234 ___E: ::fidl_next::Encoder + ?Sized,
1235 {
1236 #[inline]
1237 fn encode(
1238 self,
1239 encoder: &mut ___E,
1240 out: &mut ::core::mem::MaybeUninit<crate::wire::Runner<'static>>,
1241 _: (),
1242 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1243 ::fidl_next::munge!(let crate::wire::Runner { table } = out);
1244
1245 let max_ord = self.__max_ordinal();
1246
1247 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1248 ::fidl_next::Wire::zero_padding(&mut out);
1249
1250 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1251 ::fidl_next::wire::Envelope,
1252 >(encoder, max_ord);
1253
1254 for i in 1..=max_ord {
1255 match i {
1256 2 => {
1257 if let Some(value) = &self.source_path {
1258 ::fidl_next::wire::Envelope::encode_value::<
1259 ::fidl_next::wire::String<'static>,
1260 ___E,
1261 >(
1262 value, preallocated.encoder, &mut out, 1024
1263 )?;
1264 } else {
1265 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1266 }
1267 }
1268
1269 1 => {
1270 if let Some(value) = &self.name {
1271 ::fidl_next::wire::Envelope::encode_value::<
1272 ::fidl_next::wire::String<'static>,
1273 ___E,
1274 >(
1275 value, preallocated.encoder, &mut out, 100
1276 )?;
1277 } else {
1278 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1279 }
1280 }
1281
1282 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1283 }
1284 unsafe {
1285 preallocated.write_next(out.assume_init_ref());
1286 }
1287 }
1288
1289 ::fidl_next::wire::Table::encode_len(table, max_ord);
1290
1291 Ok(())
1292 }
1293 }
1294
1295 impl<'de> ::fidl_next::FromWire<crate::wire::Runner<'de>> for Runner {
1296 #[inline]
1297 fn from_wire(wire_: crate::wire::Runner<'de>) -> Self {
1298 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1299
1300 let name = wire_.table.get(1);
1301
1302 let source_path = wire_.table.get(2);
1303
1304 Self {
1305 name: name.map(|envelope| {
1306 ::fidl_next::FromWire::from_wire(unsafe {
1307 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
1308 })
1309 }),
1310
1311 source_path: source_path.map(|envelope| {
1312 ::fidl_next::FromWire::from_wire(unsafe {
1313 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
1314 })
1315 }),
1316 }
1317 }
1318 }
1319
1320 impl<'de> ::fidl_next::FromWireRef<crate::wire::Runner<'de>> for Runner {
1321 #[inline]
1322 fn from_wire_ref(wire: &crate::wire::Runner<'de>) -> Self {
1323 Self {
1324 name: wire.table.get(1).map(|envelope| {
1325 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1326 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
1327 })
1328 }),
1329
1330 source_path: wire.table.get(2).map(|envelope| {
1331 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1332 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
1333 })
1334 }),
1335 }
1336 }
1337 }
1338
1339 #[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"]
1340 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1341 pub struct Resolver {
1342 pub name: ::core::option::Option<::std::string::String>,
1343
1344 pub source_path: ::core::option::Option<::std::string::String>,
1345 }
1346
1347 impl Resolver {
1348 fn __max_ordinal(&self) -> usize {
1349 if self.source_path.is_some() {
1350 return 2;
1351 }
1352
1353 if self.name.is_some() {
1354 return 1;
1355 }
1356
1357 0
1358 }
1359 }
1360
1361 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Resolver<'static>, ___E> for Resolver
1362 where
1363 ___E: ::fidl_next::Encoder + ?Sized,
1364 {
1365 #[inline]
1366 fn encode(
1367 mut self,
1368 encoder: &mut ___E,
1369 out: &mut ::core::mem::MaybeUninit<crate::wire::Resolver<'static>>,
1370 _: (),
1371 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1372 ::fidl_next::munge!(let crate::wire::Resolver { table } = out);
1373
1374 let max_ord = self.__max_ordinal();
1375
1376 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1377 ::fidl_next::Wire::zero_padding(&mut out);
1378
1379 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1380 ::fidl_next::wire::Envelope,
1381 >(encoder, max_ord);
1382
1383 for i in 1..=max_ord {
1384 match i {
1385 2 => {
1386 if let Some(value) = self.source_path.take() {
1387 ::fidl_next::wire::Envelope::encode_value::<
1388 ::fidl_next::wire::String<'static>,
1389 ___E,
1390 >(
1391 value, preallocated.encoder, &mut out, 1024
1392 )?;
1393 } else {
1394 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1395 }
1396 }
1397
1398 1 => {
1399 if let Some(value) = self.name.take() {
1400 ::fidl_next::wire::Envelope::encode_value::<
1401 ::fidl_next::wire::String<'static>,
1402 ___E,
1403 >(
1404 value, preallocated.encoder, &mut out, 100
1405 )?;
1406 } else {
1407 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1408 }
1409 }
1410
1411 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1412 }
1413 unsafe {
1414 preallocated.write_next(out.assume_init_ref());
1415 }
1416 }
1417
1418 ::fidl_next::wire::Table::encode_len(table, max_ord);
1419
1420 Ok(())
1421 }
1422 }
1423
1424 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Resolver<'static>, ___E> for &'a Resolver
1425 where
1426 ___E: ::fidl_next::Encoder + ?Sized,
1427 {
1428 #[inline]
1429 fn encode(
1430 self,
1431 encoder: &mut ___E,
1432 out: &mut ::core::mem::MaybeUninit<crate::wire::Resolver<'static>>,
1433 _: (),
1434 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1435 ::fidl_next::munge!(let crate::wire::Resolver { table } = out);
1436
1437 let max_ord = self.__max_ordinal();
1438
1439 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1440 ::fidl_next::Wire::zero_padding(&mut out);
1441
1442 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1443 ::fidl_next::wire::Envelope,
1444 >(encoder, max_ord);
1445
1446 for i in 1..=max_ord {
1447 match i {
1448 2 => {
1449 if let Some(value) = &self.source_path {
1450 ::fidl_next::wire::Envelope::encode_value::<
1451 ::fidl_next::wire::String<'static>,
1452 ___E,
1453 >(
1454 value, preallocated.encoder, &mut out, 1024
1455 )?;
1456 } else {
1457 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1458 }
1459 }
1460
1461 1 => {
1462 if let Some(value) = &self.name {
1463 ::fidl_next::wire::Envelope::encode_value::<
1464 ::fidl_next::wire::String<'static>,
1465 ___E,
1466 >(
1467 value, preallocated.encoder, &mut out, 100
1468 )?;
1469 } else {
1470 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1471 }
1472 }
1473
1474 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1475 }
1476 unsafe {
1477 preallocated.write_next(out.assume_init_ref());
1478 }
1479 }
1480
1481 ::fidl_next::wire::Table::encode_len(table, max_ord);
1482
1483 Ok(())
1484 }
1485 }
1486
1487 impl<'de> ::fidl_next::FromWire<crate::wire::Resolver<'de>> for Resolver {
1488 #[inline]
1489 fn from_wire(wire_: crate::wire::Resolver<'de>) -> Self {
1490 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1491
1492 let name = wire_.table.get(1);
1493
1494 let source_path = wire_.table.get(2);
1495
1496 Self {
1497 name: name.map(|envelope| {
1498 ::fidl_next::FromWire::from_wire(unsafe {
1499 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
1500 })
1501 }),
1502
1503 source_path: source_path.map(|envelope| {
1504 ::fidl_next::FromWire::from_wire(unsafe {
1505 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
1506 })
1507 }),
1508 }
1509 }
1510 }
1511
1512 impl<'de> ::fidl_next::FromWireRef<crate::wire::Resolver<'de>> for Resolver {
1513 #[inline]
1514 fn from_wire_ref(wire: &crate::wire::Resolver<'de>) -> Self {
1515 Self {
1516 name: wire.table.get(1).map(|envelope| {
1517 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1518 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
1519 })
1520 }),
1521
1522 source_path: wire.table.get(2).map(|envelope| {
1523 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1524 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
1525 })
1526 }),
1527 }
1528 }
1529 }
1530
1531 #[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"]
1532 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1533 pub struct EventStream {
1534 pub name: ::core::option::Option<::std::string::String>,
1535 }
1536
1537 impl EventStream {
1538 fn __max_ordinal(&self) -> usize {
1539 if self.name.is_some() {
1540 return 1;
1541 }
1542
1543 0
1544 }
1545 }
1546
1547 unsafe impl<___E> ::fidl_next::Encode<crate::wire::EventStream<'static>, ___E> for EventStream
1548 where
1549 ___E: ::fidl_next::Encoder + ?Sized,
1550 {
1551 #[inline]
1552 fn encode(
1553 mut self,
1554 encoder: &mut ___E,
1555 out: &mut ::core::mem::MaybeUninit<crate::wire::EventStream<'static>>,
1556 _: (),
1557 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1558 ::fidl_next::munge!(let crate::wire::EventStream { table } = out);
1559
1560 let max_ord = self.__max_ordinal();
1561
1562 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1563 ::fidl_next::Wire::zero_padding(&mut out);
1564
1565 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1566 ::fidl_next::wire::Envelope,
1567 >(encoder, max_ord);
1568
1569 for i in 1..=max_ord {
1570 match i {
1571 1 => {
1572 if let Some(value) = self.name.take() {
1573 ::fidl_next::wire::Envelope::encode_value::<
1574 ::fidl_next::wire::String<'static>,
1575 ___E,
1576 >(
1577 value, preallocated.encoder, &mut out, 100
1578 )?;
1579 } else {
1580 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1581 }
1582 }
1583
1584 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1585 }
1586 unsafe {
1587 preallocated.write_next(out.assume_init_ref());
1588 }
1589 }
1590
1591 ::fidl_next::wire::Table::encode_len(table, max_ord);
1592
1593 Ok(())
1594 }
1595 }
1596
1597 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EventStream<'static>, ___E>
1598 for &'a EventStream
1599 where
1600 ___E: ::fidl_next::Encoder + ?Sized,
1601 {
1602 #[inline]
1603 fn encode(
1604 self,
1605 encoder: &mut ___E,
1606 out: &mut ::core::mem::MaybeUninit<crate::wire::EventStream<'static>>,
1607 _: (),
1608 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1609 ::fidl_next::munge!(let crate::wire::EventStream { table } = out);
1610
1611 let max_ord = self.__max_ordinal();
1612
1613 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1614 ::fidl_next::Wire::zero_padding(&mut out);
1615
1616 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1617 ::fidl_next::wire::Envelope,
1618 >(encoder, max_ord);
1619
1620 for i in 1..=max_ord {
1621 match i {
1622 1 => {
1623 if let Some(value) = &self.name {
1624 ::fidl_next::wire::Envelope::encode_value::<
1625 ::fidl_next::wire::String<'static>,
1626 ___E,
1627 >(
1628 value, preallocated.encoder, &mut out, 100
1629 )?;
1630 } else {
1631 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1632 }
1633 }
1634
1635 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1636 }
1637 unsafe {
1638 preallocated.write_next(out.assume_init_ref());
1639 }
1640 }
1641
1642 ::fidl_next::wire::Table::encode_len(table, max_ord);
1643
1644 Ok(())
1645 }
1646 }
1647
1648 impl<'de> ::fidl_next::FromWire<crate::wire::EventStream<'de>> for EventStream {
1649 #[inline]
1650 fn from_wire(wire_: crate::wire::EventStream<'de>) -> Self {
1651 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1652
1653 let name = wire_.table.get(1);
1654
1655 Self {
1656 name: name.map(|envelope| {
1657 ::fidl_next::FromWire::from_wire(unsafe {
1658 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
1659 })
1660 }),
1661 }
1662 }
1663 }
1664
1665 impl<'de> ::fidl_next::FromWireRef<crate::wire::EventStream<'de>> for EventStream {
1666 #[inline]
1667 fn from_wire_ref(wire: &crate::wire::EventStream<'de>) -> Self {
1668 Self {
1669 name: wire.table.get(1).map(|envelope| {
1670 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1671 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
1672 })
1673 }),
1674 }
1675 }
1676 }
1677
1678 #[doc = " A single configuration value.\n"]
1679 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1680 pub enum ConfigSingleValue {
1681 Bool(bool),
1682
1683 Uint8(u8),
1684
1685 Uint16(u16),
1686
1687 Uint32(u32),
1688
1689 Uint64(u64),
1690
1691 Int8(i8),
1692
1693 Int16(i16),
1694
1695 Int32(i32),
1696
1697 Int64(i64),
1698
1699 String(::std::string::String),
1700
1701 UnknownOrdinal_(u64),
1702 }
1703
1704 impl ConfigSingleValue {
1705 pub fn is_unknown(&self) -> bool {
1706 #[allow(unreachable_patterns)]
1707 match self {
1708 Self::UnknownOrdinal_(_) => true,
1709 _ => false,
1710 }
1711 }
1712 }
1713
1714 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigSingleValue<'static>, ___E>
1715 for ConfigSingleValue
1716 where
1717 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1718 ___E: ::fidl_next::Encoder,
1719 {
1720 #[inline]
1721 fn encode(
1722 self,
1723 encoder: &mut ___E,
1724 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSingleValue<'static>>,
1725 _: (),
1726 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1727 ::fidl_next::munge!(let crate::wire::ConfigSingleValue { raw, _phantom: _ } = out);
1728
1729 match self {
1730 Self::Bool(value) => {
1731 ::fidl_next::wire::Union::encode_as::<___E, bool>(value, 1, encoder, raw, ())?
1732 }
1733
1734 Self::Uint8(value) => {
1735 ::fidl_next::wire::Union::encode_as::<___E, u8>(value, 2, encoder, raw, ())?
1736 }
1737
1738 Self::Uint16(value) => ::fidl_next::wire::Union::encode_as::<
1739 ___E,
1740 ::fidl_next::wire::Uint16,
1741 >(value, 3, encoder, raw, ())?,
1742
1743 Self::Uint32(value) => ::fidl_next::wire::Union::encode_as::<
1744 ___E,
1745 ::fidl_next::wire::Uint32,
1746 >(value, 4, encoder, raw, ())?,
1747
1748 Self::Uint64(value) => ::fidl_next::wire::Union::encode_as::<
1749 ___E,
1750 ::fidl_next::wire::Uint64,
1751 >(value, 5, encoder, raw, ())?,
1752
1753 Self::Int8(value) => {
1754 ::fidl_next::wire::Union::encode_as::<___E, i8>(value, 6, encoder, raw, ())?
1755 }
1756
1757 Self::Int16(value) => ::fidl_next::wire::Union::encode_as::<
1758 ___E,
1759 ::fidl_next::wire::Int16,
1760 >(value, 7, encoder, raw, ())?,
1761
1762 Self::Int32(value) => ::fidl_next::wire::Union::encode_as::<
1763 ___E,
1764 ::fidl_next::wire::Int32,
1765 >(value, 8, encoder, raw, ())?,
1766
1767 Self::Int64(value) => ::fidl_next::wire::Union::encode_as::<
1768 ___E,
1769 ::fidl_next::wire::Int64,
1770 >(value, 9, encoder, raw, ())?,
1771
1772 Self::String(value) => ::fidl_next::wire::Union::encode_as::<
1773 ___E,
1774 ::fidl_next::wire::String<'static>,
1775 >(value, 10, encoder, raw, 4294967295)?,
1776
1777 Self::UnknownOrdinal_(ordinal) => {
1778 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
1779 }
1780 }
1781
1782 Ok(())
1783 }
1784 }
1785
1786 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigSingleValue<'static>, ___E>
1787 for &'a ConfigSingleValue
1788 where
1789 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1790 ___E: ::fidl_next::Encoder,
1791 {
1792 #[inline]
1793 fn encode(
1794 self,
1795 encoder: &mut ___E,
1796 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSingleValue<'static>>,
1797 _: (),
1798 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1799 ::fidl_next::munge!(let crate::wire::ConfigSingleValue { raw, _phantom: _ } = out);
1800
1801 match self {
1802 ConfigSingleValue::Bool(value) => {
1803 ::fidl_next::wire::Union::encode_as::<___E, bool>(value, 1, encoder, raw, ())?
1804 }
1805
1806 ConfigSingleValue::Uint8(value) => {
1807 ::fidl_next::wire::Union::encode_as::<___E, u8>(value, 2, encoder, raw, ())?
1808 }
1809
1810 ConfigSingleValue::Uint16(value) => ::fidl_next::wire::Union::encode_as::<
1811 ___E,
1812 ::fidl_next::wire::Uint16,
1813 >(value, 3, encoder, raw, ())?,
1814
1815 ConfigSingleValue::Uint32(value) => ::fidl_next::wire::Union::encode_as::<
1816 ___E,
1817 ::fidl_next::wire::Uint32,
1818 >(value, 4, encoder, raw, ())?,
1819
1820 ConfigSingleValue::Uint64(value) => ::fidl_next::wire::Union::encode_as::<
1821 ___E,
1822 ::fidl_next::wire::Uint64,
1823 >(value, 5, encoder, raw, ())?,
1824
1825 ConfigSingleValue::Int8(value) => {
1826 ::fidl_next::wire::Union::encode_as::<___E, i8>(value, 6, encoder, raw, ())?
1827 }
1828
1829 ConfigSingleValue::Int16(value) => ::fidl_next::wire::Union::encode_as::<
1830 ___E,
1831 ::fidl_next::wire::Int16,
1832 >(value, 7, encoder, raw, ())?,
1833
1834 ConfigSingleValue::Int32(value) => ::fidl_next::wire::Union::encode_as::<
1835 ___E,
1836 ::fidl_next::wire::Int32,
1837 >(value, 8, encoder, raw, ())?,
1838
1839 ConfigSingleValue::Int64(value) => ::fidl_next::wire::Union::encode_as::<
1840 ___E,
1841 ::fidl_next::wire::Int64,
1842 >(value, 9, encoder, raw, ())?,
1843
1844 ConfigSingleValue::String(value) => {
1845 ::fidl_next::wire::Union::encode_as::<___E, ::fidl_next::wire::String<'static>>(
1846 value, 10, encoder, raw, 4294967295,
1847 )?
1848 }
1849
1850 ConfigSingleValue::UnknownOrdinal_(ordinal) => {
1851 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
1852 }
1853 }
1854
1855 Ok(())
1856 }
1857 }
1858
1859 unsafe impl<___E>
1860 ::fidl_next::EncodeOption<crate::wire_optional::ConfigSingleValue<'static>, ___E>
1861 for ConfigSingleValue
1862 where
1863 ___E: ?Sized,
1864 ConfigSingleValue: ::fidl_next::Encode<crate::wire::ConfigSingleValue<'static>, ___E>,
1865 {
1866 #[inline]
1867 fn encode_option(
1868 this: ::core::option::Option<Self>,
1869 encoder: &mut ___E,
1870 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigSingleValue<'static>>,
1871 _: (),
1872 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1873 ::fidl_next::munge!(let crate::wire_optional::ConfigSingleValue { raw, _phantom: _ } = &mut *out);
1874
1875 if let Some(inner) = this {
1876 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1877 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
1878 } else {
1879 ::fidl_next::wire::Union::encode_absent(raw);
1880 }
1881
1882 Ok(())
1883 }
1884 }
1885
1886 unsafe impl<'a, ___E>
1887 ::fidl_next::EncodeOption<crate::wire_optional::ConfigSingleValue<'static>, ___E>
1888 for &'a ConfigSingleValue
1889 where
1890 ___E: ?Sized,
1891 &'a ConfigSingleValue: ::fidl_next::Encode<crate::wire::ConfigSingleValue<'static>, ___E>,
1892 {
1893 #[inline]
1894 fn encode_option(
1895 this: ::core::option::Option<Self>,
1896 encoder: &mut ___E,
1897 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigSingleValue<'static>>,
1898 _: (),
1899 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1900 ::fidl_next::munge!(let crate::wire_optional::ConfigSingleValue { raw, _phantom: _ } = &mut *out);
1901
1902 if let Some(inner) = this {
1903 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
1904 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
1905 } else {
1906 ::fidl_next::wire::Union::encode_absent(raw);
1907 }
1908
1909 Ok(())
1910 }
1911 }
1912
1913 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigSingleValue<'de>> for ConfigSingleValue {
1914 #[inline]
1915 fn from_wire(wire: crate::wire::ConfigSingleValue<'de>) -> Self {
1916 let wire = ::core::mem::ManuallyDrop::new(wire);
1917 match wire.raw.ordinal() {
1918 1 => Self::Bool(::fidl_next::FromWire::from_wire(unsafe {
1919 wire.raw.get().read_unchecked::<bool>()
1920 })),
1921
1922 2 => Self::Uint8(::fidl_next::FromWire::from_wire(unsafe {
1923 wire.raw.get().read_unchecked::<u8>()
1924 })),
1925
1926 3 => Self::Uint16(::fidl_next::FromWire::from_wire(unsafe {
1927 wire.raw.get().read_unchecked::<::fidl_next::wire::Uint16>()
1928 })),
1929
1930 4 => Self::Uint32(::fidl_next::FromWire::from_wire(unsafe {
1931 wire.raw.get().read_unchecked::<::fidl_next::wire::Uint32>()
1932 })),
1933
1934 5 => Self::Uint64(::fidl_next::FromWire::from_wire(unsafe {
1935 wire.raw.get().read_unchecked::<::fidl_next::wire::Uint64>()
1936 })),
1937
1938 6 => Self::Int8(::fidl_next::FromWire::from_wire(unsafe {
1939 wire.raw.get().read_unchecked::<i8>()
1940 })),
1941
1942 7 => Self::Int16(::fidl_next::FromWire::from_wire(unsafe {
1943 wire.raw.get().read_unchecked::<::fidl_next::wire::Int16>()
1944 })),
1945
1946 8 => Self::Int32(::fidl_next::FromWire::from_wire(unsafe {
1947 wire.raw.get().read_unchecked::<::fidl_next::wire::Int32>()
1948 })),
1949
1950 9 => Self::Int64(::fidl_next::FromWire::from_wire(unsafe {
1951 wire.raw.get().read_unchecked::<::fidl_next::wire::Int64>()
1952 })),
1953
1954 10 => Self::String(::fidl_next::FromWire::from_wire(unsafe {
1955 wire.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
1956 })),
1957
1958 ord => return Self::UnknownOrdinal_(ord as u64),
1959 }
1960 }
1961 }
1962
1963 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigSingleValue<'de>> for ConfigSingleValue {
1964 #[inline]
1965 fn from_wire_ref(wire: &crate::wire::ConfigSingleValue<'de>) -> Self {
1966 match wire.raw.ordinal() {
1967 1 => Self::Bool(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1968 wire.raw.get().deref_unchecked::<bool>()
1969 })),
1970
1971 2 => Self::Uint8(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1972 wire.raw.get().deref_unchecked::<u8>()
1973 })),
1974
1975 3 => Self::Uint16(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1976 wire.raw.get().deref_unchecked::<::fidl_next::wire::Uint16>()
1977 })),
1978
1979 4 => Self::Uint32(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1980 wire.raw.get().deref_unchecked::<::fidl_next::wire::Uint32>()
1981 })),
1982
1983 5 => Self::Uint64(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1984 wire.raw.get().deref_unchecked::<::fidl_next::wire::Uint64>()
1985 })),
1986
1987 6 => Self::Int8(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1988 wire.raw.get().deref_unchecked::<i8>()
1989 })),
1990
1991 7 => Self::Int16(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1992 wire.raw.get().deref_unchecked::<::fidl_next::wire::Int16>()
1993 })),
1994
1995 8 => Self::Int32(::fidl_next::FromWireRef::from_wire_ref(unsafe {
1996 wire.raw.get().deref_unchecked::<::fidl_next::wire::Int32>()
1997 })),
1998
1999 9 => Self::Int64(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2000 wire.raw.get().deref_unchecked::<::fidl_next::wire::Int64>()
2001 })),
2002
2003 10 => Self::String(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2004 wire.raw.get().deref_unchecked::<::fidl_next::wire::String<'de>>()
2005 })),
2006
2007 ord => return Self::UnknownOrdinal_(ord as u64),
2008 }
2009 }
2010 }
2011
2012 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigSingleValue<'de>>
2013 for ConfigSingleValue
2014 {
2015 #[inline]
2016 fn from_wire_option(
2017 wire: crate::wire_optional::ConfigSingleValue<'de>,
2018 ) -> ::core::option::Option<Self> {
2019 if let Some(inner) = wire.into_option() {
2020 Some(::fidl_next::FromWire::from_wire(inner))
2021 } else {
2022 None
2023 }
2024 }
2025 }
2026
2027 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigSingleValue<'de>>
2028 for Box<ConfigSingleValue>
2029 {
2030 #[inline]
2031 fn from_wire_option(
2032 wire: crate::wire_optional::ConfigSingleValue<'de>,
2033 ) -> ::core::option::Option<Self> {
2034 <ConfigSingleValue as ::fidl_next::FromWireOption<
2035 crate::wire_optional::ConfigSingleValue<'de>,
2036 >>::from_wire_option(wire)
2037 .map(Box::new)
2038 }
2039 }
2040
2041 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ConfigSingleValue<'de>>
2042 for Box<ConfigSingleValue>
2043 {
2044 #[inline]
2045 fn from_wire_option_ref(
2046 wire: &crate::wire_optional::ConfigSingleValue<'de>,
2047 ) -> ::core::option::Option<Self> {
2048 if let Some(inner) = wire.as_ref() {
2049 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
2050 } else {
2051 None
2052 }
2053 }
2054 }
2055
2056 #[doc = " A vector configuration value.\n"]
2057 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2058 pub enum ConfigVectorValue {
2059 BoolVector(::std::vec::Vec<bool>),
2060
2061 Uint8Vector(::std::vec::Vec<u8>),
2062
2063 Uint16Vector(::std::vec::Vec<u16>),
2064
2065 Uint32Vector(::std::vec::Vec<u32>),
2066
2067 Uint64Vector(::std::vec::Vec<u64>),
2068
2069 Int8Vector(::std::vec::Vec<i8>),
2070
2071 Int16Vector(::std::vec::Vec<i16>),
2072
2073 Int32Vector(::std::vec::Vec<i32>),
2074
2075 Int64Vector(::std::vec::Vec<i64>),
2076
2077 StringVector(::std::vec::Vec<::std::string::String>),
2078
2079 UnknownOrdinal_(u64),
2080 }
2081
2082 impl ConfigVectorValue {
2083 pub fn is_unknown(&self) -> bool {
2084 #[allow(unreachable_patterns)]
2085 match self {
2086 Self::UnknownOrdinal_(_) => true,
2087 _ => false,
2088 }
2089 }
2090 }
2091
2092 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigVectorValue<'static>, ___E>
2093 for ConfigVectorValue
2094 where
2095 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2096 ___E: ::fidl_next::Encoder,
2097 {
2098 #[inline]
2099 fn encode(
2100 self,
2101 encoder: &mut ___E,
2102 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigVectorValue<'static>>,
2103 _: (),
2104 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2105 ::fidl_next::munge!(let crate::wire::ConfigVectorValue { raw, _phantom: _ } = out);
2106
2107 match self {
2108 Self::BoolVector(value) => {
2109 ::fidl_next::wire::Union::encode_as::<
2110 ___E,
2111 ::fidl_next::wire::Vector<'static, bool>,
2112 >(value, 1, encoder, raw, (4294967295, ()))?
2113 }
2114
2115 Self::Uint8Vector(value) => {
2116 ::fidl_next::wire::Union::encode_as::<
2117 ___E,
2118 ::fidl_next::wire::Vector<'static, u8>,
2119 >(value, 2, encoder, raw, (4294967295, ()))?
2120 }
2121
2122 Self::Uint16Vector(value) => {
2123 ::fidl_next::wire::Union::encode_as::<
2124 ___E,
2125 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint16>,
2126 >(value, 3, encoder, raw, (4294967295, ()))?
2127 }
2128
2129 Self::Uint32Vector(value) => {
2130 ::fidl_next::wire::Union::encode_as::<
2131 ___E,
2132 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>,
2133 >(value, 4, encoder, raw, (4294967295, ()))?
2134 }
2135
2136 Self::Uint64Vector(value) => {
2137 ::fidl_next::wire::Union::encode_as::<
2138 ___E,
2139 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint64>,
2140 >(value, 5, encoder, raw, (4294967295, ()))?
2141 }
2142
2143 Self::Int8Vector(value) => {
2144 ::fidl_next::wire::Union::encode_as::<
2145 ___E,
2146 ::fidl_next::wire::Vector<'static, i8>,
2147 >(value, 6, encoder, raw, (4294967295, ()))?
2148 }
2149
2150 Self::Int16Vector(value) => {
2151 ::fidl_next::wire::Union::encode_as::<
2152 ___E,
2153 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Int16>,
2154 >(value, 7, encoder, raw, (4294967295, ()))?
2155 }
2156
2157 Self::Int32Vector(value) => {
2158 ::fidl_next::wire::Union::encode_as::<
2159 ___E,
2160 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Int32>,
2161 >(value, 8, encoder, raw, (4294967295, ()))?
2162 }
2163
2164 Self::Int64Vector(value) => {
2165 ::fidl_next::wire::Union::encode_as::<
2166 ___E,
2167 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Int64>,
2168 >(value, 9, encoder, raw, (4294967295, ()))?
2169 }
2170
2171 Self::StringVector(value) => {
2172 ::fidl_next::wire::Union::encode_as::<
2173 ___E,
2174 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::String<'static>>,
2175 >(value, 10, encoder, raw, (4294967295, 4294967295))?
2176 }
2177
2178 Self::UnknownOrdinal_(ordinal) => {
2179 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
2180 }
2181 }
2182
2183 Ok(())
2184 }
2185 }
2186
2187 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigVectorValue<'static>, ___E>
2188 for &'a ConfigVectorValue
2189 where
2190 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2191 ___E: ::fidl_next::Encoder,
2192 {
2193 #[inline]
2194 fn encode(
2195 self,
2196 encoder: &mut ___E,
2197 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigVectorValue<'static>>,
2198 _: (),
2199 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2200 ::fidl_next::munge!(let crate::wire::ConfigVectorValue { raw, _phantom: _ } = out);
2201
2202 match self {
2203 ConfigVectorValue::BoolVector(value) => {
2204 ::fidl_next::wire::Union::encode_as::<
2205 ___E,
2206 ::fidl_next::wire::Vector<'static, bool>,
2207 >(value, 1, encoder, raw, (4294967295, ()))?
2208 }
2209
2210 ConfigVectorValue::Uint8Vector(value) => {
2211 ::fidl_next::wire::Union::encode_as::<
2212 ___E,
2213 ::fidl_next::wire::Vector<'static, u8>,
2214 >(value, 2, encoder, raw, (4294967295, ()))?
2215 }
2216
2217 ConfigVectorValue::Uint16Vector(value) => {
2218 ::fidl_next::wire::Union::encode_as::<
2219 ___E,
2220 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint16>,
2221 >(value, 3, encoder, raw, (4294967295, ()))?
2222 }
2223
2224 ConfigVectorValue::Uint32Vector(value) => {
2225 ::fidl_next::wire::Union::encode_as::<
2226 ___E,
2227 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>,
2228 >(value, 4, encoder, raw, (4294967295, ()))?
2229 }
2230
2231 ConfigVectorValue::Uint64Vector(value) => {
2232 ::fidl_next::wire::Union::encode_as::<
2233 ___E,
2234 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint64>,
2235 >(value, 5, encoder, raw, (4294967295, ()))?
2236 }
2237
2238 ConfigVectorValue::Int8Vector(value) => {
2239 ::fidl_next::wire::Union::encode_as::<
2240 ___E,
2241 ::fidl_next::wire::Vector<'static, i8>,
2242 >(value, 6, encoder, raw, (4294967295, ()))?
2243 }
2244
2245 ConfigVectorValue::Int16Vector(value) => {
2246 ::fidl_next::wire::Union::encode_as::<
2247 ___E,
2248 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Int16>,
2249 >(value, 7, encoder, raw, (4294967295, ()))?
2250 }
2251
2252 ConfigVectorValue::Int32Vector(value) => {
2253 ::fidl_next::wire::Union::encode_as::<
2254 ___E,
2255 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Int32>,
2256 >(value, 8, encoder, raw, (4294967295, ()))?
2257 }
2258
2259 ConfigVectorValue::Int64Vector(value) => {
2260 ::fidl_next::wire::Union::encode_as::<
2261 ___E,
2262 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Int64>,
2263 >(value, 9, encoder, raw, (4294967295, ()))?
2264 }
2265
2266 ConfigVectorValue::StringVector(value) => {
2267 ::fidl_next::wire::Union::encode_as::<
2268 ___E,
2269 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::String<'static>>,
2270 >(value, 10, encoder, raw, (4294967295, 4294967295))?
2271 }
2272
2273 ConfigVectorValue::UnknownOrdinal_(ordinal) => {
2274 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
2275 }
2276 }
2277
2278 Ok(())
2279 }
2280 }
2281
2282 unsafe impl<___E>
2283 ::fidl_next::EncodeOption<crate::wire_optional::ConfigVectorValue<'static>, ___E>
2284 for ConfigVectorValue
2285 where
2286 ___E: ?Sized,
2287 ConfigVectorValue: ::fidl_next::Encode<crate::wire::ConfigVectorValue<'static>, ___E>,
2288 {
2289 #[inline]
2290 fn encode_option(
2291 this: ::core::option::Option<Self>,
2292 encoder: &mut ___E,
2293 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigVectorValue<'static>>,
2294 _: (),
2295 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2296 ::fidl_next::munge!(let crate::wire_optional::ConfigVectorValue { raw, _phantom: _ } = &mut *out);
2297
2298 if let Some(inner) = this {
2299 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2300 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
2301 } else {
2302 ::fidl_next::wire::Union::encode_absent(raw);
2303 }
2304
2305 Ok(())
2306 }
2307 }
2308
2309 unsafe impl<'a, ___E>
2310 ::fidl_next::EncodeOption<crate::wire_optional::ConfigVectorValue<'static>, ___E>
2311 for &'a ConfigVectorValue
2312 where
2313 ___E: ?Sized,
2314 &'a ConfigVectorValue: ::fidl_next::Encode<crate::wire::ConfigVectorValue<'static>, ___E>,
2315 {
2316 #[inline]
2317 fn encode_option(
2318 this: ::core::option::Option<Self>,
2319 encoder: &mut ___E,
2320 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigVectorValue<'static>>,
2321 _: (),
2322 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2323 ::fidl_next::munge!(let crate::wire_optional::ConfigVectorValue { raw, _phantom: _ } = &mut *out);
2324
2325 if let Some(inner) = this {
2326 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2327 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
2328 } else {
2329 ::fidl_next::wire::Union::encode_absent(raw);
2330 }
2331
2332 Ok(())
2333 }
2334 }
2335
2336 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigVectorValue<'de>> for ConfigVectorValue {
2337 #[inline]
2338 fn from_wire(wire: crate::wire::ConfigVectorValue<'de>) -> Self {
2339 let wire = ::core::mem::ManuallyDrop::new(wire);
2340 match wire.raw.ordinal() {
2341 1 => Self::BoolVector(::fidl_next::FromWire::from_wire(unsafe {
2342 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, bool>>()
2343 })),
2344
2345 2 => Self::Uint8Vector(::fidl_next::FromWire::from_wire(unsafe {
2346 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
2347 })),
2348
2349 3 => Self::Uint16Vector(::fidl_next::FromWire::from_wire(unsafe {
2350 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint16>>()
2351 })),
2352
2353 4 => Self::Uint32Vector(::fidl_next::FromWire::from_wire(unsafe {
2354 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>>()
2355 })),
2356
2357 5 => Self::Uint64Vector(::fidl_next::FromWire::from_wire(unsafe {
2358 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint64>>()
2359 })),
2360
2361 6 => Self::Int8Vector(::fidl_next::FromWire::from_wire(unsafe {
2362 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, i8>>()
2363 })),
2364
2365 7 => {
2366 Self::Int16Vector(::fidl_next::FromWire::from_wire(unsafe {
2367 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int16>>()
2368 }))
2369 }
2370
2371 8 => {
2372 Self::Int32Vector(::fidl_next::FromWire::from_wire(unsafe {
2373 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int32>>()
2374 }))
2375 }
2376
2377 9 => {
2378 Self::Int64Vector(::fidl_next::FromWire::from_wire(unsafe {
2379 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>>()
2380 }))
2381 }
2382
2383 10 => Self::StringVector(::fidl_next::FromWire::from_wire(unsafe {
2384 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
2385 })),
2386
2387 ord => return Self::UnknownOrdinal_(ord as u64),
2388 }
2389 }
2390 }
2391
2392 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigVectorValue<'de>> for ConfigVectorValue {
2393 #[inline]
2394 fn from_wire_ref(wire: &crate::wire::ConfigVectorValue<'de>) -> Self {
2395 match wire.raw.ordinal() {
2396 1 => Self::BoolVector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2397 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, bool>>()
2398 })),
2399
2400 2 => Self::Uint8Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2401 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
2402 })),
2403
2404 3 => Self::Uint16Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2405 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint16>>()
2406 })),
2407
2408 4 => Self::Uint32Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2409 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>>()
2410 })),
2411
2412 5 => Self::Uint64Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2413 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint64>>()
2414 })),
2415
2416 6 => Self::Int8Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2417 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, i8>>()
2418 })),
2419
2420 7 => Self::Int16Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2421 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int16>>()
2422 })),
2423
2424 8 => Self::Int32Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2425 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int32>>()
2426 })),
2427
2428 9 => Self::Int64Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2429 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>>()
2430 })),
2431
2432 10 => Self::StringVector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2433 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
2434 })),
2435
2436 ord => return Self::UnknownOrdinal_(ord as u64),
2437 }
2438 }
2439 }
2440
2441 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigVectorValue<'de>>
2442 for ConfigVectorValue
2443 {
2444 #[inline]
2445 fn from_wire_option(
2446 wire: crate::wire_optional::ConfigVectorValue<'de>,
2447 ) -> ::core::option::Option<Self> {
2448 if let Some(inner) = wire.into_option() {
2449 Some(::fidl_next::FromWire::from_wire(inner))
2450 } else {
2451 None
2452 }
2453 }
2454 }
2455
2456 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigVectorValue<'de>>
2457 for Box<ConfigVectorValue>
2458 {
2459 #[inline]
2460 fn from_wire_option(
2461 wire: crate::wire_optional::ConfigVectorValue<'de>,
2462 ) -> ::core::option::Option<Self> {
2463 <ConfigVectorValue as ::fidl_next::FromWireOption<
2464 crate::wire_optional::ConfigVectorValue<'de>,
2465 >>::from_wire_option(wire)
2466 .map(Box::new)
2467 }
2468 }
2469
2470 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ConfigVectorValue<'de>>
2471 for Box<ConfigVectorValue>
2472 {
2473 #[inline]
2474 fn from_wire_option_ref(
2475 wire: &crate::wire_optional::ConfigVectorValue<'de>,
2476 ) -> ::core::option::Option<Self> {
2477 if let Some(inner) = wire.as_ref() {
2478 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
2479 } else {
2480 None
2481 }
2482 }
2483 }
2484
2485 #[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"]
2486 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2487 pub enum ConfigValue {
2488 Single(crate::natural::ConfigSingleValue),
2489
2490 Vector(crate::natural::ConfigVectorValue),
2491
2492 UnknownOrdinal_(u64),
2493 }
2494
2495 impl ConfigValue {
2496 pub fn is_unknown(&self) -> bool {
2497 #[allow(unreachable_patterns)]
2498 match self {
2499 Self::UnknownOrdinal_(_) => true,
2500 _ => false,
2501 }
2502 }
2503 }
2504
2505 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigValue<'static>, ___E> for ConfigValue
2506 where
2507 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2508 ___E: ::fidl_next::Encoder,
2509 {
2510 #[inline]
2511 fn encode(
2512 self,
2513 encoder: &mut ___E,
2514 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValue<'static>>,
2515 _: (),
2516 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2517 ::fidl_next::munge!(let crate::wire::ConfigValue { raw, _phantom: _ } = out);
2518
2519 match self {
2520 Self::Single(value) => ::fidl_next::wire::Union::encode_as::<
2521 ___E,
2522 crate::wire::ConfigSingleValue<'static>,
2523 >(value, 1, encoder, raw, ())?,
2524
2525 Self::Vector(value) => ::fidl_next::wire::Union::encode_as::<
2526 ___E,
2527 crate::wire::ConfigVectorValue<'static>,
2528 >(value, 2, encoder, raw, ())?,
2529
2530 Self::UnknownOrdinal_(ordinal) => {
2531 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
2532 }
2533 }
2534
2535 Ok(())
2536 }
2537 }
2538
2539 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigValue<'static>, ___E>
2540 for &'a ConfigValue
2541 where
2542 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2543 ___E: ::fidl_next::Encoder,
2544 {
2545 #[inline]
2546 fn encode(
2547 self,
2548 encoder: &mut ___E,
2549 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValue<'static>>,
2550 _: (),
2551 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2552 ::fidl_next::munge!(let crate::wire::ConfigValue { raw, _phantom: _ } = out);
2553
2554 match self {
2555 ConfigValue::Single(value) => ::fidl_next::wire::Union::encode_as::<
2556 ___E,
2557 crate::wire::ConfigSingleValue<'static>,
2558 >(value, 1, encoder, raw, ())?,
2559
2560 ConfigValue::Vector(value) => ::fidl_next::wire::Union::encode_as::<
2561 ___E,
2562 crate::wire::ConfigVectorValue<'static>,
2563 >(value, 2, encoder, raw, ())?,
2564
2565 ConfigValue::UnknownOrdinal_(ordinal) => {
2566 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
2567 }
2568 }
2569
2570 Ok(())
2571 }
2572 }
2573
2574 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::ConfigValue<'static>, ___E>
2575 for ConfigValue
2576 where
2577 ___E: ?Sized,
2578 ConfigValue: ::fidl_next::Encode<crate::wire::ConfigValue<'static>, ___E>,
2579 {
2580 #[inline]
2581 fn encode_option(
2582 this: ::core::option::Option<Self>,
2583 encoder: &mut ___E,
2584 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigValue<'static>>,
2585 _: (),
2586 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2587 ::fidl_next::munge!(let crate::wire_optional::ConfigValue { raw, _phantom: _ } = &mut *out);
2588
2589 if let Some(inner) = this {
2590 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2591 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
2592 } else {
2593 ::fidl_next::wire::Union::encode_absent(raw);
2594 }
2595
2596 Ok(())
2597 }
2598 }
2599
2600 unsafe impl<'a, ___E>
2601 ::fidl_next::EncodeOption<crate::wire_optional::ConfigValue<'static>, ___E>
2602 for &'a ConfigValue
2603 where
2604 ___E: ?Sized,
2605 &'a ConfigValue: ::fidl_next::Encode<crate::wire::ConfigValue<'static>, ___E>,
2606 {
2607 #[inline]
2608 fn encode_option(
2609 this: ::core::option::Option<Self>,
2610 encoder: &mut ___E,
2611 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigValue<'static>>,
2612 _: (),
2613 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2614 ::fidl_next::munge!(let crate::wire_optional::ConfigValue { raw, _phantom: _ } = &mut *out);
2615
2616 if let Some(inner) = this {
2617 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2618 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
2619 } else {
2620 ::fidl_next::wire::Union::encode_absent(raw);
2621 }
2622
2623 Ok(())
2624 }
2625 }
2626
2627 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigValue<'de>> for ConfigValue {
2628 #[inline]
2629 fn from_wire(wire: crate::wire::ConfigValue<'de>) -> Self {
2630 let wire = ::core::mem::ManuallyDrop::new(wire);
2631 match wire.raw.ordinal() {
2632 1 => Self::Single(::fidl_next::FromWire::from_wire(unsafe {
2633 wire.raw.get().read_unchecked::<crate::wire::ConfigSingleValue<'de>>()
2634 })),
2635
2636 2 => Self::Vector(::fidl_next::FromWire::from_wire(unsafe {
2637 wire.raw.get().read_unchecked::<crate::wire::ConfigVectorValue<'de>>()
2638 })),
2639
2640 ord => return Self::UnknownOrdinal_(ord as u64),
2641 }
2642 }
2643 }
2644
2645 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigValue<'de>> for ConfigValue {
2646 #[inline]
2647 fn from_wire_ref(wire: &crate::wire::ConfigValue<'de>) -> Self {
2648 match wire.raw.ordinal() {
2649 1 => Self::Single(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2650 wire.raw.get().deref_unchecked::<crate::wire::ConfigSingleValue<'de>>()
2651 })),
2652
2653 2 => Self::Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2654 wire.raw.get().deref_unchecked::<crate::wire::ConfigVectorValue<'de>>()
2655 })),
2656
2657 ord => return Self::UnknownOrdinal_(ord as u64),
2658 }
2659 }
2660 }
2661
2662 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigValue<'de>> for ConfigValue {
2663 #[inline]
2664 fn from_wire_option(
2665 wire: crate::wire_optional::ConfigValue<'de>,
2666 ) -> ::core::option::Option<Self> {
2667 if let Some(inner) = wire.into_option() {
2668 Some(::fidl_next::FromWire::from_wire(inner))
2669 } else {
2670 None
2671 }
2672 }
2673 }
2674
2675 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigValue<'de>> for Box<ConfigValue> {
2676 #[inline]
2677 fn from_wire_option(
2678 wire: crate::wire_optional::ConfigValue<'de>,
2679 ) -> ::core::option::Option<Self> {
2680 <
2681 ConfigValue as ::fidl_next::FromWireOption<crate::wire_optional::ConfigValue<'de>>
2682 >::from_wire_option(wire).map(Box::new)
2683 }
2684 }
2685
2686 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ConfigValue<'de>>
2687 for Box<ConfigValue>
2688 {
2689 #[inline]
2690 fn from_wire_option_ref(
2691 wire: &crate::wire_optional::ConfigValue<'de>,
2692 ) -> ::core::option::Option<Self> {
2693 if let Some(inner) = wire.as_ref() {
2694 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
2695 } else {
2696 None
2697 }
2698 }
2699 }
2700
2701 #[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"]
2702 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2703 pub struct Configuration {
2704 pub name: ::core::option::Option<::std::string::String>,
2705
2706 pub value: ::core::option::Option<crate::natural::ConfigValue>,
2707 }
2708
2709 impl Configuration {
2710 fn __max_ordinal(&self) -> usize {
2711 if self.value.is_some() {
2712 return 2;
2713 }
2714
2715 if self.name.is_some() {
2716 return 1;
2717 }
2718
2719 0
2720 }
2721 }
2722
2723 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Configuration<'static>, ___E> for Configuration
2724 where
2725 ___E: ::fidl_next::Encoder + ?Sized,
2726 {
2727 #[inline]
2728 fn encode(
2729 mut self,
2730 encoder: &mut ___E,
2731 out: &mut ::core::mem::MaybeUninit<crate::wire::Configuration<'static>>,
2732 _: (),
2733 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2734 ::fidl_next::munge!(let crate::wire::Configuration { table } = out);
2735
2736 let max_ord = self.__max_ordinal();
2737
2738 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2739 ::fidl_next::Wire::zero_padding(&mut out);
2740
2741 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2742 ::fidl_next::wire::Envelope,
2743 >(encoder, max_ord);
2744
2745 for i in 1..=max_ord {
2746 match i {
2747 2 => {
2748 if let Some(value) = self.value.take() {
2749 ::fidl_next::wire::Envelope::encode_value::<
2750 crate::wire::ConfigValue<'static>,
2751 ___E,
2752 >(
2753 value, preallocated.encoder, &mut out, ()
2754 )?;
2755 } else {
2756 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2757 }
2758 }
2759
2760 1 => {
2761 if let Some(value) = self.name.take() {
2762 ::fidl_next::wire::Envelope::encode_value::<
2763 ::fidl_next::wire::String<'static>,
2764 ___E,
2765 >(
2766 value, preallocated.encoder, &mut out, 100
2767 )?;
2768 } else {
2769 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2770 }
2771 }
2772
2773 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2774 }
2775 unsafe {
2776 preallocated.write_next(out.assume_init_ref());
2777 }
2778 }
2779
2780 ::fidl_next::wire::Table::encode_len(table, max_ord);
2781
2782 Ok(())
2783 }
2784 }
2785
2786 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Configuration<'static>, ___E>
2787 for &'a Configuration
2788 where
2789 ___E: ::fidl_next::Encoder + ?Sized,
2790 {
2791 #[inline]
2792 fn encode(
2793 self,
2794 encoder: &mut ___E,
2795 out: &mut ::core::mem::MaybeUninit<crate::wire::Configuration<'static>>,
2796 _: (),
2797 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2798 ::fidl_next::munge!(let crate::wire::Configuration { table } = out);
2799
2800 let max_ord = self.__max_ordinal();
2801
2802 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2803 ::fidl_next::Wire::zero_padding(&mut out);
2804
2805 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2806 ::fidl_next::wire::Envelope,
2807 >(encoder, max_ord);
2808
2809 for i in 1..=max_ord {
2810 match i {
2811 2 => {
2812 if let Some(value) = &self.value {
2813 ::fidl_next::wire::Envelope::encode_value::<
2814 crate::wire::ConfigValue<'static>,
2815 ___E,
2816 >(
2817 value, preallocated.encoder, &mut out, ()
2818 )?;
2819 } else {
2820 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2821 }
2822 }
2823
2824 1 => {
2825 if let Some(value) = &self.name {
2826 ::fidl_next::wire::Envelope::encode_value::<
2827 ::fidl_next::wire::String<'static>,
2828 ___E,
2829 >(
2830 value, preallocated.encoder, &mut out, 100
2831 )?;
2832 } else {
2833 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2834 }
2835 }
2836
2837 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2838 }
2839 unsafe {
2840 preallocated.write_next(out.assume_init_ref());
2841 }
2842 }
2843
2844 ::fidl_next::wire::Table::encode_len(table, max_ord);
2845
2846 Ok(())
2847 }
2848 }
2849
2850 impl<'de> ::fidl_next::FromWire<crate::wire::Configuration<'de>> for Configuration {
2851 #[inline]
2852 fn from_wire(wire_: crate::wire::Configuration<'de>) -> Self {
2853 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2854
2855 let name = wire_.table.get(1);
2856
2857 let value = wire_.table.get(2);
2858
2859 Self {
2860 name: name.map(|envelope| {
2861 ::fidl_next::FromWire::from_wire(unsafe {
2862 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2863 })
2864 }),
2865
2866 value: value.map(|envelope| {
2867 ::fidl_next::FromWire::from_wire(unsafe {
2868 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
2869 })
2870 }),
2871 }
2872 }
2873 }
2874
2875 impl<'de> ::fidl_next::FromWireRef<crate::wire::Configuration<'de>> for Configuration {
2876 #[inline]
2877 fn from_wire_ref(wire: &crate::wire::Configuration<'de>) -> Self {
2878 Self {
2879 name: wire.table.get(1).map(|envelope| {
2880 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2881 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
2882 })
2883 }),
2884
2885 value: wire.table.get(2).map(|envelope| {
2886 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2887 envelope.deref_unchecked::<crate::wire::ConfigValue<'de>>()
2888 })
2889 }),
2890 }
2891 }
2892 }
2893
2894 #[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"]
2895 pub type DictionaryPath = ::std::string::String;
2896
2897 #[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"]
2898 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2899 #[repr(u32)]
2900 pub enum DeliveryType {
2901 Immediate = 0,
2902 OnReadable = 1,
2903 UnknownOrdinal_(u32) = 2,
2904 }
2905 impl ::std::convert::From<u32> for DeliveryType {
2906 fn from(value: u32) -> Self {
2907 match value {
2908 0 => Self::Immediate,
2909 1 => Self::OnReadable,
2910
2911 _ => Self::UnknownOrdinal_(value),
2912 }
2913 }
2914 }
2915
2916 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeliveryType, ___E> for DeliveryType
2917 where
2918 ___E: ?Sized,
2919 {
2920 #[inline]
2921 fn encode(
2922 self,
2923 encoder: &mut ___E,
2924 out: &mut ::core::mem::MaybeUninit<crate::wire::DeliveryType>,
2925 _: (),
2926 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2927 ::fidl_next::Encode::encode(&self, encoder, out, ())
2928 }
2929 }
2930
2931 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeliveryType, ___E> for &'a DeliveryType
2932 where
2933 ___E: ?Sized,
2934 {
2935 #[inline]
2936 fn encode(
2937 self,
2938 encoder: &mut ___E,
2939 out: &mut ::core::mem::MaybeUninit<crate::wire::DeliveryType>,
2940 _: (),
2941 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2942 ::fidl_next::munge!(let crate::wire::DeliveryType { value } = out);
2943 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
2944 DeliveryType::Immediate => 0,
2945
2946 DeliveryType::OnReadable => 1,
2947
2948 DeliveryType::UnknownOrdinal_(value) => value,
2949 }));
2950
2951 Ok(())
2952 }
2953 }
2954
2955 impl ::core::convert::From<crate::wire::DeliveryType> for DeliveryType {
2956 fn from(wire: crate::wire::DeliveryType) -> Self {
2957 match u32::from(wire.value) {
2958 0 => Self::Immediate,
2959
2960 1 => Self::OnReadable,
2961
2962 value => Self::UnknownOrdinal_(value),
2963 }
2964 }
2965 }
2966
2967 impl ::fidl_next::FromWire<crate::wire::DeliveryType> for DeliveryType {
2968 #[inline]
2969 fn from_wire(wire: crate::wire::DeliveryType) -> Self {
2970 Self::from(wire)
2971 }
2972 }
2973
2974 impl ::fidl_next::FromWireRef<crate::wire::DeliveryType> for DeliveryType {
2975 #[inline]
2976 fn from_wire_ref(wire: &crate::wire::DeliveryType) -> Self {
2977 Self::from(*wire)
2978 }
2979 }
2980
2981 #[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"]
2982 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2983 pub struct Protocol {
2984 pub name: ::core::option::Option<::std::string::String>,
2985
2986 pub source_path: ::core::option::Option<::std::string::String>,
2987
2988 pub delivery: ::core::option::Option<crate::natural::DeliveryType>,
2989 }
2990
2991 impl Protocol {
2992 fn __max_ordinal(&self) -> usize {
2993 if self.delivery.is_some() {
2994 return 3;
2995 }
2996
2997 if self.source_path.is_some() {
2998 return 2;
2999 }
3000
3001 if self.name.is_some() {
3002 return 1;
3003 }
3004
3005 0
3006 }
3007 }
3008
3009 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Protocol<'static>, ___E> for Protocol
3010 where
3011 ___E: ::fidl_next::Encoder + ?Sized,
3012 {
3013 #[inline]
3014 fn encode(
3015 mut self,
3016 encoder: &mut ___E,
3017 out: &mut ::core::mem::MaybeUninit<crate::wire::Protocol<'static>>,
3018 _: (),
3019 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3020 ::fidl_next::munge!(let crate::wire::Protocol { table } = out);
3021
3022 let max_ord = self.__max_ordinal();
3023
3024 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3025 ::fidl_next::Wire::zero_padding(&mut out);
3026
3027 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3028 ::fidl_next::wire::Envelope,
3029 >(encoder, max_ord);
3030
3031 for i in 1..=max_ord {
3032 match i {
3033 3 => {
3034 if let Some(value) = self.delivery.take() {
3035 ::fidl_next::wire::Envelope::encode_value::<
3036 crate::wire::DeliveryType,
3037 ___E,
3038 >(
3039 value, preallocated.encoder, &mut out, ()
3040 )?;
3041 } else {
3042 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3043 }
3044 }
3045
3046 2 => {
3047 if let Some(value) = self.source_path.take() {
3048 ::fidl_next::wire::Envelope::encode_value::<
3049 ::fidl_next::wire::String<'static>,
3050 ___E,
3051 >(
3052 value, preallocated.encoder, &mut out, 1024
3053 )?;
3054 } else {
3055 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3056 }
3057 }
3058
3059 1 => {
3060 if let Some(value) = self.name.take() {
3061 ::fidl_next::wire::Envelope::encode_value::<
3062 ::fidl_next::wire::String<'static>,
3063 ___E,
3064 >(
3065 value, preallocated.encoder, &mut out, 100
3066 )?;
3067 } else {
3068 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3069 }
3070 }
3071
3072 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3073 }
3074 unsafe {
3075 preallocated.write_next(out.assume_init_ref());
3076 }
3077 }
3078
3079 ::fidl_next::wire::Table::encode_len(table, max_ord);
3080
3081 Ok(())
3082 }
3083 }
3084
3085 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Protocol<'static>, ___E> for &'a Protocol
3086 where
3087 ___E: ::fidl_next::Encoder + ?Sized,
3088 {
3089 #[inline]
3090 fn encode(
3091 self,
3092 encoder: &mut ___E,
3093 out: &mut ::core::mem::MaybeUninit<crate::wire::Protocol<'static>>,
3094 _: (),
3095 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3096 ::fidl_next::munge!(let crate::wire::Protocol { table } = out);
3097
3098 let max_ord = self.__max_ordinal();
3099
3100 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3101 ::fidl_next::Wire::zero_padding(&mut out);
3102
3103 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3104 ::fidl_next::wire::Envelope,
3105 >(encoder, max_ord);
3106
3107 for i in 1..=max_ord {
3108 match i {
3109 3 => {
3110 if let Some(value) = &self.delivery {
3111 ::fidl_next::wire::Envelope::encode_value::<
3112 crate::wire::DeliveryType,
3113 ___E,
3114 >(
3115 value, preallocated.encoder, &mut out, ()
3116 )?;
3117 } else {
3118 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3119 }
3120 }
3121
3122 2 => {
3123 if let Some(value) = &self.source_path {
3124 ::fidl_next::wire::Envelope::encode_value::<
3125 ::fidl_next::wire::String<'static>,
3126 ___E,
3127 >(
3128 value, preallocated.encoder, &mut out, 1024
3129 )?;
3130 } else {
3131 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3132 }
3133 }
3134
3135 1 => {
3136 if let Some(value) = &self.name {
3137 ::fidl_next::wire::Envelope::encode_value::<
3138 ::fidl_next::wire::String<'static>,
3139 ___E,
3140 >(
3141 value, preallocated.encoder, &mut out, 100
3142 )?;
3143 } else {
3144 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3145 }
3146 }
3147
3148 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3149 }
3150 unsafe {
3151 preallocated.write_next(out.assume_init_ref());
3152 }
3153 }
3154
3155 ::fidl_next::wire::Table::encode_len(table, max_ord);
3156
3157 Ok(())
3158 }
3159 }
3160
3161 impl<'de> ::fidl_next::FromWire<crate::wire::Protocol<'de>> for Protocol {
3162 #[inline]
3163 fn from_wire(wire_: crate::wire::Protocol<'de>) -> Self {
3164 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3165
3166 let name = wire_.table.get(1);
3167
3168 let source_path = wire_.table.get(2);
3169
3170 let delivery = wire_.table.get(3);
3171
3172 Self {
3173 name: name.map(|envelope| {
3174 ::fidl_next::FromWire::from_wire(unsafe {
3175 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
3176 })
3177 }),
3178
3179 source_path: source_path.map(|envelope| {
3180 ::fidl_next::FromWire::from_wire(unsafe {
3181 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
3182 })
3183 }),
3184
3185 delivery: delivery.map(|envelope| {
3186 ::fidl_next::FromWire::from_wire(unsafe {
3187 envelope.read_unchecked::<crate::wire::DeliveryType>()
3188 })
3189 }),
3190 }
3191 }
3192 }
3193
3194 impl<'de> ::fidl_next::FromWireRef<crate::wire::Protocol<'de>> for Protocol {
3195 #[inline]
3196 fn from_wire_ref(wire: &crate::wire::Protocol<'de>) -> Self {
3197 Self {
3198 name: wire.table.get(1).map(|envelope| {
3199 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3200 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
3201 })
3202 }),
3203
3204 source_path: wire.table.get(2).map(|envelope| {
3205 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3206 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
3207 })
3208 }),
3209
3210 delivery: wire.table.get(3).map(|envelope| {
3211 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3212 envelope.deref_unchecked::<crate::wire::DeliveryType>()
3213 })
3214 }),
3215 }
3216 }
3217 }
3218
3219 #[doc = " A reference to the environment.\n"]
3220 pub type EnvironmentRef = ();
3221
3222 #[doc = " A reference to a capability source or destination relative to this\n component.\n"]
3223 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3224 pub enum Ref {
3225 Parent(crate::natural::ParentRef),
3226
3227 Self_(crate::natural::SelfRef),
3228
3229 Child(crate::natural::ChildRef),
3230
3231 Collection(crate::natural::CollectionRef),
3232
3233 Framework(crate::natural::FrameworkRef),
3234
3235 Capability(crate::natural::CapabilityRef),
3236
3237 Debug(crate::natural::DebugRef),
3238
3239 VoidType(crate::natural::VoidRef),
3240
3241 Environment(crate::natural::EnvironmentRef),
3242
3243 UnknownOrdinal_(u64),
3244 }
3245
3246 impl Ref {
3247 pub fn is_unknown(&self) -> bool {
3248 #[allow(unreachable_patterns)]
3249 match self {
3250 Self::UnknownOrdinal_(_) => true,
3251 _ => false,
3252 }
3253 }
3254 }
3255
3256 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Ref<'static>, ___E> for Ref
3257 where
3258 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3259 ___E: ::fidl_next::Encoder,
3260 {
3261 #[inline]
3262 fn encode(
3263 self,
3264 encoder: &mut ___E,
3265 out: &mut ::core::mem::MaybeUninit<crate::wire::Ref<'static>>,
3266 _: (),
3267 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3268 ::fidl_next::munge!(let crate::wire::Ref { raw, _phantom: _ } = out);
3269
3270 match self {
3271 Self::Parent(value) => ::fidl_next::wire::Union::encode_as::<
3272 ___E,
3273 crate::wire::ParentRef,
3274 >(value, 1, encoder, raw, ())?,
3275
3276 Self::Self_(value) => ::fidl_next::wire::Union::encode_as::<
3277 ___E,
3278 crate::wire::SelfRef,
3279 >(value, 2, encoder, raw, ())?,
3280
3281 Self::Child(value) => ::fidl_next::wire::Union::encode_as::<
3282 ___E,
3283 crate::wire::ChildRef<'static>,
3284 >(value, 3, encoder, raw, ())?,
3285
3286 Self::Collection(value) => ::fidl_next::wire::Union::encode_as::<
3287 ___E,
3288 crate::wire::CollectionRef<'static>,
3289 >(value, 4, encoder, raw, ())?,
3290
3291 Self::Framework(value) => ::fidl_next::wire::Union::encode_as::<
3292 ___E,
3293 crate::wire::FrameworkRef,
3294 >(value, 5, encoder, raw, ())?,
3295
3296 Self::Capability(value) => ::fidl_next::wire::Union::encode_as::<
3297 ___E,
3298 crate::wire::CapabilityRef<'static>,
3299 >(value, 6, encoder, raw, ())?,
3300
3301 Self::Debug(value) => ::fidl_next::wire::Union::encode_as::<
3302 ___E,
3303 crate::wire::DebugRef,
3304 >(value, 7, encoder, raw, ())?,
3305
3306 Self::VoidType(value) => ::fidl_next::wire::Union::encode_as::<
3307 ___E,
3308 crate::wire::VoidRef,
3309 >(value, 8, encoder, raw, ())?,
3310
3311 Self::Environment(value) => ::fidl_next::wire::Union::encode_as::<
3312 ___E,
3313 crate::wire::EnvironmentRef,
3314 >(value, 9, encoder, raw, ())?,
3315
3316 Self::UnknownOrdinal_(ordinal) => {
3317 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
3318 }
3319 }
3320
3321 Ok(())
3322 }
3323 }
3324
3325 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Ref<'static>, ___E> for &'a Ref
3326 where
3327 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3328 ___E: ::fidl_next::Encoder,
3329 {
3330 #[inline]
3331 fn encode(
3332 self,
3333 encoder: &mut ___E,
3334 out: &mut ::core::mem::MaybeUninit<crate::wire::Ref<'static>>,
3335 _: (),
3336 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3337 ::fidl_next::munge!(let crate::wire::Ref { raw, _phantom: _ } = out);
3338
3339 match self {
3340 Ref::Parent(value) => ::fidl_next::wire::Union::encode_as::<
3341 ___E,
3342 crate::wire::ParentRef,
3343 >(value, 1, encoder, raw, ())?,
3344
3345 Ref::Self_(value) => ::fidl_next::wire::Union::encode_as::<
3346 ___E,
3347 crate::wire::SelfRef,
3348 >(value, 2, encoder, raw, ())?,
3349
3350 Ref::Child(value) => ::fidl_next::wire::Union::encode_as::<
3351 ___E,
3352 crate::wire::ChildRef<'static>,
3353 >(value, 3, encoder, raw, ())?,
3354
3355 Ref::Collection(value) => ::fidl_next::wire::Union::encode_as::<
3356 ___E,
3357 crate::wire::CollectionRef<'static>,
3358 >(value, 4, encoder, raw, ())?,
3359
3360 Ref::Framework(value) => ::fidl_next::wire::Union::encode_as::<
3361 ___E,
3362 crate::wire::FrameworkRef,
3363 >(value, 5, encoder, raw, ())?,
3364
3365 Ref::Capability(value) => ::fidl_next::wire::Union::encode_as::<
3366 ___E,
3367 crate::wire::CapabilityRef<'static>,
3368 >(value, 6, encoder, raw, ())?,
3369
3370 Ref::Debug(value) => ::fidl_next::wire::Union::encode_as::<
3371 ___E,
3372 crate::wire::DebugRef,
3373 >(value, 7, encoder, raw, ())?,
3374
3375 Ref::VoidType(value) => ::fidl_next::wire::Union::encode_as::<
3376 ___E,
3377 crate::wire::VoidRef,
3378 >(value, 8, encoder, raw, ())?,
3379
3380 Ref::Environment(value) => ::fidl_next::wire::Union::encode_as::<
3381 ___E,
3382 crate::wire::EnvironmentRef,
3383 >(value, 9, encoder, raw, ())?,
3384
3385 Ref::UnknownOrdinal_(ordinal) => {
3386 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
3387 }
3388 }
3389
3390 Ok(())
3391 }
3392 }
3393
3394 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Ref<'static>, ___E> for Ref
3395 where
3396 ___E: ?Sized,
3397 Ref: ::fidl_next::Encode<crate::wire::Ref<'static>, ___E>,
3398 {
3399 #[inline]
3400 fn encode_option(
3401 this: ::core::option::Option<Self>,
3402 encoder: &mut ___E,
3403 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Ref<'static>>,
3404 _: (),
3405 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3406 ::fidl_next::munge!(let crate::wire_optional::Ref { raw, _phantom: _ } = &mut *out);
3407
3408 if let Some(inner) = this {
3409 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
3410 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
3411 } else {
3412 ::fidl_next::wire::Union::encode_absent(raw);
3413 }
3414
3415 Ok(())
3416 }
3417 }
3418
3419 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Ref<'static>, ___E>
3420 for &'a Ref
3421 where
3422 ___E: ?Sized,
3423 &'a Ref: ::fidl_next::Encode<crate::wire::Ref<'static>, ___E>,
3424 {
3425 #[inline]
3426 fn encode_option(
3427 this: ::core::option::Option<Self>,
3428 encoder: &mut ___E,
3429 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Ref<'static>>,
3430 _: (),
3431 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3432 ::fidl_next::munge!(let crate::wire_optional::Ref { raw, _phantom: _ } = &mut *out);
3433
3434 if let Some(inner) = this {
3435 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
3436 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
3437 } else {
3438 ::fidl_next::wire::Union::encode_absent(raw);
3439 }
3440
3441 Ok(())
3442 }
3443 }
3444
3445 impl<'de> ::fidl_next::FromWire<crate::wire::Ref<'de>> for Ref {
3446 #[inline]
3447 fn from_wire(wire: crate::wire::Ref<'de>) -> Self {
3448 let wire = ::core::mem::ManuallyDrop::new(wire);
3449 match wire.raw.ordinal() {
3450 1 => Self::Parent(::fidl_next::FromWire::from_wire(unsafe {
3451 wire.raw.get().read_unchecked::<crate::wire::ParentRef>()
3452 })),
3453
3454 2 => Self::Self_(::fidl_next::FromWire::from_wire(unsafe {
3455 wire.raw.get().read_unchecked::<crate::wire::SelfRef>()
3456 })),
3457
3458 3 => Self::Child(::fidl_next::FromWire::from_wire(unsafe {
3459 wire.raw.get().read_unchecked::<crate::wire::ChildRef<'de>>()
3460 })),
3461
3462 4 => Self::Collection(::fidl_next::FromWire::from_wire(unsafe {
3463 wire.raw.get().read_unchecked::<crate::wire::CollectionRef<'de>>()
3464 })),
3465
3466 5 => Self::Framework(::fidl_next::FromWire::from_wire(unsafe {
3467 wire.raw.get().read_unchecked::<crate::wire::FrameworkRef>()
3468 })),
3469
3470 6 => Self::Capability(::fidl_next::FromWire::from_wire(unsafe {
3471 wire.raw.get().read_unchecked::<crate::wire::CapabilityRef<'de>>()
3472 })),
3473
3474 7 => Self::Debug(::fidl_next::FromWire::from_wire(unsafe {
3475 wire.raw.get().read_unchecked::<crate::wire::DebugRef>()
3476 })),
3477
3478 8 => Self::VoidType(::fidl_next::FromWire::from_wire(unsafe {
3479 wire.raw.get().read_unchecked::<crate::wire::VoidRef>()
3480 })),
3481
3482 9 => Self::Environment(::fidl_next::FromWire::from_wire(unsafe {
3483 wire.raw.get().read_unchecked::<crate::wire::EnvironmentRef>()
3484 })),
3485
3486 ord => return Self::UnknownOrdinal_(ord as u64),
3487 }
3488 }
3489 }
3490
3491 impl<'de> ::fidl_next::FromWireRef<crate::wire::Ref<'de>> for Ref {
3492 #[inline]
3493 fn from_wire_ref(wire: &crate::wire::Ref<'de>) -> Self {
3494 match wire.raw.ordinal() {
3495 1 => Self::Parent(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3496 wire.raw.get().deref_unchecked::<crate::wire::ParentRef>()
3497 })),
3498
3499 2 => Self::Self_(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3500 wire.raw.get().deref_unchecked::<crate::wire::SelfRef>()
3501 })),
3502
3503 3 => Self::Child(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3504 wire.raw.get().deref_unchecked::<crate::wire::ChildRef<'de>>()
3505 })),
3506
3507 4 => Self::Collection(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3508 wire.raw.get().deref_unchecked::<crate::wire::CollectionRef<'de>>()
3509 })),
3510
3511 5 => Self::Framework(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3512 wire.raw.get().deref_unchecked::<crate::wire::FrameworkRef>()
3513 })),
3514
3515 6 => Self::Capability(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3516 wire.raw.get().deref_unchecked::<crate::wire::CapabilityRef<'de>>()
3517 })),
3518
3519 7 => Self::Debug(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3520 wire.raw.get().deref_unchecked::<crate::wire::DebugRef>()
3521 })),
3522
3523 8 => Self::VoidType(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3524 wire.raw.get().deref_unchecked::<crate::wire::VoidRef>()
3525 })),
3526
3527 9 => Self::Environment(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3528 wire.raw.get().deref_unchecked::<crate::wire::EnvironmentRef>()
3529 })),
3530
3531 ord => return Self::UnknownOrdinal_(ord as u64),
3532 }
3533 }
3534 }
3535
3536 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Ref<'de>> for Ref {
3537 #[inline]
3538 fn from_wire_option(wire: crate::wire_optional::Ref<'de>) -> ::core::option::Option<Self> {
3539 if let Some(inner) = wire.into_option() {
3540 Some(::fidl_next::FromWire::from_wire(inner))
3541 } else {
3542 None
3543 }
3544 }
3545 }
3546
3547 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Ref<'de>> for Box<Ref> {
3548 #[inline]
3549 fn from_wire_option(wire: crate::wire_optional::Ref<'de>) -> ::core::option::Option<Self> {
3550 <Ref as ::fidl_next::FromWireOption<crate::wire_optional::Ref<'de>>>::from_wire_option(
3551 wire,
3552 )
3553 .map(Box::new)
3554 }
3555 }
3556
3557 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::Ref<'de>> for Box<Ref> {
3558 #[inline]
3559 fn from_wire_option_ref(
3560 wire: &crate::wire_optional::Ref<'de>,
3561 ) -> ::core::option::Option<Self> {
3562 if let Some(inner) = wire.as_ref() {
3563 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
3564 } else {
3565 None
3566 }
3567 }
3568 }
3569
3570 #[doc = " Declares a storage capability backed by a directory from which data, cache,\n or meta storage can be offered.\n"]
3571 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3572 pub struct Storage {
3573 pub name: ::core::option::Option<::std::string::String>,
3574
3575 pub source: ::core::option::Option<crate::natural::Ref>,
3576
3577 pub backing_dir: ::core::option::Option<::std::string::String>,
3578
3579 pub subdir: ::core::option::Option<::std::string::String>,
3580
3581 pub storage_id: ::core::option::Option<crate::natural::StorageId>,
3582 }
3583
3584 impl Storage {
3585 fn __max_ordinal(&self) -> usize {
3586 if self.storage_id.is_some() {
3587 return 5;
3588 }
3589
3590 if self.subdir.is_some() {
3591 return 4;
3592 }
3593
3594 if self.backing_dir.is_some() {
3595 return 3;
3596 }
3597
3598 if self.source.is_some() {
3599 return 2;
3600 }
3601
3602 if self.name.is_some() {
3603 return 1;
3604 }
3605
3606 0
3607 }
3608 }
3609
3610 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Storage<'static>, ___E> for Storage
3611 where
3612 ___E: ::fidl_next::Encoder + ?Sized,
3613 {
3614 #[inline]
3615 fn encode(
3616 mut self,
3617 encoder: &mut ___E,
3618 out: &mut ::core::mem::MaybeUninit<crate::wire::Storage<'static>>,
3619 _: (),
3620 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3621 ::fidl_next::munge!(let crate::wire::Storage { table } = out);
3622
3623 let max_ord = self.__max_ordinal();
3624
3625 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3626 ::fidl_next::Wire::zero_padding(&mut out);
3627
3628 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3629 ::fidl_next::wire::Envelope,
3630 >(encoder, max_ord);
3631
3632 for i in 1..=max_ord {
3633 match i {
3634 5 => {
3635 if let Some(value) = self.storage_id.take() {
3636 ::fidl_next::wire::Envelope::encode_value::<
3637 crate::wire::StorageId,
3638 ___E,
3639 >(
3640 value, preallocated.encoder, &mut out, ()
3641 )?;
3642 } else {
3643 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3644 }
3645 }
3646
3647 4 => {
3648 if let Some(value) = self.subdir.take() {
3649 ::fidl_next::wire::Envelope::encode_value::<
3650 ::fidl_next::wire::String<'static>,
3651 ___E,
3652 >(
3653 value, preallocated.encoder, &mut out, 1024
3654 )?;
3655 } else {
3656 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3657 }
3658 }
3659
3660 3 => {
3661 if let Some(value) = self.backing_dir.take() {
3662 ::fidl_next::wire::Envelope::encode_value::<
3663 ::fidl_next::wire::String<'static>,
3664 ___E,
3665 >(
3666 value, preallocated.encoder, &mut out, 100
3667 )?;
3668 } else {
3669 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3670 }
3671 }
3672
3673 2 => {
3674 if let Some(value) = self.source.take() {
3675 ::fidl_next::wire::Envelope::encode_value::<
3676 crate::wire::Ref<'static>,
3677 ___E,
3678 >(
3679 value, preallocated.encoder, &mut out, ()
3680 )?;
3681 } else {
3682 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3683 }
3684 }
3685
3686 1 => {
3687 if let Some(value) = self.name.take() {
3688 ::fidl_next::wire::Envelope::encode_value::<
3689 ::fidl_next::wire::String<'static>,
3690 ___E,
3691 >(
3692 value, preallocated.encoder, &mut out, 100
3693 )?;
3694 } else {
3695 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3696 }
3697 }
3698
3699 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3700 }
3701 unsafe {
3702 preallocated.write_next(out.assume_init_ref());
3703 }
3704 }
3705
3706 ::fidl_next::wire::Table::encode_len(table, max_ord);
3707
3708 Ok(())
3709 }
3710 }
3711
3712 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Storage<'static>, ___E> for &'a Storage
3713 where
3714 ___E: ::fidl_next::Encoder + ?Sized,
3715 {
3716 #[inline]
3717 fn encode(
3718 self,
3719 encoder: &mut ___E,
3720 out: &mut ::core::mem::MaybeUninit<crate::wire::Storage<'static>>,
3721 _: (),
3722 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3723 ::fidl_next::munge!(let crate::wire::Storage { table } = out);
3724
3725 let max_ord = self.__max_ordinal();
3726
3727 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3728 ::fidl_next::Wire::zero_padding(&mut out);
3729
3730 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3731 ::fidl_next::wire::Envelope,
3732 >(encoder, max_ord);
3733
3734 for i in 1..=max_ord {
3735 match i {
3736 5 => {
3737 if let Some(value) = &self.storage_id {
3738 ::fidl_next::wire::Envelope::encode_value::<
3739 crate::wire::StorageId,
3740 ___E,
3741 >(
3742 value, preallocated.encoder, &mut out, ()
3743 )?;
3744 } else {
3745 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3746 }
3747 }
3748
3749 4 => {
3750 if let Some(value) = &self.subdir {
3751 ::fidl_next::wire::Envelope::encode_value::<
3752 ::fidl_next::wire::String<'static>,
3753 ___E,
3754 >(
3755 value, preallocated.encoder, &mut out, 1024
3756 )?;
3757 } else {
3758 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3759 }
3760 }
3761
3762 3 => {
3763 if let Some(value) = &self.backing_dir {
3764 ::fidl_next::wire::Envelope::encode_value::<
3765 ::fidl_next::wire::String<'static>,
3766 ___E,
3767 >(
3768 value, preallocated.encoder, &mut out, 100
3769 )?;
3770 } else {
3771 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3772 }
3773 }
3774
3775 2 => {
3776 if let Some(value) = &self.source {
3777 ::fidl_next::wire::Envelope::encode_value::<
3778 crate::wire::Ref<'static>,
3779 ___E,
3780 >(
3781 value, preallocated.encoder, &mut out, ()
3782 )?;
3783 } else {
3784 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3785 }
3786 }
3787
3788 1 => {
3789 if let Some(value) = &self.name {
3790 ::fidl_next::wire::Envelope::encode_value::<
3791 ::fidl_next::wire::String<'static>,
3792 ___E,
3793 >(
3794 value, preallocated.encoder, &mut out, 100
3795 )?;
3796 } else {
3797 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3798 }
3799 }
3800
3801 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3802 }
3803 unsafe {
3804 preallocated.write_next(out.assume_init_ref());
3805 }
3806 }
3807
3808 ::fidl_next::wire::Table::encode_len(table, max_ord);
3809
3810 Ok(())
3811 }
3812 }
3813
3814 impl<'de> ::fidl_next::FromWire<crate::wire::Storage<'de>> for Storage {
3815 #[inline]
3816 fn from_wire(wire_: crate::wire::Storage<'de>) -> Self {
3817 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3818
3819 let name = wire_.table.get(1);
3820
3821 let source = wire_.table.get(2);
3822
3823 let backing_dir = wire_.table.get(3);
3824
3825 let subdir = wire_.table.get(4);
3826
3827 let storage_id = wire_.table.get(5);
3828
3829 Self {
3830 name: name.map(|envelope| {
3831 ::fidl_next::FromWire::from_wire(unsafe {
3832 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
3833 })
3834 }),
3835
3836 source: source.map(|envelope| {
3837 ::fidl_next::FromWire::from_wire(unsafe {
3838 envelope.read_unchecked::<crate::wire::Ref<'de>>()
3839 })
3840 }),
3841
3842 backing_dir: backing_dir.map(|envelope| {
3843 ::fidl_next::FromWire::from_wire(unsafe {
3844 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
3845 })
3846 }),
3847
3848 subdir: subdir.map(|envelope| {
3849 ::fidl_next::FromWire::from_wire(unsafe {
3850 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
3851 })
3852 }),
3853
3854 storage_id: storage_id.map(|envelope| {
3855 ::fidl_next::FromWire::from_wire(unsafe {
3856 envelope.read_unchecked::<crate::wire::StorageId>()
3857 })
3858 }),
3859 }
3860 }
3861 }
3862
3863 impl<'de> ::fidl_next::FromWireRef<crate::wire::Storage<'de>> for Storage {
3864 #[inline]
3865 fn from_wire_ref(wire: &crate::wire::Storage<'de>) -> Self {
3866 Self {
3867 name: wire.table.get(1).map(|envelope| {
3868 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3869 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
3870 })
3871 }),
3872
3873 source: wire.table.get(2).map(|envelope| {
3874 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3875 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
3876 })
3877 }),
3878
3879 backing_dir: wire.table.get(3).map(|envelope| {
3880 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3881 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
3882 })
3883 }),
3884
3885 subdir: wire.table.get(4).map(|envelope| {
3886 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3887 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
3888 })
3889 }),
3890
3891 storage_id: wire.table.get(5).map(|envelope| {
3892 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3893 envelope.deref_unchecked::<crate::wire::StorageId>()
3894 })
3895 }),
3896 }
3897 }
3898 }
3899
3900 #[doc = " Declares a dictionary capability.\n"]
3901 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3902 pub struct Dictionary {
3903 pub name: ::core::option::Option<::std::string::String>,
3904
3905 pub source: ::core::option::Option<crate::natural::Ref>,
3906
3907 pub source_dictionary: ::core::option::Option<::std::string::String>,
3908
3909 pub source_path: ::core::option::Option<::std::string::String>,
3910 }
3911
3912 impl Dictionary {
3913 fn __max_ordinal(&self) -> usize {
3914 if self.source_path.is_some() {
3915 return 4;
3916 }
3917
3918 if self.source_dictionary.is_some() {
3919 return 3;
3920 }
3921
3922 if self.source.is_some() {
3923 return 2;
3924 }
3925
3926 if self.name.is_some() {
3927 return 1;
3928 }
3929
3930 0
3931 }
3932 }
3933
3934 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Dictionary<'static>, ___E> for Dictionary
3935 where
3936 ___E: ::fidl_next::Encoder + ?Sized,
3937 {
3938 #[inline]
3939 fn encode(
3940 mut self,
3941 encoder: &mut ___E,
3942 out: &mut ::core::mem::MaybeUninit<crate::wire::Dictionary<'static>>,
3943 _: (),
3944 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3945 ::fidl_next::munge!(let crate::wire::Dictionary { table } = out);
3946
3947 let max_ord = self.__max_ordinal();
3948
3949 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3950 ::fidl_next::Wire::zero_padding(&mut out);
3951
3952 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3953 ::fidl_next::wire::Envelope,
3954 >(encoder, max_ord);
3955
3956 for i in 1..=max_ord {
3957 match i {
3958 4 => {
3959 if let Some(value) = self.source_path.take() {
3960 ::fidl_next::wire::Envelope::encode_value::<
3961 ::fidl_next::wire::String<'static>,
3962 ___E,
3963 >(
3964 value, preallocated.encoder, &mut out, 1024
3965 )?;
3966 } else {
3967 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3968 }
3969 }
3970
3971 3 => {
3972 if let Some(value) = self.source_dictionary.take() {
3973 ::fidl_next::wire::Envelope::encode_value::<
3974 ::fidl_next::wire::String<'static>,
3975 ___E,
3976 >(
3977 value, preallocated.encoder, &mut out, 1024
3978 )?;
3979 } else {
3980 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3981 }
3982 }
3983
3984 2 => {
3985 if let Some(value) = self.source.take() {
3986 ::fidl_next::wire::Envelope::encode_value::<
3987 crate::wire::Ref<'static>,
3988 ___E,
3989 >(
3990 value, preallocated.encoder, &mut out, ()
3991 )?;
3992 } else {
3993 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3994 }
3995 }
3996
3997 1 => {
3998 if let Some(value) = self.name.take() {
3999 ::fidl_next::wire::Envelope::encode_value::<
4000 ::fidl_next::wire::String<'static>,
4001 ___E,
4002 >(
4003 value, preallocated.encoder, &mut out, 100
4004 )?;
4005 } else {
4006 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4007 }
4008 }
4009
4010 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4011 }
4012 unsafe {
4013 preallocated.write_next(out.assume_init_ref());
4014 }
4015 }
4016
4017 ::fidl_next::wire::Table::encode_len(table, max_ord);
4018
4019 Ok(())
4020 }
4021 }
4022
4023 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Dictionary<'static>, ___E> for &'a Dictionary
4024 where
4025 ___E: ::fidl_next::Encoder + ?Sized,
4026 {
4027 #[inline]
4028 fn encode(
4029 self,
4030 encoder: &mut ___E,
4031 out: &mut ::core::mem::MaybeUninit<crate::wire::Dictionary<'static>>,
4032 _: (),
4033 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4034 ::fidl_next::munge!(let crate::wire::Dictionary { table } = out);
4035
4036 let max_ord = self.__max_ordinal();
4037
4038 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4039 ::fidl_next::Wire::zero_padding(&mut out);
4040
4041 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4042 ::fidl_next::wire::Envelope,
4043 >(encoder, max_ord);
4044
4045 for i in 1..=max_ord {
4046 match i {
4047 4 => {
4048 if let Some(value) = &self.source_path {
4049 ::fidl_next::wire::Envelope::encode_value::<
4050 ::fidl_next::wire::String<'static>,
4051 ___E,
4052 >(
4053 value, preallocated.encoder, &mut out, 1024
4054 )?;
4055 } else {
4056 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4057 }
4058 }
4059
4060 3 => {
4061 if let Some(value) = &self.source_dictionary {
4062 ::fidl_next::wire::Envelope::encode_value::<
4063 ::fidl_next::wire::String<'static>,
4064 ___E,
4065 >(
4066 value, preallocated.encoder, &mut out, 1024
4067 )?;
4068 } else {
4069 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4070 }
4071 }
4072
4073 2 => {
4074 if let Some(value) = &self.source {
4075 ::fidl_next::wire::Envelope::encode_value::<
4076 crate::wire::Ref<'static>,
4077 ___E,
4078 >(
4079 value, preallocated.encoder, &mut out, ()
4080 )?;
4081 } else {
4082 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4083 }
4084 }
4085
4086 1 => {
4087 if let Some(value) = &self.name {
4088 ::fidl_next::wire::Envelope::encode_value::<
4089 ::fidl_next::wire::String<'static>,
4090 ___E,
4091 >(
4092 value, preallocated.encoder, &mut out, 100
4093 )?;
4094 } else {
4095 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4096 }
4097 }
4098
4099 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4100 }
4101 unsafe {
4102 preallocated.write_next(out.assume_init_ref());
4103 }
4104 }
4105
4106 ::fidl_next::wire::Table::encode_len(table, max_ord);
4107
4108 Ok(())
4109 }
4110 }
4111
4112 impl<'de> ::fidl_next::FromWire<crate::wire::Dictionary<'de>> for Dictionary {
4113 #[inline]
4114 fn from_wire(wire_: crate::wire::Dictionary<'de>) -> Self {
4115 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4116
4117 let name = wire_.table.get(1);
4118
4119 let source = wire_.table.get(2);
4120
4121 let source_dictionary = wire_.table.get(3);
4122
4123 let source_path = wire_.table.get(4);
4124
4125 Self {
4126 name: name.map(|envelope| {
4127 ::fidl_next::FromWire::from_wire(unsafe {
4128 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4129 })
4130 }),
4131
4132 source: source.map(|envelope| {
4133 ::fidl_next::FromWire::from_wire(unsafe {
4134 envelope.read_unchecked::<crate::wire::Ref<'de>>()
4135 })
4136 }),
4137
4138 source_dictionary: source_dictionary.map(|envelope| {
4139 ::fidl_next::FromWire::from_wire(unsafe {
4140 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4141 })
4142 }),
4143
4144 source_path: source_path.map(|envelope| {
4145 ::fidl_next::FromWire::from_wire(unsafe {
4146 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4147 })
4148 }),
4149 }
4150 }
4151 }
4152
4153 impl<'de> ::fidl_next::FromWireRef<crate::wire::Dictionary<'de>> for Dictionary {
4154 #[inline]
4155 fn from_wire_ref(wire: &crate::wire::Dictionary<'de>) -> Self {
4156 Self {
4157 name: wire.table.get(1).map(|envelope| {
4158 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4159 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
4160 })
4161 }),
4162
4163 source: wire.table.get(2).map(|envelope| {
4164 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4165 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
4166 })
4167 }),
4168
4169 source_dictionary: wire.table.get(3).map(|envelope| {
4170 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4171 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
4172 })
4173 }),
4174
4175 source_path: wire.table.get(4).map(|envelope| {
4176 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4177 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
4178 })
4179 }),
4180 }
4181 }
4182 }
4183
4184 #[doc = " Declares a capability defined by this component.\n"]
4185 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4186 pub enum Capability {
4187 Service(crate::natural::Service),
4188
4189 Protocol(crate::natural::Protocol),
4190
4191 Directory(crate::natural::Directory),
4192
4193 Storage(crate::natural::Storage),
4194
4195 Runner(crate::natural::Runner),
4196
4197 Resolver(crate::natural::Resolver),
4198
4199 EventStream(crate::natural::EventStream),
4200
4201 Dictionary(crate::natural::Dictionary),
4202
4203 Config(crate::natural::Configuration),
4204
4205 UnknownOrdinal_(u64),
4206 }
4207
4208 impl Capability {
4209 pub fn is_unknown(&self) -> bool {
4210 #[allow(unreachable_patterns)]
4211 match self {
4212 Self::UnknownOrdinal_(_) => true,
4213 _ => false,
4214 }
4215 }
4216 }
4217
4218 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Capability<'static>, ___E> for Capability
4219 where
4220 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4221 ___E: ::fidl_next::Encoder,
4222 {
4223 #[inline]
4224 fn encode(
4225 self,
4226 encoder: &mut ___E,
4227 out: &mut ::core::mem::MaybeUninit<crate::wire::Capability<'static>>,
4228 _: (),
4229 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4230 ::fidl_next::munge!(let crate::wire::Capability { raw, _phantom: _ } = out);
4231
4232 match self {
4233 Self::Service(value) => ::fidl_next::wire::Union::encode_as::<
4234 ___E,
4235 crate::wire::Service<'static>,
4236 >(value, 1, encoder, raw, ())?,
4237
4238 Self::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
4239 ___E,
4240 crate::wire::Protocol<'static>,
4241 >(value, 2, encoder, raw, ())?,
4242
4243 Self::Directory(value) => ::fidl_next::wire::Union::encode_as::<
4244 ___E,
4245 crate::wire::Directory<'static>,
4246 >(value, 3, encoder, raw, ())?,
4247
4248 Self::Storage(value) => ::fidl_next::wire::Union::encode_as::<
4249 ___E,
4250 crate::wire::Storage<'static>,
4251 >(value, 4, encoder, raw, ())?,
4252
4253 Self::Runner(value) => ::fidl_next::wire::Union::encode_as::<
4254 ___E,
4255 crate::wire::Runner<'static>,
4256 >(value, 5, encoder, raw, ())?,
4257
4258 Self::Resolver(value) => ::fidl_next::wire::Union::encode_as::<
4259 ___E,
4260 crate::wire::Resolver<'static>,
4261 >(value, 6, encoder, raw, ())?,
4262
4263 Self::EventStream(value) => ::fidl_next::wire::Union::encode_as::<
4264 ___E,
4265 crate::wire::EventStream<'static>,
4266 >(value, 8, encoder, raw, ())?,
4267
4268 Self::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
4269 ___E,
4270 crate::wire::Dictionary<'static>,
4271 >(value, 9, encoder, raw, ())?,
4272
4273 Self::Config(value) => ::fidl_next::wire::Union::encode_as::<
4274 ___E,
4275 crate::wire::Configuration<'static>,
4276 >(value, 10, encoder, raw, ())?,
4277
4278 Self::UnknownOrdinal_(ordinal) => {
4279 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
4280 }
4281 }
4282
4283 Ok(())
4284 }
4285 }
4286
4287 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Capability<'static>, ___E> for &'a Capability
4288 where
4289 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4290 ___E: ::fidl_next::Encoder,
4291 {
4292 #[inline]
4293 fn encode(
4294 self,
4295 encoder: &mut ___E,
4296 out: &mut ::core::mem::MaybeUninit<crate::wire::Capability<'static>>,
4297 _: (),
4298 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4299 ::fidl_next::munge!(let crate::wire::Capability { raw, _phantom: _ } = out);
4300
4301 match self {
4302 Capability::Service(value) => ::fidl_next::wire::Union::encode_as::<
4303 ___E,
4304 crate::wire::Service<'static>,
4305 >(value, 1, encoder, raw, ())?,
4306
4307 Capability::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
4308 ___E,
4309 crate::wire::Protocol<'static>,
4310 >(value, 2, encoder, raw, ())?,
4311
4312 Capability::Directory(value) => ::fidl_next::wire::Union::encode_as::<
4313 ___E,
4314 crate::wire::Directory<'static>,
4315 >(value, 3, encoder, raw, ())?,
4316
4317 Capability::Storage(value) => ::fidl_next::wire::Union::encode_as::<
4318 ___E,
4319 crate::wire::Storage<'static>,
4320 >(value, 4, encoder, raw, ())?,
4321
4322 Capability::Runner(value) => ::fidl_next::wire::Union::encode_as::<
4323 ___E,
4324 crate::wire::Runner<'static>,
4325 >(value, 5, encoder, raw, ())?,
4326
4327 Capability::Resolver(value) => ::fidl_next::wire::Union::encode_as::<
4328 ___E,
4329 crate::wire::Resolver<'static>,
4330 >(value, 6, encoder, raw, ())?,
4331
4332 Capability::EventStream(value) => ::fidl_next::wire::Union::encode_as::<
4333 ___E,
4334 crate::wire::EventStream<'static>,
4335 >(value, 8, encoder, raw, ())?,
4336
4337 Capability::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
4338 ___E,
4339 crate::wire::Dictionary<'static>,
4340 >(value, 9, encoder, raw, ())?,
4341
4342 Capability::Config(value) => ::fidl_next::wire::Union::encode_as::<
4343 ___E,
4344 crate::wire::Configuration<'static>,
4345 >(value, 10, encoder, raw, ())?,
4346
4347 Capability::UnknownOrdinal_(ordinal) => {
4348 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
4349 }
4350 }
4351
4352 Ok(())
4353 }
4354 }
4355
4356 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Capability<'static>, ___E>
4357 for Capability
4358 where
4359 ___E: ?Sized,
4360 Capability: ::fidl_next::Encode<crate::wire::Capability<'static>, ___E>,
4361 {
4362 #[inline]
4363 fn encode_option(
4364 this: ::core::option::Option<Self>,
4365 encoder: &mut ___E,
4366 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Capability<'static>>,
4367 _: (),
4368 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4369 ::fidl_next::munge!(let crate::wire_optional::Capability { raw, _phantom: _ } = &mut *out);
4370
4371 if let Some(inner) = this {
4372 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4373 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
4374 } else {
4375 ::fidl_next::wire::Union::encode_absent(raw);
4376 }
4377
4378 Ok(())
4379 }
4380 }
4381
4382 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Capability<'static>, ___E>
4383 for &'a Capability
4384 where
4385 ___E: ?Sized,
4386 &'a Capability: ::fidl_next::Encode<crate::wire::Capability<'static>, ___E>,
4387 {
4388 #[inline]
4389 fn encode_option(
4390 this: ::core::option::Option<Self>,
4391 encoder: &mut ___E,
4392 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Capability<'static>>,
4393 _: (),
4394 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4395 ::fidl_next::munge!(let crate::wire_optional::Capability { raw, _phantom: _ } = &mut *out);
4396
4397 if let Some(inner) = this {
4398 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4399 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
4400 } else {
4401 ::fidl_next::wire::Union::encode_absent(raw);
4402 }
4403
4404 Ok(())
4405 }
4406 }
4407
4408 impl<'de> ::fidl_next::FromWire<crate::wire::Capability<'de>> for Capability {
4409 #[inline]
4410 fn from_wire(wire: crate::wire::Capability<'de>) -> Self {
4411 let wire = ::core::mem::ManuallyDrop::new(wire);
4412 match wire.raw.ordinal() {
4413 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
4414 wire.raw.get().read_unchecked::<crate::wire::Service<'de>>()
4415 })),
4416
4417 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
4418 wire.raw.get().read_unchecked::<crate::wire::Protocol<'de>>()
4419 })),
4420
4421 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
4422 wire.raw.get().read_unchecked::<crate::wire::Directory<'de>>()
4423 })),
4424
4425 4 => Self::Storage(::fidl_next::FromWire::from_wire(unsafe {
4426 wire.raw.get().read_unchecked::<crate::wire::Storage<'de>>()
4427 })),
4428
4429 5 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
4430 wire.raw.get().read_unchecked::<crate::wire::Runner<'de>>()
4431 })),
4432
4433 6 => Self::Resolver(::fidl_next::FromWire::from_wire(unsafe {
4434 wire.raw.get().read_unchecked::<crate::wire::Resolver<'de>>()
4435 })),
4436
4437 8 => Self::EventStream(::fidl_next::FromWire::from_wire(unsafe {
4438 wire.raw.get().read_unchecked::<crate::wire::EventStream<'de>>()
4439 })),
4440
4441 9 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
4442 wire.raw.get().read_unchecked::<crate::wire::Dictionary<'de>>()
4443 })),
4444
4445 10 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
4446 wire.raw.get().read_unchecked::<crate::wire::Configuration<'de>>()
4447 })),
4448
4449 ord => return Self::UnknownOrdinal_(ord as u64),
4450 }
4451 }
4452 }
4453
4454 impl<'de> ::fidl_next::FromWireRef<crate::wire::Capability<'de>> for Capability {
4455 #[inline]
4456 fn from_wire_ref(wire: &crate::wire::Capability<'de>) -> Self {
4457 match wire.raw.ordinal() {
4458 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4459 wire.raw.get().deref_unchecked::<crate::wire::Service<'de>>()
4460 })),
4461
4462 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4463 wire.raw.get().deref_unchecked::<crate::wire::Protocol<'de>>()
4464 })),
4465
4466 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4467 wire.raw.get().deref_unchecked::<crate::wire::Directory<'de>>()
4468 })),
4469
4470 4 => Self::Storage(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4471 wire.raw.get().deref_unchecked::<crate::wire::Storage<'de>>()
4472 })),
4473
4474 5 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4475 wire.raw.get().deref_unchecked::<crate::wire::Runner<'de>>()
4476 })),
4477
4478 6 => Self::Resolver(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4479 wire.raw.get().deref_unchecked::<crate::wire::Resolver<'de>>()
4480 })),
4481
4482 8 => Self::EventStream(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4483 wire.raw.get().deref_unchecked::<crate::wire::EventStream<'de>>()
4484 })),
4485
4486 9 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4487 wire.raw.get().deref_unchecked::<crate::wire::Dictionary<'de>>()
4488 })),
4489
4490 10 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4491 wire.raw.get().deref_unchecked::<crate::wire::Configuration<'de>>()
4492 })),
4493
4494 ord => return Self::UnknownOrdinal_(ord as u64),
4495 }
4496 }
4497 }
4498
4499 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Capability<'de>> for Capability {
4500 #[inline]
4501 fn from_wire_option(
4502 wire: crate::wire_optional::Capability<'de>,
4503 ) -> ::core::option::Option<Self> {
4504 if let Some(inner) = wire.into_option() {
4505 Some(::fidl_next::FromWire::from_wire(inner))
4506 } else {
4507 None
4508 }
4509 }
4510 }
4511
4512 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Capability<'de>> for Box<Capability> {
4513 #[inline]
4514 fn from_wire_option(
4515 wire: crate::wire_optional::Capability<'de>,
4516 ) -> ::core::option::Option<Self> {
4517 <
4518 Capability as ::fidl_next::FromWireOption<crate::wire_optional::Capability<'de>>
4519 >::from_wire_option(wire).map(Box::new)
4520 }
4521 }
4522
4523 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::Capability<'de>>
4524 for Box<Capability>
4525 {
4526 #[inline]
4527 fn from_wire_option_ref(
4528 wire: &crate::wire_optional::Capability<'de>,
4529 ) -> ::core::option::Option<Self> {
4530 if let Some(inner) = wire.as_ref() {
4531 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
4532 } else {
4533 None
4534 }
4535 }
4536 }
4537
4538 #[doc = " Describes under what conditions the component may be started.\n"]
4539 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4540 #[repr(u32)]
4541 pub enum StartupMode {
4542 Lazy = 0,
4543 Eager = 1,
4544 }
4545 impl ::core::convert::TryFrom<u32> for StartupMode {
4546 type Error = ::fidl_next::UnknownStrictEnumMemberError;
4547 fn try_from(
4548 value: u32,
4549 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
4550 match value {
4551 0 => Ok(Self::Lazy),
4552 1 => Ok(Self::Eager),
4553
4554 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
4555 }
4556 }
4557 }
4558
4559 unsafe impl<___E> ::fidl_next::Encode<crate::wire::StartupMode, ___E> for StartupMode
4560 where
4561 ___E: ?Sized,
4562 {
4563 #[inline]
4564 fn encode(
4565 self,
4566 encoder: &mut ___E,
4567 out: &mut ::core::mem::MaybeUninit<crate::wire::StartupMode>,
4568 _: (),
4569 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4570 ::fidl_next::Encode::encode(&self, encoder, out, ())
4571 }
4572 }
4573
4574 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::StartupMode, ___E> for &'a StartupMode
4575 where
4576 ___E: ?Sized,
4577 {
4578 #[inline]
4579 fn encode(
4580 self,
4581 encoder: &mut ___E,
4582 out: &mut ::core::mem::MaybeUninit<crate::wire::StartupMode>,
4583 _: (),
4584 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4585 ::fidl_next::munge!(let crate::wire::StartupMode { value } = out);
4586 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
4587 StartupMode::Lazy => 0,
4588
4589 StartupMode::Eager => 1,
4590 }));
4591
4592 Ok(())
4593 }
4594 }
4595
4596 impl ::core::convert::From<crate::wire::StartupMode> for StartupMode {
4597 fn from(wire: crate::wire::StartupMode) -> Self {
4598 match u32::from(wire.value) {
4599 0 => Self::Lazy,
4600
4601 1 => Self::Eager,
4602
4603 _ => unsafe { ::core::hint::unreachable_unchecked() },
4604 }
4605 }
4606 }
4607
4608 impl ::fidl_next::FromWire<crate::wire::StartupMode> for StartupMode {
4609 #[inline]
4610 fn from_wire(wire: crate::wire::StartupMode) -> Self {
4611 Self::from(wire)
4612 }
4613 }
4614
4615 impl ::fidl_next::FromWireRef<crate::wire::StartupMode> for StartupMode {
4616 #[inline]
4617 fn from_wire_ref(wire: &crate::wire::StartupMode) -> Self {
4618 Self::from(*wire)
4619 }
4620 }
4621
4622 #[doc = " Describes the action to take if this component instance terminates\n unexpectedly.\n"]
4623 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4624 #[repr(u32)]
4625 pub enum OnTerminate {
4626 None = 0,
4627 Reboot = 1,
4628 }
4629 impl ::core::convert::TryFrom<u32> for OnTerminate {
4630 type Error = ::fidl_next::UnknownStrictEnumMemberError;
4631 fn try_from(
4632 value: u32,
4633 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
4634 match value {
4635 0 => Ok(Self::None),
4636 1 => Ok(Self::Reboot),
4637
4638 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
4639 }
4640 }
4641 }
4642
4643 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OnTerminate, ___E> for OnTerminate
4644 where
4645 ___E: ?Sized,
4646 {
4647 #[inline]
4648 fn encode(
4649 self,
4650 encoder: &mut ___E,
4651 out: &mut ::core::mem::MaybeUninit<crate::wire::OnTerminate>,
4652 _: (),
4653 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4654 ::fidl_next::Encode::encode(&self, encoder, out, ())
4655 }
4656 }
4657
4658 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OnTerminate, ___E> for &'a OnTerminate
4659 where
4660 ___E: ?Sized,
4661 {
4662 #[inline]
4663 fn encode(
4664 self,
4665 encoder: &mut ___E,
4666 out: &mut ::core::mem::MaybeUninit<crate::wire::OnTerminate>,
4667 _: (),
4668 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4669 ::fidl_next::munge!(let crate::wire::OnTerminate { value } = out);
4670 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
4671 OnTerminate::None => 0,
4672
4673 OnTerminate::Reboot => 1,
4674 }));
4675
4676 Ok(())
4677 }
4678 }
4679
4680 impl ::core::convert::From<crate::wire::OnTerminate> for OnTerminate {
4681 fn from(wire: crate::wire::OnTerminate) -> Self {
4682 match u32::from(wire.value) {
4683 0 => Self::None,
4684
4685 1 => Self::Reboot,
4686
4687 _ => unsafe { ::core::hint::unreachable_unchecked() },
4688 }
4689 }
4690 }
4691
4692 impl ::fidl_next::FromWire<crate::wire::OnTerminate> for OnTerminate {
4693 #[inline]
4694 fn from_wire(wire: crate::wire::OnTerminate) -> Self {
4695 Self::from(wire)
4696 }
4697 }
4698
4699 impl ::fidl_next::FromWireRef<crate::wire::OnTerminate> for OnTerminate {
4700 #[inline]
4701 fn from_wire_ref(wire: &crate::wire::OnTerminate) -> Self {
4702 Self::from(*wire)
4703 }
4704 }
4705
4706 #[doc = " The string identifier for a config field.\n"]
4707 pub type ConfigKey = ::std::string::String;
4708
4709 #[doc = " A directive to override the value of a particular configuration field in the child.\n"]
4710 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4711 pub struct ConfigOverride {
4712 pub key: ::core::option::Option<::std::string::String>,
4713
4714 pub value: ::core::option::Option<crate::natural::ConfigValue>,
4715 }
4716
4717 impl ConfigOverride {
4718 fn __max_ordinal(&self) -> usize {
4719 if self.value.is_some() {
4720 return 2;
4721 }
4722
4723 if self.key.is_some() {
4724 return 1;
4725 }
4726
4727 0
4728 }
4729 }
4730
4731 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigOverride<'static>, ___E> for ConfigOverride
4732 where
4733 ___E: ::fidl_next::Encoder + ?Sized,
4734 {
4735 #[inline]
4736 fn encode(
4737 mut self,
4738 encoder: &mut ___E,
4739 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigOverride<'static>>,
4740 _: (),
4741 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4742 ::fidl_next::munge!(let crate::wire::ConfigOverride { table } = out);
4743
4744 let max_ord = self.__max_ordinal();
4745
4746 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4747 ::fidl_next::Wire::zero_padding(&mut out);
4748
4749 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4750 ::fidl_next::wire::Envelope,
4751 >(encoder, max_ord);
4752
4753 for i in 1..=max_ord {
4754 match i {
4755 2 => {
4756 if let Some(value) = self.value.take() {
4757 ::fidl_next::wire::Envelope::encode_value::<
4758 crate::wire::ConfigValue<'static>,
4759 ___E,
4760 >(
4761 value, preallocated.encoder, &mut out, ()
4762 )?;
4763 } else {
4764 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4765 }
4766 }
4767
4768 1 => {
4769 if let Some(value) = self.key.take() {
4770 ::fidl_next::wire::Envelope::encode_value::<
4771 ::fidl_next::wire::String<'static>,
4772 ___E,
4773 >(
4774 value, preallocated.encoder, &mut out, 64
4775 )?;
4776 } else {
4777 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4778 }
4779 }
4780
4781 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4782 }
4783 unsafe {
4784 preallocated.write_next(out.assume_init_ref());
4785 }
4786 }
4787
4788 ::fidl_next::wire::Table::encode_len(table, max_ord);
4789
4790 Ok(())
4791 }
4792 }
4793
4794 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigOverride<'static>, ___E>
4795 for &'a ConfigOverride
4796 where
4797 ___E: ::fidl_next::Encoder + ?Sized,
4798 {
4799 #[inline]
4800 fn encode(
4801 self,
4802 encoder: &mut ___E,
4803 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigOverride<'static>>,
4804 _: (),
4805 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4806 ::fidl_next::munge!(let crate::wire::ConfigOverride { table } = out);
4807
4808 let max_ord = self.__max_ordinal();
4809
4810 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4811 ::fidl_next::Wire::zero_padding(&mut out);
4812
4813 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4814 ::fidl_next::wire::Envelope,
4815 >(encoder, max_ord);
4816
4817 for i in 1..=max_ord {
4818 match i {
4819 2 => {
4820 if let Some(value) = &self.value {
4821 ::fidl_next::wire::Envelope::encode_value::<
4822 crate::wire::ConfigValue<'static>,
4823 ___E,
4824 >(
4825 value, preallocated.encoder, &mut out, ()
4826 )?;
4827 } else {
4828 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4829 }
4830 }
4831
4832 1 => {
4833 if let Some(value) = &self.key {
4834 ::fidl_next::wire::Envelope::encode_value::<
4835 ::fidl_next::wire::String<'static>,
4836 ___E,
4837 >(
4838 value, preallocated.encoder, &mut out, 64
4839 )?;
4840 } else {
4841 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4842 }
4843 }
4844
4845 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4846 }
4847 unsafe {
4848 preallocated.write_next(out.assume_init_ref());
4849 }
4850 }
4851
4852 ::fidl_next::wire::Table::encode_len(table, max_ord);
4853
4854 Ok(())
4855 }
4856 }
4857
4858 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigOverride<'de>> for ConfigOverride {
4859 #[inline]
4860 fn from_wire(wire_: crate::wire::ConfigOverride<'de>) -> Self {
4861 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4862
4863 let key = wire_.table.get(1);
4864
4865 let value = wire_.table.get(2);
4866
4867 Self {
4868 key: key.map(|envelope| {
4869 ::fidl_next::FromWire::from_wire(unsafe {
4870 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4871 })
4872 }),
4873
4874 value: value.map(|envelope| {
4875 ::fidl_next::FromWire::from_wire(unsafe {
4876 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
4877 })
4878 }),
4879 }
4880 }
4881 }
4882
4883 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigOverride<'de>> for ConfigOverride {
4884 #[inline]
4885 fn from_wire_ref(wire: &crate::wire::ConfigOverride<'de>) -> Self {
4886 Self {
4887 key: wire.table.get(1).map(|envelope| {
4888 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4889 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
4890 })
4891 }),
4892
4893 value: wire.table.get(2).map(|envelope| {
4894 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4895 envelope.deref_unchecked::<crate::wire::ConfigValue<'de>>()
4896 })
4897 }),
4898 }
4899 }
4900 }
4901
4902 #[doc = " Statically declares a child component instance.\n"]
4903 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4904 pub struct Child {
4905 pub name: ::core::option::Option<::std::string::String>,
4906
4907 pub url: ::core::option::Option<::std::string::String>,
4908
4909 pub startup: ::core::option::Option<crate::natural::StartupMode>,
4910
4911 pub environment: ::core::option::Option<::std::string::String>,
4912
4913 pub on_terminate: ::core::option::Option<crate::natural::OnTerminate>,
4914
4915 pub config_overrides:
4916 ::core::option::Option<::std::vec::Vec<crate::natural::ConfigOverride>>,
4917 }
4918
4919 impl Child {
4920 fn __max_ordinal(&self) -> usize {
4921 if self.config_overrides.is_some() {
4922 return 6;
4923 }
4924
4925 if self.on_terminate.is_some() {
4926 return 5;
4927 }
4928
4929 if self.environment.is_some() {
4930 return 4;
4931 }
4932
4933 if self.startup.is_some() {
4934 return 3;
4935 }
4936
4937 if self.url.is_some() {
4938 return 2;
4939 }
4940
4941 if self.name.is_some() {
4942 return 1;
4943 }
4944
4945 0
4946 }
4947 }
4948
4949 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Child<'static>, ___E> for Child
4950 where
4951 ___E: ::fidl_next::Encoder + ?Sized,
4952 {
4953 #[inline]
4954 fn encode(
4955 mut self,
4956 encoder: &mut ___E,
4957 out: &mut ::core::mem::MaybeUninit<crate::wire::Child<'static>>,
4958 _: (),
4959 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4960 ::fidl_next::munge!(let crate::wire::Child { table } = out);
4961
4962 let max_ord = self.__max_ordinal();
4963
4964 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4965 ::fidl_next::Wire::zero_padding(&mut out);
4966
4967 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4968 ::fidl_next::wire::Envelope,
4969 >(encoder, max_ord);
4970
4971 for i in 1..=max_ord {
4972 match i {
4973 6 => {
4974 if let Some(value) = self.config_overrides.take() {
4975 ::fidl_next::wire::Envelope::encode_value::<
4976 ::fidl_next::wire::Vector<
4977 'static,
4978 crate::wire::ConfigOverride<'static>,
4979 >,
4980 ___E,
4981 >(
4982 value, preallocated.encoder, &mut out, (4294967295, ())
4983 )?;
4984 } else {
4985 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4986 }
4987 }
4988
4989 5 => {
4990 if let Some(value) = self.on_terminate.take() {
4991 ::fidl_next::wire::Envelope::encode_value::<
4992 crate::wire::OnTerminate,
4993 ___E,
4994 >(
4995 value, preallocated.encoder, &mut out, ()
4996 )?;
4997 } else {
4998 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4999 }
5000 }
5001
5002 4 => {
5003 if let Some(value) = self.environment.take() {
5004 ::fidl_next::wire::Envelope::encode_value::<
5005 ::fidl_next::wire::String<'static>,
5006 ___E,
5007 >(
5008 value, preallocated.encoder, &mut out, 100
5009 )?;
5010 } else {
5011 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5012 }
5013 }
5014
5015 3 => {
5016 if let Some(value) = self.startup.take() {
5017 ::fidl_next::wire::Envelope::encode_value::<
5018 crate::wire::StartupMode,
5019 ___E,
5020 >(
5021 value, preallocated.encoder, &mut out, ()
5022 )?;
5023 } else {
5024 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5025 }
5026 }
5027
5028 2 => {
5029 if let Some(value) = self.url.take() {
5030 ::fidl_next::wire::Envelope::encode_value::<
5031 ::fidl_next::wire::String<'static>,
5032 ___E,
5033 >(
5034 value, preallocated.encoder, &mut out, 4096
5035 )?;
5036 } else {
5037 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5038 }
5039 }
5040
5041 1 => {
5042 if let Some(value) = self.name.take() {
5043 ::fidl_next::wire::Envelope::encode_value::<
5044 ::fidl_next::wire::String<'static>,
5045 ___E,
5046 >(
5047 value, preallocated.encoder, &mut out, 1024
5048 )?;
5049 } else {
5050 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5051 }
5052 }
5053
5054 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5055 }
5056 unsafe {
5057 preallocated.write_next(out.assume_init_ref());
5058 }
5059 }
5060
5061 ::fidl_next::wire::Table::encode_len(table, max_ord);
5062
5063 Ok(())
5064 }
5065 }
5066
5067 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Child<'static>, ___E> for &'a Child
5068 where
5069 ___E: ::fidl_next::Encoder + ?Sized,
5070 {
5071 #[inline]
5072 fn encode(
5073 self,
5074 encoder: &mut ___E,
5075 out: &mut ::core::mem::MaybeUninit<crate::wire::Child<'static>>,
5076 _: (),
5077 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5078 ::fidl_next::munge!(let crate::wire::Child { table } = out);
5079
5080 let max_ord = self.__max_ordinal();
5081
5082 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5083 ::fidl_next::Wire::zero_padding(&mut out);
5084
5085 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5086 ::fidl_next::wire::Envelope,
5087 >(encoder, max_ord);
5088
5089 for i in 1..=max_ord {
5090 match i {
5091 6 => {
5092 if let Some(value) = &self.config_overrides {
5093 ::fidl_next::wire::Envelope::encode_value::<
5094 ::fidl_next::wire::Vector<
5095 'static,
5096 crate::wire::ConfigOverride<'static>,
5097 >,
5098 ___E,
5099 >(
5100 value, preallocated.encoder, &mut out, (4294967295, ())
5101 )?;
5102 } else {
5103 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5104 }
5105 }
5106
5107 5 => {
5108 if let Some(value) = &self.on_terminate {
5109 ::fidl_next::wire::Envelope::encode_value::<
5110 crate::wire::OnTerminate,
5111 ___E,
5112 >(
5113 value, preallocated.encoder, &mut out, ()
5114 )?;
5115 } else {
5116 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5117 }
5118 }
5119
5120 4 => {
5121 if let Some(value) = &self.environment {
5122 ::fidl_next::wire::Envelope::encode_value::<
5123 ::fidl_next::wire::String<'static>,
5124 ___E,
5125 >(
5126 value, preallocated.encoder, &mut out, 100
5127 )?;
5128 } else {
5129 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5130 }
5131 }
5132
5133 3 => {
5134 if let Some(value) = &self.startup {
5135 ::fidl_next::wire::Envelope::encode_value::<
5136 crate::wire::StartupMode,
5137 ___E,
5138 >(
5139 value, preallocated.encoder, &mut out, ()
5140 )?;
5141 } else {
5142 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5143 }
5144 }
5145
5146 2 => {
5147 if let Some(value) = &self.url {
5148 ::fidl_next::wire::Envelope::encode_value::<
5149 ::fidl_next::wire::String<'static>,
5150 ___E,
5151 >(
5152 value, preallocated.encoder, &mut out, 4096
5153 )?;
5154 } else {
5155 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5156 }
5157 }
5158
5159 1 => {
5160 if let Some(value) = &self.name {
5161 ::fidl_next::wire::Envelope::encode_value::<
5162 ::fidl_next::wire::String<'static>,
5163 ___E,
5164 >(
5165 value, preallocated.encoder, &mut out, 1024
5166 )?;
5167 } else {
5168 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5169 }
5170 }
5171
5172 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5173 }
5174 unsafe {
5175 preallocated.write_next(out.assume_init_ref());
5176 }
5177 }
5178
5179 ::fidl_next::wire::Table::encode_len(table, max_ord);
5180
5181 Ok(())
5182 }
5183 }
5184
5185 impl<'de> ::fidl_next::FromWire<crate::wire::Child<'de>> for Child {
5186 #[inline]
5187 fn from_wire(wire_: crate::wire::Child<'de>) -> Self {
5188 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5189
5190 let name = wire_.table.get(1);
5191
5192 let url = wire_.table.get(2);
5193
5194 let startup = wire_.table.get(3);
5195
5196 let environment = wire_.table.get(4);
5197
5198 let on_terminate = wire_.table.get(5);
5199
5200 let config_overrides = wire_.table.get(6);
5201
5202 Self {
5203
5204
5205 name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
5206 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
5207 )),
5208
5209
5210 url: url.map(|envelope| ::fidl_next::FromWire::from_wire(
5211 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
5212 )),
5213
5214
5215 startup: startup.map(|envelope| ::fidl_next::FromWire::from_wire(
5216 unsafe { envelope.read_unchecked::<crate::wire::StartupMode>() }
5217 )),
5218
5219
5220 environment: environment.map(|envelope| ::fidl_next::FromWire::from_wire(
5221 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
5222 )),
5223
5224
5225 on_terminate: on_terminate.map(|envelope| ::fidl_next::FromWire::from_wire(
5226 unsafe { envelope.read_unchecked::<crate::wire::OnTerminate>() }
5227 )),
5228
5229
5230 config_overrides: config_overrides.map(|envelope| ::fidl_next::FromWire::from_wire(
5231 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigOverride<'de>>>() }
5232 )),
5233
5234 }
5235 }
5236 }
5237
5238 impl<'de> ::fidl_next::FromWireRef<crate::wire::Child<'de>> for Child {
5239 #[inline]
5240 fn from_wire_ref(wire: &crate::wire::Child<'de>) -> Self {
5241 Self {
5242
5243
5244 name: wire.table.get(1)
5245 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5246 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
5247 )),
5248
5249
5250 url: wire.table.get(2)
5251 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5252 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
5253 )),
5254
5255
5256 startup: wire.table.get(3)
5257 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5258 unsafe { envelope.deref_unchecked::<crate::wire::StartupMode>() }
5259 )),
5260
5261
5262 environment: wire.table.get(4)
5263 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5264 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
5265 )),
5266
5267
5268 on_terminate: wire.table.get(5)
5269 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5270 unsafe { envelope.deref_unchecked::<crate::wire::OnTerminate>() }
5271 )),
5272
5273
5274 config_overrides: wire.table.get(6)
5275 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5276 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigOverride<'de>>>() }
5277 )),
5278
5279 }
5280 }
5281 }
5282
5283 #[doc = " The durability of component instances created in a collection.\n"]
5284 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5285 #[repr(u32)]
5286 pub enum Durability {
5287 Transient = 2,
5288 SingleRun = 3,
5289 }
5290 impl ::core::convert::TryFrom<u32> for Durability {
5291 type Error = ::fidl_next::UnknownStrictEnumMemberError;
5292 fn try_from(
5293 value: u32,
5294 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
5295 match value {
5296 2 => Ok(Self::Transient),
5297 3 => Ok(Self::SingleRun),
5298
5299 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
5300 }
5301 }
5302 }
5303
5304 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Durability, ___E> for Durability
5305 where
5306 ___E: ?Sized,
5307 {
5308 #[inline]
5309 fn encode(
5310 self,
5311 encoder: &mut ___E,
5312 out: &mut ::core::mem::MaybeUninit<crate::wire::Durability>,
5313 _: (),
5314 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5315 ::fidl_next::Encode::encode(&self, encoder, out, ())
5316 }
5317 }
5318
5319 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Durability, ___E> for &'a Durability
5320 where
5321 ___E: ?Sized,
5322 {
5323 #[inline]
5324 fn encode(
5325 self,
5326 encoder: &mut ___E,
5327 out: &mut ::core::mem::MaybeUninit<crate::wire::Durability>,
5328 _: (),
5329 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5330 ::fidl_next::munge!(let crate::wire::Durability { value } = out);
5331 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
5332 Durability::Transient => 2,
5333
5334 Durability::SingleRun => 3,
5335 }));
5336
5337 Ok(())
5338 }
5339 }
5340
5341 impl ::core::convert::From<crate::wire::Durability> for Durability {
5342 fn from(wire: crate::wire::Durability) -> Self {
5343 match u32::from(wire.value) {
5344 2 => Self::Transient,
5345
5346 3 => Self::SingleRun,
5347
5348 _ => unsafe { ::core::hint::unreachable_unchecked() },
5349 }
5350 }
5351 }
5352
5353 impl ::fidl_next::FromWire<crate::wire::Durability> for Durability {
5354 #[inline]
5355 fn from_wire(wire: crate::wire::Durability) -> Self {
5356 Self::from(wire)
5357 }
5358 }
5359
5360 impl ::fidl_next::FromWireRef<crate::wire::Durability> for Durability {
5361 #[inline]
5362 fn from_wire_ref(wire: &crate::wire::Durability) -> Self {
5363 Self::from(*wire)
5364 }
5365 }
5366
5367 #[doc = " Statically declares a component instance collection.\n"]
5368 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5369 pub struct Collection {
5370 pub name: ::core::option::Option<::std::string::String>,
5371
5372 pub durability: ::core::option::Option<crate::natural::Durability>,
5373
5374 pub environment: ::core::option::Option<::std::string::String>,
5375
5376 pub allowed_offers: ::core::option::Option<crate::natural::AllowedOffers>,
5377
5378 pub allow_long_names: ::core::option::Option<bool>,
5379
5380 pub persistent_storage: ::core::option::Option<bool>,
5381 }
5382
5383 impl Collection {
5384 fn __max_ordinal(&self) -> usize {
5385 if self.persistent_storage.is_some() {
5386 return 6;
5387 }
5388
5389 if self.allow_long_names.is_some() {
5390 return 5;
5391 }
5392
5393 if self.allowed_offers.is_some() {
5394 return 4;
5395 }
5396
5397 if self.environment.is_some() {
5398 return 3;
5399 }
5400
5401 if self.durability.is_some() {
5402 return 2;
5403 }
5404
5405 if self.name.is_some() {
5406 return 1;
5407 }
5408
5409 0
5410 }
5411 }
5412
5413 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Collection<'static>, ___E> for Collection
5414 where
5415 ___E: ::fidl_next::Encoder + ?Sized,
5416 {
5417 #[inline]
5418 fn encode(
5419 mut self,
5420 encoder: &mut ___E,
5421 out: &mut ::core::mem::MaybeUninit<crate::wire::Collection<'static>>,
5422 _: (),
5423 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5424 ::fidl_next::munge!(let crate::wire::Collection { table } = out);
5425
5426 let max_ord = self.__max_ordinal();
5427
5428 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5429 ::fidl_next::Wire::zero_padding(&mut out);
5430
5431 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5432 ::fidl_next::wire::Envelope,
5433 >(encoder, max_ord);
5434
5435 for i in 1..=max_ord {
5436 match i {
5437 6 => {
5438 if let Some(value) = self.persistent_storage.take() {
5439 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
5440 value,
5441 preallocated.encoder,
5442 &mut out,
5443 (),
5444 )?;
5445 } else {
5446 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5447 }
5448 }
5449
5450 5 => {
5451 if let Some(value) = self.allow_long_names.take() {
5452 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
5453 value,
5454 preallocated.encoder,
5455 &mut out,
5456 (),
5457 )?;
5458 } else {
5459 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5460 }
5461 }
5462
5463 4 => {
5464 if let Some(value) = self.allowed_offers.take() {
5465 ::fidl_next::wire::Envelope::encode_value::<
5466 crate::wire::AllowedOffers,
5467 ___E,
5468 >(
5469 value, preallocated.encoder, &mut out, ()
5470 )?;
5471 } else {
5472 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5473 }
5474 }
5475
5476 3 => {
5477 if let Some(value) = self.environment.take() {
5478 ::fidl_next::wire::Envelope::encode_value::<
5479 ::fidl_next::wire::String<'static>,
5480 ___E,
5481 >(
5482 value, preallocated.encoder, &mut out, 100
5483 )?;
5484 } else {
5485 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5486 }
5487 }
5488
5489 2 => {
5490 if let Some(value) = self.durability.take() {
5491 ::fidl_next::wire::Envelope::encode_value::<
5492 crate::wire::Durability,
5493 ___E,
5494 >(
5495 value, preallocated.encoder, &mut out, ()
5496 )?;
5497 } else {
5498 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5499 }
5500 }
5501
5502 1 => {
5503 if let Some(value) = self.name.take() {
5504 ::fidl_next::wire::Envelope::encode_value::<
5505 ::fidl_next::wire::String<'static>,
5506 ___E,
5507 >(
5508 value, preallocated.encoder, &mut out, 100
5509 )?;
5510 } else {
5511 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5512 }
5513 }
5514
5515 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5516 }
5517 unsafe {
5518 preallocated.write_next(out.assume_init_ref());
5519 }
5520 }
5521
5522 ::fidl_next::wire::Table::encode_len(table, max_ord);
5523
5524 Ok(())
5525 }
5526 }
5527
5528 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Collection<'static>, ___E> for &'a Collection
5529 where
5530 ___E: ::fidl_next::Encoder + ?Sized,
5531 {
5532 #[inline]
5533 fn encode(
5534 self,
5535 encoder: &mut ___E,
5536 out: &mut ::core::mem::MaybeUninit<crate::wire::Collection<'static>>,
5537 _: (),
5538 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5539 ::fidl_next::munge!(let crate::wire::Collection { table } = out);
5540
5541 let max_ord = self.__max_ordinal();
5542
5543 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5544 ::fidl_next::Wire::zero_padding(&mut out);
5545
5546 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5547 ::fidl_next::wire::Envelope,
5548 >(encoder, max_ord);
5549
5550 for i in 1..=max_ord {
5551 match i {
5552 6 => {
5553 if let Some(value) = &self.persistent_storage {
5554 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
5555 value,
5556 preallocated.encoder,
5557 &mut out,
5558 (),
5559 )?;
5560 } else {
5561 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5562 }
5563 }
5564
5565 5 => {
5566 if let Some(value) = &self.allow_long_names {
5567 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
5568 value,
5569 preallocated.encoder,
5570 &mut out,
5571 (),
5572 )?;
5573 } else {
5574 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5575 }
5576 }
5577
5578 4 => {
5579 if let Some(value) = &self.allowed_offers {
5580 ::fidl_next::wire::Envelope::encode_value::<
5581 crate::wire::AllowedOffers,
5582 ___E,
5583 >(
5584 value, preallocated.encoder, &mut out, ()
5585 )?;
5586 } else {
5587 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5588 }
5589 }
5590
5591 3 => {
5592 if let Some(value) = &self.environment {
5593 ::fidl_next::wire::Envelope::encode_value::<
5594 ::fidl_next::wire::String<'static>,
5595 ___E,
5596 >(
5597 value, preallocated.encoder, &mut out, 100
5598 )?;
5599 } else {
5600 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5601 }
5602 }
5603
5604 2 => {
5605 if let Some(value) = &self.durability {
5606 ::fidl_next::wire::Envelope::encode_value::<
5607 crate::wire::Durability,
5608 ___E,
5609 >(
5610 value, preallocated.encoder, &mut out, ()
5611 )?;
5612 } else {
5613 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5614 }
5615 }
5616
5617 1 => {
5618 if let Some(value) = &self.name {
5619 ::fidl_next::wire::Envelope::encode_value::<
5620 ::fidl_next::wire::String<'static>,
5621 ___E,
5622 >(
5623 value, preallocated.encoder, &mut out, 100
5624 )?;
5625 } else {
5626 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5627 }
5628 }
5629
5630 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5631 }
5632 unsafe {
5633 preallocated.write_next(out.assume_init_ref());
5634 }
5635 }
5636
5637 ::fidl_next::wire::Table::encode_len(table, max_ord);
5638
5639 Ok(())
5640 }
5641 }
5642
5643 impl<'de> ::fidl_next::FromWire<crate::wire::Collection<'de>> for Collection {
5644 #[inline]
5645 fn from_wire(wire_: crate::wire::Collection<'de>) -> Self {
5646 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5647
5648 let name = wire_.table.get(1);
5649
5650 let durability = wire_.table.get(2);
5651
5652 let environment = wire_.table.get(3);
5653
5654 let allowed_offers = wire_.table.get(4);
5655
5656 let allow_long_names = wire_.table.get(5);
5657
5658 let persistent_storage = wire_.table.get(6);
5659
5660 Self {
5661 name: name.map(|envelope| {
5662 ::fidl_next::FromWire::from_wire(unsafe {
5663 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
5664 })
5665 }),
5666
5667 durability: durability.map(|envelope| {
5668 ::fidl_next::FromWire::from_wire(unsafe {
5669 envelope.read_unchecked::<crate::wire::Durability>()
5670 })
5671 }),
5672
5673 environment: environment.map(|envelope| {
5674 ::fidl_next::FromWire::from_wire(unsafe {
5675 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
5676 })
5677 }),
5678
5679 allowed_offers: allowed_offers.map(|envelope| {
5680 ::fidl_next::FromWire::from_wire(unsafe {
5681 envelope.read_unchecked::<crate::wire::AllowedOffers>()
5682 })
5683 }),
5684
5685 allow_long_names: allow_long_names.map(|envelope| {
5686 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
5687 }),
5688
5689 persistent_storage: persistent_storage.map(|envelope| {
5690 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
5691 }),
5692 }
5693 }
5694 }
5695
5696 impl<'de> ::fidl_next::FromWireRef<crate::wire::Collection<'de>> for Collection {
5697 #[inline]
5698 fn from_wire_ref(wire: &crate::wire::Collection<'de>) -> Self {
5699 Self {
5700 name: wire.table.get(1).map(|envelope| {
5701 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5702 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
5703 })
5704 }),
5705
5706 durability: wire.table.get(2).map(|envelope| {
5707 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5708 envelope.deref_unchecked::<crate::wire::Durability>()
5709 })
5710 }),
5711
5712 environment: wire.table.get(3).map(|envelope| {
5713 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5714 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
5715 })
5716 }),
5717
5718 allowed_offers: wire.table.get(4).map(|envelope| {
5719 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5720 envelope.deref_unchecked::<crate::wire::AllowedOffers>()
5721 })
5722 }),
5723
5724 allow_long_names: wire.table.get(5).map(|envelope| {
5725 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5726 envelope.deref_unchecked::<bool>()
5727 })
5728 }),
5729
5730 persistent_storage: wire.table.get(6).map(|envelope| {
5731 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5732 envelope.deref_unchecked::<bool>()
5733 })
5734 }),
5735 }
5736 }
5737 }
5738
5739 #[doc = " Describes the type of dependency implied by the capability.\n"]
5740 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5741 #[repr(u32)]
5742 pub enum DependencyType {
5743 Strong = 1,
5744 Weak = 2,
5745 }
5746 impl ::core::convert::TryFrom<u32> for DependencyType {
5747 type Error = ::fidl_next::UnknownStrictEnumMemberError;
5748 fn try_from(
5749 value: u32,
5750 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
5751 match value {
5752 1 => Ok(Self::Strong),
5753 2 => Ok(Self::Weak),
5754
5755 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
5756 }
5757 }
5758 }
5759
5760 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DependencyType, ___E> for DependencyType
5761 where
5762 ___E: ?Sized,
5763 {
5764 #[inline]
5765 fn encode(
5766 self,
5767 encoder: &mut ___E,
5768 out: &mut ::core::mem::MaybeUninit<crate::wire::DependencyType>,
5769 _: (),
5770 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5771 ::fidl_next::Encode::encode(&self, encoder, out, ())
5772 }
5773 }
5774
5775 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DependencyType, ___E> for &'a DependencyType
5776 where
5777 ___E: ?Sized,
5778 {
5779 #[inline]
5780 fn encode(
5781 self,
5782 encoder: &mut ___E,
5783 out: &mut ::core::mem::MaybeUninit<crate::wire::DependencyType>,
5784 _: (),
5785 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5786 ::fidl_next::munge!(let crate::wire::DependencyType { value } = out);
5787 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
5788 DependencyType::Strong => 1,
5789
5790 DependencyType::Weak => 2,
5791 }));
5792
5793 Ok(())
5794 }
5795 }
5796
5797 impl ::core::convert::From<crate::wire::DependencyType> for DependencyType {
5798 fn from(wire: crate::wire::DependencyType) -> Self {
5799 match u32::from(wire.value) {
5800 1 => Self::Strong,
5801
5802 2 => Self::Weak,
5803
5804 _ => unsafe { ::core::hint::unreachable_unchecked() },
5805 }
5806 }
5807 }
5808
5809 impl ::fidl_next::FromWire<crate::wire::DependencyType> for DependencyType {
5810 #[inline]
5811 fn from_wire(wire: crate::wire::DependencyType) -> Self {
5812 Self::from(wire)
5813 }
5814 }
5815
5816 impl ::fidl_next::FromWireRef<crate::wire::DependencyType> for DependencyType {
5817 #[inline]
5818 fn from_wire_ref(wire: &crate::wire::DependencyType) -> Self {
5819 Self::from(*wire)
5820 }
5821 }
5822
5823 #[doc = " Type used to create a mapping between 2 names. Used to rename service or component instances\n in FIDL declarations.\n"]
5824 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5825 pub struct NameMapping {
5826 pub source_name: ::std::string::String,
5827
5828 pub target_name: ::std::string::String,
5829 }
5830
5831 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NameMapping<'static>, ___E> for NameMapping
5832 where
5833 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5834 ___E: ::fidl_next::Encoder,
5835 {
5836 #[inline]
5837 fn encode(
5838 self,
5839 encoder_: &mut ___E,
5840 out_: &mut ::core::mem::MaybeUninit<crate::wire::NameMapping<'static>>,
5841 _: (),
5842 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5843 ::fidl_next::munge! {
5844 let crate::wire::NameMapping {
5845 source_name,
5846 target_name,
5847
5848 } = out_;
5849 }
5850
5851 ::fidl_next::Encode::encode(self.source_name, encoder_, source_name, 100)?;
5852
5853 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(source_name.as_mut_ptr()) };
5854 ::fidl_next::Constrained::validate(_field, 100)?;
5855
5856 ::fidl_next::Encode::encode(self.target_name, encoder_, target_name, 100)?;
5857
5858 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(target_name.as_mut_ptr()) };
5859 ::fidl_next::Constrained::validate(_field, 100)?;
5860
5861 Ok(())
5862 }
5863 }
5864
5865 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NameMapping<'static>, ___E>
5866 for &'a NameMapping
5867 where
5868 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5869 ___E: ::fidl_next::Encoder,
5870 {
5871 #[inline]
5872 fn encode(
5873 self,
5874 encoder_: &mut ___E,
5875 out_: &mut ::core::mem::MaybeUninit<crate::wire::NameMapping<'static>>,
5876 _: (),
5877 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5878 ::fidl_next::munge! {
5879 let crate::wire::NameMapping {
5880 source_name,
5881 target_name,
5882
5883 } = out_;
5884 }
5885
5886 ::fidl_next::Encode::encode(&self.source_name, encoder_, source_name, 100)?;
5887
5888 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(source_name.as_mut_ptr()) };
5889 ::fidl_next::Constrained::validate(_field, 100)?;
5890
5891 ::fidl_next::Encode::encode(&self.target_name, encoder_, target_name, 100)?;
5892
5893 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(target_name.as_mut_ptr()) };
5894 ::fidl_next::Constrained::validate(_field, 100)?;
5895
5896 Ok(())
5897 }
5898 }
5899
5900 unsafe impl<___E>
5901 ::fidl_next::EncodeOption<
5902 ::fidl_next::wire::Box<'static, crate::wire::NameMapping<'static>>,
5903 ___E,
5904 > for NameMapping
5905 where
5906 ___E: ::fidl_next::Encoder + ?Sized,
5907 NameMapping: ::fidl_next::Encode<crate::wire::NameMapping<'static>, ___E>,
5908 {
5909 #[inline]
5910 fn encode_option(
5911 this: ::core::option::Option<Self>,
5912 encoder: &mut ___E,
5913 out: &mut ::core::mem::MaybeUninit<
5914 ::fidl_next::wire::Box<'static, crate::wire::NameMapping<'static>>,
5915 >,
5916 _: (),
5917 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5918 if let Some(inner) = this {
5919 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5920 ::fidl_next::wire::Box::encode_present(out);
5921 } else {
5922 ::fidl_next::wire::Box::encode_absent(out);
5923 }
5924
5925 Ok(())
5926 }
5927 }
5928
5929 unsafe impl<'a, ___E>
5930 ::fidl_next::EncodeOption<
5931 ::fidl_next::wire::Box<'static, crate::wire::NameMapping<'static>>,
5932 ___E,
5933 > for &'a NameMapping
5934 where
5935 ___E: ::fidl_next::Encoder + ?Sized,
5936 &'a NameMapping: ::fidl_next::Encode<crate::wire::NameMapping<'static>, ___E>,
5937 {
5938 #[inline]
5939 fn encode_option(
5940 this: ::core::option::Option<Self>,
5941 encoder: &mut ___E,
5942 out: &mut ::core::mem::MaybeUninit<
5943 ::fidl_next::wire::Box<'static, crate::wire::NameMapping<'static>>,
5944 >,
5945 _: (),
5946 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5947 if let Some(inner) = this {
5948 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5949 ::fidl_next::wire::Box::encode_present(out);
5950 } else {
5951 ::fidl_next::wire::Box::encode_absent(out);
5952 }
5953
5954 Ok(())
5955 }
5956 }
5957
5958 impl<'de> ::fidl_next::FromWire<crate::wire::NameMapping<'de>> for NameMapping {
5959 #[inline]
5960 fn from_wire(wire: crate::wire::NameMapping<'de>) -> Self {
5961 Self {
5962 source_name: ::fidl_next::FromWire::from_wire(wire.source_name),
5963
5964 target_name: ::fidl_next::FromWire::from_wire(wire.target_name),
5965 }
5966 }
5967 }
5968
5969 impl<'de> ::fidl_next::FromWireRef<crate::wire::NameMapping<'de>> for NameMapping {
5970 #[inline]
5971 fn from_wire_ref(wire: &crate::wire::NameMapping<'de>) -> Self {
5972 Self {
5973 source_name: ::fidl_next::FromWireRef::from_wire_ref(&wire.source_name),
5974
5975 target_name: ::fidl_next::FromWireRef::from_wire_ref(&wire.target_name),
5976 }
5977 }
5978 }
5979
5980 #[doc = " Specifies how a declared environment\'s initial set of properties are assigned.\n"]
5981 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5982 #[repr(u32)]
5983 pub enum EnvironmentExtends {
5984 None = 0,
5985 Realm = 1,
5986 }
5987 impl ::core::convert::TryFrom<u32> for EnvironmentExtends {
5988 type Error = ::fidl_next::UnknownStrictEnumMemberError;
5989 fn try_from(
5990 value: u32,
5991 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
5992 match value {
5993 0 => Ok(Self::None),
5994 1 => Ok(Self::Realm),
5995
5996 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
5997 }
5998 }
5999 }
6000
6001 unsafe impl<___E> ::fidl_next::Encode<crate::wire::EnvironmentExtends, ___E> for EnvironmentExtends
6002 where
6003 ___E: ?Sized,
6004 {
6005 #[inline]
6006 fn encode(
6007 self,
6008 encoder: &mut ___E,
6009 out: &mut ::core::mem::MaybeUninit<crate::wire::EnvironmentExtends>,
6010 _: (),
6011 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6012 ::fidl_next::Encode::encode(&self, encoder, out, ())
6013 }
6014 }
6015
6016 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EnvironmentExtends, ___E>
6017 for &'a EnvironmentExtends
6018 where
6019 ___E: ?Sized,
6020 {
6021 #[inline]
6022 fn encode(
6023 self,
6024 encoder: &mut ___E,
6025 out: &mut ::core::mem::MaybeUninit<crate::wire::EnvironmentExtends>,
6026 _: (),
6027 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6028 ::fidl_next::munge!(let crate::wire::EnvironmentExtends { value } = out);
6029 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
6030 EnvironmentExtends::None => 0,
6031
6032 EnvironmentExtends::Realm => 1,
6033 }));
6034
6035 Ok(())
6036 }
6037 }
6038
6039 impl ::core::convert::From<crate::wire::EnvironmentExtends> for EnvironmentExtends {
6040 fn from(wire: crate::wire::EnvironmentExtends) -> Self {
6041 match u32::from(wire.value) {
6042 0 => Self::None,
6043
6044 1 => Self::Realm,
6045
6046 _ => unsafe { ::core::hint::unreachable_unchecked() },
6047 }
6048 }
6049 }
6050
6051 impl ::fidl_next::FromWire<crate::wire::EnvironmentExtends> for EnvironmentExtends {
6052 #[inline]
6053 fn from_wire(wire: crate::wire::EnvironmentExtends) -> Self {
6054 Self::from(wire)
6055 }
6056 }
6057
6058 impl ::fidl_next::FromWireRef<crate::wire::EnvironmentExtends> for EnvironmentExtends {
6059 #[inline]
6060 fn from_wire_ref(wire: &crate::wire::EnvironmentExtends) -> Self {
6061 Self::from(*wire)
6062 }
6063 }
6064
6065 pub type UrlScheme = ::std::string::String;
6066
6067 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6068 #[repr(u32)]
6069 pub enum ConfigTypeLayout {
6070 Bool = 1,
6071 Uint8 = 2,
6072 Uint16 = 3,
6073 Uint32 = 4,
6074 Uint64 = 5,
6075 Int8 = 6,
6076 Int16 = 7,
6077 Int32 = 8,
6078 Int64 = 9,
6079 String = 10,
6080 Vector = 11,
6081 UnknownOrdinal_(u32) = 12,
6082 }
6083 impl ::std::convert::From<u32> for ConfigTypeLayout {
6084 fn from(value: u32) -> Self {
6085 match value {
6086 1 => Self::Bool,
6087 2 => Self::Uint8,
6088 3 => Self::Uint16,
6089 4 => Self::Uint32,
6090 5 => Self::Uint64,
6091 6 => Self::Int8,
6092 7 => Self::Int16,
6093 8 => Self::Int32,
6094 9 => Self::Int64,
6095 10 => Self::String,
6096 11 => Self::Vector,
6097
6098 _ => Self::UnknownOrdinal_(value),
6099 }
6100 }
6101 }
6102
6103 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigTypeLayout, ___E> for ConfigTypeLayout
6104 where
6105 ___E: ?Sized,
6106 {
6107 #[inline]
6108 fn encode(
6109 self,
6110 encoder: &mut ___E,
6111 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigTypeLayout>,
6112 _: (),
6113 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6114 ::fidl_next::Encode::encode(&self, encoder, out, ())
6115 }
6116 }
6117
6118 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigTypeLayout, ___E>
6119 for &'a ConfigTypeLayout
6120 where
6121 ___E: ?Sized,
6122 {
6123 #[inline]
6124 fn encode(
6125 self,
6126 encoder: &mut ___E,
6127 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigTypeLayout>,
6128 _: (),
6129 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6130 ::fidl_next::munge!(let crate::wire::ConfigTypeLayout { value } = out);
6131 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
6132 ConfigTypeLayout::Bool => 1,
6133
6134 ConfigTypeLayout::Uint8 => 2,
6135
6136 ConfigTypeLayout::Uint16 => 3,
6137
6138 ConfigTypeLayout::Uint32 => 4,
6139
6140 ConfigTypeLayout::Uint64 => 5,
6141
6142 ConfigTypeLayout::Int8 => 6,
6143
6144 ConfigTypeLayout::Int16 => 7,
6145
6146 ConfigTypeLayout::Int32 => 8,
6147
6148 ConfigTypeLayout::Int64 => 9,
6149
6150 ConfigTypeLayout::String => 10,
6151
6152 ConfigTypeLayout::Vector => 11,
6153
6154 ConfigTypeLayout::UnknownOrdinal_(value) => value,
6155 }));
6156
6157 Ok(())
6158 }
6159 }
6160
6161 impl ::core::convert::From<crate::wire::ConfigTypeLayout> for ConfigTypeLayout {
6162 fn from(wire: crate::wire::ConfigTypeLayout) -> Self {
6163 match u32::from(wire.value) {
6164 1 => Self::Bool,
6165
6166 2 => Self::Uint8,
6167
6168 3 => Self::Uint16,
6169
6170 4 => Self::Uint32,
6171
6172 5 => Self::Uint64,
6173
6174 6 => Self::Int8,
6175
6176 7 => Self::Int16,
6177
6178 8 => Self::Int32,
6179
6180 9 => Self::Int64,
6181
6182 10 => Self::String,
6183
6184 11 => Self::Vector,
6185
6186 value => Self::UnknownOrdinal_(value),
6187 }
6188 }
6189 }
6190
6191 impl ::fidl_next::FromWire<crate::wire::ConfigTypeLayout> for ConfigTypeLayout {
6192 #[inline]
6193 fn from_wire(wire: crate::wire::ConfigTypeLayout) -> Self {
6194 Self::from(wire)
6195 }
6196 }
6197
6198 impl ::fidl_next::FromWireRef<crate::wire::ConfigTypeLayout> for ConfigTypeLayout {
6199 #[inline]
6200 fn from_wire_ref(wire: &crate::wire::ConfigTypeLayout) -> Self {
6201 Self::from(*wire)
6202 }
6203 }
6204
6205 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6206 pub enum LayoutConstraint {
6207 MaxSize(u32),
6208
6209 UnknownOrdinal_(u64),
6210 }
6211
6212 impl LayoutConstraint {
6213 pub fn is_unknown(&self) -> bool {
6214 #[allow(unreachable_patterns)]
6215 match self {
6216 Self::UnknownOrdinal_(_) => true,
6217 _ => false,
6218 }
6219 }
6220 }
6221
6222 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LayoutConstraint<'static>, ___E>
6223 for LayoutConstraint
6224 where
6225 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6226 ___E: ::fidl_next::Encoder,
6227 {
6228 #[inline]
6229 fn encode(
6230 self,
6231 encoder: &mut ___E,
6232 out: &mut ::core::mem::MaybeUninit<crate::wire::LayoutConstraint<'static>>,
6233 _: (),
6234 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6235 ::fidl_next::munge!(let crate::wire::LayoutConstraint { raw, _phantom: _ } = out);
6236
6237 match self {
6238 Self::MaxSize(value) => ::fidl_next::wire::Union::encode_as::<
6239 ___E,
6240 ::fidl_next::wire::Uint32,
6241 >(value, 1, encoder, raw, ())?,
6242
6243 Self::UnknownOrdinal_(ordinal) => {
6244 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
6245 }
6246 }
6247
6248 Ok(())
6249 }
6250 }
6251
6252 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LayoutConstraint<'static>, ___E>
6253 for &'a LayoutConstraint
6254 where
6255 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6256 ___E: ::fidl_next::Encoder,
6257 {
6258 #[inline]
6259 fn encode(
6260 self,
6261 encoder: &mut ___E,
6262 out: &mut ::core::mem::MaybeUninit<crate::wire::LayoutConstraint<'static>>,
6263 _: (),
6264 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6265 ::fidl_next::munge!(let crate::wire::LayoutConstraint { raw, _phantom: _ } = out);
6266
6267 match self {
6268 LayoutConstraint::MaxSize(value) => ::fidl_next::wire::Union::encode_as::<
6269 ___E,
6270 ::fidl_next::wire::Uint32,
6271 >(value, 1, encoder, raw, ())?,
6272
6273 LayoutConstraint::UnknownOrdinal_(ordinal) => {
6274 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
6275 }
6276 }
6277
6278 Ok(())
6279 }
6280 }
6281
6282 unsafe impl<___E>
6283 ::fidl_next::EncodeOption<crate::wire_optional::LayoutConstraint<'static>, ___E>
6284 for LayoutConstraint
6285 where
6286 ___E: ?Sized,
6287 LayoutConstraint: ::fidl_next::Encode<crate::wire::LayoutConstraint<'static>, ___E>,
6288 {
6289 #[inline]
6290 fn encode_option(
6291 this: ::core::option::Option<Self>,
6292 encoder: &mut ___E,
6293 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LayoutConstraint<'static>>,
6294 _: (),
6295 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6296 ::fidl_next::munge!(let crate::wire_optional::LayoutConstraint { raw, _phantom: _ } = &mut *out);
6297
6298 if let Some(inner) = this {
6299 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
6300 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
6301 } else {
6302 ::fidl_next::wire::Union::encode_absent(raw);
6303 }
6304
6305 Ok(())
6306 }
6307 }
6308
6309 unsafe impl<'a, ___E>
6310 ::fidl_next::EncodeOption<crate::wire_optional::LayoutConstraint<'static>, ___E>
6311 for &'a LayoutConstraint
6312 where
6313 ___E: ?Sized,
6314 &'a LayoutConstraint: ::fidl_next::Encode<crate::wire::LayoutConstraint<'static>, ___E>,
6315 {
6316 #[inline]
6317 fn encode_option(
6318 this: ::core::option::Option<Self>,
6319 encoder: &mut ___E,
6320 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LayoutConstraint<'static>>,
6321 _: (),
6322 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6323 ::fidl_next::munge!(let crate::wire_optional::LayoutConstraint { raw, _phantom: _ } = &mut *out);
6324
6325 if let Some(inner) = this {
6326 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
6327 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
6328 } else {
6329 ::fidl_next::wire::Union::encode_absent(raw);
6330 }
6331
6332 Ok(())
6333 }
6334 }
6335
6336 impl<'de> ::fidl_next::FromWire<crate::wire::LayoutConstraint<'de>> for LayoutConstraint {
6337 #[inline]
6338 fn from_wire(wire: crate::wire::LayoutConstraint<'de>) -> Self {
6339 let wire = ::core::mem::ManuallyDrop::new(wire);
6340 match wire.raw.ordinal() {
6341 1 => Self::MaxSize(::fidl_next::FromWire::from_wire(unsafe {
6342 wire.raw.get().read_unchecked::<::fidl_next::wire::Uint32>()
6343 })),
6344
6345 ord => return Self::UnknownOrdinal_(ord as u64),
6346 }
6347 }
6348 }
6349
6350 impl<'de> ::fidl_next::FromWireRef<crate::wire::LayoutConstraint<'de>> for LayoutConstraint {
6351 #[inline]
6352 fn from_wire_ref(wire: &crate::wire::LayoutConstraint<'de>) -> Self {
6353 match wire.raw.ordinal() {
6354 1 => Self::MaxSize(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6355 wire.raw.get().deref_unchecked::<::fidl_next::wire::Uint32>()
6356 })),
6357
6358 ord => return Self::UnknownOrdinal_(ord as u64),
6359 }
6360 }
6361 }
6362
6363 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LayoutConstraint<'de>>
6364 for LayoutConstraint
6365 {
6366 #[inline]
6367 fn from_wire_option(
6368 wire: crate::wire_optional::LayoutConstraint<'de>,
6369 ) -> ::core::option::Option<Self> {
6370 if let Some(inner) = wire.into_option() {
6371 Some(::fidl_next::FromWire::from_wire(inner))
6372 } else {
6373 None
6374 }
6375 }
6376 }
6377
6378 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LayoutConstraint<'de>>
6379 for Box<LayoutConstraint>
6380 {
6381 #[inline]
6382 fn from_wire_option(
6383 wire: crate::wire_optional::LayoutConstraint<'de>,
6384 ) -> ::core::option::Option<Self> {
6385 <LayoutConstraint as ::fidl_next::FromWireOption<
6386 crate::wire_optional::LayoutConstraint<'de>,
6387 >>::from_wire_option(wire)
6388 .map(Box::new)
6389 }
6390 }
6391
6392 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::LayoutConstraint<'de>>
6393 for Box<LayoutConstraint>
6394 {
6395 #[inline]
6396 fn from_wire_option_ref(
6397 wire: &crate::wire_optional::LayoutConstraint<'de>,
6398 ) -> ::core::option::Option<Self> {
6399 if let Some(inner) = wire.as_ref() {
6400 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
6401 } else {
6402 None
6403 }
6404 }
6405 }
6406
6407 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6408 pub struct ConfigType {
6409 pub layout: crate::natural::ConfigTypeLayout,
6410
6411 pub parameters: ::core::option::Option<::std::vec::Vec<crate::natural::LayoutParameter>>,
6412
6413 pub constraints: ::std::vec::Vec<crate::natural::LayoutConstraint>,
6414 }
6415
6416 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigType<'static>, ___E> for ConfigType
6417 where
6418 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6419 ___E: ::fidl_next::Encoder,
6420 {
6421 #[inline]
6422 fn encode(
6423 self,
6424 encoder_: &mut ___E,
6425 out_: &mut ::core::mem::MaybeUninit<crate::wire::ConfigType<'static>>,
6426 _: (),
6427 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6428 ::fidl_next::munge! {
6429 let crate::wire::ConfigType {
6430 layout,
6431 parameters,
6432 constraints,
6433
6434 } = out_;
6435 }
6436
6437 ::fidl_next::Encode::encode(self.layout, encoder_, layout, ())?;
6438
6439 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(layout.as_mut_ptr()) };
6440
6441 ::fidl_next::Encode::encode(self.parameters, encoder_, parameters, (4294967295, ()))?;
6442
6443 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(parameters.as_mut_ptr()) };
6444 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
6445
6446 ::fidl_next::Encode::encode(self.constraints, encoder_, constraints, (4294967295, ()))?;
6447
6448 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(constraints.as_mut_ptr()) };
6449 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
6450
6451 Ok(())
6452 }
6453 }
6454
6455 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigType<'static>, ___E> for &'a ConfigType
6456 where
6457 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6458 ___E: ::fidl_next::Encoder,
6459 {
6460 #[inline]
6461 fn encode(
6462 self,
6463 encoder_: &mut ___E,
6464 out_: &mut ::core::mem::MaybeUninit<crate::wire::ConfigType<'static>>,
6465 _: (),
6466 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6467 ::fidl_next::munge! {
6468 let crate::wire::ConfigType {
6469 layout,
6470 parameters,
6471 constraints,
6472
6473 } = out_;
6474 }
6475
6476 ::fidl_next::Encode::encode(&self.layout, encoder_, layout, ())?;
6477
6478 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(layout.as_mut_ptr()) };
6479
6480 ::fidl_next::Encode::encode(&self.parameters, encoder_, parameters, (4294967295, ()))?;
6481
6482 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(parameters.as_mut_ptr()) };
6483 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
6484
6485 ::fidl_next::Encode::encode(
6486 &self.constraints,
6487 encoder_,
6488 constraints,
6489 (4294967295, ()),
6490 )?;
6491
6492 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(constraints.as_mut_ptr()) };
6493 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
6494
6495 Ok(())
6496 }
6497 }
6498
6499 unsafe impl<___E>
6500 ::fidl_next::EncodeOption<
6501 ::fidl_next::wire::Box<'static, crate::wire::ConfigType<'static>>,
6502 ___E,
6503 > for ConfigType
6504 where
6505 ___E: ::fidl_next::Encoder + ?Sized,
6506 ConfigType: ::fidl_next::Encode<crate::wire::ConfigType<'static>, ___E>,
6507 {
6508 #[inline]
6509 fn encode_option(
6510 this: ::core::option::Option<Self>,
6511 encoder: &mut ___E,
6512 out: &mut ::core::mem::MaybeUninit<
6513 ::fidl_next::wire::Box<'static, crate::wire::ConfigType<'static>>,
6514 >,
6515 _: (),
6516 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6517 if let Some(inner) = this {
6518 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6519 ::fidl_next::wire::Box::encode_present(out);
6520 } else {
6521 ::fidl_next::wire::Box::encode_absent(out);
6522 }
6523
6524 Ok(())
6525 }
6526 }
6527
6528 unsafe impl<'a, ___E>
6529 ::fidl_next::EncodeOption<
6530 ::fidl_next::wire::Box<'static, crate::wire::ConfigType<'static>>,
6531 ___E,
6532 > for &'a ConfigType
6533 where
6534 ___E: ::fidl_next::Encoder + ?Sized,
6535 &'a ConfigType: ::fidl_next::Encode<crate::wire::ConfigType<'static>, ___E>,
6536 {
6537 #[inline]
6538 fn encode_option(
6539 this: ::core::option::Option<Self>,
6540 encoder: &mut ___E,
6541 out: &mut ::core::mem::MaybeUninit<
6542 ::fidl_next::wire::Box<'static, crate::wire::ConfigType<'static>>,
6543 >,
6544 _: (),
6545 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6546 if let Some(inner) = this {
6547 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6548 ::fidl_next::wire::Box::encode_present(out);
6549 } else {
6550 ::fidl_next::wire::Box::encode_absent(out);
6551 }
6552
6553 Ok(())
6554 }
6555 }
6556
6557 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigType<'de>> for ConfigType {
6558 #[inline]
6559 fn from_wire(wire: crate::wire::ConfigType<'de>) -> Self {
6560 Self {
6561 layout: ::fidl_next::FromWire::from_wire(wire.layout),
6562
6563 parameters: ::fidl_next::FromWire::from_wire(wire.parameters),
6564
6565 constraints: ::fidl_next::FromWire::from_wire(wire.constraints),
6566 }
6567 }
6568 }
6569
6570 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigType<'de>> for ConfigType {
6571 #[inline]
6572 fn from_wire_ref(wire: &crate::wire::ConfigType<'de>) -> Self {
6573 Self {
6574 layout: ::fidl_next::FromWireRef::from_wire_ref(&wire.layout),
6575
6576 parameters: ::fidl_next::FromWireRef::from_wire_ref(&wire.parameters),
6577
6578 constraints: ::fidl_next::FromWireRef::from_wire_ref(&wire.constraints),
6579 }
6580 }
6581 }
6582
6583 #[doc = " The checksum produced for a configuration interface.\n Two configuration interfaces are the same if their checksums are the same.\n"]
6584 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6585 pub enum ConfigChecksum {
6586 Sha256([u8; 32]),
6587
6588 UnknownOrdinal_(u64),
6589 }
6590
6591 impl ConfigChecksum {
6592 pub fn is_unknown(&self) -> bool {
6593 #[allow(unreachable_patterns)]
6594 match self {
6595 Self::UnknownOrdinal_(_) => true,
6596 _ => false,
6597 }
6598 }
6599 }
6600
6601 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigChecksum<'static>, ___E> for ConfigChecksum
6602 where
6603 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6604 ___E: ::fidl_next::Encoder,
6605 {
6606 #[inline]
6607 fn encode(
6608 self,
6609 encoder: &mut ___E,
6610 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigChecksum<'static>>,
6611 _: (),
6612 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6613 ::fidl_next::munge!(let crate::wire::ConfigChecksum { raw, _phantom: _ } = out);
6614
6615 match self {
6616 Self::Sha256(value) => ::fidl_next::wire::Union::encode_as::<___E, [u8; 32]>(
6617 value,
6618 1,
6619 encoder,
6620 raw,
6621 (),
6622 )?,
6623
6624 Self::UnknownOrdinal_(ordinal) => {
6625 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
6626 }
6627 }
6628
6629 Ok(())
6630 }
6631 }
6632
6633 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigChecksum<'static>, ___E>
6634 for &'a ConfigChecksum
6635 where
6636 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6637 ___E: ::fidl_next::Encoder,
6638 {
6639 #[inline]
6640 fn encode(
6641 self,
6642 encoder: &mut ___E,
6643 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigChecksum<'static>>,
6644 _: (),
6645 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6646 ::fidl_next::munge!(let crate::wire::ConfigChecksum { raw, _phantom: _ } = out);
6647
6648 match self {
6649 ConfigChecksum::Sha256(value) => ::fidl_next::wire::Union::encode_as::<
6650 ___E,
6651 [u8; 32],
6652 >(value, 1, encoder, raw, ())?,
6653
6654 ConfigChecksum::UnknownOrdinal_(ordinal) => {
6655 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
6656 }
6657 }
6658
6659 Ok(())
6660 }
6661 }
6662
6663 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::ConfigChecksum<'static>, ___E>
6664 for ConfigChecksum
6665 where
6666 ___E: ?Sized,
6667 ConfigChecksum: ::fidl_next::Encode<crate::wire::ConfigChecksum<'static>, ___E>,
6668 {
6669 #[inline]
6670 fn encode_option(
6671 this: ::core::option::Option<Self>,
6672 encoder: &mut ___E,
6673 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigChecksum<'static>>,
6674 _: (),
6675 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6676 ::fidl_next::munge!(let crate::wire_optional::ConfigChecksum { raw, _phantom: _ } = &mut *out);
6677
6678 if let Some(inner) = this {
6679 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
6680 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
6681 } else {
6682 ::fidl_next::wire::Union::encode_absent(raw);
6683 }
6684
6685 Ok(())
6686 }
6687 }
6688
6689 unsafe impl<'a, ___E>
6690 ::fidl_next::EncodeOption<crate::wire_optional::ConfigChecksum<'static>, ___E>
6691 for &'a ConfigChecksum
6692 where
6693 ___E: ?Sized,
6694 &'a ConfigChecksum: ::fidl_next::Encode<crate::wire::ConfigChecksum<'static>, ___E>,
6695 {
6696 #[inline]
6697 fn encode_option(
6698 this: ::core::option::Option<Self>,
6699 encoder: &mut ___E,
6700 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigChecksum<'static>>,
6701 _: (),
6702 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6703 ::fidl_next::munge!(let crate::wire_optional::ConfigChecksum { raw, _phantom: _ } = &mut *out);
6704
6705 if let Some(inner) = this {
6706 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
6707 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
6708 } else {
6709 ::fidl_next::wire::Union::encode_absent(raw);
6710 }
6711
6712 Ok(())
6713 }
6714 }
6715
6716 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigChecksum<'de>> for ConfigChecksum {
6717 #[inline]
6718 fn from_wire(wire: crate::wire::ConfigChecksum<'de>) -> Self {
6719 let wire = ::core::mem::ManuallyDrop::new(wire);
6720 match wire.raw.ordinal() {
6721 1 => Self::Sha256(::fidl_next::FromWire::from_wire(unsafe {
6722 wire.raw.get().read_unchecked::<[u8; 32]>()
6723 })),
6724
6725 ord => return Self::UnknownOrdinal_(ord as u64),
6726 }
6727 }
6728 }
6729
6730 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigChecksum<'de>> for ConfigChecksum {
6731 #[inline]
6732 fn from_wire_ref(wire: &crate::wire::ConfigChecksum<'de>) -> Self {
6733 match wire.raw.ordinal() {
6734 1 => Self::Sha256(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6735 wire.raw.get().deref_unchecked::<[u8; 32]>()
6736 })),
6737
6738 ord => return Self::UnknownOrdinal_(ord as u64),
6739 }
6740 }
6741 }
6742
6743 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigChecksum<'de>>
6744 for ConfigChecksum
6745 {
6746 #[inline]
6747 fn from_wire_option(
6748 wire: crate::wire_optional::ConfigChecksum<'de>,
6749 ) -> ::core::option::Option<Self> {
6750 if let Some(inner) = wire.into_option() {
6751 Some(::fidl_next::FromWire::from_wire(inner))
6752 } else {
6753 None
6754 }
6755 }
6756 }
6757
6758 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigChecksum<'de>>
6759 for Box<ConfigChecksum>
6760 {
6761 #[inline]
6762 fn from_wire_option(
6763 wire: crate::wire_optional::ConfigChecksum<'de>,
6764 ) -> ::core::option::Option<Self> {
6765 <ConfigChecksum as ::fidl_next::FromWireOption<
6766 crate::wire_optional::ConfigChecksum<'de>,
6767 >>::from_wire_option(wire)
6768 .map(Box::new)
6769 }
6770 }
6771
6772 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ConfigChecksum<'de>>
6773 for Box<ConfigChecksum>
6774 {
6775 #[inline]
6776 fn from_wire_option_ref(
6777 wire: &crate::wire_optional::ConfigChecksum<'de>,
6778 ) -> ::core::option::Option<Self> {
6779 if let Some(inner) = wire.as_ref() {
6780 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
6781 } else {
6782 None
6783 }
6784 }
6785 }
6786
6787 #[doc = " Declares storage used by a component, which was offered to it.\n"]
6788 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6789 pub struct UseStorage {
6790 pub source_name: ::core::option::Option<::std::string::String>,
6791
6792 pub target_path: ::core::option::Option<::std::string::String>,
6793
6794 pub availability: ::core::option::Option<crate::natural::Availability>,
6795 }
6796
6797 impl UseStorage {
6798 fn __max_ordinal(&self) -> usize {
6799 if self.availability.is_some() {
6800 return 3;
6801 }
6802
6803 if self.target_path.is_some() {
6804 return 2;
6805 }
6806
6807 if self.source_name.is_some() {
6808 return 1;
6809 }
6810
6811 0
6812 }
6813 }
6814
6815 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseStorage<'static>, ___E> for UseStorage
6816 where
6817 ___E: ::fidl_next::Encoder + ?Sized,
6818 {
6819 #[inline]
6820 fn encode(
6821 mut self,
6822 encoder: &mut ___E,
6823 out: &mut ::core::mem::MaybeUninit<crate::wire::UseStorage<'static>>,
6824 _: (),
6825 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6826 ::fidl_next::munge!(let crate::wire::UseStorage { table } = out);
6827
6828 let max_ord = self.__max_ordinal();
6829
6830 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6831 ::fidl_next::Wire::zero_padding(&mut out);
6832
6833 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6834 ::fidl_next::wire::Envelope,
6835 >(encoder, max_ord);
6836
6837 for i in 1..=max_ord {
6838 match i {
6839 3 => {
6840 if let Some(value) = self.availability.take() {
6841 ::fidl_next::wire::Envelope::encode_value::<
6842 crate::wire::Availability,
6843 ___E,
6844 >(
6845 value, preallocated.encoder, &mut out, ()
6846 )?;
6847 } else {
6848 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6849 }
6850 }
6851
6852 2 => {
6853 if let Some(value) = self.target_path.take() {
6854 ::fidl_next::wire::Envelope::encode_value::<
6855 ::fidl_next::wire::String<'static>,
6856 ___E,
6857 >(
6858 value, preallocated.encoder, &mut out, 1024
6859 )?;
6860 } else {
6861 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6862 }
6863 }
6864
6865 1 => {
6866 if let Some(value) = self.source_name.take() {
6867 ::fidl_next::wire::Envelope::encode_value::<
6868 ::fidl_next::wire::String<'static>,
6869 ___E,
6870 >(
6871 value, preallocated.encoder, &mut out, 100
6872 )?;
6873 } else {
6874 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6875 }
6876 }
6877
6878 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6879 }
6880 unsafe {
6881 preallocated.write_next(out.assume_init_ref());
6882 }
6883 }
6884
6885 ::fidl_next::wire::Table::encode_len(table, max_ord);
6886
6887 Ok(())
6888 }
6889 }
6890
6891 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseStorage<'static>, ___E> for &'a UseStorage
6892 where
6893 ___E: ::fidl_next::Encoder + ?Sized,
6894 {
6895 #[inline]
6896 fn encode(
6897 self,
6898 encoder: &mut ___E,
6899 out: &mut ::core::mem::MaybeUninit<crate::wire::UseStorage<'static>>,
6900 _: (),
6901 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6902 ::fidl_next::munge!(let crate::wire::UseStorage { table } = out);
6903
6904 let max_ord = self.__max_ordinal();
6905
6906 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6907 ::fidl_next::Wire::zero_padding(&mut out);
6908
6909 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6910 ::fidl_next::wire::Envelope,
6911 >(encoder, max_ord);
6912
6913 for i in 1..=max_ord {
6914 match i {
6915 3 => {
6916 if let Some(value) = &self.availability {
6917 ::fidl_next::wire::Envelope::encode_value::<
6918 crate::wire::Availability,
6919 ___E,
6920 >(
6921 value, preallocated.encoder, &mut out, ()
6922 )?;
6923 } else {
6924 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6925 }
6926 }
6927
6928 2 => {
6929 if let Some(value) = &self.target_path {
6930 ::fidl_next::wire::Envelope::encode_value::<
6931 ::fidl_next::wire::String<'static>,
6932 ___E,
6933 >(
6934 value, preallocated.encoder, &mut out, 1024
6935 )?;
6936 } else {
6937 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6938 }
6939 }
6940
6941 1 => {
6942 if let Some(value) = &self.source_name {
6943 ::fidl_next::wire::Envelope::encode_value::<
6944 ::fidl_next::wire::String<'static>,
6945 ___E,
6946 >(
6947 value, preallocated.encoder, &mut out, 100
6948 )?;
6949 } else {
6950 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6951 }
6952 }
6953
6954 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6955 }
6956 unsafe {
6957 preallocated.write_next(out.assume_init_ref());
6958 }
6959 }
6960
6961 ::fidl_next::wire::Table::encode_len(table, max_ord);
6962
6963 Ok(())
6964 }
6965 }
6966
6967 impl<'de> ::fidl_next::FromWire<crate::wire::UseStorage<'de>> for UseStorage {
6968 #[inline]
6969 fn from_wire(wire_: crate::wire::UseStorage<'de>) -> Self {
6970 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6971
6972 let source_name = wire_.table.get(1);
6973
6974 let target_path = wire_.table.get(2);
6975
6976 let availability = wire_.table.get(3);
6977
6978 Self {
6979 source_name: source_name.map(|envelope| {
6980 ::fidl_next::FromWire::from_wire(unsafe {
6981 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
6982 })
6983 }),
6984
6985 target_path: target_path.map(|envelope| {
6986 ::fidl_next::FromWire::from_wire(unsafe {
6987 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
6988 })
6989 }),
6990
6991 availability: availability.map(|envelope| {
6992 ::fidl_next::FromWire::from_wire(unsafe {
6993 envelope.read_unchecked::<crate::wire::Availability>()
6994 })
6995 }),
6996 }
6997 }
6998 }
6999
7000 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseStorage<'de>> for UseStorage {
7001 #[inline]
7002 fn from_wire_ref(wire: &crate::wire::UseStorage<'de>) -> Self {
7003 Self {
7004 source_name: wire.table.get(1).map(|envelope| {
7005 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7006 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
7007 })
7008 }),
7009
7010 target_path: wire.table.get(2).map(|envelope| {
7011 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7012 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
7013 })
7014 }),
7015
7016 availability: wire.table.get(3).map(|envelope| {
7017 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7018 envelope.deref_unchecked::<crate::wire::Availability>()
7019 })
7020 }),
7021 }
7022 }
7023 }
7024
7025 ::fidl_next::bitflags::bitflags! {
7026 #[doc = " Allowed sources for runtime overrides of a config field\'s value.\n"]#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct ConfigMutability: u32 {
7027 #[doc = " Allow parent components to provide overrides for the configuration field.\n"]const PARENT = 1;
7028 const _ = !0;
7029 }
7030 }
7031
7032 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigMutability, ___E> for ConfigMutability
7033 where
7034 ___E: ?Sized,
7035 {
7036 #[inline]
7037 fn encode(
7038 self,
7039 encoder: &mut ___E,
7040 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigMutability>,
7041 _: (),
7042 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7043 ::fidl_next::Encode::encode(&self, encoder, out, ())
7044 }
7045 }
7046
7047 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigMutability, ___E>
7048 for &'a ConfigMutability
7049 where
7050 ___E: ?Sized,
7051 {
7052 #[inline]
7053 fn encode(
7054 self,
7055 _: &mut ___E,
7056 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigMutability>,
7057 _: (),
7058 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7059 ::fidl_next::munge!(let crate::wire::ConfigMutability { value } = out);
7060
7061 let _ = value.write(::fidl_next::wire::Uint32::from(self.bits()));
7062 Ok(())
7063 }
7064 }
7065
7066 impl ::core::convert::From<crate::wire::ConfigMutability> for ConfigMutability {
7067 fn from(wire: crate::wire::ConfigMutability) -> Self {
7068 Self::from_bits_retain(u32::from(wire.value))
7069 }
7070 }
7071
7072 impl ::fidl_next::FromWire<crate::wire::ConfigMutability> for ConfigMutability {
7073 #[inline]
7074 fn from_wire(wire: crate::wire::ConfigMutability) -> Self {
7075 Self::from(wire)
7076 }
7077 }
7078
7079 impl ::fidl_next::FromWireRef<crate::wire::ConfigMutability> for ConfigMutability {
7080 #[inline]
7081 fn from_wire_ref(wire: &crate::wire::ConfigMutability) -> Self {
7082 Self::from(*wire)
7083 }
7084 }
7085
7086 #[doc = " Declares a single config field (key + type)\n"]
7087 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7088 pub struct ConfigField {
7089 pub key: ::core::option::Option<::std::string::String>,
7090
7091 pub type_: ::core::option::Option<crate::natural::ConfigType>,
7092
7093 pub mutability: ::core::option::Option<crate::natural::ConfigMutability>,
7094 }
7095
7096 impl ConfigField {
7097 fn __max_ordinal(&self) -> usize {
7098 if self.mutability.is_some() {
7099 return 3;
7100 }
7101
7102 if self.type_.is_some() {
7103 return 2;
7104 }
7105
7106 if self.key.is_some() {
7107 return 1;
7108 }
7109
7110 0
7111 }
7112 }
7113
7114 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigField<'static>, ___E> for ConfigField
7115 where
7116 ___E: ::fidl_next::Encoder + ?Sized,
7117 {
7118 #[inline]
7119 fn encode(
7120 mut self,
7121 encoder: &mut ___E,
7122 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigField<'static>>,
7123 _: (),
7124 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7125 ::fidl_next::munge!(let crate::wire::ConfigField { table } = out);
7126
7127 let max_ord = self.__max_ordinal();
7128
7129 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7130 ::fidl_next::Wire::zero_padding(&mut out);
7131
7132 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7133 ::fidl_next::wire::Envelope,
7134 >(encoder, max_ord);
7135
7136 for i in 1..=max_ord {
7137 match i {
7138 3 => {
7139 if let Some(value) = self.mutability.take() {
7140 ::fidl_next::wire::Envelope::encode_value::<
7141 crate::wire::ConfigMutability,
7142 ___E,
7143 >(
7144 value, preallocated.encoder, &mut out, ()
7145 )?;
7146 } else {
7147 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7148 }
7149 }
7150
7151 2 => {
7152 if let Some(value) = self.type_.take() {
7153 ::fidl_next::wire::Envelope::encode_value::<
7154 crate::wire::ConfigType<'static>,
7155 ___E,
7156 >(
7157 value, preallocated.encoder, &mut out, ()
7158 )?;
7159 } else {
7160 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7161 }
7162 }
7163
7164 1 => {
7165 if let Some(value) = self.key.take() {
7166 ::fidl_next::wire::Envelope::encode_value::<
7167 ::fidl_next::wire::String<'static>,
7168 ___E,
7169 >(
7170 value, preallocated.encoder, &mut out, 64
7171 )?;
7172 } else {
7173 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7174 }
7175 }
7176
7177 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7178 }
7179 unsafe {
7180 preallocated.write_next(out.assume_init_ref());
7181 }
7182 }
7183
7184 ::fidl_next::wire::Table::encode_len(table, max_ord);
7185
7186 Ok(())
7187 }
7188 }
7189
7190 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigField<'static>, ___E>
7191 for &'a ConfigField
7192 where
7193 ___E: ::fidl_next::Encoder + ?Sized,
7194 {
7195 #[inline]
7196 fn encode(
7197 self,
7198 encoder: &mut ___E,
7199 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigField<'static>>,
7200 _: (),
7201 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7202 ::fidl_next::munge!(let crate::wire::ConfigField { table } = out);
7203
7204 let max_ord = self.__max_ordinal();
7205
7206 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7207 ::fidl_next::Wire::zero_padding(&mut out);
7208
7209 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7210 ::fidl_next::wire::Envelope,
7211 >(encoder, max_ord);
7212
7213 for i in 1..=max_ord {
7214 match i {
7215 3 => {
7216 if let Some(value) = &self.mutability {
7217 ::fidl_next::wire::Envelope::encode_value::<
7218 crate::wire::ConfigMutability,
7219 ___E,
7220 >(
7221 value, preallocated.encoder, &mut out, ()
7222 )?;
7223 } else {
7224 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7225 }
7226 }
7227
7228 2 => {
7229 if let Some(value) = &self.type_ {
7230 ::fidl_next::wire::Envelope::encode_value::<
7231 crate::wire::ConfigType<'static>,
7232 ___E,
7233 >(
7234 value, preallocated.encoder, &mut out, ()
7235 )?;
7236 } else {
7237 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7238 }
7239 }
7240
7241 1 => {
7242 if let Some(value) = &self.key {
7243 ::fidl_next::wire::Envelope::encode_value::<
7244 ::fidl_next::wire::String<'static>,
7245 ___E,
7246 >(
7247 value, preallocated.encoder, &mut out, 64
7248 )?;
7249 } else {
7250 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7251 }
7252 }
7253
7254 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7255 }
7256 unsafe {
7257 preallocated.write_next(out.assume_init_ref());
7258 }
7259 }
7260
7261 ::fidl_next::wire::Table::encode_len(table, max_ord);
7262
7263 Ok(())
7264 }
7265 }
7266
7267 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigField<'de>> for ConfigField {
7268 #[inline]
7269 fn from_wire(wire_: crate::wire::ConfigField<'de>) -> Self {
7270 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7271
7272 let key = wire_.table.get(1);
7273
7274 let type_ = wire_.table.get(2);
7275
7276 let mutability = wire_.table.get(3);
7277
7278 Self {
7279 key: key.map(|envelope| {
7280 ::fidl_next::FromWire::from_wire(unsafe {
7281 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
7282 })
7283 }),
7284
7285 type_: type_.map(|envelope| {
7286 ::fidl_next::FromWire::from_wire(unsafe {
7287 envelope.read_unchecked::<crate::wire::ConfigType<'de>>()
7288 })
7289 }),
7290
7291 mutability: mutability.map(|envelope| {
7292 ::fidl_next::FromWire::from_wire(unsafe {
7293 envelope.read_unchecked::<crate::wire::ConfigMutability>()
7294 })
7295 }),
7296 }
7297 }
7298 }
7299
7300 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigField<'de>> for ConfigField {
7301 #[inline]
7302 fn from_wire_ref(wire: &crate::wire::ConfigField<'de>) -> Self {
7303 Self {
7304 key: wire.table.get(1).map(|envelope| {
7305 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7306 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
7307 })
7308 }),
7309
7310 type_: wire.table.get(2).map(|envelope| {
7311 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7312 envelope.deref_unchecked::<crate::wire::ConfigType<'de>>()
7313 })
7314 }),
7315
7316 mutability: wire.table.get(3).map(|envelope| {
7317 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7318 envelope.deref_unchecked::<crate::wire::ConfigMutability>()
7319 })
7320 }),
7321 }
7322 }
7323 }
7324
7325 #[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"]
7326 #[derive(Debug, Default, Clone, PartialEq)]
7327 pub struct Program {
7328 pub runner: ::core::option::Option<::std::string::String>,
7329
7330 pub info: ::core::option::Option<::fidl_next_common_fuchsia_data::natural::Dictionary>,
7331 }
7332
7333 impl Program {
7334 fn __max_ordinal(&self) -> usize {
7335 if self.info.is_some() {
7336 return 2;
7337 }
7338
7339 if self.runner.is_some() {
7340 return 1;
7341 }
7342
7343 0
7344 }
7345 }
7346
7347 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Program<'static>, ___E> for Program
7348 where
7349 ___E: ::fidl_next::Encoder + ?Sized,
7350 {
7351 #[inline]
7352 fn encode(
7353 mut self,
7354 encoder: &mut ___E,
7355 out: &mut ::core::mem::MaybeUninit<crate::wire::Program<'static>>,
7356 _: (),
7357 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7358 ::fidl_next::munge!(let crate::wire::Program { table } = out);
7359
7360 let max_ord = self.__max_ordinal();
7361
7362 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7363 ::fidl_next::Wire::zero_padding(&mut out);
7364
7365 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7366 ::fidl_next::wire::Envelope,
7367 >(encoder, max_ord);
7368
7369 for i in 1..=max_ord {
7370 match i {
7371 2 => {
7372 if let Some(value) = self.info.take() {
7373 ::fidl_next::wire::Envelope::encode_value::<
7374 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
7375 ___E,
7376 >(
7377 value, preallocated.encoder, &mut out, ()
7378 )?;
7379 } else {
7380 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7381 }
7382 }
7383
7384 1 => {
7385 if let Some(value) = self.runner.take() {
7386 ::fidl_next::wire::Envelope::encode_value::<
7387 ::fidl_next::wire::String<'static>,
7388 ___E,
7389 >(
7390 value, preallocated.encoder, &mut out, 100
7391 )?;
7392 } else {
7393 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7394 }
7395 }
7396
7397 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7398 }
7399 unsafe {
7400 preallocated.write_next(out.assume_init_ref());
7401 }
7402 }
7403
7404 ::fidl_next::wire::Table::encode_len(table, max_ord);
7405
7406 Ok(())
7407 }
7408 }
7409
7410 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Program<'static>, ___E> for &'a Program
7411 where
7412 ___E: ::fidl_next::Encoder + ?Sized,
7413 {
7414 #[inline]
7415 fn encode(
7416 self,
7417 encoder: &mut ___E,
7418 out: &mut ::core::mem::MaybeUninit<crate::wire::Program<'static>>,
7419 _: (),
7420 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7421 ::fidl_next::munge!(let crate::wire::Program { table } = out);
7422
7423 let max_ord = self.__max_ordinal();
7424
7425 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7426 ::fidl_next::Wire::zero_padding(&mut out);
7427
7428 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7429 ::fidl_next::wire::Envelope,
7430 >(encoder, max_ord);
7431
7432 for i in 1..=max_ord {
7433 match i {
7434 2 => {
7435 if let Some(value) = &self.info {
7436 ::fidl_next::wire::Envelope::encode_value::<
7437 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
7438 ___E,
7439 >(
7440 value, preallocated.encoder, &mut out, ()
7441 )?;
7442 } else {
7443 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7444 }
7445 }
7446
7447 1 => {
7448 if let Some(value) = &self.runner {
7449 ::fidl_next::wire::Envelope::encode_value::<
7450 ::fidl_next::wire::String<'static>,
7451 ___E,
7452 >(
7453 value, preallocated.encoder, &mut out, 100
7454 )?;
7455 } else {
7456 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7457 }
7458 }
7459
7460 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7461 }
7462 unsafe {
7463 preallocated.write_next(out.assume_init_ref());
7464 }
7465 }
7466
7467 ::fidl_next::wire::Table::encode_len(table, max_ord);
7468
7469 Ok(())
7470 }
7471 }
7472
7473 impl<'de> ::fidl_next::FromWire<crate::wire::Program<'de>> for Program {
7474 #[inline]
7475 fn from_wire(wire_: crate::wire::Program<'de>) -> Self {
7476 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7477
7478 let runner = wire_.table.get(1);
7479
7480 let info = wire_.table.get(2);
7481
7482 Self {
7483
7484
7485 runner: runner.map(|envelope| ::fidl_next::FromWire::from_wire(
7486 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
7487 )),
7488
7489
7490 info: info.map(|envelope| ::fidl_next::FromWire::from_wire(
7491 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
7492 )),
7493
7494 }
7495 }
7496 }
7497
7498 impl<'de> ::fidl_next::FromWireRef<crate::wire::Program<'de>> for Program {
7499 #[inline]
7500 fn from_wire_ref(wire: &crate::wire::Program<'de>) -> Self {
7501 Self {
7502
7503
7504 runner: wire.table.get(1)
7505 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
7506 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
7507 )),
7508
7509
7510 info: wire.table.get(2)
7511 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
7512 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
7513 )),
7514
7515 }
7516 }
7517 }
7518
7519 #[doc = " Debug information about the component.\n"]
7520 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7521 pub struct DebugInfo {
7522 pub manifest_sources: ::core::option::Option<::std::vec::Vec<::std::string::String>>,
7523 }
7524
7525 impl DebugInfo {
7526 fn __max_ordinal(&self) -> usize {
7527 if self.manifest_sources.is_some() {
7528 return 1;
7529 }
7530
7531 0
7532 }
7533 }
7534
7535 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DebugInfo<'static>, ___E> for DebugInfo
7536 where
7537 ___E: ::fidl_next::Encoder + ?Sized,
7538 {
7539 #[inline]
7540 fn encode(
7541 mut self,
7542 encoder: &mut ___E,
7543 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugInfo<'static>>,
7544 _: (),
7545 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7546 ::fidl_next::munge!(let crate::wire::DebugInfo { table } = out);
7547
7548 let max_ord = self.__max_ordinal();
7549
7550 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7551 ::fidl_next::Wire::zero_padding(&mut out);
7552
7553 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7554 ::fidl_next::wire::Envelope,
7555 >(encoder, max_ord);
7556
7557 for i in 1..=max_ord {
7558 match i {
7559 1 => {
7560 if let Some(value) = self.manifest_sources.take() {
7561 ::fidl_next::wire::Envelope::encode_value::<
7562 ::fidl_next::wire::Vector<
7563 'static,
7564 ::fidl_next::wire::String<'static>,
7565 >,
7566 ___E,
7567 >(
7568 value, preallocated.encoder, &mut out, (4294967295, 4294967295)
7569 )?;
7570 } else {
7571 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7572 }
7573 }
7574
7575 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7576 }
7577 unsafe {
7578 preallocated.write_next(out.assume_init_ref());
7579 }
7580 }
7581
7582 ::fidl_next::wire::Table::encode_len(table, max_ord);
7583
7584 Ok(())
7585 }
7586 }
7587
7588 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DebugInfo<'static>, ___E> for &'a DebugInfo
7589 where
7590 ___E: ::fidl_next::Encoder + ?Sized,
7591 {
7592 #[inline]
7593 fn encode(
7594 self,
7595 encoder: &mut ___E,
7596 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugInfo<'static>>,
7597 _: (),
7598 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7599 ::fidl_next::munge!(let crate::wire::DebugInfo { table } = out);
7600
7601 let max_ord = self.__max_ordinal();
7602
7603 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7604 ::fidl_next::Wire::zero_padding(&mut out);
7605
7606 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7607 ::fidl_next::wire::Envelope,
7608 >(encoder, max_ord);
7609
7610 for i in 1..=max_ord {
7611 match i {
7612 1 => {
7613 if let Some(value) = &self.manifest_sources {
7614 ::fidl_next::wire::Envelope::encode_value::<
7615 ::fidl_next::wire::Vector<
7616 'static,
7617 ::fidl_next::wire::String<'static>,
7618 >,
7619 ___E,
7620 >(
7621 value, preallocated.encoder, &mut out, (4294967295, 4294967295)
7622 )?;
7623 } else {
7624 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7625 }
7626 }
7627
7628 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7629 }
7630 unsafe {
7631 preallocated.write_next(out.assume_init_ref());
7632 }
7633 }
7634
7635 ::fidl_next::wire::Table::encode_len(table, max_ord);
7636
7637 Ok(())
7638 }
7639 }
7640
7641 impl<'de> ::fidl_next::FromWire<crate::wire::DebugInfo<'de>> for DebugInfo {
7642 #[inline]
7643 fn from_wire(wire_: crate::wire::DebugInfo<'de>) -> Self {
7644 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7645
7646 let manifest_sources = wire_.table.get(1);
7647
7648 Self {
7649
7650
7651 manifest_sources: manifest_sources.map(|envelope| ::fidl_next::FromWire::from_wire(
7652 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>() }
7653 )),
7654
7655 }
7656 }
7657 }
7658
7659 impl<'de> ::fidl_next::FromWireRef<crate::wire::DebugInfo<'de>> for DebugInfo {
7660 #[inline]
7661 fn from_wire_ref(wire: &crate::wire::DebugInfo<'de>) -> Self {
7662 Self {
7663
7664
7665 manifest_sources: wire.table.get(1)
7666 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
7667 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>() }
7668 )),
7669
7670 }
7671 }
7672 }
7673
7674 #[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"]
7675 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7676 pub struct UseService {
7677 pub source: ::core::option::Option<crate::natural::Ref>,
7678
7679 pub source_name: ::core::option::Option<::std::string::String>,
7680
7681 pub target_path: ::core::option::Option<::std::string::String>,
7682
7683 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
7684
7685 pub availability: ::core::option::Option<crate::natural::Availability>,
7686
7687 pub source_dictionary: ::core::option::Option<::std::string::String>,
7688 }
7689
7690 impl UseService {
7691 fn __max_ordinal(&self) -> usize {
7692 if self.source_dictionary.is_some() {
7693 return 6;
7694 }
7695
7696 if self.availability.is_some() {
7697 return 5;
7698 }
7699
7700 if self.dependency_type.is_some() {
7701 return 4;
7702 }
7703
7704 if self.target_path.is_some() {
7705 return 3;
7706 }
7707
7708 if self.source_name.is_some() {
7709 return 2;
7710 }
7711
7712 if self.source.is_some() {
7713 return 1;
7714 }
7715
7716 0
7717 }
7718 }
7719
7720 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseService<'static>, ___E> for UseService
7721 where
7722 ___E: ::fidl_next::Encoder + ?Sized,
7723 {
7724 #[inline]
7725 fn encode(
7726 mut self,
7727 encoder: &mut ___E,
7728 out: &mut ::core::mem::MaybeUninit<crate::wire::UseService<'static>>,
7729 _: (),
7730 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7731 ::fidl_next::munge!(let crate::wire::UseService { table } = out);
7732
7733 let max_ord = self.__max_ordinal();
7734
7735 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7736 ::fidl_next::Wire::zero_padding(&mut out);
7737
7738 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7739 ::fidl_next::wire::Envelope,
7740 >(encoder, max_ord);
7741
7742 for i in 1..=max_ord {
7743 match i {
7744 6 => {
7745 if let Some(value) = self.source_dictionary.take() {
7746 ::fidl_next::wire::Envelope::encode_value::<
7747 ::fidl_next::wire::String<'static>,
7748 ___E,
7749 >(
7750 value, preallocated.encoder, &mut out, 1024
7751 )?;
7752 } else {
7753 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7754 }
7755 }
7756
7757 5 => {
7758 if let Some(value) = self.availability.take() {
7759 ::fidl_next::wire::Envelope::encode_value::<
7760 crate::wire::Availability,
7761 ___E,
7762 >(
7763 value, preallocated.encoder, &mut out, ()
7764 )?;
7765 } else {
7766 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7767 }
7768 }
7769
7770 4 => {
7771 if let Some(value) = self.dependency_type.take() {
7772 ::fidl_next::wire::Envelope::encode_value::<
7773 crate::wire::DependencyType,
7774 ___E,
7775 >(
7776 value, preallocated.encoder, &mut out, ()
7777 )?;
7778 } else {
7779 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7780 }
7781 }
7782
7783 3 => {
7784 if let Some(value) = self.target_path.take() {
7785 ::fidl_next::wire::Envelope::encode_value::<
7786 ::fidl_next::wire::String<'static>,
7787 ___E,
7788 >(
7789 value, preallocated.encoder, &mut out, 1024
7790 )?;
7791 } else {
7792 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7793 }
7794 }
7795
7796 2 => {
7797 if let Some(value) = self.source_name.take() {
7798 ::fidl_next::wire::Envelope::encode_value::<
7799 ::fidl_next::wire::String<'static>,
7800 ___E,
7801 >(
7802 value, preallocated.encoder, &mut out, 100
7803 )?;
7804 } else {
7805 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7806 }
7807 }
7808
7809 1 => {
7810 if let Some(value) = self.source.take() {
7811 ::fidl_next::wire::Envelope::encode_value::<
7812 crate::wire::Ref<'static>,
7813 ___E,
7814 >(
7815 value, preallocated.encoder, &mut out, ()
7816 )?;
7817 } else {
7818 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7819 }
7820 }
7821
7822 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7823 }
7824 unsafe {
7825 preallocated.write_next(out.assume_init_ref());
7826 }
7827 }
7828
7829 ::fidl_next::wire::Table::encode_len(table, max_ord);
7830
7831 Ok(())
7832 }
7833 }
7834
7835 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseService<'static>, ___E> for &'a UseService
7836 where
7837 ___E: ::fidl_next::Encoder + ?Sized,
7838 {
7839 #[inline]
7840 fn encode(
7841 self,
7842 encoder: &mut ___E,
7843 out: &mut ::core::mem::MaybeUninit<crate::wire::UseService<'static>>,
7844 _: (),
7845 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7846 ::fidl_next::munge!(let crate::wire::UseService { table } = out);
7847
7848 let max_ord = self.__max_ordinal();
7849
7850 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7851 ::fidl_next::Wire::zero_padding(&mut out);
7852
7853 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7854 ::fidl_next::wire::Envelope,
7855 >(encoder, max_ord);
7856
7857 for i in 1..=max_ord {
7858 match i {
7859 6 => {
7860 if let Some(value) = &self.source_dictionary {
7861 ::fidl_next::wire::Envelope::encode_value::<
7862 ::fidl_next::wire::String<'static>,
7863 ___E,
7864 >(
7865 value, preallocated.encoder, &mut out, 1024
7866 )?;
7867 } else {
7868 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7869 }
7870 }
7871
7872 5 => {
7873 if let Some(value) = &self.availability {
7874 ::fidl_next::wire::Envelope::encode_value::<
7875 crate::wire::Availability,
7876 ___E,
7877 >(
7878 value, preallocated.encoder, &mut out, ()
7879 )?;
7880 } else {
7881 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7882 }
7883 }
7884
7885 4 => {
7886 if let Some(value) = &self.dependency_type {
7887 ::fidl_next::wire::Envelope::encode_value::<
7888 crate::wire::DependencyType,
7889 ___E,
7890 >(
7891 value, preallocated.encoder, &mut out, ()
7892 )?;
7893 } else {
7894 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7895 }
7896 }
7897
7898 3 => {
7899 if let Some(value) = &self.target_path {
7900 ::fidl_next::wire::Envelope::encode_value::<
7901 ::fidl_next::wire::String<'static>,
7902 ___E,
7903 >(
7904 value, preallocated.encoder, &mut out, 1024
7905 )?;
7906 } else {
7907 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7908 }
7909 }
7910
7911 2 => {
7912 if let Some(value) = &self.source_name {
7913 ::fidl_next::wire::Envelope::encode_value::<
7914 ::fidl_next::wire::String<'static>,
7915 ___E,
7916 >(
7917 value, preallocated.encoder, &mut out, 100
7918 )?;
7919 } else {
7920 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7921 }
7922 }
7923
7924 1 => {
7925 if let Some(value) = &self.source {
7926 ::fidl_next::wire::Envelope::encode_value::<
7927 crate::wire::Ref<'static>,
7928 ___E,
7929 >(
7930 value, preallocated.encoder, &mut out, ()
7931 )?;
7932 } else {
7933 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7934 }
7935 }
7936
7937 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7938 }
7939 unsafe {
7940 preallocated.write_next(out.assume_init_ref());
7941 }
7942 }
7943
7944 ::fidl_next::wire::Table::encode_len(table, max_ord);
7945
7946 Ok(())
7947 }
7948 }
7949
7950 impl<'de> ::fidl_next::FromWire<crate::wire::UseService<'de>> for UseService {
7951 #[inline]
7952 fn from_wire(wire_: crate::wire::UseService<'de>) -> Self {
7953 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7954
7955 let source = wire_.table.get(1);
7956
7957 let source_name = wire_.table.get(2);
7958
7959 let target_path = wire_.table.get(3);
7960
7961 let dependency_type = wire_.table.get(4);
7962
7963 let availability = wire_.table.get(5);
7964
7965 let source_dictionary = wire_.table.get(6);
7966
7967 Self {
7968 source: source.map(|envelope| {
7969 ::fidl_next::FromWire::from_wire(unsafe {
7970 envelope.read_unchecked::<crate::wire::Ref<'de>>()
7971 })
7972 }),
7973
7974 source_name: source_name.map(|envelope| {
7975 ::fidl_next::FromWire::from_wire(unsafe {
7976 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
7977 })
7978 }),
7979
7980 target_path: target_path.map(|envelope| {
7981 ::fidl_next::FromWire::from_wire(unsafe {
7982 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
7983 })
7984 }),
7985
7986 dependency_type: dependency_type.map(|envelope| {
7987 ::fidl_next::FromWire::from_wire(unsafe {
7988 envelope.read_unchecked::<crate::wire::DependencyType>()
7989 })
7990 }),
7991
7992 availability: availability.map(|envelope| {
7993 ::fidl_next::FromWire::from_wire(unsafe {
7994 envelope.read_unchecked::<crate::wire::Availability>()
7995 })
7996 }),
7997
7998 source_dictionary: source_dictionary.map(|envelope| {
7999 ::fidl_next::FromWire::from_wire(unsafe {
8000 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
8001 })
8002 }),
8003 }
8004 }
8005 }
8006
8007 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseService<'de>> for UseService {
8008 #[inline]
8009 fn from_wire_ref(wire: &crate::wire::UseService<'de>) -> Self {
8010 Self {
8011 source: wire.table.get(1).map(|envelope| {
8012 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8013 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
8014 })
8015 }),
8016
8017 source_name: wire.table.get(2).map(|envelope| {
8018 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8019 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
8020 })
8021 }),
8022
8023 target_path: wire.table.get(3).map(|envelope| {
8024 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8025 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
8026 })
8027 }),
8028
8029 dependency_type: wire.table.get(4).map(|envelope| {
8030 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8031 envelope.deref_unchecked::<crate::wire::DependencyType>()
8032 })
8033 }),
8034
8035 availability: wire.table.get(5).map(|envelope| {
8036 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8037 envelope.deref_unchecked::<crate::wire::Availability>()
8038 })
8039 }),
8040
8041 source_dictionary: wire.table.get(6).map(|envelope| {
8042 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8043 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
8044 })
8045 }),
8046 }
8047 }
8048 }
8049
8050 #[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"]
8051 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8052 pub struct UseProtocol {
8053 pub source: ::core::option::Option<crate::natural::Ref>,
8054
8055 pub source_name: ::core::option::Option<::std::string::String>,
8056
8057 pub target_path: ::core::option::Option<::std::string::String>,
8058
8059 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
8060
8061 pub availability: ::core::option::Option<crate::natural::Availability>,
8062
8063 pub source_dictionary: ::core::option::Option<::std::string::String>,
8064
8065 pub numbered_handle: ::core::option::Option<u8>,
8066 }
8067
8068 impl UseProtocol {
8069 fn __max_ordinal(&self) -> usize {
8070 if self.numbered_handle.is_some() {
8071 return 7;
8072 }
8073
8074 if self.source_dictionary.is_some() {
8075 return 6;
8076 }
8077
8078 if self.availability.is_some() {
8079 return 5;
8080 }
8081
8082 if self.dependency_type.is_some() {
8083 return 4;
8084 }
8085
8086 if self.target_path.is_some() {
8087 return 3;
8088 }
8089
8090 if self.source_name.is_some() {
8091 return 2;
8092 }
8093
8094 if self.source.is_some() {
8095 return 1;
8096 }
8097
8098 0
8099 }
8100 }
8101
8102 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseProtocol<'static>, ___E> for UseProtocol
8103 where
8104 ___E: ::fidl_next::Encoder + ?Sized,
8105 {
8106 #[inline]
8107 fn encode(
8108 mut self,
8109 encoder: &mut ___E,
8110 out: &mut ::core::mem::MaybeUninit<crate::wire::UseProtocol<'static>>,
8111 _: (),
8112 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8113 ::fidl_next::munge!(let crate::wire::UseProtocol { table } = out);
8114
8115 let max_ord = self.__max_ordinal();
8116
8117 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8118 ::fidl_next::Wire::zero_padding(&mut out);
8119
8120 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8121 ::fidl_next::wire::Envelope,
8122 >(encoder, max_ord);
8123
8124 for i in 1..=max_ord {
8125 match i {
8126 7 => {
8127 if let Some(value) = self.numbered_handle.take() {
8128 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
8129 value,
8130 preallocated.encoder,
8131 &mut out,
8132 (),
8133 )?;
8134 } else {
8135 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8136 }
8137 }
8138
8139 6 => {
8140 if let Some(value) = self.source_dictionary.take() {
8141 ::fidl_next::wire::Envelope::encode_value::<
8142 ::fidl_next::wire::String<'static>,
8143 ___E,
8144 >(
8145 value, preallocated.encoder, &mut out, 1024
8146 )?;
8147 } else {
8148 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8149 }
8150 }
8151
8152 5 => {
8153 if let Some(value) = self.availability.take() {
8154 ::fidl_next::wire::Envelope::encode_value::<
8155 crate::wire::Availability,
8156 ___E,
8157 >(
8158 value, preallocated.encoder, &mut out, ()
8159 )?;
8160 } else {
8161 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8162 }
8163 }
8164
8165 4 => {
8166 if let Some(value) = self.dependency_type.take() {
8167 ::fidl_next::wire::Envelope::encode_value::<
8168 crate::wire::DependencyType,
8169 ___E,
8170 >(
8171 value, preallocated.encoder, &mut out, ()
8172 )?;
8173 } else {
8174 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8175 }
8176 }
8177
8178 3 => {
8179 if let Some(value) = self.target_path.take() {
8180 ::fidl_next::wire::Envelope::encode_value::<
8181 ::fidl_next::wire::String<'static>,
8182 ___E,
8183 >(
8184 value, preallocated.encoder, &mut out, 1024
8185 )?;
8186 } else {
8187 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8188 }
8189 }
8190
8191 2 => {
8192 if let Some(value) = self.source_name.take() {
8193 ::fidl_next::wire::Envelope::encode_value::<
8194 ::fidl_next::wire::String<'static>,
8195 ___E,
8196 >(
8197 value, preallocated.encoder, &mut out, 100
8198 )?;
8199 } else {
8200 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8201 }
8202 }
8203
8204 1 => {
8205 if let Some(value) = self.source.take() {
8206 ::fidl_next::wire::Envelope::encode_value::<
8207 crate::wire::Ref<'static>,
8208 ___E,
8209 >(
8210 value, preallocated.encoder, &mut out, ()
8211 )?;
8212 } else {
8213 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8214 }
8215 }
8216
8217 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8218 }
8219 unsafe {
8220 preallocated.write_next(out.assume_init_ref());
8221 }
8222 }
8223
8224 ::fidl_next::wire::Table::encode_len(table, max_ord);
8225
8226 Ok(())
8227 }
8228 }
8229
8230 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseProtocol<'static>, ___E>
8231 for &'a UseProtocol
8232 where
8233 ___E: ::fidl_next::Encoder + ?Sized,
8234 {
8235 #[inline]
8236 fn encode(
8237 self,
8238 encoder: &mut ___E,
8239 out: &mut ::core::mem::MaybeUninit<crate::wire::UseProtocol<'static>>,
8240 _: (),
8241 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8242 ::fidl_next::munge!(let crate::wire::UseProtocol { table } = out);
8243
8244 let max_ord = self.__max_ordinal();
8245
8246 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8247 ::fidl_next::Wire::zero_padding(&mut out);
8248
8249 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8250 ::fidl_next::wire::Envelope,
8251 >(encoder, max_ord);
8252
8253 for i in 1..=max_ord {
8254 match i {
8255 7 => {
8256 if let Some(value) = &self.numbered_handle {
8257 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
8258 value,
8259 preallocated.encoder,
8260 &mut out,
8261 (),
8262 )?;
8263 } else {
8264 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8265 }
8266 }
8267
8268 6 => {
8269 if let Some(value) = &self.source_dictionary {
8270 ::fidl_next::wire::Envelope::encode_value::<
8271 ::fidl_next::wire::String<'static>,
8272 ___E,
8273 >(
8274 value, preallocated.encoder, &mut out, 1024
8275 )?;
8276 } else {
8277 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8278 }
8279 }
8280
8281 5 => {
8282 if let Some(value) = &self.availability {
8283 ::fidl_next::wire::Envelope::encode_value::<
8284 crate::wire::Availability,
8285 ___E,
8286 >(
8287 value, preallocated.encoder, &mut out, ()
8288 )?;
8289 } else {
8290 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8291 }
8292 }
8293
8294 4 => {
8295 if let Some(value) = &self.dependency_type {
8296 ::fidl_next::wire::Envelope::encode_value::<
8297 crate::wire::DependencyType,
8298 ___E,
8299 >(
8300 value, preallocated.encoder, &mut out, ()
8301 )?;
8302 } else {
8303 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8304 }
8305 }
8306
8307 3 => {
8308 if let Some(value) = &self.target_path {
8309 ::fidl_next::wire::Envelope::encode_value::<
8310 ::fidl_next::wire::String<'static>,
8311 ___E,
8312 >(
8313 value, preallocated.encoder, &mut out, 1024
8314 )?;
8315 } else {
8316 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8317 }
8318 }
8319
8320 2 => {
8321 if let Some(value) = &self.source_name {
8322 ::fidl_next::wire::Envelope::encode_value::<
8323 ::fidl_next::wire::String<'static>,
8324 ___E,
8325 >(
8326 value, preallocated.encoder, &mut out, 100
8327 )?;
8328 } else {
8329 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8330 }
8331 }
8332
8333 1 => {
8334 if let Some(value) = &self.source {
8335 ::fidl_next::wire::Envelope::encode_value::<
8336 crate::wire::Ref<'static>,
8337 ___E,
8338 >(
8339 value, preallocated.encoder, &mut out, ()
8340 )?;
8341 } else {
8342 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8343 }
8344 }
8345
8346 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8347 }
8348 unsafe {
8349 preallocated.write_next(out.assume_init_ref());
8350 }
8351 }
8352
8353 ::fidl_next::wire::Table::encode_len(table, max_ord);
8354
8355 Ok(())
8356 }
8357 }
8358
8359 impl<'de> ::fidl_next::FromWire<crate::wire::UseProtocol<'de>> for UseProtocol {
8360 #[inline]
8361 fn from_wire(wire_: crate::wire::UseProtocol<'de>) -> Self {
8362 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8363
8364 let source = wire_.table.get(1);
8365
8366 let source_name = wire_.table.get(2);
8367
8368 let target_path = wire_.table.get(3);
8369
8370 let dependency_type = wire_.table.get(4);
8371
8372 let availability = wire_.table.get(5);
8373
8374 let source_dictionary = wire_.table.get(6);
8375
8376 let numbered_handle = wire_.table.get(7);
8377
8378 Self {
8379 source: source.map(|envelope| {
8380 ::fidl_next::FromWire::from_wire(unsafe {
8381 envelope.read_unchecked::<crate::wire::Ref<'de>>()
8382 })
8383 }),
8384
8385 source_name: source_name.map(|envelope| {
8386 ::fidl_next::FromWire::from_wire(unsafe {
8387 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
8388 })
8389 }),
8390
8391 target_path: target_path.map(|envelope| {
8392 ::fidl_next::FromWire::from_wire(unsafe {
8393 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
8394 })
8395 }),
8396
8397 dependency_type: dependency_type.map(|envelope| {
8398 ::fidl_next::FromWire::from_wire(unsafe {
8399 envelope.read_unchecked::<crate::wire::DependencyType>()
8400 })
8401 }),
8402
8403 availability: availability.map(|envelope| {
8404 ::fidl_next::FromWire::from_wire(unsafe {
8405 envelope.read_unchecked::<crate::wire::Availability>()
8406 })
8407 }),
8408
8409 source_dictionary: source_dictionary.map(|envelope| {
8410 ::fidl_next::FromWire::from_wire(unsafe {
8411 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
8412 })
8413 }),
8414
8415 numbered_handle: numbered_handle.map(|envelope| {
8416 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
8417 }),
8418 }
8419 }
8420 }
8421
8422 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseProtocol<'de>> for UseProtocol {
8423 #[inline]
8424 fn from_wire_ref(wire: &crate::wire::UseProtocol<'de>) -> Self {
8425 Self {
8426 source: wire.table.get(1).map(|envelope| {
8427 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8428 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
8429 })
8430 }),
8431
8432 source_name: wire.table.get(2).map(|envelope| {
8433 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8434 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
8435 })
8436 }),
8437
8438 target_path: wire.table.get(3).map(|envelope| {
8439 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8440 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
8441 })
8442 }),
8443
8444 dependency_type: wire.table.get(4).map(|envelope| {
8445 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8446 envelope.deref_unchecked::<crate::wire::DependencyType>()
8447 })
8448 }),
8449
8450 availability: wire.table.get(5).map(|envelope| {
8451 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8452 envelope.deref_unchecked::<crate::wire::Availability>()
8453 })
8454 }),
8455
8456 source_dictionary: wire.table.get(6).map(|envelope| {
8457 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8458 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
8459 })
8460 }),
8461
8462 numbered_handle: wire.table.get(7).map(|envelope| {
8463 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8464 envelope.deref_unchecked::<u8>()
8465 })
8466 }),
8467 }
8468 }
8469 }
8470
8471 #[doc = " Declares a directory used by a component, which was offered to it.\n"]
8472 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8473 pub struct UseDirectory {
8474 pub source: ::core::option::Option<crate::natural::Ref>,
8475
8476 pub source_name: ::core::option::Option<::std::string::String>,
8477
8478 pub target_path: ::core::option::Option<::std::string::String>,
8479
8480 pub rights: ::core::option::Option<::fidl_next_common_fuchsia_io::natural::Operations>,
8481
8482 pub subdir: ::core::option::Option<::std::string::String>,
8483
8484 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
8485
8486 pub availability: ::core::option::Option<crate::natural::Availability>,
8487
8488 pub source_dictionary: ::core::option::Option<::std::string::String>,
8489 }
8490
8491 impl UseDirectory {
8492 fn __max_ordinal(&self) -> usize {
8493 if self.source_dictionary.is_some() {
8494 return 8;
8495 }
8496
8497 if self.availability.is_some() {
8498 return 7;
8499 }
8500
8501 if self.dependency_type.is_some() {
8502 return 6;
8503 }
8504
8505 if self.subdir.is_some() {
8506 return 5;
8507 }
8508
8509 if self.rights.is_some() {
8510 return 4;
8511 }
8512
8513 if self.target_path.is_some() {
8514 return 3;
8515 }
8516
8517 if self.source_name.is_some() {
8518 return 2;
8519 }
8520
8521 if self.source.is_some() {
8522 return 1;
8523 }
8524
8525 0
8526 }
8527 }
8528
8529 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseDirectory<'static>, ___E> for UseDirectory
8530 where
8531 ___E: ::fidl_next::Encoder + ?Sized,
8532 {
8533 #[inline]
8534 fn encode(
8535 mut self,
8536 encoder: &mut ___E,
8537 out: &mut ::core::mem::MaybeUninit<crate::wire::UseDirectory<'static>>,
8538 _: (),
8539 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8540 ::fidl_next::munge!(let crate::wire::UseDirectory { table } = out);
8541
8542 let max_ord = self.__max_ordinal();
8543
8544 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8545 ::fidl_next::Wire::zero_padding(&mut out);
8546
8547 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8548 ::fidl_next::wire::Envelope,
8549 >(encoder, max_ord);
8550
8551 for i in 1..=max_ord {
8552 match i {
8553 8 => {
8554 if let Some(value) = self.source_dictionary.take() {
8555 ::fidl_next::wire::Envelope::encode_value::<
8556 ::fidl_next::wire::String<'static>,
8557 ___E,
8558 >(
8559 value, preallocated.encoder, &mut out, 1024
8560 )?;
8561 } else {
8562 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8563 }
8564 }
8565
8566 7 => {
8567 if let Some(value) = self.availability.take() {
8568 ::fidl_next::wire::Envelope::encode_value::<
8569 crate::wire::Availability,
8570 ___E,
8571 >(
8572 value, preallocated.encoder, &mut out, ()
8573 )?;
8574 } else {
8575 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8576 }
8577 }
8578
8579 6 => {
8580 if let Some(value) = self.dependency_type.take() {
8581 ::fidl_next::wire::Envelope::encode_value::<
8582 crate::wire::DependencyType,
8583 ___E,
8584 >(
8585 value, preallocated.encoder, &mut out, ()
8586 )?;
8587 } else {
8588 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8589 }
8590 }
8591
8592 5 => {
8593 if let Some(value) = self.subdir.take() {
8594 ::fidl_next::wire::Envelope::encode_value::<
8595 ::fidl_next::wire::String<'static>,
8596 ___E,
8597 >(
8598 value, preallocated.encoder, &mut out, 1024
8599 )?;
8600 } else {
8601 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8602 }
8603 }
8604
8605 4 => {
8606 if let Some(value) = self.rights.take() {
8607 ::fidl_next::wire::Envelope::encode_value::<
8608 ::fidl_next_common_fuchsia_io::wire::Operations,
8609 ___E,
8610 >(
8611 value, preallocated.encoder, &mut out, ()
8612 )?;
8613 } else {
8614 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8615 }
8616 }
8617
8618 3 => {
8619 if let Some(value) = self.target_path.take() {
8620 ::fidl_next::wire::Envelope::encode_value::<
8621 ::fidl_next::wire::String<'static>,
8622 ___E,
8623 >(
8624 value, preallocated.encoder, &mut out, 1024
8625 )?;
8626 } else {
8627 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8628 }
8629 }
8630
8631 2 => {
8632 if let Some(value) = self.source_name.take() {
8633 ::fidl_next::wire::Envelope::encode_value::<
8634 ::fidl_next::wire::String<'static>,
8635 ___E,
8636 >(
8637 value, preallocated.encoder, &mut out, 100
8638 )?;
8639 } else {
8640 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8641 }
8642 }
8643
8644 1 => {
8645 if let Some(value) = self.source.take() {
8646 ::fidl_next::wire::Envelope::encode_value::<
8647 crate::wire::Ref<'static>,
8648 ___E,
8649 >(
8650 value, preallocated.encoder, &mut out, ()
8651 )?;
8652 } else {
8653 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8654 }
8655 }
8656
8657 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8658 }
8659 unsafe {
8660 preallocated.write_next(out.assume_init_ref());
8661 }
8662 }
8663
8664 ::fidl_next::wire::Table::encode_len(table, max_ord);
8665
8666 Ok(())
8667 }
8668 }
8669
8670 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseDirectory<'static>, ___E>
8671 for &'a UseDirectory
8672 where
8673 ___E: ::fidl_next::Encoder + ?Sized,
8674 {
8675 #[inline]
8676 fn encode(
8677 self,
8678 encoder: &mut ___E,
8679 out: &mut ::core::mem::MaybeUninit<crate::wire::UseDirectory<'static>>,
8680 _: (),
8681 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8682 ::fidl_next::munge!(let crate::wire::UseDirectory { table } = out);
8683
8684 let max_ord = self.__max_ordinal();
8685
8686 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8687 ::fidl_next::Wire::zero_padding(&mut out);
8688
8689 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8690 ::fidl_next::wire::Envelope,
8691 >(encoder, max_ord);
8692
8693 for i in 1..=max_ord {
8694 match i {
8695 8 => {
8696 if let Some(value) = &self.source_dictionary {
8697 ::fidl_next::wire::Envelope::encode_value::<
8698 ::fidl_next::wire::String<'static>,
8699 ___E,
8700 >(
8701 value, preallocated.encoder, &mut out, 1024
8702 )?;
8703 } else {
8704 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8705 }
8706 }
8707
8708 7 => {
8709 if let Some(value) = &self.availability {
8710 ::fidl_next::wire::Envelope::encode_value::<
8711 crate::wire::Availability,
8712 ___E,
8713 >(
8714 value, preallocated.encoder, &mut out, ()
8715 )?;
8716 } else {
8717 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8718 }
8719 }
8720
8721 6 => {
8722 if let Some(value) = &self.dependency_type {
8723 ::fidl_next::wire::Envelope::encode_value::<
8724 crate::wire::DependencyType,
8725 ___E,
8726 >(
8727 value, preallocated.encoder, &mut out, ()
8728 )?;
8729 } else {
8730 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8731 }
8732 }
8733
8734 5 => {
8735 if let Some(value) = &self.subdir {
8736 ::fidl_next::wire::Envelope::encode_value::<
8737 ::fidl_next::wire::String<'static>,
8738 ___E,
8739 >(
8740 value, preallocated.encoder, &mut out, 1024
8741 )?;
8742 } else {
8743 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8744 }
8745 }
8746
8747 4 => {
8748 if let Some(value) = &self.rights {
8749 ::fidl_next::wire::Envelope::encode_value::<
8750 ::fidl_next_common_fuchsia_io::wire::Operations,
8751 ___E,
8752 >(
8753 value, preallocated.encoder, &mut out, ()
8754 )?;
8755 } else {
8756 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8757 }
8758 }
8759
8760 3 => {
8761 if let Some(value) = &self.target_path {
8762 ::fidl_next::wire::Envelope::encode_value::<
8763 ::fidl_next::wire::String<'static>,
8764 ___E,
8765 >(
8766 value, preallocated.encoder, &mut out, 1024
8767 )?;
8768 } else {
8769 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8770 }
8771 }
8772
8773 2 => {
8774 if let Some(value) = &self.source_name {
8775 ::fidl_next::wire::Envelope::encode_value::<
8776 ::fidl_next::wire::String<'static>,
8777 ___E,
8778 >(
8779 value, preallocated.encoder, &mut out, 100
8780 )?;
8781 } else {
8782 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8783 }
8784 }
8785
8786 1 => {
8787 if let Some(value) = &self.source {
8788 ::fidl_next::wire::Envelope::encode_value::<
8789 crate::wire::Ref<'static>,
8790 ___E,
8791 >(
8792 value, preallocated.encoder, &mut out, ()
8793 )?;
8794 } else {
8795 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8796 }
8797 }
8798
8799 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8800 }
8801 unsafe {
8802 preallocated.write_next(out.assume_init_ref());
8803 }
8804 }
8805
8806 ::fidl_next::wire::Table::encode_len(table, max_ord);
8807
8808 Ok(())
8809 }
8810 }
8811
8812 impl<'de> ::fidl_next::FromWire<crate::wire::UseDirectory<'de>> for UseDirectory {
8813 #[inline]
8814 fn from_wire(wire_: crate::wire::UseDirectory<'de>) -> Self {
8815 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8816
8817 let source = wire_.table.get(1);
8818
8819 let source_name = wire_.table.get(2);
8820
8821 let target_path = wire_.table.get(3);
8822
8823 let rights = wire_.table.get(4);
8824
8825 let subdir = wire_.table.get(5);
8826
8827 let dependency_type = wire_.table.get(6);
8828
8829 let availability = wire_.table.get(7);
8830
8831 let source_dictionary = wire_.table.get(8);
8832
8833 Self {
8834 source: source.map(|envelope| {
8835 ::fidl_next::FromWire::from_wire(unsafe {
8836 envelope.read_unchecked::<crate::wire::Ref<'de>>()
8837 })
8838 }),
8839
8840 source_name: source_name.map(|envelope| {
8841 ::fidl_next::FromWire::from_wire(unsafe {
8842 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
8843 })
8844 }),
8845
8846 target_path: target_path.map(|envelope| {
8847 ::fidl_next::FromWire::from_wire(unsafe {
8848 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
8849 })
8850 }),
8851
8852 rights: rights.map(|envelope| {
8853 ::fidl_next::FromWire::from_wire(unsafe {
8854 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
8855 })
8856 }),
8857
8858 subdir: subdir.map(|envelope| {
8859 ::fidl_next::FromWire::from_wire(unsafe {
8860 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
8861 })
8862 }),
8863
8864 dependency_type: dependency_type.map(|envelope| {
8865 ::fidl_next::FromWire::from_wire(unsafe {
8866 envelope.read_unchecked::<crate::wire::DependencyType>()
8867 })
8868 }),
8869
8870 availability: availability.map(|envelope| {
8871 ::fidl_next::FromWire::from_wire(unsafe {
8872 envelope.read_unchecked::<crate::wire::Availability>()
8873 })
8874 }),
8875
8876 source_dictionary: source_dictionary.map(|envelope| {
8877 ::fidl_next::FromWire::from_wire(unsafe {
8878 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
8879 })
8880 }),
8881 }
8882 }
8883 }
8884
8885 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseDirectory<'de>> for UseDirectory {
8886 #[inline]
8887 fn from_wire_ref(wire: &crate::wire::UseDirectory<'de>) -> Self {
8888 Self {
8889 source: wire.table.get(1).map(|envelope| {
8890 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8891 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
8892 })
8893 }),
8894
8895 source_name: wire.table.get(2).map(|envelope| {
8896 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8897 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
8898 })
8899 }),
8900
8901 target_path: wire.table.get(3).map(|envelope| {
8902 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8903 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
8904 })
8905 }),
8906
8907 rights: wire.table.get(4).map(|envelope| {
8908 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8909 envelope
8910 .deref_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
8911 })
8912 }),
8913
8914 subdir: wire.table.get(5).map(|envelope| {
8915 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8916 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
8917 })
8918 }),
8919
8920 dependency_type: wire.table.get(6).map(|envelope| {
8921 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8922 envelope.deref_unchecked::<crate::wire::DependencyType>()
8923 })
8924 }),
8925
8926 availability: wire.table.get(7).map(|envelope| {
8927 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8928 envelope.deref_unchecked::<crate::wire::Availability>()
8929 })
8930 }),
8931
8932 source_dictionary: wire.table.get(8).map(|envelope| {
8933 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8934 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
8935 })
8936 }),
8937 }
8938 }
8939 }
8940
8941 #[doc = " Declares an EventStream used by a component.\n"]
8942 #[derive(Debug, Default, Clone, PartialEq)]
8943 pub struct UseEventStream {
8944 pub source_name: ::core::option::Option<::std::string::String>,
8945
8946 pub source: ::core::option::Option<crate::natural::Ref>,
8947
8948 pub scope: ::core::option::Option<::std::vec::Vec<crate::natural::Ref>>,
8949
8950 pub target_path: ::core::option::Option<::std::string::String>,
8951
8952 pub availability: ::core::option::Option<crate::natural::Availability>,
8953
8954 pub filter: ::core::option::Option<::fidl_next_common_fuchsia_data::natural::Dictionary>,
8955 }
8956
8957 impl UseEventStream {
8958 fn __max_ordinal(&self) -> usize {
8959 if self.filter.is_some() {
8960 return 6;
8961 }
8962
8963 if self.availability.is_some() {
8964 return 5;
8965 }
8966
8967 if self.target_path.is_some() {
8968 return 4;
8969 }
8970
8971 if self.scope.is_some() {
8972 return 3;
8973 }
8974
8975 if self.source.is_some() {
8976 return 2;
8977 }
8978
8979 if self.source_name.is_some() {
8980 return 1;
8981 }
8982
8983 0
8984 }
8985 }
8986
8987 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseEventStream<'static>, ___E> for UseEventStream
8988 where
8989 ___E: ::fidl_next::Encoder + ?Sized,
8990 {
8991 #[inline]
8992 fn encode(
8993 mut self,
8994 encoder: &mut ___E,
8995 out: &mut ::core::mem::MaybeUninit<crate::wire::UseEventStream<'static>>,
8996 _: (),
8997 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8998 ::fidl_next::munge!(let crate::wire::UseEventStream { table } = out);
8999
9000 let max_ord = self.__max_ordinal();
9001
9002 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
9003 ::fidl_next::Wire::zero_padding(&mut out);
9004
9005 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
9006 ::fidl_next::wire::Envelope,
9007 >(encoder, max_ord);
9008
9009 for i in 1..=max_ord {
9010 match i {
9011 6 => {
9012 if let Some(value) = self.filter.take() {
9013 ::fidl_next::wire::Envelope::encode_value::<
9014 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
9015 ___E,
9016 >(
9017 value, preallocated.encoder, &mut out, ()
9018 )?;
9019 } else {
9020 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9021 }
9022 }
9023
9024 5 => {
9025 if let Some(value) = self.availability.take() {
9026 ::fidl_next::wire::Envelope::encode_value::<
9027 crate::wire::Availability,
9028 ___E,
9029 >(
9030 value, preallocated.encoder, &mut out, ()
9031 )?;
9032 } else {
9033 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9034 }
9035 }
9036
9037 4 => {
9038 if let Some(value) = self.target_path.take() {
9039 ::fidl_next::wire::Envelope::encode_value::<
9040 ::fidl_next::wire::String<'static>,
9041 ___E,
9042 >(
9043 value, preallocated.encoder, &mut out, 100
9044 )?;
9045 } else {
9046 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9047 }
9048 }
9049
9050 3 => {
9051 if let Some(value) = self.scope.take() {
9052 ::fidl_next::wire::Envelope::encode_value::<
9053 ::fidl_next::wire::Vector<'static, crate::wire::Ref<'static>>,
9054 ___E,
9055 >(
9056 value, preallocated.encoder, &mut out, (4294967295, ())
9057 )?;
9058 } else {
9059 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9060 }
9061 }
9062
9063 2 => {
9064 if let Some(value) = self.source.take() {
9065 ::fidl_next::wire::Envelope::encode_value::<
9066 crate::wire::Ref<'static>,
9067 ___E,
9068 >(
9069 value, preallocated.encoder, &mut out, ()
9070 )?;
9071 } else {
9072 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9073 }
9074 }
9075
9076 1 => {
9077 if let Some(value) = self.source_name.take() {
9078 ::fidl_next::wire::Envelope::encode_value::<
9079 ::fidl_next::wire::String<'static>,
9080 ___E,
9081 >(
9082 value, preallocated.encoder, &mut out, 100
9083 )?;
9084 } else {
9085 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9086 }
9087 }
9088
9089 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
9090 }
9091 unsafe {
9092 preallocated.write_next(out.assume_init_ref());
9093 }
9094 }
9095
9096 ::fidl_next::wire::Table::encode_len(table, max_ord);
9097
9098 Ok(())
9099 }
9100 }
9101
9102 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseEventStream<'static>, ___E>
9103 for &'a UseEventStream
9104 where
9105 ___E: ::fidl_next::Encoder + ?Sized,
9106 {
9107 #[inline]
9108 fn encode(
9109 self,
9110 encoder: &mut ___E,
9111 out: &mut ::core::mem::MaybeUninit<crate::wire::UseEventStream<'static>>,
9112 _: (),
9113 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9114 ::fidl_next::munge!(let crate::wire::UseEventStream { table } = out);
9115
9116 let max_ord = self.__max_ordinal();
9117
9118 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
9119 ::fidl_next::Wire::zero_padding(&mut out);
9120
9121 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
9122 ::fidl_next::wire::Envelope,
9123 >(encoder, max_ord);
9124
9125 for i in 1..=max_ord {
9126 match i {
9127 6 => {
9128 if let Some(value) = &self.filter {
9129 ::fidl_next::wire::Envelope::encode_value::<
9130 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
9131 ___E,
9132 >(
9133 value, preallocated.encoder, &mut out, ()
9134 )?;
9135 } else {
9136 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9137 }
9138 }
9139
9140 5 => {
9141 if let Some(value) = &self.availability {
9142 ::fidl_next::wire::Envelope::encode_value::<
9143 crate::wire::Availability,
9144 ___E,
9145 >(
9146 value, preallocated.encoder, &mut out, ()
9147 )?;
9148 } else {
9149 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9150 }
9151 }
9152
9153 4 => {
9154 if let Some(value) = &self.target_path {
9155 ::fidl_next::wire::Envelope::encode_value::<
9156 ::fidl_next::wire::String<'static>,
9157 ___E,
9158 >(
9159 value, preallocated.encoder, &mut out, 100
9160 )?;
9161 } else {
9162 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9163 }
9164 }
9165
9166 3 => {
9167 if let Some(value) = &self.scope {
9168 ::fidl_next::wire::Envelope::encode_value::<
9169 ::fidl_next::wire::Vector<'static, crate::wire::Ref<'static>>,
9170 ___E,
9171 >(
9172 value, preallocated.encoder, &mut out, (4294967295, ())
9173 )?;
9174 } else {
9175 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9176 }
9177 }
9178
9179 2 => {
9180 if let Some(value) = &self.source {
9181 ::fidl_next::wire::Envelope::encode_value::<
9182 crate::wire::Ref<'static>,
9183 ___E,
9184 >(
9185 value, preallocated.encoder, &mut out, ()
9186 )?;
9187 } else {
9188 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9189 }
9190 }
9191
9192 1 => {
9193 if let Some(value) = &self.source_name {
9194 ::fidl_next::wire::Envelope::encode_value::<
9195 ::fidl_next::wire::String<'static>,
9196 ___E,
9197 >(
9198 value, preallocated.encoder, &mut out, 100
9199 )?;
9200 } else {
9201 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9202 }
9203 }
9204
9205 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
9206 }
9207 unsafe {
9208 preallocated.write_next(out.assume_init_ref());
9209 }
9210 }
9211
9212 ::fidl_next::wire::Table::encode_len(table, max_ord);
9213
9214 Ok(())
9215 }
9216 }
9217
9218 impl<'de> ::fidl_next::FromWire<crate::wire::UseEventStream<'de>> for UseEventStream {
9219 #[inline]
9220 fn from_wire(wire_: crate::wire::UseEventStream<'de>) -> Self {
9221 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
9222
9223 let source_name = wire_.table.get(1);
9224
9225 let source = wire_.table.get(2);
9226
9227 let scope = wire_.table.get(3);
9228
9229 let target_path = wire_.table.get(4);
9230
9231 let availability = wire_.table.get(5);
9232
9233 let filter = wire_.table.get(6);
9234
9235 Self {
9236
9237
9238 source_name: source_name.map(|envelope| ::fidl_next::FromWire::from_wire(
9239 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
9240 )),
9241
9242
9243 source: source.map(|envelope| ::fidl_next::FromWire::from_wire(
9244 unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() }
9245 )),
9246
9247
9248 scope: scope.map(|envelope| ::fidl_next::FromWire::from_wire(
9249 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>() }
9250 )),
9251
9252
9253 target_path: target_path.map(|envelope| ::fidl_next::FromWire::from_wire(
9254 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
9255 )),
9256
9257
9258 availability: availability.map(|envelope| ::fidl_next::FromWire::from_wire(
9259 unsafe { envelope.read_unchecked::<crate::wire::Availability>() }
9260 )),
9261
9262
9263 filter: filter.map(|envelope| ::fidl_next::FromWire::from_wire(
9264 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
9265 )),
9266
9267 }
9268 }
9269 }
9270
9271 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseEventStream<'de>> for UseEventStream {
9272 #[inline]
9273 fn from_wire_ref(wire: &crate::wire::UseEventStream<'de>) -> Self {
9274 Self {
9275
9276
9277 source_name: wire.table.get(1)
9278 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9279 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
9280 )),
9281
9282
9283 source: wire.table.get(2)
9284 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9285 unsafe { envelope.deref_unchecked::<crate::wire::Ref<'de>>() }
9286 )),
9287
9288
9289 scope: wire.table.get(3)
9290 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9291 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>() }
9292 )),
9293
9294
9295 target_path: wire.table.get(4)
9296 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9297 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
9298 )),
9299
9300
9301 availability: wire.table.get(5)
9302 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9303 unsafe { envelope.deref_unchecked::<crate::wire::Availability>() }
9304 )),
9305
9306
9307 filter: wire.table.get(6)
9308 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9309 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
9310 )),
9311
9312 }
9313 }
9314 }
9315
9316 #[doc = " Declares runner used by a component.\n"]
9317 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9318 pub struct UseRunner {
9319 pub source: ::core::option::Option<crate::natural::Ref>,
9320
9321 pub source_name: ::core::option::Option<::std::string::String>,
9322
9323 pub source_dictionary: ::core::option::Option<::std::string::String>,
9324 }
9325
9326 impl UseRunner {
9327 fn __max_ordinal(&self) -> usize {
9328 if self.source_dictionary.is_some() {
9329 return 3;
9330 }
9331
9332 if self.source_name.is_some() {
9333 return 2;
9334 }
9335
9336 if self.source.is_some() {
9337 return 1;
9338 }
9339
9340 0
9341 }
9342 }
9343
9344 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseRunner<'static>, ___E> for UseRunner
9345 where
9346 ___E: ::fidl_next::Encoder + ?Sized,
9347 {
9348 #[inline]
9349 fn encode(
9350 mut self,
9351 encoder: &mut ___E,
9352 out: &mut ::core::mem::MaybeUninit<crate::wire::UseRunner<'static>>,
9353 _: (),
9354 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9355 ::fidl_next::munge!(let crate::wire::UseRunner { table } = out);
9356
9357 let max_ord = self.__max_ordinal();
9358
9359 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
9360 ::fidl_next::Wire::zero_padding(&mut out);
9361
9362 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
9363 ::fidl_next::wire::Envelope,
9364 >(encoder, max_ord);
9365
9366 for i in 1..=max_ord {
9367 match i {
9368 3 => {
9369 if let Some(value) = self.source_dictionary.take() {
9370 ::fidl_next::wire::Envelope::encode_value::<
9371 ::fidl_next::wire::String<'static>,
9372 ___E,
9373 >(
9374 value, preallocated.encoder, &mut out, 1024
9375 )?;
9376 } else {
9377 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9378 }
9379 }
9380
9381 2 => {
9382 if let Some(value) = self.source_name.take() {
9383 ::fidl_next::wire::Envelope::encode_value::<
9384 ::fidl_next::wire::String<'static>,
9385 ___E,
9386 >(
9387 value, preallocated.encoder, &mut out, 100
9388 )?;
9389 } else {
9390 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9391 }
9392 }
9393
9394 1 => {
9395 if let Some(value) = self.source.take() {
9396 ::fidl_next::wire::Envelope::encode_value::<
9397 crate::wire::Ref<'static>,
9398 ___E,
9399 >(
9400 value, preallocated.encoder, &mut out, ()
9401 )?;
9402 } else {
9403 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9404 }
9405 }
9406
9407 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
9408 }
9409 unsafe {
9410 preallocated.write_next(out.assume_init_ref());
9411 }
9412 }
9413
9414 ::fidl_next::wire::Table::encode_len(table, max_ord);
9415
9416 Ok(())
9417 }
9418 }
9419
9420 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseRunner<'static>, ___E> for &'a UseRunner
9421 where
9422 ___E: ::fidl_next::Encoder + ?Sized,
9423 {
9424 #[inline]
9425 fn encode(
9426 self,
9427 encoder: &mut ___E,
9428 out: &mut ::core::mem::MaybeUninit<crate::wire::UseRunner<'static>>,
9429 _: (),
9430 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9431 ::fidl_next::munge!(let crate::wire::UseRunner { table } = out);
9432
9433 let max_ord = self.__max_ordinal();
9434
9435 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
9436 ::fidl_next::Wire::zero_padding(&mut out);
9437
9438 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
9439 ::fidl_next::wire::Envelope,
9440 >(encoder, max_ord);
9441
9442 for i in 1..=max_ord {
9443 match i {
9444 3 => {
9445 if let Some(value) = &self.source_dictionary {
9446 ::fidl_next::wire::Envelope::encode_value::<
9447 ::fidl_next::wire::String<'static>,
9448 ___E,
9449 >(
9450 value, preallocated.encoder, &mut out, 1024
9451 )?;
9452 } else {
9453 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9454 }
9455 }
9456
9457 2 => {
9458 if let Some(value) = &self.source_name {
9459 ::fidl_next::wire::Envelope::encode_value::<
9460 ::fidl_next::wire::String<'static>,
9461 ___E,
9462 >(
9463 value, preallocated.encoder, &mut out, 100
9464 )?;
9465 } else {
9466 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9467 }
9468 }
9469
9470 1 => {
9471 if let Some(value) = &self.source {
9472 ::fidl_next::wire::Envelope::encode_value::<
9473 crate::wire::Ref<'static>,
9474 ___E,
9475 >(
9476 value, preallocated.encoder, &mut out, ()
9477 )?;
9478 } else {
9479 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9480 }
9481 }
9482
9483 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
9484 }
9485 unsafe {
9486 preallocated.write_next(out.assume_init_ref());
9487 }
9488 }
9489
9490 ::fidl_next::wire::Table::encode_len(table, max_ord);
9491
9492 Ok(())
9493 }
9494 }
9495
9496 impl<'de> ::fidl_next::FromWire<crate::wire::UseRunner<'de>> for UseRunner {
9497 #[inline]
9498 fn from_wire(wire_: crate::wire::UseRunner<'de>) -> Self {
9499 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
9500
9501 let source = wire_.table.get(1);
9502
9503 let source_name = wire_.table.get(2);
9504
9505 let source_dictionary = wire_.table.get(3);
9506
9507 Self {
9508 source: source.map(|envelope| {
9509 ::fidl_next::FromWire::from_wire(unsafe {
9510 envelope.read_unchecked::<crate::wire::Ref<'de>>()
9511 })
9512 }),
9513
9514 source_name: source_name.map(|envelope| {
9515 ::fidl_next::FromWire::from_wire(unsafe {
9516 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9517 })
9518 }),
9519
9520 source_dictionary: source_dictionary.map(|envelope| {
9521 ::fidl_next::FromWire::from_wire(unsafe {
9522 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9523 })
9524 }),
9525 }
9526 }
9527 }
9528
9529 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseRunner<'de>> for UseRunner {
9530 #[inline]
9531 fn from_wire_ref(wire: &crate::wire::UseRunner<'de>) -> Self {
9532 Self {
9533 source: wire.table.get(1).map(|envelope| {
9534 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9535 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
9536 })
9537 }),
9538
9539 source_name: wire.table.get(2).map(|envelope| {
9540 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9541 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
9542 })
9543 }),
9544
9545 source_dictionary: wire.table.get(3).map(|envelope| {
9546 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9547 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
9548 })
9549 }),
9550 }
9551 }
9552 }
9553
9554 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9555 pub struct UseConfiguration {
9556 pub source: ::core::option::Option<crate::natural::Ref>,
9557
9558 pub source_name: ::core::option::Option<::std::string::String>,
9559
9560 pub target_name: ::core::option::Option<::std::string::String>,
9561
9562 pub availability: ::core::option::Option<crate::natural::Availability>,
9563
9564 pub type_: ::core::option::Option<crate::natural::ConfigType>,
9565
9566 pub default: ::core::option::Option<crate::natural::ConfigValue>,
9567
9568 pub source_dictionary: ::core::option::Option<::std::string::String>,
9569 }
9570
9571 impl UseConfiguration {
9572 fn __max_ordinal(&self) -> usize {
9573 if self.source_dictionary.is_some() {
9574 return 7;
9575 }
9576
9577 if self.default.is_some() {
9578 return 6;
9579 }
9580
9581 if self.type_.is_some() {
9582 return 5;
9583 }
9584
9585 if self.availability.is_some() {
9586 return 4;
9587 }
9588
9589 if self.target_name.is_some() {
9590 return 3;
9591 }
9592
9593 if self.source_name.is_some() {
9594 return 2;
9595 }
9596
9597 if self.source.is_some() {
9598 return 1;
9599 }
9600
9601 0
9602 }
9603 }
9604
9605 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseConfiguration<'static>, ___E>
9606 for UseConfiguration
9607 where
9608 ___E: ::fidl_next::Encoder + ?Sized,
9609 {
9610 #[inline]
9611 fn encode(
9612 mut self,
9613 encoder: &mut ___E,
9614 out: &mut ::core::mem::MaybeUninit<crate::wire::UseConfiguration<'static>>,
9615 _: (),
9616 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9617 ::fidl_next::munge!(let crate::wire::UseConfiguration { table } = out);
9618
9619 let max_ord = self.__max_ordinal();
9620
9621 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
9622 ::fidl_next::Wire::zero_padding(&mut out);
9623
9624 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
9625 ::fidl_next::wire::Envelope,
9626 >(encoder, max_ord);
9627
9628 for i in 1..=max_ord {
9629 match i {
9630 7 => {
9631 if let Some(value) = self.source_dictionary.take() {
9632 ::fidl_next::wire::Envelope::encode_value::<
9633 ::fidl_next::wire::String<'static>,
9634 ___E,
9635 >(
9636 value, preallocated.encoder, &mut out, 1024
9637 )?;
9638 } else {
9639 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9640 }
9641 }
9642
9643 6 => {
9644 if let Some(value) = self.default.take() {
9645 ::fidl_next::wire::Envelope::encode_value::<
9646 crate::wire::ConfigValue<'static>,
9647 ___E,
9648 >(
9649 value, preallocated.encoder, &mut out, ()
9650 )?;
9651 } else {
9652 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9653 }
9654 }
9655
9656 5 => {
9657 if let Some(value) = self.type_.take() {
9658 ::fidl_next::wire::Envelope::encode_value::<
9659 crate::wire::ConfigType<'static>,
9660 ___E,
9661 >(
9662 value, preallocated.encoder, &mut out, ()
9663 )?;
9664 } else {
9665 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9666 }
9667 }
9668
9669 4 => {
9670 if let Some(value) = self.availability.take() {
9671 ::fidl_next::wire::Envelope::encode_value::<
9672 crate::wire::Availability,
9673 ___E,
9674 >(
9675 value, preallocated.encoder, &mut out, ()
9676 )?;
9677 } else {
9678 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9679 }
9680 }
9681
9682 3 => {
9683 if let Some(value) = self.target_name.take() {
9684 ::fidl_next::wire::Envelope::encode_value::<
9685 ::fidl_next::wire::String<'static>,
9686 ___E,
9687 >(
9688 value, preallocated.encoder, &mut out, 100
9689 )?;
9690 } else {
9691 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9692 }
9693 }
9694
9695 2 => {
9696 if let Some(value) = self.source_name.take() {
9697 ::fidl_next::wire::Envelope::encode_value::<
9698 ::fidl_next::wire::String<'static>,
9699 ___E,
9700 >(
9701 value, preallocated.encoder, &mut out, 100
9702 )?;
9703 } else {
9704 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9705 }
9706 }
9707
9708 1 => {
9709 if let Some(value) = self.source.take() {
9710 ::fidl_next::wire::Envelope::encode_value::<
9711 crate::wire::Ref<'static>,
9712 ___E,
9713 >(
9714 value, preallocated.encoder, &mut out, ()
9715 )?;
9716 } else {
9717 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9718 }
9719 }
9720
9721 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
9722 }
9723 unsafe {
9724 preallocated.write_next(out.assume_init_ref());
9725 }
9726 }
9727
9728 ::fidl_next::wire::Table::encode_len(table, max_ord);
9729
9730 Ok(())
9731 }
9732 }
9733
9734 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseConfiguration<'static>, ___E>
9735 for &'a UseConfiguration
9736 where
9737 ___E: ::fidl_next::Encoder + ?Sized,
9738 {
9739 #[inline]
9740 fn encode(
9741 self,
9742 encoder: &mut ___E,
9743 out: &mut ::core::mem::MaybeUninit<crate::wire::UseConfiguration<'static>>,
9744 _: (),
9745 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9746 ::fidl_next::munge!(let crate::wire::UseConfiguration { table } = out);
9747
9748 let max_ord = self.__max_ordinal();
9749
9750 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
9751 ::fidl_next::Wire::zero_padding(&mut out);
9752
9753 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
9754 ::fidl_next::wire::Envelope,
9755 >(encoder, max_ord);
9756
9757 for i in 1..=max_ord {
9758 match i {
9759 7 => {
9760 if let Some(value) = &self.source_dictionary {
9761 ::fidl_next::wire::Envelope::encode_value::<
9762 ::fidl_next::wire::String<'static>,
9763 ___E,
9764 >(
9765 value, preallocated.encoder, &mut out, 1024
9766 )?;
9767 } else {
9768 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9769 }
9770 }
9771
9772 6 => {
9773 if let Some(value) = &self.default {
9774 ::fidl_next::wire::Envelope::encode_value::<
9775 crate::wire::ConfigValue<'static>,
9776 ___E,
9777 >(
9778 value, preallocated.encoder, &mut out, ()
9779 )?;
9780 } else {
9781 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9782 }
9783 }
9784
9785 5 => {
9786 if let Some(value) = &self.type_ {
9787 ::fidl_next::wire::Envelope::encode_value::<
9788 crate::wire::ConfigType<'static>,
9789 ___E,
9790 >(
9791 value, preallocated.encoder, &mut out, ()
9792 )?;
9793 } else {
9794 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9795 }
9796 }
9797
9798 4 => {
9799 if let Some(value) = &self.availability {
9800 ::fidl_next::wire::Envelope::encode_value::<
9801 crate::wire::Availability,
9802 ___E,
9803 >(
9804 value, preallocated.encoder, &mut out, ()
9805 )?;
9806 } else {
9807 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9808 }
9809 }
9810
9811 3 => {
9812 if let Some(value) = &self.target_name {
9813 ::fidl_next::wire::Envelope::encode_value::<
9814 ::fidl_next::wire::String<'static>,
9815 ___E,
9816 >(
9817 value, preallocated.encoder, &mut out, 100
9818 )?;
9819 } else {
9820 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9821 }
9822 }
9823
9824 2 => {
9825 if let Some(value) = &self.source_name {
9826 ::fidl_next::wire::Envelope::encode_value::<
9827 ::fidl_next::wire::String<'static>,
9828 ___E,
9829 >(
9830 value, preallocated.encoder, &mut out, 100
9831 )?;
9832 } else {
9833 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9834 }
9835 }
9836
9837 1 => {
9838 if let Some(value) = &self.source {
9839 ::fidl_next::wire::Envelope::encode_value::<
9840 crate::wire::Ref<'static>,
9841 ___E,
9842 >(
9843 value, preallocated.encoder, &mut out, ()
9844 )?;
9845 } else {
9846 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9847 }
9848 }
9849
9850 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
9851 }
9852 unsafe {
9853 preallocated.write_next(out.assume_init_ref());
9854 }
9855 }
9856
9857 ::fidl_next::wire::Table::encode_len(table, max_ord);
9858
9859 Ok(())
9860 }
9861 }
9862
9863 impl<'de> ::fidl_next::FromWire<crate::wire::UseConfiguration<'de>> for UseConfiguration {
9864 #[inline]
9865 fn from_wire(wire_: crate::wire::UseConfiguration<'de>) -> Self {
9866 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
9867
9868 let source = wire_.table.get(1);
9869
9870 let source_name = wire_.table.get(2);
9871
9872 let target_name = wire_.table.get(3);
9873
9874 let availability = wire_.table.get(4);
9875
9876 let type_ = wire_.table.get(5);
9877
9878 let default = wire_.table.get(6);
9879
9880 let source_dictionary = wire_.table.get(7);
9881
9882 Self {
9883 source: source.map(|envelope| {
9884 ::fidl_next::FromWire::from_wire(unsafe {
9885 envelope.read_unchecked::<crate::wire::Ref<'de>>()
9886 })
9887 }),
9888
9889 source_name: source_name.map(|envelope| {
9890 ::fidl_next::FromWire::from_wire(unsafe {
9891 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9892 })
9893 }),
9894
9895 target_name: target_name.map(|envelope| {
9896 ::fidl_next::FromWire::from_wire(unsafe {
9897 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9898 })
9899 }),
9900
9901 availability: availability.map(|envelope| {
9902 ::fidl_next::FromWire::from_wire(unsafe {
9903 envelope.read_unchecked::<crate::wire::Availability>()
9904 })
9905 }),
9906
9907 type_: type_.map(|envelope| {
9908 ::fidl_next::FromWire::from_wire(unsafe {
9909 envelope.read_unchecked::<crate::wire::ConfigType<'de>>()
9910 })
9911 }),
9912
9913 default: default.map(|envelope| {
9914 ::fidl_next::FromWire::from_wire(unsafe {
9915 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
9916 })
9917 }),
9918
9919 source_dictionary: source_dictionary.map(|envelope| {
9920 ::fidl_next::FromWire::from_wire(unsafe {
9921 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9922 })
9923 }),
9924 }
9925 }
9926 }
9927
9928 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseConfiguration<'de>> for UseConfiguration {
9929 #[inline]
9930 fn from_wire_ref(wire: &crate::wire::UseConfiguration<'de>) -> Self {
9931 Self {
9932 source: wire.table.get(1).map(|envelope| {
9933 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9934 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
9935 })
9936 }),
9937
9938 source_name: wire.table.get(2).map(|envelope| {
9939 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9940 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
9941 })
9942 }),
9943
9944 target_name: wire.table.get(3).map(|envelope| {
9945 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9946 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
9947 })
9948 }),
9949
9950 availability: wire.table.get(4).map(|envelope| {
9951 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9952 envelope.deref_unchecked::<crate::wire::Availability>()
9953 })
9954 }),
9955
9956 type_: wire.table.get(5).map(|envelope| {
9957 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9958 envelope.deref_unchecked::<crate::wire::ConfigType<'de>>()
9959 })
9960 }),
9961
9962 default: wire.table.get(6).map(|envelope| {
9963 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9964 envelope.deref_unchecked::<crate::wire::ConfigValue<'de>>()
9965 })
9966 }),
9967
9968 source_dictionary: wire.table.get(7).map(|envelope| {
9969 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9970 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
9971 })
9972 }),
9973 }
9974 }
9975 }
9976
9977 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9978 pub struct UseDictionary {
9979 pub source: ::core::option::Option<crate::natural::Ref>,
9980
9981 pub source_name: ::core::option::Option<::std::string::String>,
9982
9983 pub target_path: ::core::option::Option<::std::string::String>,
9984
9985 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
9986
9987 pub availability: ::core::option::Option<crate::natural::Availability>,
9988
9989 pub source_dictionary: ::core::option::Option<::std::string::String>,
9990 }
9991
9992 impl UseDictionary {
9993 fn __max_ordinal(&self) -> usize {
9994 if self.source_dictionary.is_some() {
9995 return 8;
9996 }
9997
9998 if self.availability.is_some() {
9999 return 7;
10000 }
10001
10002 if self.dependency_type.is_some() {
10003 return 6;
10004 }
10005
10006 if self.target_path.is_some() {
10007 return 3;
10008 }
10009
10010 if self.source_name.is_some() {
10011 return 2;
10012 }
10013
10014 if self.source.is_some() {
10015 return 1;
10016 }
10017
10018 0
10019 }
10020 }
10021
10022 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseDictionary<'static>, ___E> for UseDictionary
10023 where
10024 ___E: ::fidl_next::Encoder + ?Sized,
10025 {
10026 #[inline]
10027 fn encode(
10028 mut self,
10029 encoder: &mut ___E,
10030 out: &mut ::core::mem::MaybeUninit<crate::wire::UseDictionary<'static>>,
10031 _: (),
10032 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10033 ::fidl_next::munge!(let crate::wire::UseDictionary { table } = out);
10034
10035 let max_ord = self.__max_ordinal();
10036
10037 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
10038 ::fidl_next::Wire::zero_padding(&mut out);
10039
10040 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
10041 ::fidl_next::wire::Envelope,
10042 >(encoder, max_ord);
10043
10044 for i in 1..=max_ord {
10045 match i {
10046 8 => {
10047 if let Some(value) = self.source_dictionary.take() {
10048 ::fidl_next::wire::Envelope::encode_value::<
10049 ::fidl_next::wire::String<'static>,
10050 ___E,
10051 >(
10052 value, preallocated.encoder, &mut out, 1024
10053 )?;
10054 } else {
10055 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10056 }
10057 }
10058
10059 7 => {
10060 if let Some(value) = self.availability.take() {
10061 ::fidl_next::wire::Envelope::encode_value::<
10062 crate::wire::Availability,
10063 ___E,
10064 >(
10065 value, preallocated.encoder, &mut out, ()
10066 )?;
10067 } else {
10068 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10069 }
10070 }
10071
10072 6 => {
10073 if let Some(value) = self.dependency_type.take() {
10074 ::fidl_next::wire::Envelope::encode_value::<
10075 crate::wire::DependencyType,
10076 ___E,
10077 >(
10078 value, preallocated.encoder, &mut out, ()
10079 )?;
10080 } else {
10081 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10082 }
10083 }
10084
10085 3 => {
10086 if let Some(value) = self.target_path.take() {
10087 ::fidl_next::wire::Envelope::encode_value::<
10088 ::fidl_next::wire::String<'static>,
10089 ___E,
10090 >(
10091 value, preallocated.encoder, &mut out, 1024
10092 )?;
10093 } else {
10094 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10095 }
10096 }
10097
10098 2 => {
10099 if let Some(value) = self.source_name.take() {
10100 ::fidl_next::wire::Envelope::encode_value::<
10101 ::fidl_next::wire::String<'static>,
10102 ___E,
10103 >(
10104 value, preallocated.encoder, &mut out, 100
10105 )?;
10106 } else {
10107 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10108 }
10109 }
10110
10111 1 => {
10112 if let Some(value) = self.source.take() {
10113 ::fidl_next::wire::Envelope::encode_value::<
10114 crate::wire::Ref<'static>,
10115 ___E,
10116 >(
10117 value, preallocated.encoder, &mut out, ()
10118 )?;
10119 } else {
10120 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10121 }
10122 }
10123
10124 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
10125 }
10126 unsafe {
10127 preallocated.write_next(out.assume_init_ref());
10128 }
10129 }
10130
10131 ::fidl_next::wire::Table::encode_len(table, max_ord);
10132
10133 Ok(())
10134 }
10135 }
10136
10137 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseDictionary<'static>, ___E>
10138 for &'a UseDictionary
10139 where
10140 ___E: ::fidl_next::Encoder + ?Sized,
10141 {
10142 #[inline]
10143 fn encode(
10144 self,
10145 encoder: &mut ___E,
10146 out: &mut ::core::mem::MaybeUninit<crate::wire::UseDictionary<'static>>,
10147 _: (),
10148 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10149 ::fidl_next::munge!(let crate::wire::UseDictionary { table } = out);
10150
10151 let max_ord = self.__max_ordinal();
10152
10153 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
10154 ::fidl_next::Wire::zero_padding(&mut out);
10155
10156 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
10157 ::fidl_next::wire::Envelope,
10158 >(encoder, max_ord);
10159
10160 for i in 1..=max_ord {
10161 match i {
10162 8 => {
10163 if let Some(value) = &self.source_dictionary {
10164 ::fidl_next::wire::Envelope::encode_value::<
10165 ::fidl_next::wire::String<'static>,
10166 ___E,
10167 >(
10168 value, preallocated.encoder, &mut out, 1024
10169 )?;
10170 } else {
10171 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10172 }
10173 }
10174
10175 7 => {
10176 if let Some(value) = &self.availability {
10177 ::fidl_next::wire::Envelope::encode_value::<
10178 crate::wire::Availability,
10179 ___E,
10180 >(
10181 value, preallocated.encoder, &mut out, ()
10182 )?;
10183 } else {
10184 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10185 }
10186 }
10187
10188 6 => {
10189 if let Some(value) = &self.dependency_type {
10190 ::fidl_next::wire::Envelope::encode_value::<
10191 crate::wire::DependencyType,
10192 ___E,
10193 >(
10194 value, preallocated.encoder, &mut out, ()
10195 )?;
10196 } else {
10197 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10198 }
10199 }
10200
10201 3 => {
10202 if let Some(value) = &self.target_path {
10203 ::fidl_next::wire::Envelope::encode_value::<
10204 ::fidl_next::wire::String<'static>,
10205 ___E,
10206 >(
10207 value, preallocated.encoder, &mut out, 1024
10208 )?;
10209 } else {
10210 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10211 }
10212 }
10213
10214 2 => {
10215 if let Some(value) = &self.source_name {
10216 ::fidl_next::wire::Envelope::encode_value::<
10217 ::fidl_next::wire::String<'static>,
10218 ___E,
10219 >(
10220 value, preallocated.encoder, &mut out, 100
10221 )?;
10222 } else {
10223 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10224 }
10225 }
10226
10227 1 => {
10228 if let Some(value) = &self.source {
10229 ::fidl_next::wire::Envelope::encode_value::<
10230 crate::wire::Ref<'static>,
10231 ___E,
10232 >(
10233 value, preallocated.encoder, &mut out, ()
10234 )?;
10235 } else {
10236 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10237 }
10238 }
10239
10240 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
10241 }
10242 unsafe {
10243 preallocated.write_next(out.assume_init_ref());
10244 }
10245 }
10246
10247 ::fidl_next::wire::Table::encode_len(table, max_ord);
10248
10249 Ok(())
10250 }
10251 }
10252
10253 impl<'de> ::fidl_next::FromWire<crate::wire::UseDictionary<'de>> for UseDictionary {
10254 #[inline]
10255 fn from_wire(wire_: crate::wire::UseDictionary<'de>) -> Self {
10256 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
10257
10258 let source = wire_.table.get(1);
10259
10260 let source_name = wire_.table.get(2);
10261
10262 let target_path = wire_.table.get(3);
10263
10264 let dependency_type = wire_.table.get(6);
10265
10266 let availability = wire_.table.get(7);
10267
10268 let source_dictionary = wire_.table.get(8);
10269
10270 Self {
10271 source: source.map(|envelope| {
10272 ::fidl_next::FromWire::from_wire(unsafe {
10273 envelope.read_unchecked::<crate::wire::Ref<'de>>()
10274 })
10275 }),
10276
10277 source_name: source_name.map(|envelope| {
10278 ::fidl_next::FromWire::from_wire(unsafe {
10279 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
10280 })
10281 }),
10282
10283 target_path: target_path.map(|envelope| {
10284 ::fidl_next::FromWire::from_wire(unsafe {
10285 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
10286 })
10287 }),
10288
10289 dependency_type: dependency_type.map(|envelope| {
10290 ::fidl_next::FromWire::from_wire(unsafe {
10291 envelope.read_unchecked::<crate::wire::DependencyType>()
10292 })
10293 }),
10294
10295 availability: availability.map(|envelope| {
10296 ::fidl_next::FromWire::from_wire(unsafe {
10297 envelope.read_unchecked::<crate::wire::Availability>()
10298 })
10299 }),
10300
10301 source_dictionary: source_dictionary.map(|envelope| {
10302 ::fidl_next::FromWire::from_wire(unsafe {
10303 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
10304 })
10305 }),
10306 }
10307 }
10308 }
10309
10310 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseDictionary<'de>> for UseDictionary {
10311 #[inline]
10312 fn from_wire_ref(wire: &crate::wire::UseDictionary<'de>) -> Self {
10313 Self {
10314 source: wire.table.get(1).map(|envelope| {
10315 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10316 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
10317 })
10318 }),
10319
10320 source_name: wire.table.get(2).map(|envelope| {
10321 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10322 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
10323 })
10324 }),
10325
10326 target_path: wire.table.get(3).map(|envelope| {
10327 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10328 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
10329 })
10330 }),
10331
10332 dependency_type: wire.table.get(6).map(|envelope| {
10333 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10334 envelope.deref_unchecked::<crate::wire::DependencyType>()
10335 })
10336 }),
10337
10338 availability: wire.table.get(7).map(|envelope| {
10339 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10340 envelope.deref_unchecked::<crate::wire::Availability>()
10341 })
10342 }),
10343
10344 source_dictionary: wire.table.get(8).map(|envelope| {
10345 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10346 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
10347 })
10348 }),
10349 }
10350 }
10351 }
10352
10353 #[doc = " Declares a capability used by a component, which was offered to it.\n"]
10354 #[derive(Debug, Clone, PartialEq)]
10355 pub enum Use {
10356 Service(crate::natural::UseService),
10357
10358 Protocol(crate::natural::UseProtocol),
10359
10360 Directory(crate::natural::UseDirectory),
10361
10362 Storage(crate::natural::UseStorage),
10363
10364 EventStream(crate::natural::UseEventStream),
10365
10366 Runner(crate::natural::UseRunner),
10367
10368 Config(crate::natural::UseConfiguration),
10369
10370 Dictionary(crate::natural::UseDictionary),
10371
10372 UnknownOrdinal_(u64),
10373 }
10374
10375 impl Use {
10376 pub fn is_unknown(&self) -> bool {
10377 #[allow(unreachable_patterns)]
10378 match self {
10379 Self::UnknownOrdinal_(_) => true,
10380 _ => false,
10381 }
10382 }
10383 }
10384
10385 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Use<'static>, ___E> for Use
10386 where
10387 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10388 ___E: ::fidl_next::Encoder,
10389 {
10390 #[inline]
10391 fn encode(
10392 self,
10393 encoder: &mut ___E,
10394 out: &mut ::core::mem::MaybeUninit<crate::wire::Use<'static>>,
10395 _: (),
10396 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10397 ::fidl_next::munge!(let crate::wire::Use { raw, _phantom: _ } = out);
10398
10399 match self {
10400 Self::Service(value) => ::fidl_next::wire::Union::encode_as::<
10401 ___E,
10402 crate::wire::UseService<'static>,
10403 >(value, 1, encoder, raw, ())?,
10404
10405 Self::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
10406 ___E,
10407 crate::wire::UseProtocol<'static>,
10408 >(value, 2, encoder, raw, ())?,
10409
10410 Self::Directory(value) => ::fidl_next::wire::Union::encode_as::<
10411 ___E,
10412 crate::wire::UseDirectory<'static>,
10413 >(value, 3, encoder, raw, ())?,
10414
10415 Self::Storage(value) => ::fidl_next::wire::Union::encode_as::<
10416 ___E,
10417 crate::wire::UseStorage<'static>,
10418 >(value, 4, encoder, raw, ())?,
10419
10420 Self::EventStream(value) => ::fidl_next::wire::Union::encode_as::<
10421 ___E,
10422 crate::wire::UseEventStream<'static>,
10423 >(value, 7, encoder, raw, ())?,
10424
10425 Self::Runner(value) => ::fidl_next::wire::Union::encode_as::<
10426 ___E,
10427 crate::wire::UseRunner<'static>,
10428 >(value, 8, encoder, raw, ())?,
10429
10430 Self::Config(value) => ::fidl_next::wire::Union::encode_as::<
10431 ___E,
10432 crate::wire::UseConfiguration<'static>,
10433 >(value, 9, encoder, raw, ())?,
10434
10435 Self::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
10436 ___E,
10437 crate::wire::UseDictionary<'static>,
10438 >(value, 10, encoder, raw, ())?,
10439
10440 Self::UnknownOrdinal_(ordinal) => {
10441 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
10442 }
10443 }
10444
10445 Ok(())
10446 }
10447 }
10448
10449 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Use<'static>, ___E> for &'a Use
10450 where
10451 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10452 ___E: ::fidl_next::Encoder,
10453 {
10454 #[inline]
10455 fn encode(
10456 self,
10457 encoder: &mut ___E,
10458 out: &mut ::core::mem::MaybeUninit<crate::wire::Use<'static>>,
10459 _: (),
10460 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10461 ::fidl_next::munge!(let crate::wire::Use { raw, _phantom: _ } = out);
10462
10463 match self {
10464 Use::Service(value) => ::fidl_next::wire::Union::encode_as::<
10465 ___E,
10466 crate::wire::UseService<'static>,
10467 >(value, 1, encoder, raw, ())?,
10468
10469 Use::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
10470 ___E,
10471 crate::wire::UseProtocol<'static>,
10472 >(value, 2, encoder, raw, ())?,
10473
10474 Use::Directory(value) => ::fidl_next::wire::Union::encode_as::<
10475 ___E,
10476 crate::wire::UseDirectory<'static>,
10477 >(value, 3, encoder, raw, ())?,
10478
10479 Use::Storage(value) => ::fidl_next::wire::Union::encode_as::<
10480 ___E,
10481 crate::wire::UseStorage<'static>,
10482 >(value, 4, encoder, raw, ())?,
10483
10484 Use::EventStream(value) => ::fidl_next::wire::Union::encode_as::<
10485 ___E,
10486 crate::wire::UseEventStream<'static>,
10487 >(value, 7, encoder, raw, ())?,
10488
10489 Use::Runner(value) => ::fidl_next::wire::Union::encode_as::<
10490 ___E,
10491 crate::wire::UseRunner<'static>,
10492 >(value, 8, encoder, raw, ())?,
10493
10494 Use::Config(value) => ::fidl_next::wire::Union::encode_as::<
10495 ___E,
10496 crate::wire::UseConfiguration<'static>,
10497 >(value, 9, encoder, raw, ())?,
10498
10499 Use::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
10500 ___E,
10501 crate::wire::UseDictionary<'static>,
10502 >(value, 10, encoder, raw, ())?,
10503
10504 Use::UnknownOrdinal_(ordinal) => {
10505 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
10506 }
10507 }
10508
10509 Ok(())
10510 }
10511 }
10512
10513 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Use<'static>, ___E> for Use
10514 where
10515 ___E: ?Sized,
10516 Use: ::fidl_next::Encode<crate::wire::Use<'static>, ___E>,
10517 {
10518 #[inline]
10519 fn encode_option(
10520 this: ::core::option::Option<Self>,
10521 encoder: &mut ___E,
10522 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Use<'static>>,
10523 _: (),
10524 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10525 ::fidl_next::munge!(let crate::wire_optional::Use { raw, _phantom: _ } = &mut *out);
10526
10527 if let Some(inner) = this {
10528 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
10529 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
10530 } else {
10531 ::fidl_next::wire::Union::encode_absent(raw);
10532 }
10533
10534 Ok(())
10535 }
10536 }
10537
10538 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Use<'static>, ___E>
10539 for &'a Use
10540 where
10541 ___E: ?Sized,
10542 &'a Use: ::fidl_next::Encode<crate::wire::Use<'static>, ___E>,
10543 {
10544 #[inline]
10545 fn encode_option(
10546 this: ::core::option::Option<Self>,
10547 encoder: &mut ___E,
10548 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Use<'static>>,
10549 _: (),
10550 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10551 ::fidl_next::munge!(let crate::wire_optional::Use { raw, _phantom: _ } = &mut *out);
10552
10553 if let Some(inner) = this {
10554 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
10555 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
10556 } else {
10557 ::fidl_next::wire::Union::encode_absent(raw);
10558 }
10559
10560 Ok(())
10561 }
10562 }
10563
10564 impl<'de> ::fidl_next::FromWire<crate::wire::Use<'de>> for Use {
10565 #[inline]
10566 fn from_wire(wire: crate::wire::Use<'de>) -> Self {
10567 let wire = ::core::mem::ManuallyDrop::new(wire);
10568 match wire.raw.ordinal() {
10569 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
10570 wire.raw.get().read_unchecked::<crate::wire::UseService<'de>>()
10571 })),
10572
10573 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
10574 wire.raw.get().read_unchecked::<crate::wire::UseProtocol<'de>>()
10575 })),
10576
10577 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
10578 wire.raw.get().read_unchecked::<crate::wire::UseDirectory<'de>>()
10579 })),
10580
10581 4 => Self::Storage(::fidl_next::FromWire::from_wire(unsafe {
10582 wire.raw.get().read_unchecked::<crate::wire::UseStorage<'de>>()
10583 })),
10584
10585 7 => Self::EventStream(::fidl_next::FromWire::from_wire(unsafe {
10586 wire.raw.get().read_unchecked::<crate::wire::UseEventStream<'de>>()
10587 })),
10588
10589 8 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
10590 wire.raw.get().read_unchecked::<crate::wire::UseRunner<'de>>()
10591 })),
10592
10593 9 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
10594 wire.raw.get().read_unchecked::<crate::wire::UseConfiguration<'de>>()
10595 })),
10596
10597 10 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
10598 wire.raw.get().read_unchecked::<crate::wire::UseDictionary<'de>>()
10599 })),
10600
10601 ord => return Self::UnknownOrdinal_(ord as u64),
10602 }
10603 }
10604 }
10605
10606 impl<'de> ::fidl_next::FromWireRef<crate::wire::Use<'de>> for Use {
10607 #[inline]
10608 fn from_wire_ref(wire: &crate::wire::Use<'de>) -> Self {
10609 match wire.raw.ordinal() {
10610 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
10611 wire.raw.get().deref_unchecked::<crate::wire::UseService<'de>>()
10612 })),
10613
10614 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
10615 wire.raw.get().deref_unchecked::<crate::wire::UseProtocol<'de>>()
10616 })),
10617
10618 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
10619 wire.raw.get().deref_unchecked::<crate::wire::UseDirectory<'de>>()
10620 })),
10621
10622 4 => Self::Storage(::fidl_next::FromWireRef::from_wire_ref(unsafe {
10623 wire.raw.get().deref_unchecked::<crate::wire::UseStorage<'de>>()
10624 })),
10625
10626 7 => Self::EventStream(::fidl_next::FromWireRef::from_wire_ref(unsafe {
10627 wire.raw.get().deref_unchecked::<crate::wire::UseEventStream<'de>>()
10628 })),
10629
10630 8 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
10631 wire.raw.get().deref_unchecked::<crate::wire::UseRunner<'de>>()
10632 })),
10633
10634 9 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
10635 wire.raw.get().deref_unchecked::<crate::wire::UseConfiguration<'de>>()
10636 })),
10637
10638 10 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
10639 wire.raw.get().deref_unchecked::<crate::wire::UseDictionary<'de>>()
10640 })),
10641
10642 ord => return Self::UnknownOrdinal_(ord as u64),
10643 }
10644 }
10645 }
10646
10647 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Use<'de>> for Use {
10648 #[inline]
10649 fn from_wire_option(wire: crate::wire_optional::Use<'de>) -> ::core::option::Option<Self> {
10650 if let Some(inner) = wire.into_option() {
10651 Some(::fidl_next::FromWire::from_wire(inner))
10652 } else {
10653 None
10654 }
10655 }
10656 }
10657
10658 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Use<'de>> for Box<Use> {
10659 #[inline]
10660 fn from_wire_option(wire: crate::wire_optional::Use<'de>) -> ::core::option::Option<Self> {
10661 <Use as ::fidl_next::FromWireOption<crate::wire_optional::Use<'de>>>::from_wire_option(
10662 wire,
10663 )
10664 .map(Box::new)
10665 }
10666 }
10667
10668 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::Use<'de>> for Box<Use> {
10669 #[inline]
10670 fn from_wire_option_ref(
10671 wire: &crate::wire_optional::Use<'de>,
10672 ) -> ::core::option::Option<Self> {
10673 if let Some(inner) = wire.as_ref() {
10674 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
10675 } else {
10676 None
10677 }
10678 }
10679 }
10680
10681 #[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"]
10682 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
10683 pub struct ExposeService {
10684 pub source: ::core::option::Option<crate::natural::Ref>,
10685
10686 pub source_name: ::core::option::Option<::std::string::String>,
10687
10688 pub target: ::core::option::Option<crate::natural::Ref>,
10689
10690 pub target_name: ::core::option::Option<::std::string::String>,
10691
10692 pub availability: ::core::option::Option<crate::natural::Availability>,
10693
10694 pub source_dictionary: ::core::option::Option<::std::string::String>,
10695 }
10696
10697 impl ExposeService {
10698 fn __max_ordinal(&self) -> usize {
10699 if self.source_dictionary.is_some() {
10700 return 6;
10701 }
10702
10703 if self.availability.is_some() {
10704 return 5;
10705 }
10706
10707 if self.target_name.is_some() {
10708 return 4;
10709 }
10710
10711 if self.target.is_some() {
10712 return 3;
10713 }
10714
10715 if self.source_name.is_some() {
10716 return 2;
10717 }
10718
10719 if self.source.is_some() {
10720 return 1;
10721 }
10722
10723 0
10724 }
10725 }
10726
10727 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeService<'static>, ___E> for ExposeService
10728 where
10729 ___E: ::fidl_next::Encoder + ?Sized,
10730 {
10731 #[inline]
10732 fn encode(
10733 mut self,
10734 encoder: &mut ___E,
10735 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeService<'static>>,
10736 _: (),
10737 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10738 ::fidl_next::munge!(let crate::wire::ExposeService { table } = out);
10739
10740 let max_ord = self.__max_ordinal();
10741
10742 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
10743 ::fidl_next::Wire::zero_padding(&mut out);
10744
10745 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
10746 ::fidl_next::wire::Envelope,
10747 >(encoder, max_ord);
10748
10749 for i in 1..=max_ord {
10750 match i {
10751 6 => {
10752 if let Some(value) = self.source_dictionary.take() {
10753 ::fidl_next::wire::Envelope::encode_value::<
10754 ::fidl_next::wire::String<'static>,
10755 ___E,
10756 >(
10757 value, preallocated.encoder, &mut out, 1024
10758 )?;
10759 } else {
10760 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10761 }
10762 }
10763
10764 5 => {
10765 if let Some(value) = self.availability.take() {
10766 ::fidl_next::wire::Envelope::encode_value::<
10767 crate::wire::Availability,
10768 ___E,
10769 >(
10770 value, preallocated.encoder, &mut out, ()
10771 )?;
10772 } else {
10773 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10774 }
10775 }
10776
10777 4 => {
10778 if let Some(value) = self.target_name.take() {
10779 ::fidl_next::wire::Envelope::encode_value::<
10780 ::fidl_next::wire::String<'static>,
10781 ___E,
10782 >(
10783 value, preallocated.encoder, &mut out, 100
10784 )?;
10785 } else {
10786 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10787 }
10788 }
10789
10790 3 => {
10791 if let Some(value) = self.target.take() {
10792 ::fidl_next::wire::Envelope::encode_value::<
10793 crate::wire::Ref<'static>,
10794 ___E,
10795 >(
10796 value, preallocated.encoder, &mut out, ()
10797 )?;
10798 } else {
10799 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10800 }
10801 }
10802
10803 2 => {
10804 if let Some(value) = self.source_name.take() {
10805 ::fidl_next::wire::Envelope::encode_value::<
10806 ::fidl_next::wire::String<'static>,
10807 ___E,
10808 >(
10809 value, preallocated.encoder, &mut out, 100
10810 )?;
10811 } else {
10812 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10813 }
10814 }
10815
10816 1 => {
10817 if let Some(value) = self.source.take() {
10818 ::fidl_next::wire::Envelope::encode_value::<
10819 crate::wire::Ref<'static>,
10820 ___E,
10821 >(
10822 value, preallocated.encoder, &mut out, ()
10823 )?;
10824 } else {
10825 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10826 }
10827 }
10828
10829 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
10830 }
10831 unsafe {
10832 preallocated.write_next(out.assume_init_ref());
10833 }
10834 }
10835
10836 ::fidl_next::wire::Table::encode_len(table, max_ord);
10837
10838 Ok(())
10839 }
10840 }
10841
10842 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeService<'static>, ___E>
10843 for &'a ExposeService
10844 where
10845 ___E: ::fidl_next::Encoder + ?Sized,
10846 {
10847 #[inline]
10848 fn encode(
10849 self,
10850 encoder: &mut ___E,
10851 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeService<'static>>,
10852 _: (),
10853 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10854 ::fidl_next::munge!(let crate::wire::ExposeService { table } = out);
10855
10856 let max_ord = self.__max_ordinal();
10857
10858 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
10859 ::fidl_next::Wire::zero_padding(&mut out);
10860
10861 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
10862 ::fidl_next::wire::Envelope,
10863 >(encoder, max_ord);
10864
10865 for i in 1..=max_ord {
10866 match i {
10867 6 => {
10868 if let Some(value) = &self.source_dictionary {
10869 ::fidl_next::wire::Envelope::encode_value::<
10870 ::fidl_next::wire::String<'static>,
10871 ___E,
10872 >(
10873 value, preallocated.encoder, &mut out, 1024
10874 )?;
10875 } else {
10876 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10877 }
10878 }
10879
10880 5 => {
10881 if let Some(value) = &self.availability {
10882 ::fidl_next::wire::Envelope::encode_value::<
10883 crate::wire::Availability,
10884 ___E,
10885 >(
10886 value, preallocated.encoder, &mut out, ()
10887 )?;
10888 } else {
10889 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10890 }
10891 }
10892
10893 4 => {
10894 if let Some(value) = &self.target_name {
10895 ::fidl_next::wire::Envelope::encode_value::<
10896 ::fidl_next::wire::String<'static>,
10897 ___E,
10898 >(
10899 value, preallocated.encoder, &mut out, 100
10900 )?;
10901 } else {
10902 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10903 }
10904 }
10905
10906 3 => {
10907 if let Some(value) = &self.target {
10908 ::fidl_next::wire::Envelope::encode_value::<
10909 crate::wire::Ref<'static>,
10910 ___E,
10911 >(
10912 value, preallocated.encoder, &mut out, ()
10913 )?;
10914 } else {
10915 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10916 }
10917 }
10918
10919 2 => {
10920 if let Some(value) = &self.source_name {
10921 ::fidl_next::wire::Envelope::encode_value::<
10922 ::fidl_next::wire::String<'static>,
10923 ___E,
10924 >(
10925 value, preallocated.encoder, &mut out, 100
10926 )?;
10927 } else {
10928 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10929 }
10930 }
10931
10932 1 => {
10933 if let Some(value) = &self.source {
10934 ::fidl_next::wire::Envelope::encode_value::<
10935 crate::wire::Ref<'static>,
10936 ___E,
10937 >(
10938 value, preallocated.encoder, &mut out, ()
10939 )?;
10940 } else {
10941 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10942 }
10943 }
10944
10945 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
10946 }
10947 unsafe {
10948 preallocated.write_next(out.assume_init_ref());
10949 }
10950 }
10951
10952 ::fidl_next::wire::Table::encode_len(table, max_ord);
10953
10954 Ok(())
10955 }
10956 }
10957
10958 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeService<'de>> for ExposeService {
10959 #[inline]
10960 fn from_wire(wire_: crate::wire::ExposeService<'de>) -> Self {
10961 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
10962
10963 let source = wire_.table.get(1);
10964
10965 let source_name = wire_.table.get(2);
10966
10967 let target = wire_.table.get(3);
10968
10969 let target_name = wire_.table.get(4);
10970
10971 let availability = wire_.table.get(5);
10972
10973 let source_dictionary = wire_.table.get(6);
10974
10975 Self {
10976 source: source.map(|envelope| {
10977 ::fidl_next::FromWire::from_wire(unsafe {
10978 envelope.read_unchecked::<crate::wire::Ref<'de>>()
10979 })
10980 }),
10981
10982 source_name: source_name.map(|envelope| {
10983 ::fidl_next::FromWire::from_wire(unsafe {
10984 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
10985 })
10986 }),
10987
10988 target: target.map(|envelope| {
10989 ::fidl_next::FromWire::from_wire(unsafe {
10990 envelope.read_unchecked::<crate::wire::Ref<'de>>()
10991 })
10992 }),
10993
10994 target_name: target_name.map(|envelope| {
10995 ::fidl_next::FromWire::from_wire(unsafe {
10996 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
10997 })
10998 }),
10999
11000 availability: availability.map(|envelope| {
11001 ::fidl_next::FromWire::from_wire(unsafe {
11002 envelope.read_unchecked::<crate::wire::Availability>()
11003 })
11004 }),
11005
11006 source_dictionary: source_dictionary.map(|envelope| {
11007 ::fidl_next::FromWire::from_wire(unsafe {
11008 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11009 })
11010 }),
11011 }
11012 }
11013 }
11014
11015 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeService<'de>> for ExposeService {
11016 #[inline]
11017 fn from_wire_ref(wire: &crate::wire::ExposeService<'de>) -> Self {
11018 Self {
11019 source: wire.table.get(1).map(|envelope| {
11020 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11021 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
11022 })
11023 }),
11024
11025 source_name: wire.table.get(2).map(|envelope| {
11026 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11027 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11028 })
11029 }),
11030
11031 target: wire.table.get(3).map(|envelope| {
11032 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11033 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
11034 })
11035 }),
11036
11037 target_name: wire.table.get(4).map(|envelope| {
11038 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11039 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11040 })
11041 }),
11042
11043 availability: wire.table.get(5).map(|envelope| {
11044 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11045 envelope.deref_unchecked::<crate::wire::Availability>()
11046 })
11047 }),
11048
11049 source_dictionary: wire.table.get(6).map(|envelope| {
11050 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11051 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11052 })
11053 }),
11054 }
11055 }
11056 }
11057
11058 #[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"]
11059 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
11060 pub struct ExposeProtocol {
11061 pub source: ::core::option::Option<crate::natural::Ref>,
11062
11063 pub source_name: ::core::option::Option<::std::string::String>,
11064
11065 pub target: ::core::option::Option<crate::natural::Ref>,
11066
11067 pub target_name: ::core::option::Option<::std::string::String>,
11068
11069 pub availability: ::core::option::Option<crate::natural::Availability>,
11070
11071 pub source_dictionary: ::core::option::Option<::std::string::String>,
11072 }
11073
11074 impl ExposeProtocol {
11075 fn __max_ordinal(&self) -> usize {
11076 if self.source_dictionary.is_some() {
11077 return 6;
11078 }
11079
11080 if self.availability.is_some() {
11081 return 5;
11082 }
11083
11084 if self.target_name.is_some() {
11085 return 4;
11086 }
11087
11088 if self.target.is_some() {
11089 return 3;
11090 }
11091
11092 if self.source_name.is_some() {
11093 return 2;
11094 }
11095
11096 if self.source.is_some() {
11097 return 1;
11098 }
11099
11100 0
11101 }
11102 }
11103
11104 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeProtocol<'static>, ___E> for ExposeProtocol
11105 where
11106 ___E: ::fidl_next::Encoder + ?Sized,
11107 {
11108 #[inline]
11109 fn encode(
11110 mut self,
11111 encoder: &mut ___E,
11112 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeProtocol<'static>>,
11113 _: (),
11114 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11115 ::fidl_next::munge!(let crate::wire::ExposeProtocol { table } = out);
11116
11117 let max_ord = self.__max_ordinal();
11118
11119 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
11120 ::fidl_next::Wire::zero_padding(&mut out);
11121
11122 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
11123 ::fidl_next::wire::Envelope,
11124 >(encoder, max_ord);
11125
11126 for i in 1..=max_ord {
11127 match i {
11128 6 => {
11129 if let Some(value) = self.source_dictionary.take() {
11130 ::fidl_next::wire::Envelope::encode_value::<
11131 ::fidl_next::wire::String<'static>,
11132 ___E,
11133 >(
11134 value, preallocated.encoder, &mut out, 1024
11135 )?;
11136 } else {
11137 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11138 }
11139 }
11140
11141 5 => {
11142 if let Some(value) = self.availability.take() {
11143 ::fidl_next::wire::Envelope::encode_value::<
11144 crate::wire::Availability,
11145 ___E,
11146 >(
11147 value, preallocated.encoder, &mut out, ()
11148 )?;
11149 } else {
11150 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11151 }
11152 }
11153
11154 4 => {
11155 if let Some(value) = self.target_name.take() {
11156 ::fidl_next::wire::Envelope::encode_value::<
11157 ::fidl_next::wire::String<'static>,
11158 ___E,
11159 >(
11160 value, preallocated.encoder, &mut out, 100
11161 )?;
11162 } else {
11163 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11164 }
11165 }
11166
11167 3 => {
11168 if let Some(value) = self.target.take() {
11169 ::fidl_next::wire::Envelope::encode_value::<
11170 crate::wire::Ref<'static>,
11171 ___E,
11172 >(
11173 value, preallocated.encoder, &mut out, ()
11174 )?;
11175 } else {
11176 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11177 }
11178 }
11179
11180 2 => {
11181 if let Some(value) = self.source_name.take() {
11182 ::fidl_next::wire::Envelope::encode_value::<
11183 ::fidl_next::wire::String<'static>,
11184 ___E,
11185 >(
11186 value, preallocated.encoder, &mut out, 100
11187 )?;
11188 } else {
11189 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11190 }
11191 }
11192
11193 1 => {
11194 if let Some(value) = self.source.take() {
11195 ::fidl_next::wire::Envelope::encode_value::<
11196 crate::wire::Ref<'static>,
11197 ___E,
11198 >(
11199 value, preallocated.encoder, &mut out, ()
11200 )?;
11201 } else {
11202 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11203 }
11204 }
11205
11206 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
11207 }
11208 unsafe {
11209 preallocated.write_next(out.assume_init_ref());
11210 }
11211 }
11212
11213 ::fidl_next::wire::Table::encode_len(table, max_ord);
11214
11215 Ok(())
11216 }
11217 }
11218
11219 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeProtocol<'static>, ___E>
11220 for &'a ExposeProtocol
11221 where
11222 ___E: ::fidl_next::Encoder + ?Sized,
11223 {
11224 #[inline]
11225 fn encode(
11226 self,
11227 encoder: &mut ___E,
11228 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeProtocol<'static>>,
11229 _: (),
11230 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11231 ::fidl_next::munge!(let crate::wire::ExposeProtocol { table } = out);
11232
11233 let max_ord = self.__max_ordinal();
11234
11235 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
11236 ::fidl_next::Wire::zero_padding(&mut out);
11237
11238 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
11239 ::fidl_next::wire::Envelope,
11240 >(encoder, max_ord);
11241
11242 for i in 1..=max_ord {
11243 match i {
11244 6 => {
11245 if let Some(value) = &self.source_dictionary {
11246 ::fidl_next::wire::Envelope::encode_value::<
11247 ::fidl_next::wire::String<'static>,
11248 ___E,
11249 >(
11250 value, preallocated.encoder, &mut out, 1024
11251 )?;
11252 } else {
11253 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11254 }
11255 }
11256
11257 5 => {
11258 if let Some(value) = &self.availability {
11259 ::fidl_next::wire::Envelope::encode_value::<
11260 crate::wire::Availability,
11261 ___E,
11262 >(
11263 value, preallocated.encoder, &mut out, ()
11264 )?;
11265 } else {
11266 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11267 }
11268 }
11269
11270 4 => {
11271 if let Some(value) = &self.target_name {
11272 ::fidl_next::wire::Envelope::encode_value::<
11273 ::fidl_next::wire::String<'static>,
11274 ___E,
11275 >(
11276 value, preallocated.encoder, &mut out, 100
11277 )?;
11278 } else {
11279 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11280 }
11281 }
11282
11283 3 => {
11284 if let Some(value) = &self.target {
11285 ::fidl_next::wire::Envelope::encode_value::<
11286 crate::wire::Ref<'static>,
11287 ___E,
11288 >(
11289 value, preallocated.encoder, &mut out, ()
11290 )?;
11291 } else {
11292 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11293 }
11294 }
11295
11296 2 => {
11297 if let Some(value) = &self.source_name {
11298 ::fidl_next::wire::Envelope::encode_value::<
11299 ::fidl_next::wire::String<'static>,
11300 ___E,
11301 >(
11302 value, preallocated.encoder, &mut out, 100
11303 )?;
11304 } else {
11305 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11306 }
11307 }
11308
11309 1 => {
11310 if let Some(value) = &self.source {
11311 ::fidl_next::wire::Envelope::encode_value::<
11312 crate::wire::Ref<'static>,
11313 ___E,
11314 >(
11315 value, preallocated.encoder, &mut out, ()
11316 )?;
11317 } else {
11318 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11319 }
11320 }
11321
11322 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
11323 }
11324 unsafe {
11325 preallocated.write_next(out.assume_init_ref());
11326 }
11327 }
11328
11329 ::fidl_next::wire::Table::encode_len(table, max_ord);
11330
11331 Ok(())
11332 }
11333 }
11334
11335 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeProtocol<'de>> for ExposeProtocol {
11336 #[inline]
11337 fn from_wire(wire_: crate::wire::ExposeProtocol<'de>) -> Self {
11338 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
11339
11340 let source = wire_.table.get(1);
11341
11342 let source_name = wire_.table.get(2);
11343
11344 let target = wire_.table.get(3);
11345
11346 let target_name = wire_.table.get(4);
11347
11348 let availability = wire_.table.get(5);
11349
11350 let source_dictionary = wire_.table.get(6);
11351
11352 Self {
11353 source: source.map(|envelope| {
11354 ::fidl_next::FromWire::from_wire(unsafe {
11355 envelope.read_unchecked::<crate::wire::Ref<'de>>()
11356 })
11357 }),
11358
11359 source_name: source_name.map(|envelope| {
11360 ::fidl_next::FromWire::from_wire(unsafe {
11361 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11362 })
11363 }),
11364
11365 target: target.map(|envelope| {
11366 ::fidl_next::FromWire::from_wire(unsafe {
11367 envelope.read_unchecked::<crate::wire::Ref<'de>>()
11368 })
11369 }),
11370
11371 target_name: target_name.map(|envelope| {
11372 ::fidl_next::FromWire::from_wire(unsafe {
11373 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11374 })
11375 }),
11376
11377 availability: availability.map(|envelope| {
11378 ::fidl_next::FromWire::from_wire(unsafe {
11379 envelope.read_unchecked::<crate::wire::Availability>()
11380 })
11381 }),
11382
11383 source_dictionary: source_dictionary.map(|envelope| {
11384 ::fidl_next::FromWire::from_wire(unsafe {
11385 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11386 })
11387 }),
11388 }
11389 }
11390 }
11391
11392 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeProtocol<'de>> for ExposeProtocol {
11393 #[inline]
11394 fn from_wire_ref(wire: &crate::wire::ExposeProtocol<'de>) -> Self {
11395 Self {
11396 source: wire.table.get(1).map(|envelope| {
11397 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11398 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
11399 })
11400 }),
11401
11402 source_name: wire.table.get(2).map(|envelope| {
11403 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11404 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11405 })
11406 }),
11407
11408 target: wire.table.get(3).map(|envelope| {
11409 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11410 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
11411 })
11412 }),
11413
11414 target_name: wire.table.get(4).map(|envelope| {
11415 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11416 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11417 })
11418 }),
11419
11420 availability: wire.table.get(5).map(|envelope| {
11421 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11422 envelope.deref_unchecked::<crate::wire::Availability>()
11423 })
11424 }),
11425
11426 source_dictionary: wire.table.get(6).map(|envelope| {
11427 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11428 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11429 })
11430 }),
11431 }
11432 }
11433 }
11434
11435 #[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"]
11436 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
11437 pub struct ExposeDirectory {
11438 pub source: ::core::option::Option<crate::natural::Ref>,
11439
11440 pub source_name: ::core::option::Option<::std::string::String>,
11441
11442 pub target: ::core::option::Option<crate::natural::Ref>,
11443
11444 pub target_name: ::core::option::Option<::std::string::String>,
11445
11446 pub rights: ::core::option::Option<::fidl_next_common_fuchsia_io::natural::Operations>,
11447
11448 pub subdir: ::core::option::Option<::std::string::String>,
11449
11450 pub availability: ::core::option::Option<crate::natural::Availability>,
11451
11452 pub source_dictionary: ::core::option::Option<::std::string::String>,
11453 }
11454
11455 impl ExposeDirectory {
11456 fn __max_ordinal(&self) -> usize {
11457 if self.source_dictionary.is_some() {
11458 return 8;
11459 }
11460
11461 if self.availability.is_some() {
11462 return 7;
11463 }
11464
11465 if self.subdir.is_some() {
11466 return 6;
11467 }
11468
11469 if self.rights.is_some() {
11470 return 5;
11471 }
11472
11473 if self.target_name.is_some() {
11474 return 4;
11475 }
11476
11477 if self.target.is_some() {
11478 return 3;
11479 }
11480
11481 if self.source_name.is_some() {
11482 return 2;
11483 }
11484
11485 if self.source.is_some() {
11486 return 1;
11487 }
11488
11489 0
11490 }
11491 }
11492
11493 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeDirectory<'static>, ___E>
11494 for ExposeDirectory
11495 where
11496 ___E: ::fidl_next::Encoder + ?Sized,
11497 {
11498 #[inline]
11499 fn encode(
11500 mut self,
11501 encoder: &mut ___E,
11502 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeDirectory<'static>>,
11503 _: (),
11504 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11505 ::fidl_next::munge!(let crate::wire::ExposeDirectory { table } = out);
11506
11507 let max_ord = self.__max_ordinal();
11508
11509 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
11510 ::fidl_next::Wire::zero_padding(&mut out);
11511
11512 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
11513 ::fidl_next::wire::Envelope,
11514 >(encoder, max_ord);
11515
11516 for i in 1..=max_ord {
11517 match i {
11518 8 => {
11519 if let Some(value) = self.source_dictionary.take() {
11520 ::fidl_next::wire::Envelope::encode_value::<
11521 ::fidl_next::wire::String<'static>,
11522 ___E,
11523 >(
11524 value, preallocated.encoder, &mut out, 1024
11525 )?;
11526 } else {
11527 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11528 }
11529 }
11530
11531 7 => {
11532 if let Some(value) = self.availability.take() {
11533 ::fidl_next::wire::Envelope::encode_value::<
11534 crate::wire::Availability,
11535 ___E,
11536 >(
11537 value, preallocated.encoder, &mut out, ()
11538 )?;
11539 } else {
11540 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11541 }
11542 }
11543
11544 6 => {
11545 if let Some(value) = self.subdir.take() {
11546 ::fidl_next::wire::Envelope::encode_value::<
11547 ::fidl_next::wire::String<'static>,
11548 ___E,
11549 >(
11550 value, preallocated.encoder, &mut out, 1024
11551 )?;
11552 } else {
11553 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11554 }
11555 }
11556
11557 5 => {
11558 if let Some(value) = self.rights.take() {
11559 ::fidl_next::wire::Envelope::encode_value::<
11560 ::fidl_next_common_fuchsia_io::wire::Operations,
11561 ___E,
11562 >(
11563 value, preallocated.encoder, &mut out, ()
11564 )?;
11565 } else {
11566 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11567 }
11568 }
11569
11570 4 => {
11571 if let Some(value) = self.target_name.take() {
11572 ::fidl_next::wire::Envelope::encode_value::<
11573 ::fidl_next::wire::String<'static>,
11574 ___E,
11575 >(
11576 value, preallocated.encoder, &mut out, 100
11577 )?;
11578 } else {
11579 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11580 }
11581 }
11582
11583 3 => {
11584 if let Some(value) = self.target.take() {
11585 ::fidl_next::wire::Envelope::encode_value::<
11586 crate::wire::Ref<'static>,
11587 ___E,
11588 >(
11589 value, preallocated.encoder, &mut out, ()
11590 )?;
11591 } else {
11592 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11593 }
11594 }
11595
11596 2 => {
11597 if let Some(value) = self.source_name.take() {
11598 ::fidl_next::wire::Envelope::encode_value::<
11599 ::fidl_next::wire::String<'static>,
11600 ___E,
11601 >(
11602 value, preallocated.encoder, &mut out, 100
11603 )?;
11604 } else {
11605 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11606 }
11607 }
11608
11609 1 => {
11610 if let Some(value) = self.source.take() {
11611 ::fidl_next::wire::Envelope::encode_value::<
11612 crate::wire::Ref<'static>,
11613 ___E,
11614 >(
11615 value, preallocated.encoder, &mut out, ()
11616 )?;
11617 } else {
11618 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11619 }
11620 }
11621
11622 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
11623 }
11624 unsafe {
11625 preallocated.write_next(out.assume_init_ref());
11626 }
11627 }
11628
11629 ::fidl_next::wire::Table::encode_len(table, max_ord);
11630
11631 Ok(())
11632 }
11633 }
11634
11635 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeDirectory<'static>, ___E>
11636 for &'a ExposeDirectory
11637 where
11638 ___E: ::fidl_next::Encoder + ?Sized,
11639 {
11640 #[inline]
11641 fn encode(
11642 self,
11643 encoder: &mut ___E,
11644 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeDirectory<'static>>,
11645 _: (),
11646 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11647 ::fidl_next::munge!(let crate::wire::ExposeDirectory { table } = out);
11648
11649 let max_ord = self.__max_ordinal();
11650
11651 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
11652 ::fidl_next::Wire::zero_padding(&mut out);
11653
11654 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
11655 ::fidl_next::wire::Envelope,
11656 >(encoder, max_ord);
11657
11658 for i in 1..=max_ord {
11659 match i {
11660 8 => {
11661 if let Some(value) = &self.source_dictionary {
11662 ::fidl_next::wire::Envelope::encode_value::<
11663 ::fidl_next::wire::String<'static>,
11664 ___E,
11665 >(
11666 value, preallocated.encoder, &mut out, 1024
11667 )?;
11668 } else {
11669 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11670 }
11671 }
11672
11673 7 => {
11674 if let Some(value) = &self.availability {
11675 ::fidl_next::wire::Envelope::encode_value::<
11676 crate::wire::Availability,
11677 ___E,
11678 >(
11679 value, preallocated.encoder, &mut out, ()
11680 )?;
11681 } else {
11682 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11683 }
11684 }
11685
11686 6 => {
11687 if let Some(value) = &self.subdir {
11688 ::fidl_next::wire::Envelope::encode_value::<
11689 ::fidl_next::wire::String<'static>,
11690 ___E,
11691 >(
11692 value, preallocated.encoder, &mut out, 1024
11693 )?;
11694 } else {
11695 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11696 }
11697 }
11698
11699 5 => {
11700 if let Some(value) = &self.rights {
11701 ::fidl_next::wire::Envelope::encode_value::<
11702 ::fidl_next_common_fuchsia_io::wire::Operations,
11703 ___E,
11704 >(
11705 value, preallocated.encoder, &mut out, ()
11706 )?;
11707 } else {
11708 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11709 }
11710 }
11711
11712 4 => {
11713 if let Some(value) = &self.target_name {
11714 ::fidl_next::wire::Envelope::encode_value::<
11715 ::fidl_next::wire::String<'static>,
11716 ___E,
11717 >(
11718 value, preallocated.encoder, &mut out, 100
11719 )?;
11720 } else {
11721 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11722 }
11723 }
11724
11725 3 => {
11726 if let Some(value) = &self.target {
11727 ::fidl_next::wire::Envelope::encode_value::<
11728 crate::wire::Ref<'static>,
11729 ___E,
11730 >(
11731 value, preallocated.encoder, &mut out, ()
11732 )?;
11733 } else {
11734 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11735 }
11736 }
11737
11738 2 => {
11739 if let Some(value) = &self.source_name {
11740 ::fidl_next::wire::Envelope::encode_value::<
11741 ::fidl_next::wire::String<'static>,
11742 ___E,
11743 >(
11744 value, preallocated.encoder, &mut out, 100
11745 )?;
11746 } else {
11747 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11748 }
11749 }
11750
11751 1 => {
11752 if let Some(value) = &self.source {
11753 ::fidl_next::wire::Envelope::encode_value::<
11754 crate::wire::Ref<'static>,
11755 ___E,
11756 >(
11757 value, preallocated.encoder, &mut out, ()
11758 )?;
11759 } else {
11760 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11761 }
11762 }
11763
11764 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
11765 }
11766 unsafe {
11767 preallocated.write_next(out.assume_init_ref());
11768 }
11769 }
11770
11771 ::fidl_next::wire::Table::encode_len(table, max_ord);
11772
11773 Ok(())
11774 }
11775 }
11776
11777 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeDirectory<'de>> for ExposeDirectory {
11778 #[inline]
11779 fn from_wire(wire_: crate::wire::ExposeDirectory<'de>) -> Self {
11780 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
11781
11782 let source = wire_.table.get(1);
11783
11784 let source_name = wire_.table.get(2);
11785
11786 let target = wire_.table.get(3);
11787
11788 let target_name = wire_.table.get(4);
11789
11790 let rights = wire_.table.get(5);
11791
11792 let subdir = wire_.table.get(6);
11793
11794 let availability = wire_.table.get(7);
11795
11796 let source_dictionary = wire_.table.get(8);
11797
11798 Self {
11799 source: source.map(|envelope| {
11800 ::fidl_next::FromWire::from_wire(unsafe {
11801 envelope.read_unchecked::<crate::wire::Ref<'de>>()
11802 })
11803 }),
11804
11805 source_name: source_name.map(|envelope| {
11806 ::fidl_next::FromWire::from_wire(unsafe {
11807 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11808 })
11809 }),
11810
11811 target: target.map(|envelope| {
11812 ::fidl_next::FromWire::from_wire(unsafe {
11813 envelope.read_unchecked::<crate::wire::Ref<'de>>()
11814 })
11815 }),
11816
11817 target_name: target_name.map(|envelope| {
11818 ::fidl_next::FromWire::from_wire(unsafe {
11819 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11820 })
11821 }),
11822
11823 rights: rights.map(|envelope| {
11824 ::fidl_next::FromWire::from_wire(unsafe {
11825 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
11826 })
11827 }),
11828
11829 subdir: subdir.map(|envelope| {
11830 ::fidl_next::FromWire::from_wire(unsafe {
11831 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11832 })
11833 }),
11834
11835 availability: availability.map(|envelope| {
11836 ::fidl_next::FromWire::from_wire(unsafe {
11837 envelope.read_unchecked::<crate::wire::Availability>()
11838 })
11839 }),
11840
11841 source_dictionary: source_dictionary.map(|envelope| {
11842 ::fidl_next::FromWire::from_wire(unsafe {
11843 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11844 })
11845 }),
11846 }
11847 }
11848 }
11849
11850 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeDirectory<'de>> for ExposeDirectory {
11851 #[inline]
11852 fn from_wire_ref(wire: &crate::wire::ExposeDirectory<'de>) -> Self {
11853 Self {
11854 source: wire.table.get(1).map(|envelope| {
11855 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11856 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
11857 })
11858 }),
11859
11860 source_name: wire.table.get(2).map(|envelope| {
11861 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11862 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11863 })
11864 }),
11865
11866 target: wire.table.get(3).map(|envelope| {
11867 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11868 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
11869 })
11870 }),
11871
11872 target_name: wire.table.get(4).map(|envelope| {
11873 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11874 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11875 })
11876 }),
11877
11878 rights: wire.table.get(5).map(|envelope| {
11879 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11880 envelope
11881 .deref_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
11882 })
11883 }),
11884
11885 subdir: wire.table.get(6).map(|envelope| {
11886 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11887 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11888 })
11889 }),
11890
11891 availability: wire.table.get(7).map(|envelope| {
11892 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11893 envelope.deref_unchecked::<crate::wire::Availability>()
11894 })
11895 }),
11896
11897 source_dictionary: wire.table.get(8).map(|envelope| {
11898 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11899 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11900 })
11901 }),
11902 }
11903 }
11904 }
11905
11906 #[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"]
11907 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
11908 pub struct ExposeRunner {
11909 pub source: ::core::option::Option<crate::natural::Ref>,
11910
11911 pub source_name: ::core::option::Option<::std::string::String>,
11912
11913 pub target: ::core::option::Option<crate::natural::Ref>,
11914
11915 pub target_name: ::core::option::Option<::std::string::String>,
11916
11917 pub source_dictionary: ::core::option::Option<::std::string::String>,
11918 }
11919
11920 impl ExposeRunner {
11921 fn __max_ordinal(&self) -> usize {
11922 if self.source_dictionary.is_some() {
11923 return 6;
11924 }
11925
11926 if self.target_name.is_some() {
11927 return 4;
11928 }
11929
11930 if self.target.is_some() {
11931 return 3;
11932 }
11933
11934 if self.source_name.is_some() {
11935 return 2;
11936 }
11937
11938 if self.source.is_some() {
11939 return 1;
11940 }
11941
11942 0
11943 }
11944 }
11945
11946 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeRunner<'static>, ___E> for ExposeRunner
11947 where
11948 ___E: ::fidl_next::Encoder + ?Sized,
11949 {
11950 #[inline]
11951 fn encode(
11952 mut self,
11953 encoder: &mut ___E,
11954 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeRunner<'static>>,
11955 _: (),
11956 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11957 ::fidl_next::munge!(let crate::wire::ExposeRunner { table } = out);
11958
11959 let max_ord = self.__max_ordinal();
11960
11961 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
11962 ::fidl_next::Wire::zero_padding(&mut out);
11963
11964 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
11965 ::fidl_next::wire::Envelope,
11966 >(encoder, max_ord);
11967
11968 for i in 1..=max_ord {
11969 match i {
11970 6 => {
11971 if let Some(value) = self.source_dictionary.take() {
11972 ::fidl_next::wire::Envelope::encode_value::<
11973 ::fidl_next::wire::String<'static>,
11974 ___E,
11975 >(
11976 value, preallocated.encoder, &mut out, 1024
11977 )?;
11978 } else {
11979 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11980 }
11981 }
11982
11983 4 => {
11984 if let Some(value) = self.target_name.take() {
11985 ::fidl_next::wire::Envelope::encode_value::<
11986 ::fidl_next::wire::String<'static>,
11987 ___E,
11988 >(
11989 value, preallocated.encoder, &mut out, 100
11990 )?;
11991 } else {
11992 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11993 }
11994 }
11995
11996 3 => {
11997 if let Some(value) = self.target.take() {
11998 ::fidl_next::wire::Envelope::encode_value::<
11999 crate::wire::Ref<'static>,
12000 ___E,
12001 >(
12002 value, preallocated.encoder, &mut out, ()
12003 )?;
12004 } else {
12005 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12006 }
12007 }
12008
12009 2 => {
12010 if let Some(value) = self.source_name.take() {
12011 ::fidl_next::wire::Envelope::encode_value::<
12012 ::fidl_next::wire::String<'static>,
12013 ___E,
12014 >(
12015 value, preallocated.encoder, &mut out, 100
12016 )?;
12017 } else {
12018 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12019 }
12020 }
12021
12022 1 => {
12023 if let Some(value) = self.source.take() {
12024 ::fidl_next::wire::Envelope::encode_value::<
12025 crate::wire::Ref<'static>,
12026 ___E,
12027 >(
12028 value, preallocated.encoder, &mut out, ()
12029 )?;
12030 } else {
12031 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12032 }
12033 }
12034
12035 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
12036 }
12037 unsafe {
12038 preallocated.write_next(out.assume_init_ref());
12039 }
12040 }
12041
12042 ::fidl_next::wire::Table::encode_len(table, max_ord);
12043
12044 Ok(())
12045 }
12046 }
12047
12048 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeRunner<'static>, ___E>
12049 for &'a ExposeRunner
12050 where
12051 ___E: ::fidl_next::Encoder + ?Sized,
12052 {
12053 #[inline]
12054 fn encode(
12055 self,
12056 encoder: &mut ___E,
12057 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeRunner<'static>>,
12058 _: (),
12059 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12060 ::fidl_next::munge!(let crate::wire::ExposeRunner { table } = out);
12061
12062 let max_ord = self.__max_ordinal();
12063
12064 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
12065 ::fidl_next::Wire::zero_padding(&mut out);
12066
12067 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
12068 ::fidl_next::wire::Envelope,
12069 >(encoder, max_ord);
12070
12071 for i in 1..=max_ord {
12072 match i {
12073 6 => {
12074 if let Some(value) = &self.source_dictionary {
12075 ::fidl_next::wire::Envelope::encode_value::<
12076 ::fidl_next::wire::String<'static>,
12077 ___E,
12078 >(
12079 value, preallocated.encoder, &mut out, 1024
12080 )?;
12081 } else {
12082 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12083 }
12084 }
12085
12086 4 => {
12087 if let Some(value) = &self.target_name {
12088 ::fidl_next::wire::Envelope::encode_value::<
12089 ::fidl_next::wire::String<'static>,
12090 ___E,
12091 >(
12092 value, preallocated.encoder, &mut out, 100
12093 )?;
12094 } else {
12095 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12096 }
12097 }
12098
12099 3 => {
12100 if let Some(value) = &self.target {
12101 ::fidl_next::wire::Envelope::encode_value::<
12102 crate::wire::Ref<'static>,
12103 ___E,
12104 >(
12105 value, preallocated.encoder, &mut out, ()
12106 )?;
12107 } else {
12108 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12109 }
12110 }
12111
12112 2 => {
12113 if let Some(value) = &self.source_name {
12114 ::fidl_next::wire::Envelope::encode_value::<
12115 ::fidl_next::wire::String<'static>,
12116 ___E,
12117 >(
12118 value, preallocated.encoder, &mut out, 100
12119 )?;
12120 } else {
12121 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12122 }
12123 }
12124
12125 1 => {
12126 if let Some(value) = &self.source {
12127 ::fidl_next::wire::Envelope::encode_value::<
12128 crate::wire::Ref<'static>,
12129 ___E,
12130 >(
12131 value, preallocated.encoder, &mut out, ()
12132 )?;
12133 } else {
12134 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12135 }
12136 }
12137
12138 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
12139 }
12140 unsafe {
12141 preallocated.write_next(out.assume_init_ref());
12142 }
12143 }
12144
12145 ::fidl_next::wire::Table::encode_len(table, max_ord);
12146
12147 Ok(())
12148 }
12149 }
12150
12151 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeRunner<'de>> for ExposeRunner {
12152 #[inline]
12153 fn from_wire(wire_: crate::wire::ExposeRunner<'de>) -> Self {
12154 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
12155
12156 let source = wire_.table.get(1);
12157
12158 let source_name = wire_.table.get(2);
12159
12160 let target = wire_.table.get(3);
12161
12162 let target_name = wire_.table.get(4);
12163
12164 let source_dictionary = wire_.table.get(6);
12165
12166 Self {
12167 source: source.map(|envelope| {
12168 ::fidl_next::FromWire::from_wire(unsafe {
12169 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12170 })
12171 }),
12172
12173 source_name: source_name.map(|envelope| {
12174 ::fidl_next::FromWire::from_wire(unsafe {
12175 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12176 })
12177 }),
12178
12179 target: target.map(|envelope| {
12180 ::fidl_next::FromWire::from_wire(unsafe {
12181 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12182 })
12183 }),
12184
12185 target_name: target_name.map(|envelope| {
12186 ::fidl_next::FromWire::from_wire(unsafe {
12187 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12188 })
12189 }),
12190
12191 source_dictionary: source_dictionary.map(|envelope| {
12192 ::fidl_next::FromWire::from_wire(unsafe {
12193 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12194 })
12195 }),
12196 }
12197 }
12198 }
12199
12200 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeRunner<'de>> for ExposeRunner {
12201 #[inline]
12202 fn from_wire_ref(wire: &crate::wire::ExposeRunner<'de>) -> Self {
12203 Self {
12204 source: wire.table.get(1).map(|envelope| {
12205 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12206 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12207 })
12208 }),
12209
12210 source_name: wire.table.get(2).map(|envelope| {
12211 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12212 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12213 })
12214 }),
12215
12216 target: wire.table.get(3).map(|envelope| {
12217 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12218 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12219 })
12220 }),
12221
12222 target_name: wire.table.get(4).map(|envelope| {
12223 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12224 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12225 })
12226 }),
12227
12228 source_dictionary: wire.table.get(6).map(|envelope| {
12229 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12230 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12231 })
12232 }),
12233 }
12234 }
12235 }
12236
12237 #[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"]
12238 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
12239 pub struct ExposeResolver {
12240 pub source: ::core::option::Option<crate::natural::Ref>,
12241
12242 pub source_name: ::core::option::Option<::std::string::String>,
12243
12244 pub target: ::core::option::Option<crate::natural::Ref>,
12245
12246 pub target_name: ::core::option::Option<::std::string::String>,
12247
12248 pub source_dictionary: ::core::option::Option<::std::string::String>,
12249 }
12250
12251 impl ExposeResolver {
12252 fn __max_ordinal(&self) -> usize {
12253 if self.source_dictionary.is_some() {
12254 return 6;
12255 }
12256
12257 if self.target_name.is_some() {
12258 return 4;
12259 }
12260
12261 if self.target.is_some() {
12262 return 3;
12263 }
12264
12265 if self.source_name.is_some() {
12266 return 2;
12267 }
12268
12269 if self.source.is_some() {
12270 return 1;
12271 }
12272
12273 0
12274 }
12275 }
12276
12277 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeResolver<'static>, ___E> for ExposeResolver
12278 where
12279 ___E: ::fidl_next::Encoder + ?Sized,
12280 {
12281 #[inline]
12282 fn encode(
12283 mut self,
12284 encoder: &mut ___E,
12285 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeResolver<'static>>,
12286 _: (),
12287 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12288 ::fidl_next::munge!(let crate::wire::ExposeResolver { table } = out);
12289
12290 let max_ord = self.__max_ordinal();
12291
12292 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
12293 ::fidl_next::Wire::zero_padding(&mut out);
12294
12295 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
12296 ::fidl_next::wire::Envelope,
12297 >(encoder, max_ord);
12298
12299 for i in 1..=max_ord {
12300 match i {
12301 6 => {
12302 if let Some(value) = self.source_dictionary.take() {
12303 ::fidl_next::wire::Envelope::encode_value::<
12304 ::fidl_next::wire::String<'static>,
12305 ___E,
12306 >(
12307 value, preallocated.encoder, &mut out, 1024
12308 )?;
12309 } else {
12310 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12311 }
12312 }
12313
12314 4 => {
12315 if let Some(value) = self.target_name.take() {
12316 ::fidl_next::wire::Envelope::encode_value::<
12317 ::fidl_next::wire::String<'static>,
12318 ___E,
12319 >(
12320 value, preallocated.encoder, &mut out, 100
12321 )?;
12322 } else {
12323 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12324 }
12325 }
12326
12327 3 => {
12328 if let Some(value) = self.target.take() {
12329 ::fidl_next::wire::Envelope::encode_value::<
12330 crate::wire::Ref<'static>,
12331 ___E,
12332 >(
12333 value, preallocated.encoder, &mut out, ()
12334 )?;
12335 } else {
12336 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12337 }
12338 }
12339
12340 2 => {
12341 if let Some(value) = self.source_name.take() {
12342 ::fidl_next::wire::Envelope::encode_value::<
12343 ::fidl_next::wire::String<'static>,
12344 ___E,
12345 >(
12346 value, preallocated.encoder, &mut out, 100
12347 )?;
12348 } else {
12349 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12350 }
12351 }
12352
12353 1 => {
12354 if let Some(value) = self.source.take() {
12355 ::fidl_next::wire::Envelope::encode_value::<
12356 crate::wire::Ref<'static>,
12357 ___E,
12358 >(
12359 value, preallocated.encoder, &mut out, ()
12360 )?;
12361 } else {
12362 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12363 }
12364 }
12365
12366 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
12367 }
12368 unsafe {
12369 preallocated.write_next(out.assume_init_ref());
12370 }
12371 }
12372
12373 ::fidl_next::wire::Table::encode_len(table, max_ord);
12374
12375 Ok(())
12376 }
12377 }
12378
12379 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeResolver<'static>, ___E>
12380 for &'a ExposeResolver
12381 where
12382 ___E: ::fidl_next::Encoder + ?Sized,
12383 {
12384 #[inline]
12385 fn encode(
12386 self,
12387 encoder: &mut ___E,
12388 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeResolver<'static>>,
12389 _: (),
12390 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12391 ::fidl_next::munge!(let crate::wire::ExposeResolver { table } = out);
12392
12393 let max_ord = self.__max_ordinal();
12394
12395 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
12396 ::fidl_next::Wire::zero_padding(&mut out);
12397
12398 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
12399 ::fidl_next::wire::Envelope,
12400 >(encoder, max_ord);
12401
12402 for i in 1..=max_ord {
12403 match i {
12404 6 => {
12405 if let Some(value) = &self.source_dictionary {
12406 ::fidl_next::wire::Envelope::encode_value::<
12407 ::fidl_next::wire::String<'static>,
12408 ___E,
12409 >(
12410 value, preallocated.encoder, &mut out, 1024
12411 )?;
12412 } else {
12413 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12414 }
12415 }
12416
12417 4 => {
12418 if let Some(value) = &self.target_name {
12419 ::fidl_next::wire::Envelope::encode_value::<
12420 ::fidl_next::wire::String<'static>,
12421 ___E,
12422 >(
12423 value, preallocated.encoder, &mut out, 100
12424 )?;
12425 } else {
12426 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12427 }
12428 }
12429
12430 3 => {
12431 if let Some(value) = &self.target {
12432 ::fidl_next::wire::Envelope::encode_value::<
12433 crate::wire::Ref<'static>,
12434 ___E,
12435 >(
12436 value, preallocated.encoder, &mut out, ()
12437 )?;
12438 } else {
12439 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12440 }
12441 }
12442
12443 2 => {
12444 if let Some(value) = &self.source_name {
12445 ::fidl_next::wire::Envelope::encode_value::<
12446 ::fidl_next::wire::String<'static>,
12447 ___E,
12448 >(
12449 value, preallocated.encoder, &mut out, 100
12450 )?;
12451 } else {
12452 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12453 }
12454 }
12455
12456 1 => {
12457 if let Some(value) = &self.source {
12458 ::fidl_next::wire::Envelope::encode_value::<
12459 crate::wire::Ref<'static>,
12460 ___E,
12461 >(
12462 value, preallocated.encoder, &mut out, ()
12463 )?;
12464 } else {
12465 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12466 }
12467 }
12468
12469 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
12470 }
12471 unsafe {
12472 preallocated.write_next(out.assume_init_ref());
12473 }
12474 }
12475
12476 ::fidl_next::wire::Table::encode_len(table, max_ord);
12477
12478 Ok(())
12479 }
12480 }
12481
12482 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeResolver<'de>> for ExposeResolver {
12483 #[inline]
12484 fn from_wire(wire_: crate::wire::ExposeResolver<'de>) -> Self {
12485 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
12486
12487 let source = wire_.table.get(1);
12488
12489 let source_name = wire_.table.get(2);
12490
12491 let target = wire_.table.get(3);
12492
12493 let target_name = wire_.table.get(4);
12494
12495 let source_dictionary = wire_.table.get(6);
12496
12497 Self {
12498 source: source.map(|envelope| {
12499 ::fidl_next::FromWire::from_wire(unsafe {
12500 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12501 })
12502 }),
12503
12504 source_name: source_name.map(|envelope| {
12505 ::fidl_next::FromWire::from_wire(unsafe {
12506 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12507 })
12508 }),
12509
12510 target: target.map(|envelope| {
12511 ::fidl_next::FromWire::from_wire(unsafe {
12512 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12513 })
12514 }),
12515
12516 target_name: target_name.map(|envelope| {
12517 ::fidl_next::FromWire::from_wire(unsafe {
12518 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12519 })
12520 }),
12521
12522 source_dictionary: source_dictionary.map(|envelope| {
12523 ::fidl_next::FromWire::from_wire(unsafe {
12524 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12525 })
12526 }),
12527 }
12528 }
12529 }
12530
12531 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeResolver<'de>> for ExposeResolver {
12532 #[inline]
12533 fn from_wire_ref(wire: &crate::wire::ExposeResolver<'de>) -> Self {
12534 Self {
12535 source: wire.table.get(1).map(|envelope| {
12536 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12537 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12538 })
12539 }),
12540
12541 source_name: wire.table.get(2).map(|envelope| {
12542 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12543 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12544 })
12545 }),
12546
12547 target: wire.table.get(3).map(|envelope| {
12548 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12549 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12550 })
12551 }),
12552
12553 target_name: wire.table.get(4).map(|envelope| {
12554 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12555 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12556 })
12557 }),
12558
12559 source_dictionary: wire.table.get(6).map(|envelope| {
12560 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12561 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12562 })
12563 }),
12564 }
12565 }
12566 }
12567
12568 #[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"]
12569 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
12570 pub struct ExposeDictionary {
12571 pub source: ::core::option::Option<crate::natural::Ref>,
12572
12573 pub source_name: ::core::option::Option<::std::string::String>,
12574
12575 pub target: ::core::option::Option<crate::natural::Ref>,
12576
12577 pub target_name: ::core::option::Option<::std::string::String>,
12578
12579 pub availability: ::core::option::Option<crate::natural::Availability>,
12580
12581 pub source_dictionary: ::core::option::Option<::std::string::String>,
12582 }
12583
12584 impl ExposeDictionary {
12585 fn __max_ordinal(&self) -> usize {
12586 if self.source_dictionary.is_some() {
12587 return 6;
12588 }
12589
12590 if self.availability.is_some() {
12591 return 5;
12592 }
12593
12594 if self.target_name.is_some() {
12595 return 4;
12596 }
12597
12598 if self.target.is_some() {
12599 return 3;
12600 }
12601
12602 if self.source_name.is_some() {
12603 return 2;
12604 }
12605
12606 if self.source.is_some() {
12607 return 1;
12608 }
12609
12610 0
12611 }
12612 }
12613
12614 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeDictionary<'static>, ___E>
12615 for ExposeDictionary
12616 where
12617 ___E: ::fidl_next::Encoder + ?Sized,
12618 {
12619 #[inline]
12620 fn encode(
12621 mut self,
12622 encoder: &mut ___E,
12623 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeDictionary<'static>>,
12624 _: (),
12625 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12626 ::fidl_next::munge!(let crate::wire::ExposeDictionary { table } = out);
12627
12628 let max_ord = self.__max_ordinal();
12629
12630 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
12631 ::fidl_next::Wire::zero_padding(&mut out);
12632
12633 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
12634 ::fidl_next::wire::Envelope,
12635 >(encoder, max_ord);
12636
12637 for i in 1..=max_ord {
12638 match i {
12639 6 => {
12640 if let Some(value) = self.source_dictionary.take() {
12641 ::fidl_next::wire::Envelope::encode_value::<
12642 ::fidl_next::wire::String<'static>,
12643 ___E,
12644 >(
12645 value, preallocated.encoder, &mut out, 1024
12646 )?;
12647 } else {
12648 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12649 }
12650 }
12651
12652 5 => {
12653 if let Some(value) = self.availability.take() {
12654 ::fidl_next::wire::Envelope::encode_value::<
12655 crate::wire::Availability,
12656 ___E,
12657 >(
12658 value, preallocated.encoder, &mut out, ()
12659 )?;
12660 } else {
12661 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12662 }
12663 }
12664
12665 4 => {
12666 if let Some(value) = self.target_name.take() {
12667 ::fidl_next::wire::Envelope::encode_value::<
12668 ::fidl_next::wire::String<'static>,
12669 ___E,
12670 >(
12671 value, preallocated.encoder, &mut out, 100
12672 )?;
12673 } else {
12674 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12675 }
12676 }
12677
12678 3 => {
12679 if let Some(value) = self.target.take() {
12680 ::fidl_next::wire::Envelope::encode_value::<
12681 crate::wire::Ref<'static>,
12682 ___E,
12683 >(
12684 value, preallocated.encoder, &mut out, ()
12685 )?;
12686 } else {
12687 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12688 }
12689 }
12690
12691 2 => {
12692 if let Some(value) = self.source_name.take() {
12693 ::fidl_next::wire::Envelope::encode_value::<
12694 ::fidl_next::wire::String<'static>,
12695 ___E,
12696 >(
12697 value, preallocated.encoder, &mut out, 100
12698 )?;
12699 } else {
12700 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12701 }
12702 }
12703
12704 1 => {
12705 if let Some(value) = self.source.take() {
12706 ::fidl_next::wire::Envelope::encode_value::<
12707 crate::wire::Ref<'static>,
12708 ___E,
12709 >(
12710 value, preallocated.encoder, &mut out, ()
12711 )?;
12712 } else {
12713 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12714 }
12715 }
12716
12717 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
12718 }
12719 unsafe {
12720 preallocated.write_next(out.assume_init_ref());
12721 }
12722 }
12723
12724 ::fidl_next::wire::Table::encode_len(table, max_ord);
12725
12726 Ok(())
12727 }
12728 }
12729
12730 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeDictionary<'static>, ___E>
12731 for &'a ExposeDictionary
12732 where
12733 ___E: ::fidl_next::Encoder + ?Sized,
12734 {
12735 #[inline]
12736 fn encode(
12737 self,
12738 encoder: &mut ___E,
12739 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeDictionary<'static>>,
12740 _: (),
12741 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12742 ::fidl_next::munge!(let crate::wire::ExposeDictionary { table } = out);
12743
12744 let max_ord = self.__max_ordinal();
12745
12746 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
12747 ::fidl_next::Wire::zero_padding(&mut out);
12748
12749 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
12750 ::fidl_next::wire::Envelope,
12751 >(encoder, max_ord);
12752
12753 for i in 1..=max_ord {
12754 match i {
12755 6 => {
12756 if let Some(value) = &self.source_dictionary {
12757 ::fidl_next::wire::Envelope::encode_value::<
12758 ::fidl_next::wire::String<'static>,
12759 ___E,
12760 >(
12761 value, preallocated.encoder, &mut out, 1024
12762 )?;
12763 } else {
12764 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12765 }
12766 }
12767
12768 5 => {
12769 if let Some(value) = &self.availability {
12770 ::fidl_next::wire::Envelope::encode_value::<
12771 crate::wire::Availability,
12772 ___E,
12773 >(
12774 value, preallocated.encoder, &mut out, ()
12775 )?;
12776 } else {
12777 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12778 }
12779 }
12780
12781 4 => {
12782 if let Some(value) = &self.target_name {
12783 ::fidl_next::wire::Envelope::encode_value::<
12784 ::fidl_next::wire::String<'static>,
12785 ___E,
12786 >(
12787 value, preallocated.encoder, &mut out, 100
12788 )?;
12789 } else {
12790 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12791 }
12792 }
12793
12794 3 => {
12795 if let Some(value) = &self.target {
12796 ::fidl_next::wire::Envelope::encode_value::<
12797 crate::wire::Ref<'static>,
12798 ___E,
12799 >(
12800 value, preallocated.encoder, &mut out, ()
12801 )?;
12802 } else {
12803 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12804 }
12805 }
12806
12807 2 => {
12808 if let Some(value) = &self.source_name {
12809 ::fidl_next::wire::Envelope::encode_value::<
12810 ::fidl_next::wire::String<'static>,
12811 ___E,
12812 >(
12813 value, preallocated.encoder, &mut out, 100
12814 )?;
12815 } else {
12816 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12817 }
12818 }
12819
12820 1 => {
12821 if let Some(value) = &self.source {
12822 ::fidl_next::wire::Envelope::encode_value::<
12823 crate::wire::Ref<'static>,
12824 ___E,
12825 >(
12826 value, preallocated.encoder, &mut out, ()
12827 )?;
12828 } else {
12829 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12830 }
12831 }
12832
12833 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
12834 }
12835 unsafe {
12836 preallocated.write_next(out.assume_init_ref());
12837 }
12838 }
12839
12840 ::fidl_next::wire::Table::encode_len(table, max_ord);
12841
12842 Ok(())
12843 }
12844 }
12845
12846 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeDictionary<'de>> for ExposeDictionary {
12847 #[inline]
12848 fn from_wire(wire_: crate::wire::ExposeDictionary<'de>) -> Self {
12849 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
12850
12851 let source = wire_.table.get(1);
12852
12853 let source_name = wire_.table.get(2);
12854
12855 let target = wire_.table.get(3);
12856
12857 let target_name = wire_.table.get(4);
12858
12859 let availability = wire_.table.get(5);
12860
12861 let source_dictionary = wire_.table.get(6);
12862
12863 Self {
12864 source: source.map(|envelope| {
12865 ::fidl_next::FromWire::from_wire(unsafe {
12866 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12867 })
12868 }),
12869
12870 source_name: source_name.map(|envelope| {
12871 ::fidl_next::FromWire::from_wire(unsafe {
12872 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12873 })
12874 }),
12875
12876 target: target.map(|envelope| {
12877 ::fidl_next::FromWire::from_wire(unsafe {
12878 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12879 })
12880 }),
12881
12882 target_name: target_name.map(|envelope| {
12883 ::fidl_next::FromWire::from_wire(unsafe {
12884 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12885 })
12886 }),
12887
12888 availability: availability.map(|envelope| {
12889 ::fidl_next::FromWire::from_wire(unsafe {
12890 envelope.read_unchecked::<crate::wire::Availability>()
12891 })
12892 }),
12893
12894 source_dictionary: source_dictionary.map(|envelope| {
12895 ::fidl_next::FromWire::from_wire(unsafe {
12896 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12897 })
12898 }),
12899 }
12900 }
12901 }
12902
12903 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeDictionary<'de>> for ExposeDictionary {
12904 #[inline]
12905 fn from_wire_ref(wire: &crate::wire::ExposeDictionary<'de>) -> Self {
12906 Self {
12907 source: wire.table.get(1).map(|envelope| {
12908 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12909 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12910 })
12911 }),
12912
12913 source_name: wire.table.get(2).map(|envelope| {
12914 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12915 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12916 })
12917 }),
12918
12919 target: wire.table.get(3).map(|envelope| {
12920 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12921 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12922 })
12923 }),
12924
12925 target_name: wire.table.get(4).map(|envelope| {
12926 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12927 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12928 })
12929 }),
12930
12931 availability: wire.table.get(5).map(|envelope| {
12932 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12933 envelope.deref_unchecked::<crate::wire::Availability>()
12934 })
12935 }),
12936
12937 source_dictionary: wire.table.get(6).map(|envelope| {
12938 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12939 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12940 })
12941 }),
12942 }
12943 }
12944 }
12945
12946 #[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"]
12947 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
12948 pub struct ExposeConfiguration {
12949 pub source: ::core::option::Option<crate::natural::Ref>,
12950
12951 pub source_name: ::core::option::Option<::std::string::String>,
12952
12953 pub target: ::core::option::Option<crate::natural::Ref>,
12954
12955 pub target_name: ::core::option::Option<::std::string::String>,
12956
12957 pub availability: ::core::option::Option<crate::natural::Availability>,
12958
12959 pub source_dictionary: ::core::option::Option<::std::string::String>,
12960 }
12961
12962 impl ExposeConfiguration {
12963 fn __max_ordinal(&self) -> usize {
12964 if self.source_dictionary.is_some() {
12965 return 6;
12966 }
12967
12968 if self.availability.is_some() {
12969 return 5;
12970 }
12971
12972 if self.target_name.is_some() {
12973 return 4;
12974 }
12975
12976 if self.target.is_some() {
12977 return 3;
12978 }
12979
12980 if self.source_name.is_some() {
12981 return 2;
12982 }
12983
12984 if self.source.is_some() {
12985 return 1;
12986 }
12987
12988 0
12989 }
12990 }
12991
12992 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeConfiguration<'static>, ___E>
12993 for ExposeConfiguration
12994 where
12995 ___E: ::fidl_next::Encoder + ?Sized,
12996 {
12997 #[inline]
12998 fn encode(
12999 mut self,
13000 encoder: &mut ___E,
13001 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeConfiguration<'static>>,
13002 _: (),
13003 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13004 ::fidl_next::munge!(let crate::wire::ExposeConfiguration { table } = out);
13005
13006 let max_ord = self.__max_ordinal();
13007
13008 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
13009 ::fidl_next::Wire::zero_padding(&mut out);
13010
13011 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
13012 ::fidl_next::wire::Envelope,
13013 >(encoder, max_ord);
13014
13015 for i in 1..=max_ord {
13016 match i {
13017 6 => {
13018 if let Some(value) = self.source_dictionary.take() {
13019 ::fidl_next::wire::Envelope::encode_value::<
13020 ::fidl_next::wire::String<'static>,
13021 ___E,
13022 >(
13023 value, preallocated.encoder, &mut out, 1024
13024 )?;
13025 } else {
13026 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13027 }
13028 }
13029
13030 5 => {
13031 if let Some(value) = self.availability.take() {
13032 ::fidl_next::wire::Envelope::encode_value::<
13033 crate::wire::Availability,
13034 ___E,
13035 >(
13036 value, preallocated.encoder, &mut out, ()
13037 )?;
13038 } else {
13039 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13040 }
13041 }
13042
13043 4 => {
13044 if let Some(value) = self.target_name.take() {
13045 ::fidl_next::wire::Envelope::encode_value::<
13046 ::fidl_next::wire::String<'static>,
13047 ___E,
13048 >(
13049 value, preallocated.encoder, &mut out, 100
13050 )?;
13051 } else {
13052 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13053 }
13054 }
13055
13056 3 => {
13057 if let Some(value) = self.target.take() {
13058 ::fidl_next::wire::Envelope::encode_value::<
13059 crate::wire::Ref<'static>,
13060 ___E,
13061 >(
13062 value, preallocated.encoder, &mut out, ()
13063 )?;
13064 } else {
13065 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13066 }
13067 }
13068
13069 2 => {
13070 if let Some(value) = self.source_name.take() {
13071 ::fidl_next::wire::Envelope::encode_value::<
13072 ::fidl_next::wire::String<'static>,
13073 ___E,
13074 >(
13075 value, preallocated.encoder, &mut out, 100
13076 )?;
13077 } else {
13078 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13079 }
13080 }
13081
13082 1 => {
13083 if let Some(value) = self.source.take() {
13084 ::fidl_next::wire::Envelope::encode_value::<
13085 crate::wire::Ref<'static>,
13086 ___E,
13087 >(
13088 value, preallocated.encoder, &mut out, ()
13089 )?;
13090 } else {
13091 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13092 }
13093 }
13094
13095 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
13096 }
13097 unsafe {
13098 preallocated.write_next(out.assume_init_ref());
13099 }
13100 }
13101
13102 ::fidl_next::wire::Table::encode_len(table, max_ord);
13103
13104 Ok(())
13105 }
13106 }
13107
13108 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeConfiguration<'static>, ___E>
13109 for &'a ExposeConfiguration
13110 where
13111 ___E: ::fidl_next::Encoder + ?Sized,
13112 {
13113 #[inline]
13114 fn encode(
13115 self,
13116 encoder: &mut ___E,
13117 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeConfiguration<'static>>,
13118 _: (),
13119 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13120 ::fidl_next::munge!(let crate::wire::ExposeConfiguration { table } = out);
13121
13122 let max_ord = self.__max_ordinal();
13123
13124 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
13125 ::fidl_next::Wire::zero_padding(&mut out);
13126
13127 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
13128 ::fidl_next::wire::Envelope,
13129 >(encoder, max_ord);
13130
13131 for i in 1..=max_ord {
13132 match i {
13133 6 => {
13134 if let Some(value) = &self.source_dictionary {
13135 ::fidl_next::wire::Envelope::encode_value::<
13136 ::fidl_next::wire::String<'static>,
13137 ___E,
13138 >(
13139 value, preallocated.encoder, &mut out, 1024
13140 )?;
13141 } else {
13142 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13143 }
13144 }
13145
13146 5 => {
13147 if let Some(value) = &self.availability {
13148 ::fidl_next::wire::Envelope::encode_value::<
13149 crate::wire::Availability,
13150 ___E,
13151 >(
13152 value, preallocated.encoder, &mut out, ()
13153 )?;
13154 } else {
13155 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13156 }
13157 }
13158
13159 4 => {
13160 if let Some(value) = &self.target_name {
13161 ::fidl_next::wire::Envelope::encode_value::<
13162 ::fidl_next::wire::String<'static>,
13163 ___E,
13164 >(
13165 value, preallocated.encoder, &mut out, 100
13166 )?;
13167 } else {
13168 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13169 }
13170 }
13171
13172 3 => {
13173 if let Some(value) = &self.target {
13174 ::fidl_next::wire::Envelope::encode_value::<
13175 crate::wire::Ref<'static>,
13176 ___E,
13177 >(
13178 value, preallocated.encoder, &mut out, ()
13179 )?;
13180 } else {
13181 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13182 }
13183 }
13184
13185 2 => {
13186 if let Some(value) = &self.source_name {
13187 ::fidl_next::wire::Envelope::encode_value::<
13188 ::fidl_next::wire::String<'static>,
13189 ___E,
13190 >(
13191 value, preallocated.encoder, &mut out, 100
13192 )?;
13193 } else {
13194 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13195 }
13196 }
13197
13198 1 => {
13199 if let Some(value) = &self.source {
13200 ::fidl_next::wire::Envelope::encode_value::<
13201 crate::wire::Ref<'static>,
13202 ___E,
13203 >(
13204 value, preallocated.encoder, &mut out, ()
13205 )?;
13206 } else {
13207 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13208 }
13209 }
13210
13211 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
13212 }
13213 unsafe {
13214 preallocated.write_next(out.assume_init_ref());
13215 }
13216 }
13217
13218 ::fidl_next::wire::Table::encode_len(table, max_ord);
13219
13220 Ok(())
13221 }
13222 }
13223
13224 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeConfiguration<'de>> for ExposeConfiguration {
13225 #[inline]
13226 fn from_wire(wire_: crate::wire::ExposeConfiguration<'de>) -> Self {
13227 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
13228
13229 let source = wire_.table.get(1);
13230
13231 let source_name = wire_.table.get(2);
13232
13233 let target = wire_.table.get(3);
13234
13235 let target_name = wire_.table.get(4);
13236
13237 let availability = wire_.table.get(5);
13238
13239 let source_dictionary = wire_.table.get(6);
13240
13241 Self {
13242 source: source.map(|envelope| {
13243 ::fidl_next::FromWire::from_wire(unsafe {
13244 envelope.read_unchecked::<crate::wire::Ref<'de>>()
13245 })
13246 }),
13247
13248 source_name: source_name.map(|envelope| {
13249 ::fidl_next::FromWire::from_wire(unsafe {
13250 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
13251 })
13252 }),
13253
13254 target: target.map(|envelope| {
13255 ::fidl_next::FromWire::from_wire(unsafe {
13256 envelope.read_unchecked::<crate::wire::Ref<'de>>()
13257 })
13258 }),
13259
13260 target_name: target_name.map(|envelope| {
13261 ::fidl_next::FromWire::from_wire(unsafe {
13262 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
13263 })
13264 }),
13265
13266 availability: availability.map(|envelope| {
13267 ::fidl_next::FromWire::from_wire(unsafe {
13268 envelope.read_unchecked::<crate::wire::Availability>()
13269 })
13270 }),
13271
13272 source_dictionary: source_dictionary.map(|envelope| {
13273 ::fidl_next::FromWire::from_wire(unsafe {
13274 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
13275 })
13276 }),
13277 }
13278 }
13279 }
13280
13281 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeConfiguration<'de>> for ExposeConfiguration {
13282 #[inline]
13283 fn from_wire_ref(wire: &crate::wire::ExposeConfiguration<'de>) -> Self {
13284 Self {
13285 source: wire.table.get(1).map(|envelope| {
13286 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13287 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
13288 })
13289 }),
13290
13291 source_name: wire.table.get(2).map(|envelope| {
13292 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13293 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
13294 })
13295 }),
13296
13297 target: wire.table.get(3).map(|envelope| {
13298 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13299 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
13300 })
13301 }),
13302
13303 target_name: wire.table.get(4).map(|envelope| {
13304 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13305 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
13306 })
13307 }),
13308
13309 availability: wire.table.get(5).map(|envelope| {
13310 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13311 envelope.deref_unchecked::<crate::wire::Availability>()
13312 })
13313 }),
13314
13315 source_dictionary: wire.table.get(6).map(|envelope| {
13316 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13317 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
13318 })
13319 }),
13320 }
13321 }
13322 }
13323
13324 #[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"]
13325 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
13326 pub enum Expose {
13327 Service(crate::natural::ExposeService),
13328
13329 Protocol(crate::natural::ExposeProtocol),
13330
13331 Directory(crate::natural::ExposeDirectory),
13332
13333 Runner(crate::natural::ExposeRunner),
13334
13335 Resolver(crate::natural::ExposeResolver),
13336
13337 Dictionary(crate::natural::ExposeDictionary),
13338
13339 Config(crate::natural::ExposeConfiguration),
13340
13341 UnknownOrdinal_(u64),
13342 }
13343
13344 impl Expose {
13345 pub fn is_unknown(&self) -> bool {
13346 #[allow(unreachable_patterns)]
13347 match self {
13348 Self::UnknownOrdinal_(_) => true,
13349 _ => false,
13350 }
13351 }
13352 }
13353
13354 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Expose<'static>, ___E> for Expose
13355 where
13356 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13357 ___E: ::fidl_next::Encoder,
13358 {
13359 #[inline]
13360 fn encode(
13361 self,
13362 encoder: &mut ___E,
13363 out: &mut ::core::mem::MaybeUninit<crate::wire::Expose<'static>>,
13364 _: (),
13365 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13366 ::fidl_next::munge!(let crate::wire::Expose { raw, _phantom: _ } = out);
13367
13368 match self {
13369 Self::Service(value) => ::fidl_next::wire::Union::encode_as::<
13370 ___E,
13371 crate::wire::ExposeService<'static>,
13372 >(value, 1, encoder, raw, ())?,
13373
13374 Self::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
13375 ___E,
13376 crate::wire::ExposeProtocol<'static>,
13377 >(value, 2, encoder, raw, ())?,
13378
13379 Self::Directory(value) => ::fidl_next::wire::Union::encode_as::<
13380 ___E,
13381 crate::wire::ExposeDirectory<'static>,
13382 >(value, 3, encoder, raw, ())?,
13383
13384 Self::Runner(value) => ::fidl_next::wire::Union::encode_as::<
13385 ___E,
13386 crate::wire::ExposeRunner<'static>,
13387 >(value, 4, encoder, raw, ())?,
13388
13389 Self::Resolver(value) => ::fidl_next::wire::Union::encode_as::<
13390 ___E,
13391 crate::wire::ExposeResolver<'static>,
13392 >(value, 5, encoder, raw, ())?,
13393
13394 Self::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
13395 ___E,
13396 crate::wire::ExposeDictionary<'static>,
13397 >(value, 7, encoder, raw, ())?,
13398
13399 Self::Config(value) => ::fidl_next::wire::Union::encode_as::<
13400 ___E,
13401 crate::wire::ExposeConfiguration<'static>,
13402 >(value, 8, encoder, raw, ())?,
13403
13404 Self::UnknownOrdinal_(ordinal) => {
13405 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
13406 }
13407 }
13408
13409 Ok(())
13410 }
13411 }
13412
13413 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Expose<'static>, ___E> for &'a Expose
13414 where
13415 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13416 ___E: ::fidl_next::Encoder,
13417 {
13418 #[inline]
13419 fn encode(
13420 self,
13421 encoder: &mut ___E,
13422 out: &mut ::core::mem::MaybeUninit<crate::wire::Expose<'static>>,
13423 _: (),
13424 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13425 ::fidl_next::munge!(let crate::wire::Expose { raw, _phantom: _ } = out);
13426
13427 match self {
13428 Expose::Service(value) => ::fidl_next::wire::Union::encode_as::<
13429 ___E,
13430 crate::wire::ExposeService<'static>,
13431 >(value, 1, encoder, raw, ())?,
13432
13433 Expose::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
13434 ___E,
13435 crate::wire::ExposeProtocol<'static>,
13436 >(value, 2, encoder, raw, ())?,
13437
13438 Expose::Directory(value) => ::fidl_next::wire::Union::encode_as::<
13439 ___E,
13440 crate::wire::ExposeDirectory<'static>,
13441 >(value, 3, encoder, raw, ())?,
13442
13443 Expose::Runner(value) => ::fidl_next::wire::Union::encode_as::<
13444 ___E,
13445 crate::wire::ExposeRunner<'static>,
13446 >(value, 4, encoder, raw, ())?,
13447
13448 Expose::Resolver(value) => ::fidl_next::wire::Union::encode_as::<
13449 ___E,
13450 crate::wire::ExposeResolver<'static>,
13451 >(value, 5, encoder, raw, ())?,
13452
13453 Expose::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
13454 ___E,
13455 crate::wire::ExposeDictionary<'static>,
13456 >(value, 7, encoder, raw, ())?,
13457
13458 Expose::Config(value) => ::fidl_next::wire::Union::encode_as::<
13459 ___E,
13460 crate::wire::ExposeConfiguration<'static>,
13461 >(value, 8, encoder, raw, ())?,
13462
13463 Expose::UnknownOrdinal_(ordinal) => {
13464 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
13465 }
13466 }
13467
13468 Ok(())
13469 }
13470 }
13471
13472 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Expose<'static>, ___E> for Expose
13473 where
13474 ___E: ?Sized,
13475 Expose: ::fidl_next::Encode<crate::wire::Expose<'static>, ___E>,
13476 {
13477 #[inline]
13478 fn encode_option(
13479 this: ::core::option::Option<Self>,
13480 encoder: &mut ___E,
13481 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Expose<'static>>,
13482 _: (),
13483 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13484 ::fidl_next::munge!(let crate::wire_optional::Expose { raw, _phantom: _ } = &mut *out);
13485
13486 if let Some(inner) = this {
13487 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
13488 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
13489 } else {
13490 ::fidl_next::wire::Union::encode_absent(raw);
13491 }
13492
13493 Ok(())
13494 }
13495 }
13496
13497 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Expose<'static>, ___E>
13498 for &'a Expose
13499 where
13500 ___E: ?Sized,
13501 &'a Expose: ::fidl_next::Encode<crate::wire::Expose<'static>, ___E>,
13502 {
13503 #[inline]
13504 fn encode_option(
13505 this: ::core::option::Option<Self>,
13506 encoder: &mut ___E,
13507 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Expose<'static>>,
13508 _: (),
13509 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13510 ::fidl_next::munge!(let crate::wire_optional::Expose { raw, _phantom: _ } = &mut *out);
13511
13512 if let Some(inner) = this {
13513 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
13514 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
13515 } else {
13516 ::fidl_next::wire::Union::encode_absent(raw);
13517 }
13518
13519 Ok(())
13520 }
13521 }
13522
13523 impl<'de> ::fidl_next::FromWire<crate::wire::Expose<'de>> for Expose {
13524 #[inline]
13525 fn from_wire(wire: crate::wire::Expose<'de>) -> Self {
13526 let wire = ::core::mem::ManuallyDrop::new(wire);
13527 match wire.raw.ordinal() {
13528 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
13529 wire.raw.get().read_unchecked::<crate::wire::ExposeService<'de>>()
13530 })),
13531
13532 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
13533 wire.raw.get().read_unchecked::<crate::wire::ExposeProtocol<'de>>()
13534 })),
13535
13536 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
13537 wire.raw.get().read_unchecked::<crate::wire::ExposeDirectory<'de>>()
13538 })),
13539
13540 4 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
13541 wire.raw.get().read_unchecked::<crate::wire::ExposeRunner<'de>>()
13542 })),
13543
13544 5 => Self::Resolver(::fidl_next::FromWire::from_wire(unsafe {
13545 wire.raw.get().read_unchecked::<crate::wire::ExposeResolver<'de>>()
13546 })),
13547
13548 7 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
13549 wire.raw.get().read_unchecked::<crate::wire::ExposeDictionary<'de>>()
13550 })),
13551
13552 8 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
13553 wire.raw.get().read_unchecked::<crate::wire::ExposeConfiguration<'de>>()
13554 })),
13555
13556 ord => return Self::UnknownOrdinal_(ord as u64),
13557 }
13558 }
13559 }
13560
13561 impl<'de> ::fidl_next::FromWireRef<crate::wire::Expose<'de>> for Expose {
13562 #[inline]
13563 fn from_wire_ref(wire: &crate::wire::Expose<'de>) -> Self {
13564 match wire.raw.ordinal() {
13565 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
13566 wire.raw.get().deref_unchecked::<crate::wire::ExposeService<'de>>()
13567 })),
13568
13569 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
13570 wire.raw.get().deref_unchecked::<crate::wire::ExposeProtocol<'de>>()
13571 })),
13572
13573 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
13574 wire.raw.get().deref_unchecked::<crate::wire::ExposeDirectory<'de>>()
13575 })),
13576
13577 4 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
13578 wire.raw.get().deref_unchecked::<crate::wire::ExposeRunner<'de>>()
13579 })),
13580
13581 5 => Self::Resolver(::fidl_next::FromWireRef::from_wire_ref(unsafe {
13582 wire.raw.get().deref_unchecked::<crate::wire::ExposeResolver<'de>>()
13583 })),
13584
13585 7 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
13586 wire.raw.get().deref_unchecked::<crate::wire::ExposeDictionary<'de>>()
13587 })),
13588
13589 8 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
13590 wire.raw.get().deref_unchecked::<crate::wire::ExposeConfiguration<'de>>()
13591 })),
13592
13593 ord => return Self::UnknownOrdinal_(ord as u64),
13594 }
13595 }
13596 }
13597
13598 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Expose<'de>> for Expose {
13599 #[inline]
13600 fn from_wire_option(
13601 wire: crate::wire_optional::Expose<'de>,
13602 ) -> ::core::option::Option<Self> {
13603 if let Some(inner) = wire.into_option() {
13604 Some(::fidl_next::FromWire::from_wire(inner))
13605 } else {
13606 None
13607 }
13608 }
13609 }
13610
13611 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Expose<'de>> for Box<Expose> {
13612 #[inline]
13613 fn from_wire_option(
13614 wire: crate::wire_optional::Expose<'de>,
13615 ) -> ::core::option::Option<Self> {
13616 <
13617 Expose as ::fidl_next::FromWireOption<crate::wire_optional::Expose<'de>>
13618 >::from_wire_option(wire).map(Box::new)
13619 }
13620 }
13621
13622 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::Expose<'de>> for Box<Expose> {
13623 #[inline]
13624 fn from_wire_option_ref(
13625 wire: &crate::wire_optional::Expose<'de>,
13626 ) -> ::core::option::Option<Self> {
13627 if let Some(inner) = wire.as_ref() {
13628 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
13629 } else {
13630 None
13631 }
13632 }
13633 }
13634
13635 #[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"]
13636 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
13637 pub struct OfferService {
13638 pub source: ::core::option::Option<crate::natural::Ref>,
13639
13640 pub source_name: ::core::option::Option<::std::string::String>,
13641
13642 pub target: ::core::option::Option<crate::natural::Ref>,
13643
13644 pub target_name: ::core::option::Option<::std::string::String>,
13645
13646 pub source_instance_filter: ::core::option::Option<::std::vec::Vec<::std::string::String>>,
13647
13648 pub renamed_instances: ::core::option::Option<::std::vec::Vec<crate::natural::NameMapping>>,
13649
13650 pub availability: ::core::option::Option<crate::natural::Availability>,
13651
13652 pub source_dictionary: ::core::option::Option<::std::string::String>,
13653
13654 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
13655 }
13656
13657 impl OfferService {
13658 fn __max_ordinal(&self) -> usize {
13659 if self.dependency_type.is_some() {
13660 return 9;
13661 }
13662
13663 if self.source_dictionary.is_some() {
13664 return 8;
13665 }
13666
13667 if self.availability.is_some() {
13668 return 7;
13669 }
13670
13671 if self.renamed_instances.is_some() {
13672 return 6;
13673 }
13674
13675 if self.source_instance_filter.is_some() {
13676 return 5;
13677 }
13678
13679 if self.target_name.is_some() {
13680 return 4;
13681 }
13682
13683 if self.target.is_some() {
13684 return 3;
13685 }
13686
13687 if self.source_name.is_some() {
13688 return 2;
13689 }
13690
13691 if self.source.is_some() {
13692 return 1;
13693 }
13694
13695 0
13696 }
13697 }
13698
13699 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferService<'static>, ___E> for OfferService
13700 where
13701 ___E: ::fidl_next::Encoder + ?Sized,
13702 {
13703 #[inline]
13704 fn encode(
13705 mut self,
13706 encoder: &mut ___E,
13707 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferService<'static>>,
13708 _: (),
13709 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13710 ::fidl_next::munge!(let crate::wire::OfferService { table } = out);
13711
13712 let max_ord = self.__max_ordinal();
13713
13714 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
13715 ::fidl_next::Wire::zero_padding(&mut out);
13716
13717 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
13718 ::fidl_next::wire::Envelope,
13719 >(encoder, max_ord);
13720
13721 for i in 1..=max_ord {
13722 match i {
13723 9 => {
13724 if let Some(value) = self.dependency_type.take() {
13725 ::fidl_next::wire::Envelope::encode_value::<
13726 crate::wire::DependencyType,
13727 ___E,
13728 >(
13729 value, preallocated.encoder, &mut out, ()
13730 )?;
13731 } else {
13732 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13733 }
13734 }
13735
13736 8 => {
13737 if let Some(value) = self.source_dictionary.take() {
13738 ::fidl_next::wire::Envelope::encode_value::<
13739 ::fidl_next::wire::String<'static>,
13740 ___E,
13741 >(
13742 value, preallocated.encoder, &mut out, 1024
13743 )?;
13744 } else {
13745 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13746 }
13747 }
13748
13749 7 => {
13750 if let Some(value) = self.availability.take() {
13751 ::fidl_next::wire::Envelope::encode_value::<
13752 crate::wire::Availability,
13753 ___E,
13754 >(
13755 value, preallocated.encoder, &mut out, ()
13756 )?;
13757 } else {
13758 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13759 }
13760 }
13761
13762 6 => {
13763 if let Some(value) = self.renamed_instances.take() {
13764 ::fidl_next::wire::Envelope::encode_value::<
13765 ::fidl_next::wire::Vector<
13766 'static,
13767 crate::wire::NameMapping<'static>,
13768 >,
13769 ___E,
13770 >(
13771 value, preallocated.encoder, &mut out, (4294967295, ())
13772 )?;
13773 } else {
13774 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13775 }
13776 }
13777
13778 5 => {
13779 if let Some(value) = self.source_instance_filter.take() {
13780 ::fidl_next::wire::Envelope::encode_value::<
13781 ::fidl_next::wire::Vector<
13782 'static,
13783 ::fidl_next::wire::String<'static>,
13784 >,
13785 ___E,
13786 >(
13787 value, preallocated.encoder, &mut out, (4294967295, 100)
13788 )?;
13789 } else {
13790 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13791 }
13792 }
13793
13794 4 => {
13795 if let Some(value) = self.target_name.take() {
13796 ::fidl_next::wire::Envelope::encode_value::<
13797 ::fidl_next::wire::String<'static>,
13798 ___E,
13799 >(
13800 value, preallocated.encoder, &mut out, 100
13801 )?;
13802 } else {
13803 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13804 }
13805 }
13806
13807 3 => {
13808 if let Some(value) = self.target.take() {
13809 ::fidl_next::wire::Envelope::encode_value::<
13810 crate::wire::Ref<'static>,
13811 ___E,
13812 >(
13813 value, preallocated.encoder, &mut out, ()
13814 )?;
13815 } else {
13816 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13817 }
13818 }
13819
13820 2 => {
13821 if let Some(value) = self.source_name.take() {
13822 ::fidl_next::wire::Envelope::encode_value::<
13823 ::fidl_next::wire::String<'static>,
13824 ___E,
13825 >(
13826 value, preallocated.encoder, &mut out, 100
13827 )?;
13828 } else {
13829 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13830 }
13831 }
13832
13833 1 => {
13834 if let Some(value) = self.source.take() {
13835 ::fidl_next::wire::Envelope::encode_value::<
13836 crate::wire::Ref<'static>,
13837 ___E,
13838 >(
13839 value, preallocated.encoder, &mut out, ()
13840 )?;
13841 } else {
13842 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13843 }
13844 }
13845
13846 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
13847 }
13848 unsafe {
13849 preallocated.write_next(out.assume_init_ref());
13850 }
13851 }
13852
13853 ::fidl_next::wire::Table::encode_len(table, max_ord);
13854
13855 Ok(())
13856 }
13857 }
13858
13859 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferService<'static>, ___E>
13860 for &'a OfferService
13861 where
13862 ___E: ::fidl_next::Encoder + ?Sized,
13863 {
13864 #[inline]
13865 fn encode(
13866 self,
13867 encoder: &mut ___E,
13868 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferService<'static>>,
13869 _: (),
13870 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13871 ::fidl_next::munge!(let crate::wire::OfferService { table } = out);
13872
13873 let max_ord = self.__max_ordinal();
13874
13875 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
13876 ::fidl_next::Wire::zero_padding(&mut out);
13877
13878 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
13879 ::fidl_next::wire::Envelope,
13880 >(encoder, max_ord);
13881
13882 for i in 1..=max_ord {
13883 match i {
13884 9 => {
13885 if let Some(value) = &self.dependency_type {
13886 ::fidl_next::wire::Envelope::encode_value::<
13887 crate::wire::DependencyType,
13888 ___E,
13889 >(
13890 value, preallocated.encoder, &mut out, ()
13891 )?;
13892 } else {
13893 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13894 }
13895 }
13896
13897 8 => {
13898 if let Some(value) = &self.source_dictionary {
13899 ::fidl_next::wire::Envelope::encode_value::<
13900 ::fidl_next::wire::String<'static>,
13901 ___E,
13902 >(
13903 value, preallocated.encoder, &mut out, 1024
13904 )?;
13905 } else {
13906 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13907 }
13908 }
13909
13910 7 => {
13911 if let Some(value) = &self.availability {
13912 ::fidl_next::wire::Envelope::encode_value::<
13913 crate::wire::Availability,
13914 ___E,
13915 >(
13916 value, preallocated.encoder, &mut out, ()
13917 )?;
13918 } else {
13919 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13920 }
13921 }
13922
13923 6 => {
13924 if let Some(value) = &self.renamed_instances {
13925 ::fidl_next::wire::Envelope::encode_value::<
13926 ::fidl_next::wire::Vector<
13927 'static,
13928 crate::wire::NameMapping<'static>,
13929 >,
13930 ___E,
13931 >(
13932 value, preallocated.encoder, &mut out, (4294967295, ())
13933 )?;
13934 } else {
13935 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13936 }
13937 }
13938
13939 5 => {
13940 if let Some(value) = &self.source_instance_filter {
13941 ::fidl_next::wire::Envelope::encode_value::<
13942 ::fidl_next::wire::Vector<
13943 'static,
13944 ::fidl_next::wire::String<'static>,
13945 >,
13946 ___E,
13947 >(
13948 value, preallocated.encoder, &mut out, (4294967295, 100)
13949 )?;
13950 } else {
13951 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13952 }
13953 }
13954
13955 4 => {
13956 if let Some(value) = &self.target_name {
13957 ::fidl_next::wire::Envelope::encode_value::<
13958 ::fidl_next::wire::String<'static>,
13959 ___E,
13960 >(
13961 value, preallocated.encoder, &mut out, 100
13962 )?;
13963 } else {
13964 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13965 }
13966 }
13967
13968 3 => {
13969 if let Some(value) = &self.target {
13970 ::fidl_next::wire::Envelope::encode_value::<
13971 crate::wire::Ref<'static>,
13972 ___E,
13973 >(
13974 value, preallocated.encoder, &mut out, ()
13975 )?;
13976 } else {
13977 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13978 }
13979 }
13980
13981 2 => {
13982 if let Some(value) = &self.source_name {
13983 ::fidl_next::wire::Envelope::encode_value::<
13984 ::fidl_next::wire::String<'static>,
13985 ___E,
13986 >(
13987 value, preallocated.encoder, &mut out, 100
13988 )?;
13989 } else {
13990 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13991 }
13992 }
13993
13994 1 => {
13995 if let Some(value) = &self.source {
13996 ::fidl_next::wire::Envelope::encode_value::<
13997 crate::wire::Ref<'static>,
13998 ___E,
13999 >(
14000 value, preallocated.encoder, &mut out, ()
14001 )?;
14002 } else {
14003 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14004 }
14005 }
14006
14007 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
14008 }
14009 unsafe {
14010 preallocated.write_next(out.assume_init_ref());
14011 }
14012 }
14013
14014 ::fidl_next::wire::Table::encode_len(table, max_ord);
14015
14016 Ok(())
14017 }
14018 }
14019
14020 impl<'de> ::fidl_next::FromWire<crate::wire::OfferService<'de>> for OfferService {
14021 #[inline]
14022 fn from_wire(wire_: crate::wire::OfferService<'de>) -> Self {
14023 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
14024
14025 let source = wire_.table.get(1);
14026
14027 let source_name = wire_.table.get(2);
14028
14029 let target = wire_.table.get(3);
14030
14031 let target_name = wire_.table.get(4);
14032
14033 let source_instance_filter = wire_.table.get(5);
14034
14035 let renamed_instances = wire_.table.get(6);
14036
14037 let availability = wire_.table.get(7);
14038
14039 let source_dictionary = wire_.table.get(8);
14040
14041 let dependency_type = wire_.table.get(9);
14042
14043 Self {
14044
14045
14046 source: source.map(|envelope| ::fidl_next::FromWire::from_wire(
14047 unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() }
14048 )),
14049
14050
14051 source_name: source_name.map(|envelope| ::fidl_next::FromWire::from_wire(
14052 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
14053 )),
14054
14055
14056 target: target.map(|envelope| ::fidl_next::FromWire::from_wire(
14057 unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() }
14058 )),
14059
14060
14061 target_name: target_name.map(|envelope| ::fidl_next::FromWire::from_wire(
14062 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
14063 )),
14064
14065
14066 source_instance_filter: source_instance_filter.map(|envelope| ::fidl_next::FromWire::from_wire(
14067 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>() }
14068 )),
14069
14070
14071 renamed_instances: renamed_instances.map(|envelope| ::fidl_next::FromWire::from_wire(
14072 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::NameMapping<'de>>>() }
14073 )),
14074
14075
14076 availability: availability.map(|envelope| ::fidl_next::FromWire::from_wire(
14077 unsafe { envelope.read_unchecked::<crate::wire::Availability>() }
14078 )),
14079
14080
14081 source_dictionary: source_dictionary.map(|envelope| ::fidl_next::FromWire::from_wire(
14082 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
14083 )),
14084
14085
14086 dependency_type: dependency_type.map(|envelope| ::fidl_next::FromWire::from_wire(
14087 unsafe { envelope.read_unchecked::<crate::wire::DependencyType>() }
14088 )),
14089
14090 }
14091 }
14092 }
14093
14094 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferService<'de>> for OfferService {
14095 #[inline]
14096 fn from_wire_ref(wire: &crate::wire::OfferService<'de>) -> Self {
14097 Self {
14098
14099
14100 source: wire.table.get(1)
14101 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14102 unsafe { envelope.deref_unchecked::<crate::wire::Ref<'de>>() }
14103 )),
14104
14105
14106 source_name: wire.table.get(2)
14107 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14108 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
14109 )),
14110
14111
14112 target: wire.table.get(3)
14113 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14114 unsafe { envelope.deref_unchecked::<crate::wire::Ref<'de>>() }
14115 )),
14116
14117
14118 target_name: wire.table.get(4)
14119 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14120 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
14121 )),
14122
14123
14124 source_instance_filter: wire.table.get(5)
14125 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14126 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>() }
14127 )),
14128
14129
14130 renamed_instances: wire.table.get(6)
14131 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14132 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::NameMapping<'de>>>() }
14133 )),
14134
14135
14136 availability: wire.table.get(7)
14137 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14138 unsafe { envelope.deref_unchecked::<crate::wire::Availability>() }
14139 )),
14140
14141
14142 source_dictionary: wire.table.get(8)
14143 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14144 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
14145 )),
14146
14147
14148 dependency_type: wire.table.get(9)
14149 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14150 unsafe { envelope.deref_unchecked::<crate::wire::DependencyType>() }
14151 )),
14152
14153 }
14154 }
14155 }
14156
14157 #[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"]
14158 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
14159 pub struct OfferProtocol {
14160 pub source: ::core::option::Option<crate::natural::Ref>,
14161
14162 pub source_name: ::core::option::Option<::std::string::String>,
14163
14164 pub target: ::core::option::Option<crate::natural::Ref>,
14165
14166 pub target_name: ::core::option::Option<::std::string::String>,
14167
14168 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
14169
14170 pub availability: ::core::option::Option<crate::natural::Availability>,
14171
14172 pub source_dictionary: ::core::option::Option<::std::string::String>,
14173 }
14174
14175 impl OfferProtocol {
14176 fn __max_ordinal(&self) -> usize {
14177 if self.source_dictionary.is_some() {
14178 return 7;
14179 }
14180
14181 if self.availability.is_some() {
14182 return 6;
14183 }
14184
14185 if self.dependency_type.is_some() {
14186 return 5;
14187 }
14188
14189 if self.target_name.is_some() {
14190 return 4;
14191 }
14192
14193 if self.target.is_some() {
14194 return 3;
14195 }
14196
14197 if self.source_name.is_some() {
14198 return 2;
14199 }
14200
14201 if self.source.is_some() {
14202 return 1;
14203 }
14204
14205 0
14206 }
14207 }
14208
14209 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferProtocol<'static>, ___E> for OfferProtocol
14210 where
14211 ___E: ::fidl_next::Encoder + ?Sized,
14212 {
14213 #[inline]
14214 fn encode(
14215 mut self,
14216 encoder: &mut ___E,
14217 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferProtocol<'static>>,
14218 _: (),
14219 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14220 ::fidl_next::munge!(let crate::wire::OfferProtocol { table } = out);
14221
14222 let max_ord = self.__max_ordinal();
14223
14224 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
14225 ::fidl_next::Wire::zero_padding(&mut out);
14226
14227 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
14228 ::fidl_next::wire::Envelope,
14229 >(encoder, max_ord);
14230
14231 for i in 1..=max_ord {
14232 match i {
14233 7 => {
14234 if let Some(value) = self.source_dictionary.take() {
14235 ::fidl_next::wire::Envelope::encode_value::<
14236 ::fidl_next::wire::String<'static>,
14237 ___E,
14238 >(
14239 value, preallocated.encoder, &mut out, 1024
14240 )?;
14241 } else {
14242 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14243 }
14244 }
14245
14246 6 => {
14247 if let Some(value) = self.availability.take() {
14248 ::fidl_next::wire::Envelope::encode_value::<
14249 crate::wire::Availability,
14250 ___E,
14251 >(
14252 value, preallocated.encoder, &mut out, ()
14253 )?;
14254 } else {
14255 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14256 }
14257 }
14258
14259 5 => {
14260 if let Some(value) = self.dependency_type.take() {
14261 ::fidl_next::wire::Envelope::encode_value::<
14262 crate::wire::DependencyType,
14263 ___E,
14264 >(
14265 value, preallocated.encoder, &mut out, ()
14266 )?;
14267 } else {
14268 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14269 }
14270 }
14271
14272 4 => {
14273 if let Some(value) = self.target_name.take() {
14274 ::fidl_next::wire::Envelope::encode_value::<
14275 ::fidl_next::wire::String<'static>,
14276 ___E,
14277 >(
14278 value, preallocated.encoder, &mut out, 100
14279 )?;
14280 } else {
14281 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14282 }
14283 }
14284
14285 3 => {
14286 if let Some(value) = self.target.take() {
14287 ::fidl_next::wire::Envelope::encode_value::<
14288 crate::wire::Ref<'static>,
14289 ___E,
14290 >(
14291 value, preallocated.encoder, &mut out, ()
14292 )?;
14293 } else {
14294 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14295 }
14296 }
14297
14298 2 => {
14299 if let Some(value) = self.source_name.take() {
14300 ::fidl_next::wire::Envelope::encode_value::<
14301 ::fidl_next::wire::String<'static>,
14302 ___E,
14303 >(
14304 value, preallocated.encoder, &mut out, 100
14305 )?;
14306 } else {
14307 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14308 }
14309 }
14310
14311 1 => {
14312 if let Some(value) = self.source.take() {
14313 ::fidl_next::wire::Envelope::encode_value::<
14314 crate::wire::Ref<'static>,
14315 ___E,
14316 >(
14317 value, preallocated.encoder, &mut out, ()
14318 )?;
14319 } else {
14320 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14321 }
14322 }
14323
14324 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
14325 }
14326 unsafe {
14327 preallocated.write_next(out.assume_init_ref());
14328 }
14329 }
14330
14331 ::fidl_next::wire::Table::encode_len(table, max_ord);
14332
14333 Ok(())
14334 }
14335 }
14336
14337 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferProtocol<'static>, ___E>
14338 for &'a OfferProtocol
14339 where
14340 ___E: ::fidl_next::Encoder + ?Sized,
14341 {
14342 #[inline]
14343 fn encode(
14344 self,
14345 encoder: &mut ___E,
14346 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferProtocol<'static>>,
14347 _: (),
14348 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14349 ::fidl_next::munge!(let crate::wire::OfferProtocol { table } = out);
14350
14351 let max_ord = self.__max_ordinal();
14352
14353 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
14354 ::fidl_next::Wire::zero_padding(&mut out);
14355
14356 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
14357 ::fidl_next::wire::Envelope,
14358 >(encoder, max_ord);
14359
14360 for i in 1..=max_ord {
14361 match i {
14362 7 => {
14363 if let Some(value) = &self.source_dictionary {
14364 ::fidl_next::wire::Envelope::encode_value::<
14365 ::fidl_next::wire::String<'static>,
14366 ___E,
14367 >(
14368 value, preallocated.encoder, &mut out, 1024
14369 )?;
14370 } else {
14371 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14372 }
14373 }
14374
14375 6 => {
14376 if let Some(value) = &self.availability {
14377 ::fidl_next::wire::Envelope::encode_value::<
14378 crate::wire::Availability,
14379 ___E,
14380 >(
14381 value, preallocated.encoder, &mut out, ()
14382 )?;
14383 } else {
14384 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14385 }
14386 }
14387
14388 5 => {
14389 if let Some(value) = &self.dependency_type {
14390 ::fidl_next::wire::Envelope::encode_value::<
14391 crate::wire::DependencyType,
14392 ___E,
14393 >(
14394 value, preallocated.encoder, &mut out, ()
14395 )?;
14396 } else {
14397 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14398 }
14399 }
14400
14401 4 => {
14402 if let Some(value) = &self.target_name {
14403 ::fidl_next::wire::Envelope::encode_value::<
14404 ::fidl_next::wire::String<'static>,
14405 ___E,
14406 >(
14407 value, preallocated.encoder, &mut out, 100
14408 )?;
14409 } else {
14410 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14411 }
14412 }
14413
14414 3 => {
14415 if let Some(value) = &self.target {
14416 ::fidl_next::wire::Envelope::encode_value::<
14417 crate::wire::Ref<'static>,
14418 ___E,
14419 >(
14420 value, preallocated.encoder, &mut out, ()
14421 )?;
14422 } else {
14423 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14424 }
14425 }
14426
14427 2 => {
14428 if let Some(value) = &self.source_name {
14429 ::fidl_next::wire::Envelope::encode_value::<
14430 ::fidl_next::wire::String<'static>,
14431 ___E,
14432 >(
14433 value, preallocated.encoder, &mut out, 100
14434 )?;
14435 } else {
14436 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14437 }
14438 }
14439
14440 1 => {
14441 if let Some(value) = &self.source {
14442 ::fidl_next::wire::Envelope::encode_value::<
14443 crate::wire::Ref<'static>,
14444 ___E,
14445 >(
14446 value, preallocated.encoder, &mut out, ()
14447 )?;
14448 } else {
14449 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14450 }
14451 }
14452
14453 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
14454 }
14455 unsafe {
14456 preallocated.write_next(out.assume_init_ref());
14457 }
14458 }
14459
14460 ::fidl_next::wire::Table::encode_len(table, max_ord);
14461
14462 Ok(())
14463 }
14464 }
14465
14466 impl<'de> ::fidl_next::FromWire<crate::wire::OfferProtocol<'de>> for OfferProtocol {
14467 #[inline]
14468 fn from_wire(wire_: crate::wire::OfferProtocol<'de>) -> Self {
14469 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
14470
14471 let source = wire_.table.get(1);
14472
14473 let source_name = wire_.table.get(2);
14474
14475 let target = wire_.table.get(3);
14476
14477 let target_name = wire_.table.get(4);
14478
14479 let dependency_type = wire_.table.get(5);
14480
14481 let availability = wire_.table.get(6);
14482
14483 let source_dictionary = wire_.table.get(7);
14484
14485 Self {
14486 source: source.map(|envelope| {
14487 ::fidl_next::FromWire::from_wire(unsafe {
14488 envelope.read_unchecked::<crate::wire::Ref<'de>>()
14489 })
14490 }),
14491
14492 source_name: source_name.map(|envelope| {
14493 ::fidl_next::FromWire::from_wire(unsafe {
14494 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
14495 })
14496 }),
14497
14498 target: target.map(|envelope| {
14499 ::fidl_next::FromWire::from_wire(unsafe {
14500 envelope.read_unchecked::<crate::wire::Ref<'de>>()
14501 })
14502 }),
14503
14504 target_name: target_name.map(|envelope| {
14505 ::fidl_next::FromWire::from_wire(unsafe {
14506 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
14507 })
14508 }),
14509
14510 dependency_type: dependency_type.map(|envelope| {
14511 ::fidl_next::FromWire::from_wire(unsafe {
14512 envelope.read_unchecked::<crate::wire::DependencyType>()
14513 })
14514 }),
14515
14516 availability: availability.map(|envelope| {
14517 ::fidl_next::FromWire::from_wire(unsafe {
14518 envelope.read_unchecked::<crate::wire::Availability>()
14519 })
14520 }),
14521
14522 source_dictionary: source_dictionary.map(|envelope| {
14523 ::fidl_next::FromWire::from_wire(unsafe {
14524 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
14525 })
14526 }),
14527 }
14528 }
14529 }
14530
14531 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferProtocol<'de>> for OfferProtocol {
14532 #[inline]
14533 fn from_wire_ref(wire: &crate::wire::OfferProtocol<'de>) -> Self {
14534 Self {
14535 source: wire.table.get(1).map(|envelope| {
14536 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14537 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
14538 })
14539 }),
14540
14541 source_name: wire.table.get(2).map(|envelope| {
14542 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14543 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
14544 })
14545 }),
14546
14547 target: wire.table.get(3).map(|envelope| {
14548 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14549 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
14550 })
14551 }),
14552
14553 target_name: wire.table.get(4).map(|envelope| {
14554 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14555 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
14556 })
14557 }),
14558
14559 dependency_type: wire.table.get(5).map(|envelope| {
14560 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14561 envelope.deref_unchecked::<crate::wire::DependencyType>()
14562 })
14563 }),
14564
14565 availability: wire.table.get(6).map(|envelope| {
14566 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14567 envelope.deref_unchecked::<crate::wire::Availability>()
14568 })
14569 }),
14570
14571 source_dictionary: wire.table.get(7).map(|envelope| {
14572 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14573 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
14574 })
14575 }),
14576 }
14577 }
14578 }
14579
14580 #[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"]
14581 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
14582 pub struct OfferDirectory {
14583 pub source: ::core::option::Option<crate::natural::Ref>,
14584
14585 pub source_name: ::core::option::Option<::std::string::String>,
14586
14587 pub target: ::core::option::Option<crate::natural::Ref>,
14588
14589 pub target_name: ::core::option::Option<::std::string::String>,
14590
14591 pub rights: ::core::option::Option<::fidl_next_common_fuchsia_io::natural::Operations>,
14592
14593 pub subdir: ::core::option::Option<::std::string::String>,
14594
14595 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
14596
14597 pub availability: ::core::option::Option<crate::natural::Availability>,
14598
14599 pub source_dictionary: ::core::option::Option<::std::string::String>,
14600 }
14601
14602 impl OfferDirectory {
14603 fn __max_ordinal(&self) -> usize {
14604 if self.source_dictionary.is_some() {
14605 return 9;
14606 }
14607
14608 if self.availability.is_some() {
14609 return 8;
14610 }
14611
14612 if self.dependency_type.is_some() {
14613 return 7;
14614 }
14615
14616 if self.subdir.is_some() {
14617 return 6;
14618 }
14619
14620 if self.rights.is_some() {
14621 return 5;
14622 }
14623
14624 if self.target_name.is_some() {
14625 return 4;
14626 }
14627
14628 if self.target.is_some() {
14629 return 3;
14630 }
14631
14632 if self.source_name.is_some() {
14633 return 2;
14634 }
14635
14636 if self.source.is_some() {
14637 return 1;
14638 }
14639
14640 0
14641 }
14642 }
14643
14644 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferDirectory<'static>, ___E> for OfferDirectory
14645 where
14646 ___E: ::fidl_next::Encoder + ?Sized,
14647 {
14648 #[inline]
14649 fn encode(
14650 mut self,
14651 encoder: &mut ___E,
14652 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferDirectory<'static>>,
14653 _: (),
14654 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14655 ::fidl_next::munge!(let crate::wire::OfferDirectory { table } = out);
14656
14657 let max_ord = self.__max_ordinal();
14658
14659 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
14660 ::fidl_next::Wire::zero_padding(&mut out);
14661
14662 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
14663 ::fidl_next::wire::Envelope,
14664 >(encoder, max_ord);
14665
14666 for i in 1..=max_ord {
14667 match i {
14668 9 => {
14669 if let Some(value) = self.source_dictionary.take() {
14670 ::fidl_next::wire::Envelope::encode_value::<
14671 ::fidl_next::wire::String<'static>,
14672 ___E,
14673 >(
14674 value, preallocated.encoder, &mut out, 1024
14675 )?;
14676 } else {
14677 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14678 }
14679 }
14680
14681 8 => {
14682 if let Some(value) = self.availability.take() {
14683 ::fidl_next::wire::Envelope::encode_value::<
14684 crate::wire::Availability,
14685 ___E,
14686 >(
14687 value, preallocated.encoder, &mut out, ()
14688 )?;
14689 } else {
14690 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14691 }
14692 }
14693
14694 7 => {
14695 if let Some(value) = self.dependency_type.take() {
14696 ::fidl_next::wire::Envelope::encode_value::<
14697 crate::wire::DependencyType,
14698 ___E,
14699 >(
14700 value, preallocated.encoder, &mut out, ()
14701 )?;
14702 } else {
14703 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14704 }
14705 }
14706
14707 6 => {
14708 if let Some(value) = self.subdir.take() {
14709 ::fidl_next::wire::Envelope::encode_value::<
14710 ::fidl_next::wire::String<'static>,
14711 ___E,
14712 >(
14713 value, preallocated.encoder, &mut out, 1024
14714 )?;
14715 } else {
14716 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14717 }
14718 }
14719
14720 5 => {
14721 if let Some(value) = self.rights.take() {
14722 ::fidl_next::wire::Envelope::encode_value::<
14723 ::fidl_next_common_fuchsia_io::wire::Operations,
14724 ___E,
14725 >(
14726 value, preallocated.encoder, &mut out, ()
14727 )?;
14728 } else {
14729 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14730 }
14731 }
14732
14733 4 => {
14734 if let Some(value) = self.target_name.take() {
14735 ::fidl_next::wire::Envelope::encode_value::<
14736 ::fidl_next::wire::String<'static>,
14737 ___E,
14738 >(
14739 value, preallocated.encoder, &mut out, 100
14740 )?;
14741 } else {
14742 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14743 }
14744 }
14745
14746 3 => {
14747 if let Some(value) = self.target.take() {
14748 ::fidl_next::wire::Envelope::encode_value::<
14749 crate::wire::Ref<'static>,
14750 ___E,
14751 >(
14752 value, preallocated.encoder, &mut out, ()
14753 )?;
14754 } else {
14755 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14756 }
14757 }
14758
14759 2 => {
14760 if let Some(value) = self.source_name.take() {
14761 ::fidl_next::wire::Envelope::encode_value::<
14762 ::fidl_next::wire::String<'static>,
14763 ___E,
14764 >(
14765 value, preallocated.encoder, &mut out, 100
14766 )?;
14767 } else {
14768 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14769 }
14770 }
14771
14772 1 => {
14773 if let Some(value) = self.source.take() {
14774 ::fidl_next::wire::Envelope::encode_value::<
14775 crate::wire::Ref<'static>,
14776 ___E,
14777 >(
14778 value, preallocated.encoder, &mut out, ()
14779 )?;
14780 } else {
14781 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14782 }
14783 }
14784
14785 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
14786 }
14787 unsafe {
14788 preallocated.write_next(out.assume_init_ref());
14789 }
14790 }
14791
14792 ::fidl_next::wire::Table::encode_len(table, max_ord);
14793
14794 Ok(())
14795 }
14796 }
14797
14798 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferDirectory<'static>, ___E>
14799 for &'a OfferDirectory
14800 where
14801 ___E: ::fidl_next::Encoder + ?Sized,
14802 {
14803 #[inline]
14804 fn encode(
14805 self,
14806 encoder: &mut ___E,
14807 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferDirectory<'static>>,
14808 _: (),
14809 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14810 ::fidl_next::munge!(let crate::wire::OfferDirectory { table } = out);
14811
14812 let max_ord = self.__max_ordinal();
14813
14814 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
14815 ::fidl_next::Wire::zero_padding(&mut out);
14816
14817 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
14818 ::fidl_next::wire::Envelope,
14819 >(encoder, max_ord);
14820
14821 for i in 1..=max_ord {
14822 match i {
14823 9 => {
14824 if let Some(value) = &self.source_dictionary {
14825 ::fidl_next::wire::Envelope::encode_value::<
14826 ::fidl_next::wire::String<'static>,
14827 ___E,
14828 >(
14829 value, preallocated.encoder, &mut out, 1024
14830 )?;
14831 } else {
14832 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14833 }
14834 }
14835
14836 8 => {
14837 if let Some(value) = &self.availability {
14838 ::fidl_next::wire::Envelope::encode_value::<
14839 crate::wire::Availability,
14840 ___E,
14841 >(
14842 value, preallocated.encoder, &mut out, ()
14843 )?;
14844 } else {
14845 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14846 }
14847 }
14848
14849 7 => {
14850 if let Some(value) = &self.dependency_type {
14851 ::fidl_next::wire::Envelope::encode_value::<
14852 crate::wire::DependencyType,
14853 ___E,
14854 >(
14855 value, preallocated.encoder, &mut out, ()
14856 )?;
14857 } else {
14858 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14859 }
14860 }
14861
14862 6 => {
14863 if let Some(value) = &self.subdir {
14864 ::fidl_next::wire::Envelope::encode_value::<
14865 ::fidl_next::wire::String<'static>,
14866 ___E,
14867 >(
14868 value, preallocated.encoder, &mut out, 1024
14869 )?;
14870 } else {
14871 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14872 }
14873 }
14874
14875 5 => {
14876 if let Some(value) = &self.rights {
14877 ::fidl_next::wire::Envelope::encode_value::<
14878 ::fidl_next_common_fuchsia_io::wire::Operations,
14879 ___E,
14880 >(
14881 value, preallocated.encoder, &mut out, ()
14882 )?;
14883 } else {
14884 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14885 }
14886 }
14887
14888 4 => {
14889 if let Some(value) = &self.target_name {
14890 ::fidl_next::wire::Envelope::encode_value::<
14891 ::fidl_next::wire::String<'static>,
14892 ___E,
14893 >(
14894 value, preallocated.encoder, &mut out, 100
14895 )?;
14896 } else {
14897 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14898 }
14899 }
14900
14901 3 => {
14902 if let Some(value) = &self.target {
14903 ::fidl_next::wire::Envelope::encode_value::<
14904 crate::wire::Ref<'static>,
14905 ___E,
14906 >(
14907 value, preallocated.encoder, &mut out, ()
14908 )?;
14909 } else {
14910 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14911 }
14912 }
14913
14914 2 => {
14915 if let Some(value) = &self.source_name {
14916 ::fidl_next::wire::Envelope::encode_value::<
14917 ::fidl_next::wire::String<'static>,
14918 ___E,
14919 >(
14920 value, preallocated.encoder, &mut out, 100
14921 )?;
14922 } else {
14923 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14924 }
14925 }
14926
14927 1 => {
14928 if let Some(value) = &self.source {
14929 ::fidl_next::wire::Envelope::encode_value::<
14930 crate::wire::Ref<'static>,
14931 ___E,
14932 >(
14933 value, preallocated.encoder, &mut out, ()
14934 )?;
14935 } else {
14936 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14937 }
14938 }
14939
14940 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
14941 }
14942 unsafe {
14943 preallocated.write_next(out.assume_init_ref());
14944 }
14945 }
14946
14947 ::fidl_next::wire::Table::encode_len(table, max_ord);
14948
14949 Ok(())
14950 }
14951 }
14952
14953 impl<'de> ::fidl_next::FromWire<crate::wire::OfferDirectory<'de>> for OfferDirectory {
14954 #[inline]
14955 fn from_wire(wire_: crate::wire::OfferDirectory<'de>) -> Self {
14956 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
14957
14958 let source = wire_.table.get(1);
14959
14960 let source_name = wire_.table.get(2);
14961
14962 let target = wire_.table.get(3);
14963
14964 let target_name = wire_.table.get(4);
14965
14966 let rights = wire_.table.get(5);
14967
14968 let subdir = wire_.table.get(6);
14969
14970 let dependency_type = wire_.table.get(7);
14971
14972 let availability = wire_.table.get(8);
14973
14974 let source_dictionary = wire_.table.get(9);
14975
14976 Self {
14977 source: source.map(|envelope| {
14978 ::fidl_next::FromWire::from_wire(unsafe {
14979 envelope.read_unchecked::<crate::wire::Ref<'de>>()
14980 })
14981 }),
14982
14983 source_name: source_name.map(|envelope| {
14984 ::fidl_next::FromWire::from_wire(unsafe {
14985 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
14986 })
14987 }),
14988
14989 target: target.map(|envelope| {
14990 ::fidl_next::FromWire::from_wire(unsafe {
14991 envelope.read_unchecked::<crate::wire::Ref<'de>>()
14992 })
14993 }),
14994
14995 target_name: target_name.map(|envelope| {
14996 ::fidl_next::FromWire::from_wire(unsafe {
14997 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
14998 })
14999 }),
15000
15001 rights: rights.map(|envelope| {
15002 ::fidl_next::FromWire::from_wire(unsafe {
15003 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
15004 })
15005 }),
15006
15007 subdir: subdir.map(|envelope| {
15008 ::fidl_next::FromWire::from_wire(unsafe {
15009 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
15010 })
15011 }),
15012
15013 dependency_type: dependency_type.map(|envelope| {
15014 ::fidl_next::FromWire::from_wire(unsafe {
15015 envelope.read_unchecked::<crate::wire::DependencyType>()
15016 })
15017 }),
15018
15019 availability: availability.map(|envelope| {
15020 ::fidl_next::FromWire::from_wire(unsafe {
15021 envelope.read_unchecked::<crate::wire::Availability>()
15022 })
15023 }),
15024
15025 source_dictionary: source_dictionary.map(|envelope| {
15026 ::fidl_next::FromWire::from_wire(unsafe {
15027 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
15028 })
15029 }),
15030 }
15031 }
15032 }
15033
15034 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferDirectory<'de>> for OfferDirectory {
15035 #[inline]
15036 fn from_wire_ref(wire: &crate::wire::OfferDirectory<'de>) -> Self {
15037 Self {
15038 source: wire.table.get(1).map(|envelope| {
15039 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15040 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15041 })
15042 }),
15043
15044 source_name: wire.table.get(2).map(|envelope| {
15045 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15046 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15047 })
15048 }),
15049
15050 target: wire.table.get(3).map(|envelope| {
15051 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15052 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15053 })
15054 }),
15055
15056 target_name: wire.table.get(4).map(|envelope| {
15057 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15058 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15059 })
15060 }),
15061
15062 rights: wire.table.get(5).map(|envelope| {
15063 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15064 envelope
15065 .deref_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
15066 })
15067 }),
15068
15069 subdir: wire.table.get(6).map(|envelope| {
15070 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15071 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15072 })
15073 }),
15074
15075 dependency_type: wire.table.get(7).map(|envelope| {
15076 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15077 envelope.deref_unchecked::<crate::wire::DependencyType>()
15078 })
15079 }),
15080
15081 availability: wire.table.get(8).map(|envelope| {
15082 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15083 envelope.deref_unchecked::<crate::wire::Availability>()
15084 })
15085 }),
15086
15087 source_dictionary: wire.table.get(9).map(|envelope| {
15088 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15089 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15090 })
15091 }),
15092 }
15093 }
15094 }
15095
15096 #[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"]
15097 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
15098 pub struct OfferStorage {
15099 pub source_name: ::core::option::Option<::std::string::String>,
15100
15101 pub source: ::core::option::Option<crate::natural::Ref>,
15102
15103 pub target: ::core::option::Option<crate::natural::Ref>,
15104
15105 pub target_name: ::core::option::Option<::std::string::String>,
15106
15107 pub availability: ::core::option::Option<crate::natural::Availability>,
15108 }
15109
15110 impl OfferStorage {
15111 fn __max_ordinal(&self) -> usize {
15112 if self.availability.is_some() {
15113 return 5;
15114 }
15115
15116 if self.target_name.is_some() {
15117 return 4;
15118 }
15119
15120 if self.target.is_some() {
15121 return 3;
15122 }
15123
15124 if self.source.is_some() {
15125 return 2;
15126 }
15127
15128 if self.source_name.is_some() {
15129 return 1;
15130 }
15131
15132 0
15133 }
15134 }
15135
15136 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferStorage<'static>, ___E> for OfferStorage
15137 where
15138 ___E: ::fidl_next::Encoder + ?Sized,
15139 {
15140 #[inline]
15141 fn encode(
15142 mut self,
15143 encoder: &mut ___E,
15144 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferStorage<'static>>,
15145 _: (),
15146 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15147 ::fidl_next::munge!(let crate::wire::OfferStorage { table } = out);
15148
15149 let max_ord = self.__max_ordinal();
15150
15151 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
15152 ::fidl_next::Wire::zero_padding(&mut out);
15153
15154 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
15155 ::fidl_next::wire::Envelope,
15156 >(encoder, max_ord);
15157
15158 for i in 1..=max_ord {
15159 match i {
15160 5 => {
15161 if let Some(value) = self.availability.take() {
15162 ::fidl_next::wire::Envelope::encode_value::<
15163 crate::wire::Availability,
15164 ___E,
15165 >(
15166 value, preallocated.encoder, &mut out, ()
15167 )?;
15168 } else {
15169 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15170 }
15171 }
15172
15173 4 => {
15174 if let Some(value) = self.target_name.take() {
15175 ::fidl_next::wire::Envelope::encode_value::<
15176 ::fidl_next::wire::String<'static>,
15177 ___E,
15178 >(
15179 value, preallocated.encoder, &mut out, 100
15180 )?;
15181 } else {
15182 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15183 }
15184 }
15185
15186 3 => {
15187 if let Some(value) = self.target.take() {
15188 ::fidl_next::wire::Envelope::encode_value::<
15189 crate::wire::Ref<'static>,
15190 ___E,
15191 >(
15192 value, preallocated.encoder, &mut out, ()
15193 )?;
15194 } else {
15195 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15196 }
15197 }
15198
15199 2 => {
15200 if let Some(value) = self.source.take() {
15201 ::fidl_next::wire::Envelope::encode_value::<
15202 crate::wire::Ref<'static>,
15203 ___E,
15204 >(
15205 value, preallocated.encoder, &mut out, ()
15206 )?;
15207 } else {
15208 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15209 }
15210 }
15211
15212 1 => {
15213 if let Some(value) = self.source_name.take() {
15214 ::fidl_next::wire::Envelope::encode_value::<
15215 ::fidl_next::wire::String<'static>,
15216 ___E,
15217 >(
15218 value, preallocated.encoder, &mut out, 100
15219 )?;
15220 } else {
15221 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15222 }
15223 }
15224
15225 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
15226 }
15227 unsafe {
15228 preallocated.write_next(out.assume_init_ref());
15229 }
15230 }
15231
15232 ::fidl_next::wire::Table::encode_len(table, max_ord);
15233
15234 Ok(())
15235 }
15236 }
15237
15238 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferStorage<'static>, ___E>
15239 for &'a OfferStorage
15240 where
15241 ___E: ::fidl_next::Encoder + ?Sized,
15242 {
15243 #[inline]
15244 fn encode(
15245 self,
15246 encoder: &mut ___E,
15247 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferStorage<'static>>,
15248 _: (),
15249 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15250 ::fidl_next::munge!(let crate::wire::OfferStorage { table } = out);
15251
15252 let max_ord = self.__max_ordinal();
15253
15254 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
15255 ::fidl_next::Wire::zero_padding(&mut out);
15256
15257 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
15258 ::fidl_next::wire::Envelope,
15259 >(encoder, max_ord);
15260
15261 for i in 1..=max_ord {
15262 match i {
15263 5 => {
15264 if let Some(value) = &self.availability {
15265 ::fidl_next::wire::Envelope::encode_value::<
15266 crate::wire::Availability,
15267 ___E,
15268 >(
15269 value, preallocated.encoder, &mut out, ()
15270 )?;
15271 } else {
15272 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15273 }
15274 }
15275
15276 4 => {
15277 if let Some(value) = &self.target_name {
15278 ::fidl_next::wire::Envelope::encode_value::<
15279 ::fidl_next::wire::String<'static>,
15280 ___E,
15281 >(
15282 value, preallocated.encoder, &mut out, 100
15283 )?;
15284 } else {
15285 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15286 }
15287 }
15288
15289 3 => {
15290 if let Some(value) = &self.target {
15291 ::fidl_next::wire::Envelope::encode_value::<
15292 crate::wire::Ref<'static>,
15293 ___E,
15294 >(
15295 value, preallocated.encoder, &mut out, ()
15296 )?;
15297 } else {
15298 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15299 }
15300 }
15301
15302 2 => {
15303 if let Some(value) = &self.source {
15304 ::fidl_next::wire::Envelope::encode_value::<
15305 crate::wire::Ref<'static>,
15306 ___E,
15307 >(
15308 value, preallocated.encoder, &mut out, ()
15309 )?;
15310 } else {
15311 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15312 }
15313 }
15314
15315 1 => {
15316 if let Some(value) = &self.source_name {
15317 ::fidl_next::wire::Envelope::encode_value::<
15318 ::fidl_next::wire::String<'static>,
15319 ___E,
15320 >(
15321 value, preallocated.encoder, &mut out, 100
15322 )?;
15323 } else {
15324 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15325 }
15326 }
15327
15328 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
15329 }
15330 unsafe {
15331 preallocated.write_next(out.assume_init_ref());
15332 }
15333 }
15334
15335 ::fidl_next::wire::Table::encode_len(table, max_ord);
15336
15337 Ok(())
15338 }
15339 }
15340
15341 impl<'de> ::fidl_next::FromWire<crate::wire::OfferStorage<'de>> for OfferStorage {
15342 #[inline]
15343 fn from_wire(wire_: crate::wire::OfferStorage<'de>) -> Self {
15344 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
15345
15346 let source_name = wire_.table.get(1);
15347
15348 let source = wire_.table.get(2);
15349
15350 let target = wire_.table.get(3);
15351
15352 let target_name = wire_.table.get(4);
15353
15354 let availability = wire_.table.get(5);
15355
15356 Self {
15357 source_name: source_name.map(|envelope| {
15358 ::fidl_next::FromWire::from_wire(unsafe {
15359 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
15360 })
15361 }),
15362
15363 source: source.map(|envelope| {
15364 ::fidl_next::FromWire::from_wire(unsafe {
15365 envelope.read_unchecked::<crate::wire::Ref<'de>>()
15366 })
15367 }),
15368
15369 target: target.map(|envelope| {
15370 ::fidl_next::FromWire::from_wire(unsafe {
15371 envelope.read_unchecked::<crate::wire::Ref<'de>>()
15372 })
15373 }),
15374
15375 target_name: target_name.map(|envelope| {
15376 ::fidl_next::FromWire::from_wire(unsafe {
15377 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
15378 })
15379 }),
15380
15381 availability: availability.map(|envelope| {
15382 ::fidl_next::FromWire::from_wire(unsafe {
15383 envelope.read_unchecked::<crate::wire::Availability>()
15384 })
15385 }),
15386 }
15387 }
15388 }
15389
15390 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferStorage<'de>> for OfferStorage {
15391 #[inline]
15392 fn from_wire_ref(wire: &crate::wire::OfferStorage<'de>) -> Self {
15393 Self {
15394 source_name: wire.table.get(1).map(|envelope| {
15395 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15396 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15397 })
15398 }),
15399
15400 source: wire.table.get(2).map(|envelope| {
15401 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15402 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15403 })
15404 }),
15405
15406 target: wire.table.get(3).map(|envelope| {
15407 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15408 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15409 })
15410 }),
15411
15412 target_name: wire.table.get(4).map(|envelope| {
15413 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15414 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15415 })
15416 }),
15417
15418 availability: wire.table.get(5).map(|envelope| {
15419 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15420 envelope.deref_unchecked::<crate::wire::Availability>()
15421 })
15422 }),
15423 }
15424 }
15425 }
15426
15427 #[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"]
15428 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
15429 pub struct OfferRunner {
15430 pub source: ::core::option::Option<crate::natural::Ref>,
15431
15432 pub source_name: ::core::option::Option<::std::string::String>,
15433
15434 pub target: ::core::option::Option<crate::natural::Ref>,
15435
15436 pub target_name: ::core::option::Option<::std::string::String>,
15437
15438 pub source_dictionary: ::core::option::Option<::std::string::String>,
15439 }
15440
15441 impl OfferRunner {
15442 fn __max_ordinal(&self) -> usize {
15443 if self.source_dictionary.is_some() {
15444 return 5;
15445 }
15446
15447 if self.target_name.is_some() {
15448 return 4;
15449 }
15450
15451 if self.target.is_some() {
15452 return 3;
15453 }
15454
15455 if self.source_name.is_some() {
15456 return 2;
15457 }
15458
15459 if self.source.is_some() {
15460 return 1;
15461 }
15462
15463 0
15464 }
15465 }
15466
15467 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferRunner<'static>, ___E> for OfferRunner
15468 where
15469 ___E: ::fidl_next::Encoder + ?Sized,
15470 {
15471 #[inline]
15472 fn encode(
15473 mut self,
15474 encoder: &mut ___E,
15475 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferRunner<'static>>,
15476 _: (),
15477 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15478 ::fidl_next::munge!(let crate::wire::OfferRunner { table } = out);
15479
15480 let max_ord = self.__max_ordinal();
15481
15482 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
15483 ::fidl_next::Wire::zero_padding(&mut out);
15484
15485 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
15486 ::fidl_next::wire::Envelope,
15487 >(encoder, max_ord);
15488
15489 for i in 1..=max_ord {
15490 match i {
15491 5 => {
15492 if let Some(value) = self.source_dictionary.take() {
15493 ::fidl_next::wire::Envelope::encode_value::<
15494 ::fidl_next::wire::String<'static>,
15495 ___E,
15496 >(
15497 value, preallocated.encoder, &mut out, 1024
15498 )?;
15499 } else {
15500 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15501 }
15502 }
15503
15504 4 => {
15505 if let Some(value) = self.target_name.take() {
15506 ::fidl_next::wire::Envelope::encode_value::<
15507 ::fidl_next::wire::String<'static>,
15508 ___E,
15509 >(
15510 value, preallocated.encoder, &mut out, 100
15511 )?;
15512 } else {
15513 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15514 }
15515 }
15516
15517 3 => {
15518 if let Some(value) = self.target.take() {
15519 ::fidl_next::wire::Envelope::encode_value::<
15520 crate::wire::Ref<'static>,
15521 ___E,
15522 >(
15523 value, preallocated.encoder, &mut out, ()
15524 )?;
15525 } else {
15526 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15527 }
15528 }
15529
15530 2 => {
15531 if let Some(value) = self.source_name.take() {
15532 ::fidl_next::wire::Envelope::encode_value::<
15533 ::fidl_next::wire::String<'static>,
15534 ___E,
15535 >(
15536 value, preallocated.encoder, &mut out, 100
15537 )?;
15538 } else {
15539 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15540 }
15541 }
15542
15543 1 => {
15544 if let Some(value) = self.source.take() {
15545 ::fidl_next::wire::Envelope::encode_value::<
15546 crate::wire::Ref<'static>,
15547 ___E,
15548 >(
15549 value, preallocated.encoder, &mut out, ()
15550 )?;
15551 } else {
15552 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15553 }
15554 }
15555
15556 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
15557 }
15558 unsafe {
15559 preallocated.write_next(out.assume_init_ref());
15560 }
15561 }
15562
15563 ::fidl_next::wire::Table::encode_len(table, max_ord);
15564
15565 Ok(())
15566 }
15567 }
15568
15569 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferRunner<'static>, ___E>
15570 for &'a OfferRunner
15571 where
15572 ___E: ::fidl_next::Encoder + ?Sized,
15573 {
15574 #[inline]
15575 fn encode(
15576 self,
15577 encoder: &mut ___E,
15578 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferRunner<'static>>,
15579 _: (),
15580 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15581 ::fidl_next::munge!(let crate::wire::OfferRunner { table } = out);
15582
15583 let max_ord = self.__max_ordinal();
15584
15585 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
15586 ::fidl_next::Wire::zero_padding(&mut out);
15587
15588 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
15589 ::fidl_next::wire::Envelope,
15590 >(encoder, max_ord);
15591
15592 for i in 1..=max_ord {
15593 match i {
15594 5 => {
15595 if let Some(value) = &self.source_dictionary {
15596 ::fidl_next::wire::Envelope::encode_value::<
15597 ::fidl_next::wire::String<'static>,
15598 ___E,
15599 >(
15600 value, preallocated.encoder, &mut out, 1024
15601 )?;
15602 } else {
15603 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15604 }
15605 }
15606
15607 4 => {
15608 if let Some(value) = &self.target_name {
15609 ::fidl_next::wire::Envelope::encode_value::<
15610 ::fidl_next::wire::String<'static>,
15611 ___E,
15612 >(
15613 value, preallocated.encoder, &mut out, 100
15614 )?;
15615 } else {
15616 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15617 }
15618 }
15619
15620 3 => {
15621 if let Some(value) = &self.target {
15622 ::fidl_next::wire::Envelope::encode_value::<
15623 crate::wire::Ref<'static>,
15624 ___E,
15625 >(
15626 value, preallocated.encoder, &mut out, ()
15627 )?;
15628 } else {
15629 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15630 }
15631 }
15632
15633 2 => {
15634 if let Some(value) = &self.source_name {
15635 ::fidl_next::wire::Envelope::encode_value::<
15636 ::fidl_next::wire::String<'static>,
15637 ___E,
15638 >(
15639 value, preallocated.encoder, &mut out, 100
15640 )?;
15641 } else {
15642 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15643 }
15644 }
15645
15646 1 => {
15647 if let Some(value) = &self.source {
15648 ::fidl_next::wire::Envelope::encode_value::<
15649 crate::wire::Ref<'static>,
15650 ___E,
15651 >(
15652 value, preallocated.encoder, &mut out, ()
15653 )?;
15654 } else {
15655 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15656 }
15657 }
15658
15659 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
15660 }
15661 unsafe {
15662 preallocated.write_next(out.assume_init_ref());
15663 }
15664 }
15665
15666 ::fidl_next::wire::Table::encode_len(table, max_ord);
15667
15668 Ok(())
15669 }
15670 }
15671
15672 impl<'de> ::fidl_next::FromWire<crate::wire::OfferRunner<'de>> for OfferRunner {
15673 #[inline]
15674 fn from_wire(wire_: crate::wire::OfferRunner<'de>) -> Self {
15675 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
15676
15677 let source = wire_.table.get(1);
15678
15679 let source_name = wire_.table.get(2);
15680
15681 let target = wire_.table.get(3);
15682
15683 let target_name = wire_.table.get(4);
15684
15685 let source_dictionary = wire_.table.get(5);
15686
15687 Self {
15688 source: source.map(|envelope| {
15689 ::fidl_next::FromWire::from_wire(unsafe {
15690 envelope.read_unchecked::<crate::wire::Ref<'de>>()
15691 })
15692 }),
15693
15694 source_name: source_name.map(|envelope| {
15695 ::fidl_next::FromWire::from_wire(unsafe {
15696 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
15697 })
15698 }),
15699
15700 target: target.map(|envelope| {
15701 ::fidl_next::FromWire::from_wire(unsafe {
15702 envelope.read_unchecked::<crate::wire::Ref<'de>>()
15703 })
15704 }),
15705
15706 target_name: target_name.map(|envelope| {
15707 ::fidl_next::FromWire::from_wire(unsafe {
15708 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
15709 })
15710 }),
15711
15712 source_dictionary: source_dictionary.map(|envelope| {
15713 ::fidl_next::FromWire::from_wire(unsafe {
15714 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
15715 })
15716 }),
15717 }
15718 }
15719 }
15720
15721 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferRunner<'de>> for OfferRunner {
15722 #[inline]
15723 fn from_wire_ref(wire: &crate::wire::OfferRunner<'de>) -> Self {
15724 Self {
15725 source: wire.table.get(1).map(|envelope| {
15726 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15727 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15728 })
15729 }),
15730
15731 source_name: wire.table.get(2).map(|envelope| {
15732 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15733 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15734 })
15735 }),
15736
15737 target: wire.table.get(3).map(|envelope| {
15738 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15739 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15740 })
15741 }),
15742
15743 target_name: wire.table.get(4).map(|envelope| {
15744 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15745 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15746 })
15747 }),
15748
15749 source_dictionary: wire.table.get(5).map(|envelope| {
15750 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15751 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15752 })
15753 }),
15754 }
15755 }
15756 }
15757
15758 #[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"]
15759 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
15760 pub struct OfferResolver {
15761 pub source: ::core::option::Option<crate::natural::Ref>,
15762
15763 pub source_name: ::core::option::Option<::std::string::String>,
15764
15765 pub target: ::core::option::Option<crate::natural::Ref>,
15766
15767 pub target_name: ::core::option::Option<::std::string::String>,
15768
15769 pub source_dictionary: ::core::option::Option<::std::string::String>,
15770 }
15771
15772 impl OfferResolver {
15773 fn __max_ordinal(&self) -> usize {
15774 if self.source_dictionary.is_some() {
15775 return 5;
15776 }
15777
15778 if self.target_name.is_some() {
15779 return 4;
15780 }
15781
15782 if self.target.is_some() {
15783 return 3;
15784 }
15785
15786 if self.source_name.is_some() {
15787 return 2;
15788 }
15789
15790 if self.source.is_some() {
15791 return 1;
15792 }
15793
15794 0
15795 }
15796 }
15797
15798 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferResolver<'static>, ___E> for OfferResolver
15799 where
15800 ___E: ::fidl_next::Encoder + ?Sized,
15801 {
15802 #[inline]
15803 fn encode(
15804 mut self,
15805 encoder: &mut ___E,
15806 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferResolver<'static>>,
15807 _: (),
15808 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15809 ::fidl_next::munge!(let crate::wire::OfferResolver { table } = out);
15810
15811 let max_ord = self.__max_ordinal();
15812
15813 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
15814 ::fidl_next::Wire::zero_padding(&mut out);
15815
15816 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
15817 ::fidl_next::wire::Envelope,
15818 >(encoder, max_ord);
15819
15820 for i in 1..=max_ord {
15821 match i {
15822 5 => {
15823 if let Some(value) = self.source_dictionary.take() {
15824 ::fidl_next::wire::Envelope::encode_value::<
15825 ::fidl_next::wire::String<'static>,
15826 ___E,
15827 >(
15828 value, preallocated.encoder, &mut out, 1024
15829 )?;
15830 } else {
15831 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15832 }
15833 }
15834
15835 4 => {
15836 if let Some(value) = self.target_name.take() {
15837 ::fidl_next::wire::Envelope::encode_value::<
15838 ::fidl_next::wire::String<'static>,
15839 ___E,
15840 >(
15841 value, preallocated.encoder, &mut out, 100
15842 )?;
15843 } else {
15844 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15845 }
15846 }
15847
15848 3 => {
15849 if let Some(value) = self.target.take() {
15850 ::fidl_next::wire::Envelope::encode_value::<
15851 crate::wire::Ref<'static>,
15852 ___E,
15853 >(
15854 value, preallocated.encoder, &mut out, ()
15855 )?;
15856 } else {
15857 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15858 }
15859 }
15860
15861 2 => {
15862 if let Some(value) = self.source_name.take() {
15863 ::fidl_next::wire::Envelope::encode_value::<
15864 ::fidl_next::wire::String<'static>,
15865 ___E,
15866 >(
15867 value, preallocated.encoder, &mut out, 100
15868 )?;
15869 } else {
15870 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15871 }
15872 }
15873
15874 1 => {
15875 if let Some(value) = self.source.take() {
15876 ::fidl_next::wire::Envelope::encode_value::<
15877 crate::wire::Ref<'static>,
15878 ___E,
15879 >(
15880 value, preallocated.encoder, &mut out, ()
15881 )?;
15882 } else {
15883 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15884 }
15885 }
15886
15887 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
15888 }
15889 unsafe {
15890 preallocated.write_next(out.assume_init_ref());
15891 }
15892 }
15893
15894 ::fidl_next::wire::Table::encode_len(table, max_ord);
15895
15896 Ok(())
15897 }
15898 }
15899
15900 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferResolver<'static>, ___E>
15901 for &'a OfferResolver
15902 where
15903 ___E: ::fidl_next::Encoder + ?Sized,
15904 {
15905 #[inline]
15906 fn encode(
15907 self,
15908 encoder: &mut ___E,
15909 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferResolver<'static>>,
15910 _: (),
15911 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15912 ::fidl_next::munge!(let crate::wire::OfferResolver { table } = out);
15913
15914 let max_ord = self.__max_ordinal();
15915
15916 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
15917 ::fidl_next::Wire::zero_padding(&mut out);
15918
15919 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
15920 ::fidl_next::wire::Envelope,
15921 >(encoder, max_ord);
15922
15923 for i in 1..=max_ord {
15924 match i {
15925 5 => {
15926 if let Some(value) = &self.source_dictionary {
15927 ::fidl_next::wire::Envelope::encode_value::<
15928 ::fidl_next::wire::String<'static>,
15929 ___E,
15930 >(
15931 value, preallocated.encoder, &mut out, 1024
15932 )?;
15933 } else {
15934 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15935 }
15936 }
15937
15938 4 => {
15939 if let Some(value) = &self.target_name {
15940 ::fidl_next::wire::Envelope::encode_value::<
15941 ::fidl_next::wire::String<'static>,
15942 ___E,
15943 >(
15944 value, preallocated.encoder, &mut out, 100
15945 )?;
15946 } else {
15947 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15948 }
15949 }
15950
15951 3 => {
15952 if let Some(value) = &self.target {
15953 ::fidl_next::wire::Envelope::encode_value::<
15954 crate::wire::Ref<'static>,
15955 ___E,
15956 >(
15957 value, preallocated.encoder, &mut out, ()
15958 )?;
15959 } else {
15960 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15961 }
15962 }
15963
15964 2 => {
15965 if let Some(value) = &self.source_name {
15966 ::fidl_next::wire::Envelope::encode_value::<
15967 ::fidl_next::wire::String<'static>,
15968 ___E,
15969 >(
15970 value, preallocated.encoder, &mut out, 100
15971 )?;
15972 } else {
15973 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15974 }
15975 }
15976
15977 1 => {
15978 if let Some(value) = &self.source {
15979 ::fidl_next::wire::Envelope::encode_value::<
15980 crate::wire::Ref<'static>,
15981 ___E,
15982 >(
15983 value, preallocated.encoder, &mut out, ()
15984 )?;
15985 } else {
15986 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15987 }
15988 }
15989
15990 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
15991 }
15992 unsafe {
15993 preallocated.write_next(out.assume_init_ref());
15994 }
15995 }
15996
15997 ::fidl_next::wire::Table::encode_len(table, max_ord);
15998
15999 Ok(())
16000 }
16001 }
16002
16003 impl<'de> ::fidl_next::FromWire<crate::wire::OfferResolver<'de>> for OfferResolver {
16004 #[inline]
16005 fn from_wire(wire_: crate::wire::OfferResolver<'de>) -> Self {
16006 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
16007
16008 let source = wire_.table.get(1);
16009
16010 let source_name = wire_.table.get(2);
16011
16012 let target = wire_.table.get(3);
16013
16014 let target_name = wire_.table.get(4);
16015
16016 let source_dictionary = wire_.table.get(5);
16017
16018 Self {
16019 source: source.map(|envelope| {
16020 ::fidl_next::FromWire::from_wire(unsafe {
16021 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16022 })
16023 }),
16024
16025 source_name: source_name.map(|envelope| {
16026 ::fidl_next::FromWire::from_wire(unsafe {
16027 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
16028 })
16029 }),
16030
16031 target: target.map(|envelope| {
16032 ::fidl_next::FromWire::from_wire(unsafe {
16033 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16034 })
16035 }),
16036
16037 target_name: target_name.map(|envelope| {
16038 ::fidl_next::FromWire::from_wire(unsafe {
16039 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
16040 })
16041 }),
16042
16043 source_dictionary: source_dictionary.map(|envelope| {
16044 ::fidl_next::FromWire::from_wire(unsafe {
16045 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
16046 })
16047 }),
16048 }
16049 }
16050 }
16051
16052 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferResolver<'de>> for OfferResolver {
16053 #[inline]
16054 fn from_wire_ref(wire: &crate::wire::OfferResolver<'de>) -> Self {
16055 Self {
16056 source: wire.table.get(1).map(|envelope| {
16057 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16058 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16059 })
16060 }),
16061
16062 source_name: wire.table.get(2).map(|envelope| {
16063 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16064 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
16065 })
16066 }),
16067
16068 target: wire.table.get(3).map(|envelope| {
16069 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16070 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16071 })
16072 }),
16073
16074 target_name: wire.table.get(4).map(|envelope| {
16075 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16076 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
16077 })
16078 }),
16079
16080 source_dictionary: wire.table.get(5).map(|envelope| {
16081 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16082 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
16083 })
16084 }),
16085 }
16086 }
16087 }
16088
16089 #[doc = " Declares an event stream offered by a component.\n"]
16090 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
16091 pub struct OfferEventStream {
16092 pub source: ::core::option::Option<crate::natural::Ref>,
16093
16094 pub source_name: ::core::option::Option<::std::string::String>,
16095
16096 pub scope: ::core::option::Option<::std::vec::Vec<crate::natural::Ref>>,
16097
16098 pub target: ::core::option::Option<crate::natural::Ref>,
16099
16100 pub target_name: ::core::option::Option<::std::string::String>,
16101
16102 pub availability: ::core::option::Option<crate::natural::Availability>,
16103 }
16104
16105 impl OfferEventStream {
16106 fn __max_ordinal(&self) -> usize {
16107 if self.availability.is_some() {
16108 return 7;
16109 }
16110
16111 if self.target_name.is_some() {
16112 return 5;
16113 }
16114
16115 if self.target.is_some() {
16116 return 4;
16117 }
16118
16119 if self.scope.is_some() {
16120 return 3;
16121 }
16122
16123 if self.source_name.is_some() {
16124 return 2;
16125 }
16126
16127 if self.source.is_some() {
16128 return 1;
16129 }
16130
16131 0
16132 }
16133 }
16134
16135 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferEventStream<'static>, ___E>
16136 for OfferEventStream
16137 where
16138 ___E: ::fidl_next::Encoder + ?Sized,
16139 {
16140 #[inline]
16141 fn encode(
16142 mut self,
16143 encoder: &mut ___E,
16144 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferEventStream<'static>>,
16145 _: (),
16146 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16147 ::fidl_next::munge!(let crate::wire::OfferEventStream { table } = out);
16148
16149 let max_ord = self.__max_ordinal();
16150
16151 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
16152 ::fidl_next::Wire::zero_padding(&mut out);
16153
16154 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
16155 ::fidl_next::wire::Envelope,
16156 >(encoder, max_ord);
16157
16158 for i in 1..=max_ord {
16159 match i {
16160 7 => {
16161 if let Some(value) = self.availability.take() {
16162 ::fidl_next::wire::Envelope::encode_value::<
16163 crate::wire::Availability,
16164 ___E,
16165 >(
16166 value, preallocated.encoder, &mut out, ()
16167 )?;
16168 } else {
16169 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16170 }
16171 }
16172
16173 5 => {
16174 if let Some(value) = self.target_name.take() {
16175 ::fidl_next::wire::Envelope::encode_value::<
16176 ::fidl_next::wire::String<'static>,
16177 ___E,
16178 >(
16179 value, preallocated.encoder, &mut out, 100
16180 )?;
16181 } else {
16182 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16183 }
16184 }
16185
16186 4 => {
16187 if let Some(value) = self.target.take() {
16188 ::fidl_next::wire::Envelope::encode_value::<
16189 crate::wire::Ref<'static>,
16190 ___E,
16191 >(
16192 value, preallocated.encoder, &mut out, ()
16193 )?;
16194 } else {
16195 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16196 }
16197 }
16198
16199 3 => {
16200 if let Some(value) = self.scope.take() {
16201 ::fidl_next::wire::Envelope::encode_value::<
16202 ::fidl_next::wire::Vector<'static, crate::wire::Ref<'static>>,
16203 ___E,
16204 >(
16205 value, preallocated.encoder, &mut out, (4294967295, ())
16206 )?;
16207 } else {
16208 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16209 }
16210 }
16211
16212 2 => {
16213 if let Some(value) = self.source_name.take() {
16214 ::fidl_next::wire::Envelope::encode_value::<
16215 ::fidl_next::wire::String<'static>,
16216 ___E,
16217 >(
16218 value, preallocated.encoder, &mut out, 100
16219 )?;
16220 } else {
16221 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16222 }
16223 }
16224
16225 1 => {
16226 if let Some(value) = self.source.take() {
16227 ::fidl_next::wire::Envelope::encode_value::<
16228 crate::wire::Ref<'static>,
16229 ___E,
16230 >(
16231 value, preallocated.encoder, &mut out, ()
16232 )?;
16233 } else {
16234 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16235 }
16236 }
16237
16238 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
16239 }
16240 unsafe {
16241 preallocated.write_next(out.assume_init_ref());
16242 }
16243 }
16244
16245 ::fidl_next::wire::Table::encode_len(table, max_ord);
16246
16247 Ok(())
16248 }
16249 }
16250
16251 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferEventStream<'static>, ___E>
16252 for &'a OfferEventStream
16253 where
16254 ___E: ::fidl_next::Encoder + ?Sized,
16255 {
16256 #[inline]
16257 fn encode(
16258 self,
16259 encoder: &mut ___E,
16260 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferEventStream<'static>>,
16261 _: (),
16262 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16263 ::fidl_next::munge!(let crate::wire::OfferEventStream { table } = out);
16264
16265 let max_ord = self.__max_ordinal();
16266
16267 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
16268 ::fidl_next::Wire::zero_padding(&mut out);
16269
16270 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
16271 ::fidl_next::wire::Envelope,
16272 >(encoder, max_ord);
16273
16274 for i in 1..=max_ord {
16275 match i {
16276 7 => {
16277 if let Some(value) = &self.availability {
16278 ::fidl_next::wire::Envelope::encode_value::<
16279 crate::wire::Availability,
16280 ___E,
16281 >(
16282 value, preallocated.encoder, &mut out, ()
16283 )?;
16284 } else {
16285 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16286 }
16287 }
16288
16289 5 => {
16290 if let Some(value) = &self.target_name {
16291 ::fidl_next::wire::Envelope::encode_value::<
16292 ::fidl_next::wire::String<'static>,
16293 ___E,
16294 >(
16295 value, preallocated.encoder, &mut out, 100
16296 )?;
16297 } else {
16298 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16299 }
16300 }
16301
16302 4 => {
16303 if let Some(value) = &self.target {
16304 ::fidl_next::wire::Envelope::encode_value::<
16305 crate::wire::Ref<'static>,
16306 ___E,
16307 >(
16308 value, preallocated.encoder, &mut out, ()
16309 )?;
16310 } else {
16311 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16312 }
16313 }
16314
16315 3 => {
16316 if let Some(value) = &self.scope {
16317 ::fidl_next::wire::Envelope::encode_value::<
16318 ::fidl_next::wire::Vector<'static, crate::wire::Ref<'static>>,
16319 ___E,
16320 >(
16321 value, preallocated.encoder, &mut out, (4294967295, ())
16322 )?;
16323 } else {
16324 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16325 }
16326 }
16327
16328 2 => {
16329 if let Some(value) = &self.source_name {
16330 ::fidl_next::wire::Envelope::encode_value::<
16331 ::fidl_next::wire::String<'static>,
16332 ___E,
16333 >(
16334 value, preallocated.encoder, &mut out, 100
16335 )?;
16336 } else {
16337 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16338 }
16339 }
16340
16341 1 => {
16342 if let Some(value) = &self.source {
16343 ::fidl_next::wire::Envelope::encode_value::<
16344 crate::wire::Ref<'static>,
16345 ___E,
16346 >(
16347 value, preallocated.encoder, &mut out, ()
16348 )?;
16349 } else {
16350 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16351 }
16352 }
16353
16354 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
16355 }
16356 unsafe {
16357 preallocated.write_next(out.assume_init_ref());
16358 }
16359 }
16360
16361 ::fidl_next::wire::Table::encode_len(table, max_ord);
16362
16363 Ok(())
16364 }
16365 }
16366
16367 impl<'de> ::fidl_next::FromWire<crate::wire::OfferEventStream<'de>> for OfferEventStream {
16368 #[inline]
16369 fn from_wire(wire_: crate::wire::OfferEventStream<'de>) -> Self {
16370 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
16371
16372 let source = wire_.table.get(1);
16373
16374 let source_name = wire_.table.get(2);
16375
16376 let scope = wire_.table.get(3);
16377
16378 let target = wire_.table.get(4);
16379
16380 let target_name = wire_.table.get(5);
16381
16382 let availability = wire_.table.get(7);
16383
16384 Self {
16385
16386
16387 source: source.map(|envelope| ::fidl_next::FromWire::from_wire(
16388 unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() }
16389 )),
16390
16391
16392 source_name: source_name.map(|envelope| ::fidl_next::FromWire::from_wire(
16393 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
16394 )),
16395
16396
16397 scope: scope.map(|envelope| ::fidl_next::FromWire::from_wire(
16398 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>() }
16399 )),
16400
16401
16402 target: target.map(|envelope| ::fidl_next::FromWire::from_wire(
16403 unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() }
16404 )),
16405
16406
16407 target_name: target_name.map(|envelope| ::fidl_next::FromWire::from_wire(
16408 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
16409 )),
16410
16411
16412 availability: availability.map(|envelope| ::fidl_next::FromWire::from_wire(
16413 unsafe { envelope.read_unchecked::<crate::wire::Availability>() }
16414 )),
16415
16416 }
16417 }
16418 }
16419
16420 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferEventStream<'de>> for OfferEventStream {
16421 #[inline]
16422 fn from_wire_ref(wire: &crate::wire::OfferEventStream<'de>) -> Self {
16423 Self {
16424
16425
16426 source: wire.table.get(1)
16427 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
16428 unsafe { envelope.deref_unchecked::<crate::wire::Ref<'de>>() }
16429 )),
16430
16431
16432 source_name: wire.table.get(2)
16433 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
16434 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
16435 )),
16436
16437
16438 scope: wire.table.get(3)
16439 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
16440 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>() }
16441 )),
16442
16443
16444 target: wire.table.get(4)
16445 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
16446 unsafe { envelope.deref_unchecked::<crate::wire::Ref<'de>>() }
16447 )),
16448
16449
16450 target_name: wire.table.get(5)
16451 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
16452 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
16453 )),
16454
16455
16456 availability: wire.table.get(7)
16457 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
16458 unsafe { envelope.deref_unchecked::<crate::wire::Availability>() }
16459 )),
16460
16461 }
16462 }
16463 }
16464
16465 #[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"]
16466 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
16467 pub struct OfferDictionary {
16468 pub source: ::core::option::Option<crate::natural::Ref>,
16469
16470 pub source_name: ::core::option::Option<::std::string::String>,
16471
16472 pub target: ::core::option::Option<crate::natural::Ref>,
16473
16474 pub target_name: ::core::option::Option<::std::string::String>,
16475
16476 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
16477
16478 pub availability: ::core::option::Option<crate::natural::Availability>,
16479
16480 pub source_dictionary: ::core::option::Option<::std::string::String>,
16481 }
16482
16483 impl OfferDictionary {
16484 fn __max_ordinal(&self) -> usize {
16485 if self.source_dictionary.is_some() {
16486 return 7;
16487 }
16488
16489 if self.availability.is_some() {
16490 return 6;
16491 }
16492
16493 if self.dependency_type.is_some() {
16494 return 5;
16495 }
16496
16497 if self.target_name.is_some() {
16498 return 4;
16499 }
16500
16501 if self.target.is_some() {
16502 return 3;
16503 }
16504
16505 if self.source_name.is_some() {
16506 return 2;
16507 }
16508
16509 if self.source.is_some() {
16510 return 1;
16511 }
16512
16513 0
16514 }
16515 }
16516
16517 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferDictionary<'static>, ___E>
16518 for OfferDictionary
16519 where
16520 ___E: ::fidl_next::Encoder + ?Sized,
16521 {
16522 #[inline]
16523 fn encode(
16524 mut self,
16525 encoder: &mut ___E,
16526 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferDictionary<'static>>,
16527 _: (),
16528 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16529 ::fidl_next::munge!(let crate::wire::OfferDictionary { table } = out);
16530
16531 let max_ord = self.__max_ordinal();
16532
16533 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
16534 ::fidl_next::Wire::zero_padding(&mut out);
16535
16536 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
16537 ::fidl_next::wire::Envelope,
16538 >(encoder, max_ord);
16539
16540 for i in 1..=max_ord {
16541 match i {
16542 7 => {
16543 if let Some(value) = self.source_dictionary.take() {
16544 ::fidl_next::wire::Envelope::encode_value::<
16545 ::fidl_next::wire::String<'static>,
16546 ___E,
16547 >(
16548 value, preallocated.encoder, &mut out, 1024
16549 )?;
16550 } else {
16551 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16552 }
16553 }
16554
16555 6 => {
16556 if let Some(value) = self.availability.take() {
16557 ::fidl_next::wire::Envelope::encode_value::<
16558 crate::wire::Availability,
16559 ___E,
16560 >(
16561 value, preallocated.encoder, &mut out, ()
16562 )?;
16563 } else {
16564 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16565 }
16566 }
16567
16568 5 => {
16569 if let Some(value) = self.dependency_type.take() {
16570 ::fidl_next::wire::Envelope::encode_value::<
16571 crate::wire::DependencyType,
16572 ___E,
16573 >(
16574 value, preallocated.encoder, &mut out, ()
16575 )?;
16576 } else {
16577 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16578 }
16579 }
16580
16581 4 => {
16582 if let Some(value) = self.target_name.take() {
16583 ::fidl_next::wire::Envelope::encode_value::<
16584 ::fidl_next::wire::String<'static>,
16585 ___E,
16586 >(
16587 value, preallocated.encoder, &mut out, 100
16588 )?;
16589 } else {
16590 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16591 }
16592 }
16593
16594 3 => {
16595 if let Some(value) = self.target.take() {
16596 ::fidl_next::wire::Envelope::encode_value::<
16597 crate::wire::Ref<'static>,
16598 ___E,
16599 >(
16600 value, preallocated.encoder, &mut out, ()
16601 )?;
16602 } else {
16603 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16604 }
16605 }
16606
16607 2 => {
16608 if let Some(value) = self.source_name.take() {
16609 ::fidl_next::wire::Envelope::encode_value::<
16610 ::fidl_next::wire::String<'static>,
16611 ___E,
16612 >(
16613 value, preallocated.encoder, &mut out, 100
16614 )?;
16615 } else {
16616 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16617 }
16618 }
16619
16620 1 => {
16621 if let Some(value) = self.source.take() {
16622 ::fidl_next::wire::Envelope::encode_value::<
16623 crate::wire::Ref<'static>,
16624 ___E,
16625 >(
16626 value, preallocated.encoder, &mut out, ()
16627 )?;
16628 } else {
16629 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16630 }
16631 }
16632
16633 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
16634 }
16635 unsafe {
16636 preallocated.write_next(out.assume_init_ref());
16637 }
16638 }
16639
16640 ::fidl_next::wire::Table::encode_len(table, max_ord);
16641
16642 Ok(())
16643 }
16644 }
16645
16646 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferDictionary<'static>, ___E>
16647 for &'a OfferDictionary
16648 where
16649 ___E: ::fidl_next::Encoder + ?Sized,
16650 {
16651 #[inline]
16652 fn encode(
16653 self,
16654 encoder: &mut ___E,
16655 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferDictionary<'static>>,
16656 _: (),
16657 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16658 ::fidl_next::munge!(let crate::wire::OfferDictionary { table } = out);
16659
16660 let max_ord = self.__max_ordinal();
16661
16662 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
16663 ::fidl_next::Wire::zero_padding(&mut out);
16664
16665 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
16666 ::fidl_next::wire::Envelope,
16667 >(encoder, max_ord);
16668
16669 for i in 1..=max_ord {
16670 match i {
16671 7 => {
16672 if let Some(value) = &self.source_dictionary {
16673 ::fidl_next::wire::Envelope::encode_value::<
16674 ::fidl_next::wire::String<'static>,
16675 ___E,
16676 >(
16677 value, preallocated.encoder, &mut out, 1024
16678 )?;
16679 } else {
16680 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16681 }
16682 }
16683
16684 6 => {
16685 if let Some(value) = &self.availability {
16686 ::fidl_next::wire::Envelope::encode_value::<
16687 crate::wire::Availability,
16688 ___E,
16689 >(
16690 value, preallocated.encoder, &mut out, ()
16691 )?;
16692 } else {
16693 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16694 }
16695 }
16696
16697 5 => {
16698 if let Some(value) = &self.dependency_type {
16699 ::fidl_next::wire::Envelope::encode_value::<
16700 crate::wire::DependencyType,
16701 ___E,
16702 >(
16703 value, preallocated.encoder, &mut out, ()
16704 )?;
16705 } else {
16706 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16707 }
16708 }
16709
16710 4 => {
16711 if let Some(value) = &self.target_name {
16712 ::fidl_next::wire::Envelope::encode_value::<
16713 ::fidl_next::wire::String<'static>,
16714 ___E,
16715 >(
16716 value, preallocated.encoder, &mut out, 100
16717 )?;
16718 } else {
16719 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16720 }
16721 }
16722
16723 3 => {
16724 if let Some(value) = &self.target {
16725 ::fidl_next::wire::Envelope::encode_value::<
16726 crate::wire::Ref<'static>,
16727 ___E,
16728 >(
16729 value, preallocated.encoder, &mut out, ()
16730 )?;
16731 } else {
16732 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16733 }
16734 }
16735
16736 2 => {
16737 if let Some(value) = &self.source_name {
16738 ::fidl_next::wire::Envelope::encode_value::<
16739 ::fidl_next::wire::String<'static>,
16740 ___E,
16741 >(
16742 value, preallocated.encoder, &mut out, 100
16743 )?;
16744 } else {
16745 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16746 }
16747 }
16748
16749 1 => {
16750 if let Some(value) = &self.source {
16751 ::fidl_next::wire::Envelope::encode_value::<
16752 crate::wire::Ref<'static>,
16753 ___E,
16754 >(
16755 value, preallocated.encoder, &mut out, ()
16756 )?;
16757 } else {
16758 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16759 }
16760 }
16761
16762 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
16763 }
16764 unsafe {
16765 preallocated.write_next(out.assume_init_ref());
16766 }
16767 }
16768
16769 ::fidl_next::wire::Table::encode_len(table, max_ord);
16770
16771 Ok(())
16772 }
16773 }
16774
16775 impl<'de> ::fidl_next::FromWire<crate::wire::OfferDictionary<'de>> for OfferDictionary {
16776 #[inline]
16777 fn from_wire(wire_: crate::wire::OfferDictionary<'de>) -> Self {
16778 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
16779
16780 let source = wire_.table.get(1);
16781
16782 let source_name = wire_.table.get(2);
16783
16784 let target = wire_.table.get(3);
16785
16786 let target_name = wire_.table.get(4);
16787
16788 let dependency_type = wire_.table.get(5);
16789
16790 let availability = wire_.table.get(6);
16791
16792 let source_dictionary = wire_.table.get(7);
16793
16794 Self {
16795 source: source.map(|envelope| {
16796 ::fidl_next::FromWire::from_wire(unsafe {
16797 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16798 })
16799 }),
16800
16801 source_name: source_name.map(|envelope| {
16802 ::fidl_next::FromWire::from_wire(unsafe {
16803 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
16804 })
16805 }),
16806
16807 target: target.map(|envelope| {
16808 ::fidl_next::FromWire::from_wire(unsafe {
16809 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16810 })
16811 }),
16812
16813 target_name: target_name.map(|envelope| {
16814 ::fidl_next::FromWire::from_wire(unsafe {
16815 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
16816 })
16817 }),
16818
16819 dependency_type: dependency_type.map(|envelope| {
16820 ::fidl_next::FromWire::from_wire(unsafe {
16821 envelope.read_unchecked::<crate::wire::DependencyType>()
16822 })
16823 }),
16824
16825 availability: availability.map(|envelope| {
16826 ::fidl_next::FromWire::from_wire(unsafe {
16827 envelope.read_unchecked::<crate::wire::Availability>()
16828 })
16829 }),
16830
16831 source_dictionary: source_dictionary.map(|envelope| {
16832 ::fidl_next::FromWire::from_wire(unsafe {
16833 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
16834 })
16835 }),
16836 }
16837 }
16838 }
16839
16840 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferDictionary<'de>> for OfferDictionary {
16841 #[inline]
16842 fn from_wire_ref(wire: &crate::wire::OfferDictionary<'de>) -> Self {
16843 Self {
16844 source: wire.table.get(1).map(|envelope| {
16845 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16846 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16847 })
16848 }),
16849
16850 source_name: wire.table.get(2).map(|envelope| {
16851 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16852 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
16853 })
16854 }),
16855
16856 target: wire.table.get(3).map(|envelope| {
16857 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16858 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16859 })
16860 }),
16861
16862 target_name: wire.table.get(4).map(|envelope| {
16863 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16864 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
16865 })
16866 }),
16867
16868 dependency_type: wire.table.get(5).map(|envelope| {
16869 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16870 envelope.deref_unchecked::<crate::wire::DependencyType>()
16871 })
16872 }),
16873
16874 availability: wire.table.get(6).map(|envelope| {
16875 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16876 envelope.deref_unchecked::<crate::wire::Availability>()
16877 })
16878 }),
16879
16880 source_dictionary: wire.table.get(7).map(|envelope| {
16881 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16882 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
16883 })
16884 }),
16885 }
16886 }
16887 }
16888
16889 #[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"]
16890 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
16891 pub struct OfferConfiguration {
16892 pub source: ::core::option::Option<crate::natural::Ref>,
16893
16894 pub source_name: ::core::option::Option<::std::string::String>,
16895
16896 pub target: ::core::option::Option<crate::natural::Ref>,
16897
16898 pub target_name: ::core::option::Option<::std::string::String>,
16899
16900 pub availability: ::core::option::Option<crate::natural::Availability>,
16901
16902 pub source_dictionary: ::core::option::Option<::std::string::String>,
16903 }
16904
16905 impl OfferConfiguration {
16906 fn __max_ordinal(&self) -> usize {
16907 if self.source_dictionary.is_some() {
16908 return 6;
16909 }
16910
16911 if self.availability.is_some() {
16912 return 5;
16913 }
16914
16915 if self.target_name.is_some() {
16916 return 4;
16917 }
16918
16919 if self.target.is_some() {
16920 return 3;
16921 }
16922
16923 if self.source_name.is_some() {
16924 return 2;
16925 }
16926
16927 if self.source.is_some() {
16928 return 1;
16929 }
16930
16931 0
16932 }
16933 }
16934
16935 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferConfiguration<'static>, ___E>
16936 for OfferConfiguration
16937 where
16938 ___E: ::fidl_next::Encoder + ?Sized,
16939 {
16940 #[inline]
16941 fn encode(
16942 mut self,
16943 encoder: &mut ___E,
16944 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferConfiguration<'static>>,
16945 _: (),
16946 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16947 ::fidl_next::munge!(let crate::wire::OfferConfiguration { table } = out);
16948
16949 let max_ord = self.__max_ordinal();
16950
16951 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
16952 ::fidl_next::Wire::zero_padding(&mut out);
16953
16954 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
16955 ::fidl_next::wire::Envelope,
16956 >(encoder, max_ord);
16957
16958 for i in 1..=max_ord {
16959 match i {
16960 6 => {
16961 if let Some(value) = self.source_dictionary.take() {
16962 ::fidl_next::wire::Envelope::encode_value::<
16963 ::fidl_next::wire::String<'static>,
16964 ___E,
16965 >(
16966 value, preallocated.encoder, &mut out, 1024
16967 )?;
16968 } else {
16969 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16970 }
16971 }
16972
16973 5 => {
16974 if let Some(value) = self.availability.take() {
16975 ::fidl_next::wire::Envelope::encode_value::<
16976 crate::wire::Availability,
16977 ___E,
16978 >(
16979 value, preallocated.encoder, &mut out, ()
16980 )?;
16981 } else {
16982 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16983 }
16984 }
16985
16986 4 => {
16987 if let Some(value) = self.target_name.take() {
16988 ::fidl_next::wire::Envelope::encode_value::<
16989 ::fidl_next::wire::String<'static>,
16990 ___E,
16991 >(
16992 value, preallocated.encoder, &mut out, 100
16993 )?;
16994 } else {
16995 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16996 }
16997 }
16998
16999 3 => {
17000 if let Some(value) = self.target.take() {
17001 ::fidl_next::wire::Envelope::encode_value::<
17002 crate::wire::Ref<'static>,
17003 ___E,
17004 >(
17005 value, preallocated.encoder, &mut out, ()
17006 )?;
17007 } else {
17008 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17009 }
17010 }
17011
17012 2 => {
17013 if let Some(value) = self.source_name.take() {
17014 ::fidl_next::wire::Envelope::encode_value::<
17015 ::fidl_next::wire::String<'static>,
17016 ___E,
17017 >(
17018 value, preallocated.encoder, &mut out, 100
17019 )?;
17020 } else {
17021 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17022 }
17023 }
17024
17025 1 => {
17026 if let Some(value) = self.source.take() {
17027 ::fidl_next::wire::Envelope::encode_value::<
17028 crate::wire::Ref<'static>,
17029 ___E,
17030 >(
17031 value, preallocated.encoder, &mut out, ()
17032 )?;
17033 } else {
17034 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17035 }
17036 }
17037
17038 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
17039 }
17040 unsafe {
17041 preallocated.write_next(out.assume_init_ref());
17042 }
17043 }
17044
17045 ::fidl_next::wire::Table::encode_len(table, max_ord);
17046
17047 Ok(())
17048 }
17049 }
17050
17051 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferConfiguration<'static>, ___E>
17052 for &'a OfferConfiguration
17053 where
17054 ___E: ::fidl_next::Encoder + ?Sized,
17055 {
17056 #[inline]
17057 fn encode(
17058 self,
17059 encoder: &mut ___E,
17060 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferConfiguration<'static>>,
17061 _: (),
17062 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17063 ::fidl_next::munge!(let crate::wire::OfferConfiguration { table } = out);
17064
17065 let max_ord = self.__max_ordinal();
17066
17067 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
17068 ::fidl_next::Wire::zero_padding(&mut out);
17069
17070 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
17071 ::fidl_next::wire::Envelope,
17072 >(encoder, max_ord);
17073
17074 for i in 1..=max_ord {
17075 match i {
17076 6 => {
17077 if let Some(value) = &self.source_dictionary {
17078 ::fidl_next::wire::Envelope::encode_value::<
17079 ::fidl_next::wire::String<'static>,
17080 ___E,
17081 >(
17082 value, preallocated.encoder, &mut out, 1024
17083 )?;
17084 } else {
17085 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17086 }
17087 }
17088
17089 5 => {
17090 if let Some(value) = &self.availability {
17091 ::fidl_next::wire::Envelope::encode_value::<
17092 crate::wire::Availability,
17093 ___E,
17094 >(
17095 value, preallocated.encoder, &mut out, ()
17096 )?;
17097 } else {
17098 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17099 }
17100 }
17101
17102 4 => {
17103 if let Some(value) = &self.target_name {
17104 ::fidl_next::wire::Envelope::encode_value::<
17105 ::fidl_next::wire::String<'static>,
17106 ___E,
17107 >(
17108 value, preallocated.encoder, &mut out, 100
17109 )?;
17110 } else {
17111 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17112 }
17113 }
17114
17115 3 => {
17116 if let Some(value) = &self.target {
17117 ::fidl_next::wire::Envelope::encode_value::<
17118 crate::wire::Ref<'static>,
17119 ___E,
17120 >(
17121 value, preallocated.encoder, &mut out, ()
17122 )?;
17123 } else {
17124 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17125 }
17126 }
17127
17128 2 => {
17129 if let Some(value) = &self.source_name {
17130 ::fidl_next::wire::Envelope::encode_value::<
17131 ::fidl_next::wire::String<'static>,
17132 ___E,
17133 >(
17134 value, preallocated.encoder, &mut out, 100
17135 )?;
17136 } else {
17137 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17138 }
17139 }
17140
17141 1 => {
17142 if let Some(value) = &self.source {
17143 ::fidl_next::wire::Envelope::encode_value::<
17144 crate::wire::Ref<'static>,
17145 ___E,
17146 >(
17147 value, preallocated.encoder, &mut out, ()
17148 )?;
17149 } else {
17150 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17151 }
17152 }
17153
17154 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
17155 }
17156 unsafe {
17157 preallocated.write_next(out.assume_init_ref());
17158 }
17159 }
17160
17161 ::fidl_next::wire::Table::encode_len(table, max_ord);
17162
17163 Ok(())
17164 }
17165 }
17166
17167 impl<'de> ::fidl_next::FromWire<crate::wire::OfferConfiguration<'de>> for OfferConfiguration {
17168 #[inline]
17169 fn from_wire(wire_: crate::wire::OfferConfiguration<'de>) -> Self {
17170 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
17171
17172 let source = wire_.table.get(1);
17173
17174 let source_name = wire_.table.get(2);
17175
17176 let target = wire_.table.get(3);
17177
17178 let target_name = wire_.table.get(4);
17179
17180 let availability = wire_.table.get(5);
17181
17182 let source_dictionary = wire_.table.get(6);
17183
17184 Self {
17185 source: source.map(|envelope| {
17186 ::fidl_next::FromWire::from_wire(unsafe {
17187 envelope.read_unchecked::<crate::wire::Ref<'de>>()
17188 })
17189 }),
17190
17191 source_name: source_name.map(|envelope| {
17192 ::fidl_next::FromWire::from_wire(unsafe {
17193 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
17194 })
17195 }),
17196
17197 target: target.map(|envelope| {
17198 ::fidl_next::FromWire::from_wire(unsafe {
17199 envelope.read_unchecked::<crate::wire::Ref<'de>>()
17200 })
17201 }),
17202
17203 target_name: target_name.map(|envelope| {
17204 ::fidl_next::FromWire::from_wire(unsafe {
17205 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
17206 })
17207 }),
17208
17209 availability: availability.map(|envelope| {
17210 ::fidl_next::FromWire::from_wire(unsafe {
17211 envelope.read_unchecked::<crate::wire::Availability>()
17212 })
17213 }),
17214
17215 source_dictionary: source_dictionary.map(|envelope| {
17216 ::fidl_next::FromWire::from_wire(unsafe {
17217 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
17218 })
17219 }),
17220 }
17221 }
17222 }
17223
17224 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferConfiguration<'de>> for OfferConfiguration {
17225 #[inline]
17226 fn from_wire_ref(wire: &crate::wire::OfferConfiguration<'de>) -> Self {
17227 Self {
17228 source: wire.table.get(1).map(|envelope| {
17229 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17230 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
17231 })
17232 }),
17233
17234 source_name: wire.table.get(2).map(|envelope| {
17235 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17236 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
17237 })
17238 }),
17239
17240 target: wire.table.get(3).map(|envelope| {
17241 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17242 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
17243 })
17244 }),
17245
17246 target_name: wire.table.get(4).map(|envelope| {
17247 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17248 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
17249 })
17250 }),
17251
17252 availability: wire.table.get(5).map(|envelope| {
17253 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17254 envelope.deref_unchecked::<crate::wire::Availability>()
17255 })
17256 }),
17257
17258 source_dictionary: wire.table.get(6).map(|envelope| {
17259 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17260 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
17261 })
17262 }),
17263 }
17264 }
17265 }
17266
17267 #[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"]
17268 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
17269 pub enum Offer {
17270 Service(crate::natural::OfferService),
17271
17272 Protocol(crate::natural::OfferProtocol),
17273
17274 Directory(crate::natural::OfferDirectory),
17275
17276 Storage(crate::natural::OfferStorage),
17277
17278 Runner(crate::natural::OfferRunner),
17279
17280 Resolver(crate::natural::OfferResolver),
17281
17282 EventStream(crate::natural::OfferEventStream),
17283
17284 Dictionary(crate::natural::OfferDictionary),
17285
17286 Config(crate::natural::OfferConfiguration),
17287
17288 UnknownOrdinal_(u64),
17289 }
17290
17291 impl Offer {
17292 pub fn is_unknown(&self) -> bool {
17293 #[allow(unreachable_patterns)]
17294 match self {
17295 Self::UnknownOrdinal_(_) => true,
17296 _ => false,
17297 }
17298 }
17299 }
17300
17301 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Offer<'static>, ___E> for Offer
17302 where
17303 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17304 ___E: ::fidl_next::Encoder,
17305 {
17306 #[inline]
17307 fn encode(
17308 self,
17309 encoder: &mut ___E,
17310 out: &mut ::core::mem::MaybeUninit<crate::wire::Offer<'static>>,
17311 _: (),
17312 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17313 ::fidl_next::munge!(let crate::wire::Offer { raw, _phantom: _ } = out);
17314
17315 match self {
17316 Self::Service(value) => ::fidl_next::wire::Union::encode_as::<
17317 ___E,
17318 crate::wire::OfferService<'static>,
17319 >(value, 1, encoder, raw, ())?,
17320
17321 Self::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
17322 ___E,
17323 crate::wire::OfferProtocol<'static>,
17324 >(value, 2, encoder, raw, ())?,
17325
17326 Self::Directory(value) => ::fidl_next::wire::Union::encode_as::<
17327 ___E,
17328 crate::wire::OfferDirectory<'static>,
17329 >(value, 3, encoder, raw, ())?,
17330
17331 Self::Storage(value) => ::fidl_next::wire::Union::encode_as::<
17332 ___E,
17333 crate::wire::OfferStorage<'static>,
17334 >(value, 4, encoder, raw, ())?,
17335
17336 Self::Runner(value) => ::fidl_next::wire::Union::encode_as::<
17337 ___E,
17338 crate::wire::OfferRunner<'static>,
17339 >(value, 5, encoder, raw, ())?,
17340
17341 Self::Resolver(value) => ::fidl_next::wire::Union::encode_as::<
17342 ___E,
17343 crate::wire::OfferResolver<'static>,
17344 >(value, 6, encoder, raw, ())?,
17345
17346 Self::EventStream(value) => ::fidl_next::wire::Union::encode_as::<
17347 ___E,
17348 crate::wire::OfferEventStream<'static>,
17349 >(value, 8, encoder, raw, ())?,
17350
17351 Self::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
17352 ___E,
17353 crate::wire::OfferDictionary<'static>,
17354 >(value, 9, encoder, raw, ())?,
17355
17356 Self::Config(value) => ::fidl_next::wire::Union::encode_as::<
17357 ___E,
17358 crate::wire::OfferConfiguration<'static>,
17359 >(value, 10, encoder, raw, ())?,
17360
17361 Self::UnknownOrdinal_(ordinal) => {
17362 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
17363 }
17364 }
17365
17366 Ok(())
17367 }
17368 }
17369
17370 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Offer<'static>, ___E> for &'a Offer
17371 where
17372 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17373 ___E: ::fidl_next::Encoder,
17374 {
17375 #[inline]
17376 fn encode(
17377 self,
17378 encoder: &mut ___E,
17379 out: &mut ::core::mem::MaybeUninit<crate::wire::Offer<'static>>,
17380 _: (),
17381 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17382 ::fidl_next::munge!(let crate::wire::Offer { raw, _phantom: _ } = out);
17383
17384 match self {
17385 Offer::Service(value) => ::fidl_next::wire::Union::encode_as::<
17386 ___E,
17387 crate::wire::OfferService<'static>,
17388 >(value, 1, encoder, raw, ())?,
17389
17390 Offer::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
17391 ___E,
17392 crate::wire::OfferProtocol<'static>,
17393 >(value, 2, encoder, raw, ())?,
17394
17395 Offer::Directory(value) => ::fidl_next::wire::Union::encode_as::<
17396 ___E,
17397 crate::wire::OfferDirectory<'static>,
17398 >(value, 3, encoder, raw, ())?,
17399
17400 Offer::Storage(value) => ::fidl_next::wire::Union::encode_as::<
17401 ___E,
17402 crate::wire::OfferStorage<'static>,
17403 >(value, 4, encoder, raw, ())?,
17404
17405 Offer::Runner(value) => ::fidl_next::wire::Union::encode_as::<
17406 ___E,
17407 crate::wire::OfferRunner<'static>,
17408 >(value, 5, encoder, raw, ())?,
17409
17410 Offer::Resolver(value) => ::fidl_next::wire::Union::encode_as::<
17411 ___E,
17412 crate::wire::OfferResolver<'static>,
17413 >(value, 6, encoder, raw, ())?,
17414
17415 Offer::EventStream(value) => ::fidl_next::wire::Union::encode_as::<
17416 ___E,
17417 crate::wire::OfferEventStream<'static>,
17418 >(value, 8, encoder, raw, ())?,
17419
17420 Offer::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
17421 ___E,
17422 crate::wire::OfferDictionary<'static>,
17423 >(value, 9, encoder, raw, ())?,
17424
17425 Offer::Config(value) => ::fidl_next::wire::Union::encode_as::<
17426 ___E,
17427 crate::wire::OfferConfiguration<'static>,
17428 >(value, 10, encoder, raw, ())?,
17429
17430 Offer::UnknownOrdinal_(ordinal) => {
17431 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
17432 }
17433 }
17434
17435 Ok(())
17436 }
17437 }
17438
17439 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Offer<'static>, ___E> for Offer
17440 where
17441 ___E: ?Sized,
17442 Offer: ::fidl_next::Encode<crate::wire::Offer<'static>, ___E>,
17443 {
17444 #[inline]
17445 fn encode_option(
17446 this: ::core::option::Option<Self>,
17447 encoder: &mut ___E,
17448 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Offer<'static>>,
17449 _: (),
17450 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17451 ::fidl_next::munge!(let crate::wire_optional::Offer { raw, _phantom: _ } = &mut *out);
17452
17453 if let Some(inner) = this {
17454 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
17455 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
17456 } else {
17457 ::fidl_next::wire::Union::encode_absent(raw);
17458 }
17459
17460 Ok(())
17461 }
17462 }
17463
17464 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Offer<'static>, ___E>
17465 for &'a Offer
17466 where
17467 ___E: ?Sized,
17468 &'a Offer: ::fidl_next::Encode<crate::wire::Offer<'static>, ___E>,
17469 {
17470 #[inline]
17471 fn encode_option(
17472 this: ::core::option::Option<Self>,
17473 encoder: &mut ___E,
17474 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Offer<'static>>,
17475 _: (),
17476 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17477 ::fidl_next::munge!(let crate::wire_optional::Offer { raw, _phantom: _ } = &mut *out);
17478
17479 if let Some(inner) = this {
17480 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
17481 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
17482 } else {
17483 ::fidl_next::wire::Union::encode_absent(raw);
17484 }
17485
17486 Ok(())
17487 }
17488 }
17489
17490 impl<'de> ::fidl_next::FromWire<crate::wire::Offer<'de>> for Offer {
17491 #[inline]
17492 fn from_wire(wire: crate::wire::Offer<'de>) -> Self {
17493 let wire = ::core::mem::ManuallyDrop::new(wire);
17494 match wire.raw.ordinal() {
17495 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
17496 wire.raw.get().read_unchecked::<crate::wire::OfferService<'de>>()
17497 })),
17498
17499 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
17500 wire.raw.get().read_unchecked::<crate::wire::OfferProtocol<'de>>()
17501 })),
17502
17503 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
17504 wire.raw.get().read_unchecked::<crate::wire::OfferDirectory<'de>>()
17505 })),
17506
17507 4 => Self::Storage(::fidl_next::FromWire::from_wire(unsafe {
17508 wire.raw.get().read_unchecked::<crate::wire::OfferStorage<'de>>()
17509 })),
17510
17511 5 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
17512 wire.raw.get().read_unchecked::<crate::wire::OfferRunner<'de>>()
17513 })),
17514
17515 6 => Self::Resolver(::fidl_next::FromWire::from_wire(unsafe {
17516 wire.raw.get().read_unchecked::<crate::wire::OfferResolver<'de>>()
17517 })),
17518
17519 8 => Self::EventStream(::fidl_next::FromWire::from_wire(unsafe {
17520 wire.raw.get().read_unchecked::<crate::wire::OfferEventStream<'de>>()
17521 })),
17522
17523 9 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
17524 wire.raw.get().read_unchecked::<crate::wire::OfferDictionary<'de>>()
17525 })),
17526
17527 10 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
17528 wire.raw.get().read_unchecked::<crate::wire::OfferConfiguration<'de>>()
17529 })),
17530
17531 ord => return Self::UnknownOrdinal_(ord as u64),
17532 }
17533 }
17534 }
17535
17536 impl<'de> ::fidl_next::FromWireRef<crate::wire::Offer<'de>> for Offer {
17537 #[inline]
17538 fn from_wire_ref(wire: &crate::wire::Offer<'de>) -> Self {
17539 match wire.raw.ordinal() {
17540 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17541 wire.raw.get().deref_unchecked::<crate::wire::OfferService<'de>>()
17542 })),
17543
17544 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17545 wire.raw.get().deref_unchecked::<crate::wire::OfferProtocol<'de>>()
17546 })),
17547
17548 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17549 wire.raw.get().deref_unchecked::<crate::wire::OfferDirectory<'de>>()
17550 })),
17551
17552 4 => Self::Storage(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17553 wire.raw.get().deref_unchecked::<crate::wire::OfferStorage<'de>>()
17554 })),
17555
17556 5 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17557 wire.raw.get().deref_unchecked::<crate::wire::OfferRunner<'de>>()
17558 })),
17559
17560 6 => Self::Resolver(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17561 wire.raw.get().deref_unchecked::<crate::wire::OfferResolver<'de>>()
17562 })),
17563
17564 8 => Self::EventStream(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17565 wire.raw.get().deref_unchecked::<crate::wire::OfferEventStream<'de>>()
17566 })),
17567
17568 9 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17569 wire.raw.get().deref_unchecked::<crate::wire::OfferDictionary<'de>>()
17570 })),
17571
17572 10 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17573 wire.raw.get().deref_unchecked::<crate::wire::OfferConfiguration<'de>>()
17574 })),
17575
17576 ord => return Self::UnknownOrdinal_(ord as u64),
17577 }
17578 }
17579 }
17580
17581 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Offer<'de>> for Offer {
17582 #[inline]
17583 fn from_wire_option(
17584 wire: crate::wire_optional::Offer<'de>,
17585 ) -> ::core::option::Option<Self> {
17586 if let Some(inner) = wire.into_option() {
17587 Some(::fidl_next::FromWire::from_wire(inner))
17588 } else {
17589 None
17590 }
17591 }
17592 }
17593
17594 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Offer<'de>> for Box<Offer> {
17595 #[inline]
17596 fn from_wire_option(
17597 wire: crate::wire_optional::Offer<'de>,
17598 ) -> ::core::option::Option<Self> {
17599 <
17600 Offer as ::fidl_next::FromWireOption<crate::wire_optional::Offer<'de>>
17601 >::from_wire_option(wire).map(Box::new)
17602 }
17603 }
17604
17605 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::Offer<'de>> for Box<Offer> {
17606 #[inline]
17607 fn from_wire_option_ref(
17608 wire: &crate::wire_optional::Offer<'de>,
17609 ) -> ::core::option::Option<Self> {
17610 if let Some(inner) = wire.as_ref() {
17611 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
17612 } else {
17613 None
17614 }
17615 }
17616 }
17617
17618 #[doc = " A repository of the runners available in an environment.\n"]
17619 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
17620 pub struct RunnerRegistration {
17621 pub source_name: ::core::option::Option<::std::string::String>,
17622
17623 pub source: ::core::option::Option<crate::natural::Ref>,
17624
17625 pub target_name: ::core::option::Option<::std::string::String>,
17626 }
17627
17628 impl RunnerRegistration {
17629 fn __max_ordinal(&self) -> usize {
17630 if self.target_name.is_some() {
17631 return 3;
17632 }
17633
17634 if self.source.is_some() {
17635 return 2;
17636 }
17637
17638 if self.source_name.is_some() {
17639 return 1;
17640 }
17641
17642 0
17643 }
17644 }
17645
17646 unsafe impl<___E> ::fidl_next::Encode<crate::wire::RunnerRegistration<'static>, ___E>
17647 for RunnerRegistration
17648 where
17649 ___E: ::fidl_next::Encoder + ?Sized,
17650 {
17651 #[inline]
17652 fn encode(
17653 mut self,
17654 encoder: &mut ___E,
17655 out: &mut ::core::mem::MaybeUninit<crate::wire::RunnerRegistration<'static>>,
17656 _: (),
17657 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17658 ::fidl_next::munge!(let crate::wire::RunnerRegistration { table } = out);
17659
17660 let max_ord = self.__max_ordinal();
17661
17662 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
17663 ::fidl_next::Wire::zero_padding(&mut out);
17664
17665 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
17666 ::fidl_next::wire::Envelope,
17667 >(encoder, max_ord);
17668
17669 for i in 1..=max_ord {
17670 match i {
17671 3 => {
17672 if let Some(value) = self.target_name.take() {
17673 ::fidl_next::wire::Envelope::encode_value::<
17674 ::fidl_next::wire::String<'static>,
17675 ___E,
17676 >(
17677 value, preallocated.encoder, &mut out, 100
17678 )?;
17679 } else {
17680 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17681 }
17682 }
17683
17684 2 => {
17685 if let Some(value) = self.source.take() {
17686 ::fidl_next::wire::Envelope::encode_value::<
17687 crate::wire::Ref<'static>,
17688 ___E,
17689 >(
17690 value, preallocated.encoder, &mut out, ()
17691 )?;
17692 } else {
17693 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17694 }
17695 }
17696
17697 1 => {
17698 if let Some(value) = self.source_name.take() {
17699 ::fidl_next::wire::Envelope::encode_value::<
17700 ::fidl_next::wire::String<'static>,
17701 ___E,
17702 >(
17703 value, preallocated.encoder, &mut out, 100
17704 )?;
17705 } else {
17706 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17707 }
17708 }
17709
17710 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
17711 }
17712 unsafe {
17713 preallocated.write_next(out.assume_init_ref());
17714 }
17715 }
17716
17717 ::fidl_next::wire::Table::encode_len(table, max_ord);
17718
17719 Ok(())
17720 }
17721 }
17722
17723 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::RunnerRegistration<'static>, ___E>
17724 for &'a RunnerRegistration
17725 where
17726 ___E: ::fidl_next::Encoder + ?Sized,
17727 {
17728 #[inline]
17729 fn encode(
17730 self,
17731 encoder: &mut ___E,
17732 out: &mut ::core::mem::MaybeUninit<crate::wire::RunnerRegistration<'static>>,
17733 _: (),
17734 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17735 ::fidl_next::munge!(let crate::wire::RunnerRegistration { table } = out);
17736
17737 let max_ord = self.__max_ordinal();
17738
17739 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
17740 ::fidl_next::Wire::zero_padding(&mut out);
17741
17742 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
17743 ::fidl_next::wire::Envelope,
17744 >(encoder, max_ord);
17745
17746 for i in 1..=max_ord {
17747 match i {
17748 3 => {
17749 if let Some(value) = &self.target_name {
17750 ::fidl_next::wire::Envelope::encode_value::<
17751 ::fidl_next::wire::String<'static>,
17752 ___E,
17753 >(
17754 value, preallocated.encoder, &mut out, 100
17755 )?;
17756 } else {
17757 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17758 }
17759 }
17760
17761 2 => {
17762 if let Some(value) = &self.source {
17763 ::fidl_next::wire::Envelope::encode_value::<
17764 crate::wire::Ref<'static>,
17765 ___E,
17766 >(
17767 value, preallocated.encoder, &mut out, ()
17768 )?;
17769 } else {
17770 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17771 }
17772 }
17773
17774 1 => {
17775 if let Some(value) = &self.source_name {
17776 ::fidl_next::wire::Envelope::encode_value::<
17777 ::fidl_next::wire::String<'static>,
17778 ___E,
17779 >(
17780 value, preallocated.encoder, &mut out, 100
17781 )?;
17782 } else {
17783 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17784 }
17785 }
17786
17787 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
17788 }
17789 unsafe {
17790 preallocated.write_next(out.assume_init_ref());
17791 }
17792 }
17793
17794 ::fidl_next::wire::Table::encode_len(table, max_ord);
17795
17796 Ok(())
17797 }
17798 }
17799
17800 impl<'de> ::fidl_next::FromWire<crate::wire::RunnerRegistration<'de>> for RunnerRegistration {
17801 #[inline]
17802 fn from_wire(wire_: crate::wire::RunnerRegistration<'de>) -> Self {
17803 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
17804
17805 let source_name = wire_.table.get(1);
17806
17807 let source = wire_.table.get(2);
17808
17809 let target_name = wire_.table.get(3);
17810
17811 Self {
17812 source_name: source_name.map(|envelope| {
17813 ::fidl_next::FromWire::from_wire(unsafe {
17814 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
17815 })
17816 }),
17817
17818 source: source.map(|envelope| {
17819 ::fidl_next::FromWire::from_wire(unsafe {
17820 envelope.read_unchecked::<crate::wire::Ref<'de>>()
17821 })
17822 }),
17823
17824 target_name: target_name.map(|envelope| {
17825 ::fidl_next::FromWire::from_wire(unsafe {
17826 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
17827 })
17828 }),
17829 }
17830 }
17831 }
17832
17833 impl<'de> ::fidl_next::FromWireRef<crate::wire::RunnerRegistration<'de>> for RunnerRegistration {
17834 #[inline]
17835 fn from_wire_ref(wire: &crate::wire::RunnerRegistration<'de>) -> Self {
17836 Self {
17837 source_name: wire.table.get(1).map(|envelope| {
17838 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17839 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
17840 })
17841 }),
17842
17843 source: wire.table.get(2).map(|envelope| {
17844 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17845 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
17846 })
17847 }),
17848
17849 target_name: wire.table.get(3).map(|envelope| {
17850 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17851 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
17852 })
17853 }),
17854 }
17855 }
17856 }
17857
17858 #[doc = " A mapping of URL scheme to resolver name.\n"]
17859 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
17860 pub struct ResolverRegistration {
17861 pub resolver: ::core::option::Option<::std::string::String>,
17862
17863 pub source: ::core::option::Option<crate::natural::Ref>,
17864
17865 pub scheme: ::core::option::Option<::std::string::String>,
17866 }
17867
17868 impl ResolverRegistration {
17869 fn __max_ordinal(&self) -> usize {
17870 if self.scheme.is_some() {
17871 return 3;
17872 }
17873
17874 if self.source.is_some() {
17875 return 2;
17876 }
17877
17878 if self.resolver.is_some() {
17879 return 1;
17880 }
17881
17882 0
17883 }
17884 }
17885
17886 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ResolverRegistration<'static>, ___E>
17887 for ResolverRegistration
17888 where
17889 ___E: ::fidl_next::Encoder + ?Sized,
17890 {
17891 #[inline]
17892 fn encode(
17893 mut self,
17894 encoder: &mut ___E,
17895 out: &mut ::core::mem::MaybeUninit<crate::wire::ResolverRegistration<'static>>,
17896 _: (),
17897 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17898 ::fidl_next::munge!(let crate::wire::ResolverRegistration { table } = out);
17899
17900 let max_ord = self.__max_ordinal();
17901
17902 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
17903 ::fidl_next::Wire::zero_padding(&mut out);
17904
17905 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
17906 ::fidl_next::wire::Envelope,
17907 >(encoder, max_ord);
17908
17909 for i in 1..=max_ord {
17910 match i {
17911 3 => {
17912 if let Some(value) = self.scheme.take() {
17913 ::fidl_next::wire::Envelope::encode_value::<
17914 ::fidl_next::wire::String<'static>,
17915 ___E,
17916 >(
17917 value, preallocated.encoder, &mut out, 100
17918 )?;
17919 } else {
17920 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17921 }
17922 }
17923
17924 2 => {
17925 if let Some(value) = self.source.take() {
17926 ::fidl_next::wire::Envelope::encode_value::<
17927 crate::wire::Ref<'static>,
17928 ___E,
17929 >(
17930 value, preallocated.encoder, &mut out, ()
17931 )?;
17932 } else {
17933 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17934 }
17935 }
17936
17937 1 => {
17938 if let Some(value) = self.resolver.take() {
17939 ::fidl_next::wire::Envelope::encode_value::<
17940 ::fidl_next::wire::String<'static>,
17941 ___E,
17942 >(
17943 value, preallocated.encoder, &mut out, 100
17944 )?;
17945 } else {
17946 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17947 }
17948 }
17949
17950 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
17951 }
17952 unsafe {
17953 preallocated.write_next(out.assume_init_ref());
17954 }
17955 }
17956
17957 ::fidl_next::wire::Table::encode_len(table, max_ord);
17958
17959 Ok(())
17960 }
17961 }
17962
17963 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ResolverRegistration<'static>, ___E>
17964 for &'a ResolverRegistration
17965 where
17966 ___E: ::fidl_next::Encoder + ?Sized,
17967 {
17968 #[inline]
17969 fn encode(
17970 self,
17971 encoder: &mut ___E,
17972 out: &mut ::core::mem::MaybeUninit<crate::wire::ResolverRegistration<'static>>,
17973 _: (),
17974 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17975 ::fidl_next::munge!(let crate::wire::ResolverRegistration { table } = out);
17976
17977 let max_ord = self.__max_ordinal();
17978
17979 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
17980 ::fidl_next::Wire::zero_padding(&mut out);
17981
17982 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
17983 ::fidl_next::wire::Envelope,
17984 >(encoder, max_ord);
17985
17986 for i in 1..=max_ord {
17987 match i {
17988 3 => {
17989 if let Some(value) = &self.scheme {
17990 ::fidl_next::wire::Envelope::encode_value::<
17991 ::fidl_next::wire::String<'static>,
17992 ___E,
17993 >(
17994 value, preallocated.encoder, &mut out, 100
17995 )?;
17996 } else {
17997 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17998 }
17999 }
18000
18001 2 => {
18002 if let Some(value) = &self.source {
18003 ::fidl_next::wire::Envelope::encode_value::<
18004 crate::wire::Ref<'static>,
18005 ___E,
18006 >(
18007 value, preallocated.encoder, &mut out, ()
18008 )?;
18009 } else {
18010 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18011 }
18012 }
18013
18014 1 => {
18015 if let Some(value) = &self.resolver {
18016 ::fidl_next::wire::Envelope::encode_value::<
18017 ::fidl_next::wire::String<'static>,
18018 ___E,
18019 >(
18020 value, preallocated.encoder, &mut out, 100
18021 )?;
18022 } else {
18023 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18024 }
18025 }
18026
18027 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
18028 }
18029 unsafe {
18030 preallocated.write_next(out.assume_init_ref());
18031 }
18032 }
18033
18034 ::fidl_next::wire::Table::encode_len(table, max_ord);
18035
18036 Ok(())
18037 }
18038 }
18039
18040 impl<'de> ::fidl_next::FromWire<crate::wire::ResolverRegistration<'de>> for ResolverRegistration {
18041 #[inline]
18042 fn from_wire(wire_: crate::wire::ResolverRegistration<'de>) -> Self {
18043 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
18044
18045 let resolver = wire_.table.get(1);
18046
18047 let source = wire_.table.get(2);
18048
18049 let scheme = wire_.table.get(3);
18050
18051 Self {
18052 resolver: resolver.map(|envelope| {
18053 ::fidl_next::FromWire::from_wire(unsafe {
18054 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
18055 })
18056 }),
18057
18058 source: source.map(|envelope| {
18059 ::fidl_next::FromWire::from_wire(unsafe {
18060 envelope.read_unchecked::<crate::wire::Ref<'de>>()
18061 })
18062 }),
18063
18064 scheme: scheme.map(|envelope| {
18065 ::fidl_next::FromWire::from_wire(unsafe {
18066 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
18067 })
18068 }),
18069 }
18070 }
18071 }
18072
18073 impl<'de> ::fidl_next::FromWireRef<crate::wire::ResolverRegistration<'de>>
18074 for ResolverRegistration
18075 {
18076 #[inline]
18077 fn from_wire_ref(wire: &crate::wire::ResolverRegistration<'de>) -> Self {
18078 Self {
18079 resolver: wire.table.get(1).map(|envelope| {
18080 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18081 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
18082 })
18083 }),
18084
18085 source: wire.table.get(2).map(|envelope| {
18086 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18087 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
18088 })
18089 }),
18090
18091 scheme: wire.table.get(3).map(|envelope| {
18092 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18093 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
18094 })
18095 }),
18096 }
18097 }
18098 }
18099
18100 #[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"]
18101 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
18102 pub struct DebugProtocolRegistration {
18103 pub source: ::core::option::Option<crate::natural::Ref>,
18104
18105 pub source_name: ::core::option::Option<::std::string::String>,
18106
18107 pub target_name: ::core::option::Option<::std::string::String>,
18108 }
18109
18110 impl DebugProtocolRegistration {
18111 fn __max_ordinal(&self) -> usize {
18112 if self.target_name.is_some() {
18113 return 3;
18114 }
18115
18116 if self.source_name.is_some() {
18117 return 2;
18118 }
18119
18120 if self.source.is_some() {
18121 return 1;
18122 }
18123
18124 0
18125 }
18126 }
18127
18128 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DebugProtocolRegistration<'static>, ___E>
18129 for DebugProtocolRegistration
18130 where
18131 ___E: ::fidl_next::Encoder + ?Sized,
18132 {
18133 #[inline]
18134 fn encode(
18135 mut self,
18136 encoder: &mut ___E,
18137 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugProtocolRegistration<'static>>,
18138 _: (),
18139 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18140 ::fidl_next::munge!(let crate::wire::DebugProtocolRegistration { table } = out);
18141
18142 let max_ord = self.__max_ordinal();
18143
18144 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
18145 ::fidl_next::Wire::zero_padding(&mut out);
18146
18147 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
18148 ::fidl_next::wire::Envelope,
18149 >(encoder, max_ord);
18150
18151 for i in 1..=max_ord {
18152 match i {
18153 3 => {
18154 if let Some(value) = self.target_name.take() {
18155 ::fidl_next::wire::Envelope::encode_value::<
18156 ::fidl_next::wire::String<'static>,
18157 ___E,
18158 >(
18159 value, preallocated.encoder, &mut out, 100
18160 )?;
18161 } else {
18162 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18163 }
18164 }
18165
18166 2 => {
18167 if let Some(value) = self.source_name.take() {
18168 ::fidl_next::wire::Envelope::encode_value::<
18169 ::fidl_next::wire::String<'static>,
18170 ___E,
18171 >(
18172 value, preallocated.encoder, &mut out, 100
18173 )?;
18174 } else {
18175 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18176 }
18177 }
18178
18179 1 => {
18180 if let Some(value) = self.source.take() {
18181 ::fidl_next::wire::Envelope::encode_value::<
18182 crate::wire::Ref<'static>,
18183 ___E,
18184 >(
18185 value, preallocated.encoder, &mut out, ()
18186 )?;
18187 } else {
18188 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18189 }
18190 }
18191
18192 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
18193 }
18194 unsafe {
18195 preallocated.write_next(out.assume_init_ref());
18196 }
18197 }
18198
18199 ::fidl_next::wire::Table::encode_len(table, max_ord);
18200
18201 Ok(())
18202 }
18203 }
18204
18205 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DebugProtocolRegistration<'static>, ___E>
18206 for &'a DebugProtocolRegistration
18207 where
18208 ___E: ::fidl_next::Encoder + ?Sized,
18209 {
18210 #[inline]
18211 fn encode(
18212 self,
18213 encoder: &mut ___E,
18214 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugProtocolRegistration<'static>>,
18215 _: (),
18216 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18217 ::fidl_next::munge!(let crate::wire::DebugProtocolRegistration { table } = out);
18218
18219 let max_ord = self.__max_ordinal();
18220
18221 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
18222 ::fidl_next::Wire::zero_padding(&mut out);
18223
18224 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
18225 ::fidl_next::wire::Envelope,
18226 >(encoder, max_ord);
18227
18228 for i in 1..=max_ord {
18229 match i {
18230 3 => {
18231 if let Some(value) = &self.target_name {
18232 ::fidl_next::wire::Envelope::encode_value::<
18233 ::fidl_next::wire::String<'static>,
18234 ___E,
18235 >(
18236 value, preallocated.encoder, &mut out, 100
18237 )?;
18238 } else {
18239 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18240 }
18241 }
18242
18243 2 => {
18244 if let Some(value) = &self.source_name {
18245 ::fidl_next::wire::Envelope::encode_value::<
18246 ::fidl_next::wire::String<'static>,
18247 ___E,
18248 >(
18249 value, preallocated.encoder, &mut out, 100
18250 )?;
18251 } else {
18252 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18253 }
18254 }
18255
18256 1 => {
18257 if let Some(value) = &self.source {
18258 ::fidl_next::wire::Envelope::encode_value::<
18259 crate::wire::Ref<'static>,
18260 ___E,
18261 >(
18262 value, preallocated.encoder, &mut out, ()
18263 )?;
18264 } else {
18265 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18266 }
18267 }
18268
18269 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
18270 }
18271 unsafe {
18272 preallocated.write_next(out.assume_init_ref());
18273 }
18274 }
18275
18276 ::fidl_next::wire::Table::encode_len(table, max_ord);
18277
18278 Ok(())
18279 }
18280 }
18281
18282 impl<'de> ::fidl_next::FromWire<crate::wire::DebugProtocolRegistration<'de>>
18283 for DebugProtocolRegistration
18284 {
18285 #[inline]
18286 fn from_wire(wire_: crate::wire::DebugProtocolRegistration<'de>) -> Self {
18287 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
18288
18289 let source = wire_.table.get(1);
18290
18291 let source_name = wire_.table.get(2);
18292
18293 let target_name = wire_.table.get(3);
18294
18295 Self {
18296 source: source.map(|envelope| {
18297 ::fidl_next::FromWire::from_wire(unsafe {
18298 envelope.read_unchecked::<crate::wire::Ref<'de>>()
18299 })
18300 }),
18301
18302 source_name: source_name.map(|envelope| {
18303 ::fidl_next::FromWire::from_wire(unsafe {
18304 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
18305 })
18306 }),
18307
18308 target_name: target_name.map(|envelope| {
18309 ::fidl_next::FromWire::from_wire(unsafe {
18310 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
18311 })
18312 }),
18313 }
18314 }
18315 }
18316
18317 impl<'de> ::fidl_next::FromWireRef<crate::wire::DebugProtocolRegistration<'de>>
18318 for DebugProtocolRegistration
18319 {
18320 #[inline]
18321 fn from_wire_ref(wire: &crate::wire::DebugProtocolRegistration<'de>) -> Self {
18322 Self {
18323 source: wire.table.get(1).map(|envelope| {
18324 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18325 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
18326 })
18327 }),
18328
18329 source_name: wire.table.get(2).map(|envelope| {
18330 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18331 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
18332 })
18333 }),
18334
18335 target_name: wire.table.get(3).map(|envelope| {
18336 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18337 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
18338 })
18339 }),
18340 }
18341 }
18342 }
18343
18344 #[doc = " Declares a capability registered in the debug section of an environment.\n"]
18345 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
18346 pub enum DebugRegistration {
18347 Protocol(crate::natural::DebugProtocolRegistration),
18348
18349 UnknownOrdinal_(u64),
18350 }
18351
18352 impl DebugRegistration {
18353 pub fn is_unknown(&self) -> bool {
18354 #[allow(unreachable_patterns)]
18355 match self {
18356 Self::UnknownOrdinal_(_) => true,
18357 _ => false,
18358 }
18359 }
18360 }
18361
18362 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DebugRegistration<'static>, ___E>
18363 for DebugRegistration
18364 where
18365 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18366 ___E: ::fidl_next::Encoder,
18367 {
18368 #[inline]
18369 fn encode(
18370 self,
18371 encoder: &mut ___E,
18372 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugRegistration<'static>>,
18373 _: (),
18374 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18375 ::fidl_next::munge!(let crate::wire::DebugRegistration { raw, _phantom: _ } = out);
18376
18377 match self {
18378 Self::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
18379 ___E,
18380 crate::wire::DebugProtocolRegistration<'static>,
18381 >(value, 1, encoder, raw, ())?,
18382
18383 Self::UnknownOrdinal_(ordinal) => {
18384 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
18385 }
18386 }
18387
18388 Ok(())
18389 }
18390 }
18391
18392 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DebugRegistration<'static>, ___E>
18393 for &'a DebugRegistration
18394 where
18395 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18396 ___E: ::fidl_next::Encoder,
18397 {
18398 #[inline]
18399 fn encode(
18400 self,
18401 encoder: &mut ___E,
18402 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugRegistration<'static>>,
18403 _: (),
18404 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18405 ::fidl_next::munge!(let crate::wire::DebugRegistration { raw, _phantom: _ } = out);
18406
18407 match self {
18408 DebugRegistration::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
18409 ___E,
18410 crate::wire::DebugProtocolRegistration<'static>,
18411 >(value, 1, encoder, raw, ())?,
18412
18413 DebugRegistration::UnknownOrdinal_(ordinal) => {
18414 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
18415 }
18416 }
18417
18418 Ok(())
18419 }
18420 }
18421
18422 unsafe impl<___E>
18423 ::fidl_next::EncodeOption<crate::wire_optional::DebugRegistration<'static>, ___E>
18424 for DebugRegistration
18425 where
18426 ___E: ?Sized,
18427 DebugRegistration: ::fidl_next::Encode<crate::wire::DebugRegistration<'static>, ___E>,
18428 {
18429 #[inline]
18430 fn encode_option(
18431 this: ::core::option::Option<Self>,
18432 encoder: &mut ___E,
18433 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::DebugRegistration<'static>>,
18434 _: (),
18435 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18436 ::fidl_next::munge!(let crate::wire_optional::DebugRegistration { raw, _phantom: _ } = &mut *out);
18437
18438 if let Some(inner) = this {
18439 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
18440 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
18441 } else {
18442 ::fidl_next::wire::Union::encode_absent(raw);
18443 }
18444
18445 Ok(())
18446 }
18447 }
18448
18449 unsafe impl<'a, ___E>
18450 ::fidl_next::EncodeOption<crate::wire_optional::DebugRegistration<'static>, ___E>
18451 for &'a DebugRegistration
18452 where
18453 ___E: ?Sized,
18454 &'a DebugRegistration: ::fidl_next::Encode<crate::wire::DebugRegistration<'static>, ___E>,
18455 {
18456 #[inline]
18457 fn encode_option(
18458 this: ::core::option::Option<Self>,
18459 encoder: &mut ___E,
18460 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::DebugRegistration<'static>>,
18461 _: (),
18462 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18463 ::fidl_next::munge!(let crate::wire_optional::DebugRegistration { raw, _phantom: _ } = &mut *out);
18464
18465 if let Some(inner) = this {
18466 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
18467 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
18468 } else {
18469 ::fidl_next::wire::Union::encode_absent(raw);
18470 }
18471
18472 Ok(())
18473 }
18474 }
18475
18476 impl<'de> ::fidl_next::FromWire<crate::wire::DebugRegistration<'de>> for DebugRegistration {
18477 #[inline]
18478 fn from_wire(wire: crate::wire::DebugRegistration<'de>) -> Self {
18479 let wire = ::core::mem::ManuallyDrop::new(wire);
18480 match wire.raw.ordinal() {
18481 1 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
18482 wire.raw.get().read_unchecked::<crate::wire::DebugProtocolRegistration<'de>>()
18483 })),
18484
18485 ord => return Self::UnknownOrdinal_(ord as u64),
18486 }
18487 }
18488 }
18489
18490 impl<'de> ::fidl_next::FromWireRef<crate::wire::DebugRegistration<'de>> for DebugRegistration {
18491 #[inline]
18492 fn from_wire_ref(wire: &crate::wire::DebugRegistration<'de>) -> Self {
18493 match wire.raw.ordinal() {
18494 1 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18495 wire.raw.get().deref_unchecked::<crate::wire::DebugProtocolRegistration<'de>>()
18496 })),
18497
18498 ord => return Self::UnknownOrdinal_(ord as u64),
18499 }
18500 }
18501 }
18502
18503 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::DebugRegistration<'de>>
18504 for DebugRegistration
18505 {
18506 #[inline]
18507 fn from_wire_option(
18508 wire: crate::wire_optional::DebugRegistration<'de>,
18509 ) -> ::core::option::Option<Self> {
18510 if let Some(inner) = wire.into_option() {
18511 Some(::fidl_next::FromWire::from_wire(inner))
18512 } else {
18513 None
18514 }
18515 }
18516 }
18517
18518 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::DebugRegistration<'de>>
18519 for Box<DebugRegistration>
18520 {
18521 #[inline]
18522 fn from_wire_option(
18523 wire: crate::wire_optional::DebugRegistration<'de>,
18524 ) -> ::core::option::Option<Self> {
18525 <DebugRegistration as ::fidl_next::FromWireOption<
18526 crate::wire_optional::DebugRegistration<'de>,
18527 >>::from_wire_option(wire)
18528 .map(Box::new)
18529 }
18530 }
18531
18532 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::DebugRegistration<'de>>
18533 for Box<DebugRegistration>
18534 {
18535 #[inline]
18536 fn from_wire_option_ref(
18537 wire: &crate::wire_optional::DebugRegistration<'de>,
18538 ) -> ::core::option::Option<Self> {
18539 if let Some(inner) = wire.as_ref() {
18540 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
18541 } else {
18542 None
18543 }
18544 }
18545 }
18546
18547 #[doc = " Declares an environment which configures a realm.\n"]
18548 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
18549 pub struct Environment {
18550 pub name: ::core::option::Option<::std::string::String>,
18551
18552 pub extends: ::core::option::Option<crate::natural::EnvironmentExtends>,
18553
18554 pub runners: ::core::option::Option<::std::vec::Vec<crate::natural::RunnerRegistration>>,
18555
18556 pub resolvers:
18557 ::core::option::Option<::std::vec::Vec<crate::natural::ResolverRegistration>>,
18558
18559 pub debug_capabilities:
18560 ::core::option::Option<::std::vec::Vec<crate::natural::DebugRegistration>>,
18561
18562 pub stop_timeout_ms: ::core::option::Option<u32>,
18563 }
18564
18565 impl Environment {
18566 fn __max_ordinal(&self) -> usize {
18567 if self.stop_timeout_ms.is_some() {
18568 return 6;
18569 }
18570
18571 if self.debug_capabilities.is_some() {
18572 return 5;
18573 }
18574
18575 if self.resolvers.is_some() {
18576 return 4;
18577 }
18578
18579 if self.runners.is_some() {
18580 return 3;
18581 }
18582
18583 if self.extends.is_some() {
18584 return 2;
18585 }
18586
18587 if self.name.is_some() {
18588 return 1;
18589 }
18590
18591 0
18592 }
18593 }
18594
18595 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Environment<'static>, ___E> for Environment
18596 where
18597 ___E: ::fidl_next::Encoder + ?Sized,
18598 {
18599 #[inline]
18600 fn encode(
18601 mut self,
18602 encoder: &mut ___E,
18603 out: &mut ::core::mem::MaybeUninit<crate::wire::Environment<'static>>,
18604 _: (),
18605 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18606 ::fidl_next::munge!(let crate::wire::Environment { table } = out);
18607
18608 let max_ord = self.__max_ordinal();
18609
18610 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
18611 ::fidl_next::Wire::zero_padding(&mut out);
18612
18613 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
18614 ::fidl_next::wire::Envelope,
18615 >(encoder, max_ord);
18616
18617 for i in 1..=max_ord {
18618 match i {
18619 6 => {
18620 if let Some(value) = self.stop_timeout_ms.take() {
18621 ::fidl_next::wire::Envelope::encode_value::<
18622 ::fidl_next::wire::Uint32,
18623 ___E,
18624 >(
18625 value, preallocated.encoder, &mut out, ()
18626 )?;
18627 } else {
18628 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18629 }
18630 }
18631
18632 5 => {
18633 if let Some(value) = self.debug_capabilities.take() {
18634 ::fidl_next::wire::Envelope::encode_value::<
18635 ::fidl_next::wire::Vector<
18636 'static,
18637 crate::wire::DebugRegistration<'static>,
18638 >,
18639 ___E,
18640 >(
18641 value, preallocated.encoder, &mut out, (4294967295, ())
18642 )?;
18643 } else {
18644 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18645 }
18646 }
18647
18648 4 => {
18649 if let Some(value) = self.resolvers.take() {
18650 ::fidl_next::wire::Envelope::encode_value::<
18651 ::fidl_next::wire::Vector<
18652 'static,
18653 crate::wire::ResolverRegistration<'static>,
18654 >,
18655 ___E,
18656 >(
18657 value, preallocated.encoder, &mut out, (4294967295, ())
18658 )?;
18659 } else {
18660 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18661 }
18662 }
18663
18664 3 => {
18665 if let Some(value) = self.runners.take() {
18666 ::fidl_next::wire::Envelope::encode_value::<
18667 ::fidl_next::wire::Vector<
18668 'static,
18669 crate::wire::RunnerRegistration<'static>,
18670 >,
18671 ___E,
18672 >(
18673 value, preallocated.encoder, &mut out, (4294967295, ())
18674 )?;
18675 } else {
18676 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18677 }
18678 }
18679
18680 2 => {
18681 if let Some(value) = self.extends.take() {
18682 ::fidl_next::wire::Envelope::encode_value::<
18683 crate::wire::EnvironmentExtends,
18684 ___E,
18685 >(
18686 value, preallocated.encoder, &mut out, ()
18687 )?;
18688 } else {
18689 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18690 }
18691 }
18692
18693 1 => {
18694 if let Some(value) = self.name.take() {
18695 ::fidl_next::wire::Envelope::encode_value::<
18696 ::fidl_next::wire::String<'static>,
18697 ___E,
18698 >(
18699 value, preallocated.encoder, &mut out, 100
18700 )?;
18701 } else {
18702 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18703 }
18704 }
18705
18706 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
18707 }
18708 unsafe {
18709 preallocated.write_next(out.assume_init_ref());
18710 }
18711 }
18712
18713 ::fidl_next::wire::Table::encode_len(table, max_ord);
18714
18715 Ok(())
18716 }
18717 }
18718
18719 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Environment<'static>, ___E>
18720 for &'a Environment
18721 where
18722 ___E: ::fidl_next::Encoder + ?Sized,
18723 {
18724 #[inline]
18725 fn encode(
18726 self,
18727 encoder: &mut ___E,
18728 out: &mut ::core::mem::MaybeUninit<crate::wire::Environment<'static>>,
18729 _: (),
18730 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18731 ::fidl_next::munge!(let crate::wire::Environment { table } = out);
18732
18733 let max_ord = self.__max_ordinal();
18734
18735 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
18736 ::fidl_next::Wire::zero_padding(&mut out);
18737
18738 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
18739 ::fidl_next::wire::Envelope,
18740 >(encoder, max_ord);
18741
18742 for i in 1..=max_ord {
18743 match i {
18744 6 => {
18745 if let Some(value) = &self.stop_timeout_ms {
18746 ::fidl_next::wire::Envelope::encode_value::<
18747 ::fidl_next::wire::Uint32,
18748 ___E,
18749 >(
18750 value, preallocated.encoder, &mut out, ()
18751 )?;
18752 } else {
18753 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18754 }
18755 }
18756
18757 5 => {
18758 if let Some(value) = &self.debug_capabilities {
18759 ::fidl_next::wire::Envelope::encode_value::<
18760 ::fidl_next::wire::Vector<
18761 'static,
18762 crate::wire::DebugRegistration<'static>,
18763 >,
18764 ___E,
18765 >(
18766 value, preallocated.encoder, &mut out, (4294967295, ())
18767 )?;
18768 } else {
18769 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18770 }
18771 }
18772
18773 4 => {
18774 if let Some(value) = &self.resolvers {
18775 ::fidl_next::wire::Envelope::encode_value::<
18776 ::fidl_next::wire::Vector<
18777 'static,
18778 crate::wire::ResolverRegistration<'static>,
18779 >,
18780 ___E,
18781 >(
18782 value, preallocated.encoder, &mut out, (4294967295, ())
18783 )?;
18784 } else {
18785 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18786 }
18787 }
18788
18789 3 => {
18790 if let Some(value) = &self.runners {
18791 ::fidl_next::wire::Envelope::encode_value::<
18792 ::fidl_next::wire::Vector<
18793 'static,
18794 crate::wire::RunnerRegistration<'static>,
18795 >,
18796 ___E,
18797 >(
18798 value, preallocated.encoder, &mut out, (4294967295, ())
18799 )?;
18800 } else {
18801 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18802 }
18803 }
18804
18805 2 => {
18806 if let Some(value) = &self.extends {
18807 ::fidl_next::wire::Envelope::encode_value::<
18808 crate::wire::EnvironmentExtends,
18809 ___E,
18810 >(
18811 value, preallocated.encoder, &mut out, ()
18812 )?;
18813 } else {
18814 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18815 }
18816 }
18817
18818 1 => {
18819 if let Some(value) = &self.name {
18820 ::fidl_next::wire::Envelope::encode_value::<
18821 ::fidl_next::wire::String<'static>,
18822 ___E,
18823 >(
18824 value, preallocated.encoder, &mut out, 100
18825 )?;
18826 } else {
18827 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18828 }
18829 }
18830
18831 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
18832 }
18833 unsafe {
18834 preallocated.write_next(out.assume_init_ref());
18835 }
18836 }
18837
18838 ::fidl_next::wire::Table::encode_len(table, max_ord);
18839
18840 Ok(())
18841 }
18842 }
18843
18844 impl<'de> ::fidl_next::FromWire<crate::wire::Environment<'de>> for Environment {
18845 #[inline]
18846 fn from_wire(wire_: crate::wire::Environment<'de>) -> Self {
18847 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
18848
18849 let name = wire_.table.get(1);
18850
18851 let extends = wire_.table.get(2);
18852
18853 let runners = wire_.table.get(3);
18854
18855 let resolvers = wire_.table.get(4);
18856
18857 let debug_capabilities = wire_.table.get(5);
18858
18859 let stop_timeout_ms = wire_.table.get(6);
18860
18861 Self {
18862
18863
18864 name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
18865 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
18866 )),
18867
18868
18869 extends: extends.map(|envelope| ::fidl_next::FromWire::from_wire(
18870 unsafe { envelope.read_unchecked::<crate::wire::EnvironmentExtends>() }
18871 )),
18872
18873
18874 runners: runners.map(|envelope| ::fidl_next::FromWire::from_wire(
18875 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::RunnerRegistration<'de>>>() }
18876 )),
18877
18878
18879 resolvers: resolvers.map(|envelope| ::fidl_next::FromWire::from_wire(
18880 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ResolverRegistration<'de>>>() }
18881 )),
18882
18883
18884 debug_capabilities: debug_capabilities.map(|envelope| ::fidl_next::FromWire::from_wire(
18885 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DebugRegistration<'de>>>() }
18886 )),
18887
18888
18889 stop_timeout_ms: stop_timeout_ms.map(|envelope| ::fidl_next::FromWire::from_wire(
18890 unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() }
18891 )),
18892
18893 }
18894 }
18895 }
18896
18897 impl<'de> ::fidl_next::FromWireRef<crate::wire::Environment<'de>> for Environment {
18898 #[inline]
18899 fn from_wire_ref(wire: &crate::wire::Environment<'de>) -> Self {
18900 Self {
18901
18902
18903 name: wire.table.get(1)
18904 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
18905 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
18906 )),
18907
18908
18909 extends: wire.table.get(2)
18910 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
18911 unsafe { envelope.deref_unchecked::<crate::wire::EnvironmentExtends>() }
18912 )),
18913
18914
18915 runners: wire.table.get(3)
18916 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
18917 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::RunnerRegistration<'de>>>() }
18918 )),
18919
18920
18921 resolvers: wire.table.get(4)
18922 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
18923 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ResolverRegistration<'de>>>() }
18924 )),
18925
18926
18927 debug_capabilities: wire.table.get(5)
18928 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
18929 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DebugRegistration<'de>>>() }
18930 )),
18931
18932
18933 stop_timeout_ms: wire.table.get(6)
18934 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
18935 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint32>() }
18936 )),
18937
18938 }
18939 }
18940 }
18941
18942 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
18943 pub struct ConfigSourceCapabilities {}
18944
18945 impl ConfigSourceCapabilities {
18946 fn __max_ordinal(&self) -> usize {
18947 0
18948 }
18949 }
18950
18951 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigSourceCapabilities<'static>, ___E>
18952 for ConfigSourceCapabilities
18953 where
18954 ___E: ::fidl_next::Encoder + ?Sized,
18955 {
18956 #[inline]
18957 fn encode(
18958 mut self,
18959 encoder: &mut ___E,
18960 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSourceCapabilities<'static>>,
18961 _: (),
18962 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18963 ::fidl_next::munge!(let crate::wire::ConfigSourceCapabilities { table } = out);
18964
18965 let max_ord = self.__max_ordinal();
18966
18967 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
18968 ::fidl_next::Wire::zero_padding(&mut out);
18969
18970 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
18971 ::fidl_next::wire::Envelope,
18972 >(encoder, max_ord);
18973
18974 for i in 1..=max_ord {
18975 match i {
18976 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
18977 }
18978 unsafe {
18979 preallocated.write_next(out.assume_init_ref());
18980 }
18981 }
18982
18983 ::fidl_next::wire::Table::encode_len(table, max_ord);
18984
18985 Ok(())
18986 }
18987 }
18988
18989 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigSourceCapabilities<'static>, ___E>
18990 for &'a ConfigSourceCapabilities
18991 where
18992 ___E: ::fidl_next::Encoder + ?Sized,
18993 {
18994 #[inline]
18995 fn encode(
18996 self,
18997 encoder: &mut ___E,
18998 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSourceCapabilities<'static>>,
18999 _: (),
19000 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19001 ::fidl_next::munge!(let crate::wire::ConfigSourceCapabilities { table } = out);
19002
19003 let max_ord = self.__max_ordinal();
19004
19005 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
19006 ::fidl_next::Wire::zero_padding(&mut out);
19007
19008 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
19009 ::fidl_next::wire::Envelope,
19010 >(encoder, max_ord);
19011
19012 for i in 1..=max_ord {
19013 match i {
19014 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
19015 }
19016 unsafe {
19017 preallocated.write_next(out.assume_init_ref());
19018 }
19019 }
19020
19021 ::fidl_next::wire::Table::encode_len(table, max_ord);
19022
19023 Ok(())
19024 }
19025 }
19026
19027 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigSourceCapabilities<'de>>
19028 for ConfigSourceCapabilities
19029 {
19030 #[inline]
19031 fn from_wire(wire_: crate::wire::ConfigSourceCapabilities<'de>) -> Self {
19032 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
19033
19034 Self {}
19035 }
19036 }
19037
19038 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigSourceCapabilities<'de>>
19039 for ConfigSourceCapabilities
19040 {
19041 #[inline]
19042 fn from_wire_ref(wire: &crate::wire::ConfigSourceCapabilities<'de>) -> Self {
19043 Self {}
19044 }
19045 }
19046
19047 #[doc = " Strategies available for resolving configuration values.\n"]
19048 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
19049 pub enum ConfigValueSource {
19050 PackagePath(::std::string::String),
19051
19052 Capabilities(crate::natural::ConfigSourceCapabilities),
19053
19054 UnknownOrdinal_(u64),
19055 }
19056
19057 impl ConfigValueSource {
19058 pub fn is_unknown(&self) -> bool {
19059 #[allow(unreachable_patterns)]
19060 match self {
19061 Self::UnknownOrdinal_(_) => true,
19062 _ => false,
19063 }
19064 }
19065 }
19066
19067 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigValueSource<'static>, ___E>
19068 for ConfigValueSource
19069 where
19070 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19071 ___E: ::fidl_next::Encoder,
19072 {
19073 #[inline]
19074 fn encode(
19075 self,
19076 encoder: &mut ___E,
19077 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValueSource<'static>>,
19078 _: (),
19079 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19080 ::fidl_next::munge!(let crate::wire::ConfigValueSource { raw, _phantom: _ } = out);
19081
19082 match self {
19083 Self::PackagePath(value) => ::fidl_next::wire::Union::encode_as::<
19084 ___E,
19085 ::fidl_next::wire::String<'static>,
19086 >(value, 1, encoder, raw, 4294967295)?,
19087
19088 Self::Capabilities(value) => ::fidl_next::wire::Union::encode_as::<
19089 ___E,
19090 crate::wire::ConfigSourceCapabilities<'static>,
19091 >(value, 2, encoder, raw, ())?,
19092
19093 Self::UnknownOrdinal_(ordinal) => {
19094 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
19095 }
19096 }
19097
19098 Ok(())
19099 }
19100 }
19101
19102 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigValueSource<'static>, ___E>
19103 for &'a ConfigValueSource
19104 where
19105 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19106 ___E: ::fidl_next::Encoder,
19107 {
19108 #[inline]
19109 fn encode(
19110 self,
19111 encoder: &mut ___E,
19112 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValueSource<'static>>,
19113 _: (),
19114 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19115 ::fidl_next::munge!(let crate::wire::ConfigValueSource { raw, _phantom: _ } = out);
19116
19117 match self {
19118 ConfigValueSource::PackagePath(value) => {
19119 ::fidl_next::wire::Union::encode_as::<___E, ::fidl_next::wire::String<'static>>(
19120 value, 1, encoder, raw, 4294967295,
19121 )?
19122 }
19123
19124 ConfigValueSource::Capabilities(value) => {
19125 ::fidl_next::wire::Union::encode_as::<
19126 ___E,
19127 crate::wire::ConfigSourceCapabilities<'static>,
19128 >(value, 2, encoder, raw, ())?
19129 }
19130
19131 ConfigValueSource::UnknownOrdinal_(ordinal) => {
19132 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
19133 }
19134 }
19135
19136 Ok(())
19137 }
19138 }
19139
19140 unsafe impl<___E>
19141 ::fidl_next::EncodeOption<crate::wire_optional::ConfigValueSource<'static>, ___E>
19142 for ConfigValueSource
19143 where
19144 ___E: ?Sized,
19145 ConfigValueSource: ::fidl_next::Encode<crate::wire::ConfigValueSource<'static>, ___E>,
19146 {
19147 #[inline]
19148 fn encode_option(
19149 this: ::core::option::Option<Self>,
19150 encoder: &mut ___E,
19151 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigValueSource<'static>>,
19152 _: (),
19153 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19154 ::fidl_next::munge!(let crate::wire_optional::ConfigValueSource { raw, _phantom: _ } = &mut *out);
19155
19156 if let Some(inner) = this {
19157 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
19158 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
19159 } else {
19160 ::fidl_next::wire::Union::encode_absent(raw);
19161 }
19162
19163 Ok(())
19164 }
19165 }
19166
19167 unsafe impl<'a, ___E>
19168 ::fidl_next::EncodeOption<crate::wire_optional::ConfigValueSource<'static>, ___E>
19169 for &'a ConfigValueSource
19170 where
19171 ___E: ?Sized,
19172 &'a ConfigValueSource: ::fidl_next::Encode<crate::wire::ConfigValueSource<'static>, ___E>,
19173 {
19174 #[inline]
19175 fn encode_option(
19176 this: ::core::option::Option<Self>,
19177 encoder: &mut ___E,
19178 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigValueSource<'static>>,
19179 _: (),
19180 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19181 ::fidl_next::munge!(let crate::wire_optional::ConfigValueSource { raw, _phantom: _ } = &mut *out);
19182
19183 if let Some(inner) = this {
19184 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
19185 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
19186 } else {
19187 ::fidl_next::wire::Union::encode_absent(raw);
19188 }
19189
19190 Ok(())
19191 }
19192 }
19193
19194 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigValueSource<'de>> for ConfigValueSource {
19195 #[inline]
19196 fn from_wire(wire: crate::wire::ConfigValueSource<'de>) -> Self {
19197 let wire = ::core::mem::ManuallyDrop::new(wire);
19198 match wire.raw.ordinal() {
19199 1 => Self::PackagePath(::fidl_next::FromWire::from_wire(unsafe {
19200 wire.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
19201 })),
19202
19203 2 => Self::Capabilities(::fidl_next::FromWire::from_wire(unsafe {
19204 wire.raw.get().read_unchecked::<crate::wire::ConfigSourceCapabilities<'de>>()
19205 })),
19206
19207 ord => return Self::UnknownOrdinal_(ord as u64),
19208 }
19209 }
19210 }
19211
19212 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigValueSource<'de>> for ConfigValueSource {
19213 #[inline]
19214 fn from_wire_ref(wire: &crate::wire::ConfigValueSource<'de>) -> Self {
19215 match wire.raw.ordinal() {
19216 1 => Self::PackagePath(::fidl_next::FromWireRef::from_wire_ref(unsafe {
19217 wire.raw.get().deref_unchecked::<::fidl_next::wire::String<'de>>()
19218 })),
19219
19220 2 => Self::Capabilities(::fidl_next::FromWireRef::from_wire_ref(unsafe {
19221 wire.raw.get().deref_unchecked::<crate::wire::ConfigSourceCapabilities<'de>>()
19222 })),
19223
19224 ord => return Self::UnknownOrdinal_(ord as u64),
19225 }
19226 }
19227 }
19228
19229 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigValueSource<'de>>
19230 for ConfigValueSource
19231 {
19232 #[inline]
19233 fn from_wire_option(
19234 wire: crate::wire_optional::ConfigValueSource<'de>,
19235 ) -> ::core::option::Option<Self> {
19236 if let Some(inner) = wire.into_option() {
19237 Some(::fidl_next::FromWire::from_wire(inner))
19238 } else {
19239 None
19240 }
19241 }
19242 }
19243
19244 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigValueSource<'de>>
19245 for Box<ConfigValueSource>
19246 {
19247 #[inline]
19248 fn from_wire_option(
19249 wire: crate::wire_optional::ConfigValueSource<'de>,
19250 ) -> ::core::option::Option<Self> {
19251 <ConfigValueSource as ::fidl_next::FromWireOption<
19252 crate::wire_optional::ConfigValueSource<'de>,
19253 >>::from_wire_option(wire)
19254 .map(Box::new)
19255 }
19256 }
19257
19258 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ConfigValueSource<'de>>
19259 for Box<ConfigValueSource>
19260 {
19261 #[inline]
19262 fn from_wire_option_ref(
19263 wire: &crate::wire_optional::ConfigValueSource<'de>,
19264 ) -> ::core::option::Option<Self> {
19265 if let Some(inner) = wire.as_ref() {
19266 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
19267 } else {
19268 None
19269 }
19270 }
19271 }
19272
19273 #[doc = " The schema of a component\'s configuration interface.\n"]
19274 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
19275 pub struct ConfigSchema {
19276 pub fields: ::core::option::Option<::std::vec::Vec<crate::natural::ConfigField>>,
19277
19278 pub checksum: ::core::option::Option<crate::natural::ConfigChecksum>,
19279
19280 pub value_source: ::core::option::Option<crate::natural::ConfigValueSource>,
19281 }
19282
19283 impl ConfigSchema {
19284 fn __max_ordinal(&self) -> usize {
19285 if self.value_source.is_some() {
19286 return 3;
19287 }
19288
19289 if self.checksum.is_some() {
19290 return 2;
19291 }
19292
19293 if self.fields.is_some() {
19294 return 1;
19295 }
19296
19297 0
19298 }
19299 }
19300
19301 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigSchema<'static>, ___E> for ConfigSchema
19302 where
19303 ___E: ::fidl_next::Encoder + ?Sized,
19304 {
19305 #[inline]
19306 fn encode(
19307 mut self,
19308 encoder: &mut ___E,
19309 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSchema<'static>>,
19310 _: (),
19311 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19312 ::fidl_next::munge!(let crate::wire::ConfigSchema { table } = out);
19313
19314 let max_ord = self.__max_ordinal();
19315
19316 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
19317 ::fidl_next::Wire::zero_padding(&mut out);
19318
19319 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
19320 ::fidl_next::wire::Envelope,
19321 >(encoder, max_ord);
19322
19323 for i in 1..=max_ord {
19324 match i {
19325 3 => {
19326 if let Some(value) = self.value_source.take() {
19327 ::fidl_next::wire::Envelope::encode_value::<
19328 crate::wire::ConfigValueSource<'static>,
19329 ___E,
19330 >(
19331 value, preallocated.encoder, &mut out, ()
19332 )?;
19333 } else {
19334 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19335 }
19336 }
19337
19338 2 => {
19339 if let Some(value) = self.checksum.take() {
19340 ::fidl_next::wire::Envelope::encode_value::<
19341 crate::wire::ConfigChecksum<'static>,
19342 ___E,
19343 >(
19344 value, preallocated.encoder, &mut out, ()
19345 )?;
19346 } else {
19347 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19348 }
19349 }
19350
19351 1 => {
19352 if let Some(value) = self.fields.take() {
19353 ::fidl_next::wire::Envelope::encode_value::<
19354 ::fidl_next::wire::Vector<
19355 'static,
19356 crate::wire::ConfigField<'static>,
19357 >,
19358 ___E,
19359 >(
19360 value, preallocated.encoder, &mut out, (4294967295, ())
19361 )?;
19362 } else {
19363 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19364 }
19365 }
19366
19367 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
19368 }
19369 unsafe {
19370 preallocated.write_next(out.assume_init_ref());
19371 }
19372 }
19373
19374 ::fidl_next::wire::Table::encode_len(table, max_ord);
19375
19376 Ok(())
19377 }
19378 }
19379
19380 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigSchema<'static>, ___E>
19381 for &'a ConfigSchema
19382 where
19383 ___E: ::fidl_next::Encoder + ?Sized,
19384 {
19385 #[inline]
19386 fn encode(
19387 self,
19388 encoder: &mut ___E,
19389 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSchema<'static>>,
19390 _: (),
19391 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19392 ::fidl_next::munge!(let crate::wire::ConfigSchema { table } = out);
19393
19394 let max_ord = self.__max_ordinal();
19395
19396 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
19397 ::fidl_next::Wire::zero_padding(&mut out);
19398
19399 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
19400 ::fidl_next::wire::Envelope,
19401 >(encoder, max_ord);
19402
19403 for i in 1..=max_ord {
19404 match i {
19405 3 => {
19406 if let Some(value) = &self.value_source {
19407 ::fidl_next::wire::Envelope::encode_value::<
19408 crate::wire::ConfigValueSource<'static>,
19409 ___E,
19410 >(
19411 value, preallocated.encoder, &mut out, ()
19412 )?;
19413 } else {
19414 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19415 }
19416 }
19417
19418 2 => {
19419 if let Some(value) = &self.checksum {
19420 ::fidl_next::wire::Envelope::encode_value::<
19421 crate::wire::ConfigChecksum<'static>,
19422 ___E,
19423 >(
19424 value, preallocated.encoder, &mut out, ()
19425 )?;
19426 } else {
19427 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19428 }
19429 }
19430
19431 1 => {
19432 if let Some(value) = &self.fields {
19433 ::fidl_next::wire::Envelope::encode_value::<
19434 ::fidl_next::wire::Vector<
19435 'static,
19436 crate::wire::ConfigField<'static>,
19437 >,
19438 ___E,
19439 >(
19440 value, preallocated.encoder, &mut out, (4294967295, ())
19441 )?;
19442 } else {
19443 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19444 }
19445 }
19446
19447 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
19448 }
19449 unsafe {
19450 preallocated.write_next(out.assume_init_ref());
19451 }
19452 }
19453
19454 ::fidl_next::wire::Table::encode_len(table, max_ord);
19455
19456 Ok(())
19457 }
19458 }
19459
19460 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigSchema<'de>> for ConfigSchema {
19461 #[inline]
19462 fn from_wire(wire_: crate::wire::ConfigSchema<'de>) -> Self {
19463 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
19464
19465 let fields = wire_.table.get(1);
19466
19467 let checksum = wire_.table.get(2);
19468
19469 let value_source = wire_.table.get(3);
19470
19471 Self {
19472
19473
19474 fields: fields.map(|envelope| ::fidl_next::FromWire::from_wire(
19475 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigField<'de>>>() }
19476 )),
19477
19478
19479 checksum: checksum.map(|envelope| ::fidl_next::FromWire::from_wire(
19480 unsafe { envelope.read_unchecked::<crate::wire::ConfigChecksum<'de>>() }
19481 )),
19482
19483
19484 value_source: value_source.map(|envelope| ::fidl_next::FromWire::from_wire(
19485 unsafe { envelope.read_unchecked::<crate::wire::ConfigValueSource<'de>>() }
19486 )),
19487
19488 }
19489 }
19490 }
19491
19492 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigSchema<'de>> for ConfigSchema {
19493 #[inline]
19494 fn from_wire_ref(wire: &crate::wire::ConfigSchema<'de>) -> Self {
19495 Self {
19496
19497
19498 fields: wire.table.get(1)
19499 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19500 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigField<'de>>>() }
19501 )),
19502
19503
19504 checksum: wire.table.get(2)
19505 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19506 unsafe { envelope.deref_unchecked::<crate::wire::ConfigChecksum<'de>>() }
19507 )),
19508
19509
19510 value_source: wire.table.get(3)
19511 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19512 unsafe { envelope.deref_unchecked::<crate::wire::ConfigValueSource<'de>>() }
19513 )),
19514
19515 }
19516 }
19517 }
19518
19519 #[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"]
19520 #[derive(Debug, Default, Clone, PartialEq)]
19521 pub struct Component {
19522 pub program: ::core::option::Option<crate::natural::Program>,
19523
19524 pub uses: ::core::option::Option<::std::vec::Vec<crate::natural::Use>>,
19525
19526 pub exposes: ::core::option::Option<::std::vec::Vec<crate::natural::Expose>>,
19527
19528 pub offers: ::core::option::Option<::std::vec::Vec<crate::natural::Offer>>,
19529
19530 pub capabilities: ::core::option::Option<::std::vec::Vec<crate::natural::Capability>>,
19531
19532 pub children: ::core::option::Option<::std::vec::Vec<crate::natural::Child>>,
19533
19534 pub collections: ::core::option::Option<::std::vec::Vec<crate::natural::Collection>>,
19535
19536 pub environments: ::core::option::Option<::std::vec::Vec<crate::natural::Environment>>,
19537
19538 pub facets: ::core::option::Option<::fidl_next_common_fuchsia_data::natural::Dictionary>,
19539
19540 pub config: ::core::option::Option<crate::natural::ConfigSchema>,
19541
19542 pub debug_info: ::core::option::Option<crate::natural::DebugInfo>,
19543 }
19544
19545 impl Component {
19546 fn __max_ordinal(&self) -> usize {
19547 if self.debug_info.is_some() {
19548 return 11;
19549 }
19550
19551 if self.config.is_some() {
19552 return 10;
19553 }
19554
19555 if self.facets.is_some() {
19556 return 9;
19557 }
19558
19559 if self.environments.is_some() {
19560 return 8;
19561 }
19562
19563 if self.collections.is_some() {
19564 return 7;
19565 }
19566
19567 if self.children.is_some() {
19568 return 6;
19569 }
19570
19571 if self.capabilities.is_some() {
19572 return 5;
19573 }
19574
19575 if self.offers.is_some() {
19576 return 4;
19577 }
19578
19579 if self.exposes.is_some() {
19580 return 3;
19581 }
19582
19583 if self.uses.is_some() {
19584 return 2;
19585 }
19586
19587 if self.program.is_some() {
19588 return 1;
19589 }
19590
19591 0
19592 }
19593 }
19594
19595 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Component<'static>, ___E> for Component
19596 where
19597 ___E: ::fidl_next::Encoder + ?Sized,
19598 {
19599 #[inline]
19600 fn encode(
19601 mut self,
19602 encoder: &mut ___E,
19603 out: &mut ::core::mem::MaybeUninit<crate::wire::Component<'static>>,
19604 _: (),
19605 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19606 ::fidl_next::munge!(let crate::wire::Component { table } = out);
19607
19608 let max_ord = self.__max_ordinal();
19609
19610 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
19611 ::fidl_next::Wire::zero_padding(&mut out);
19612
19613 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
19614 ::fidl_next::wire::Envelope,
19615 >(encoder, max_ord);
19616
19617 for i in 1..=max_ord {
19618 match i {
19619 11 => {
19620 if let Some(value) = self.debug_info.take() {
19621 ::fidl_next::wire::Envelope::encode_value::<
19622 crate::wire::DebugInfo<'static>,
19623 ___E,
19624 >(
19625 value, preallocated.encoder, &mut out, ()
19626 )?;
19627 } else {
19628 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19629 }
19630 }
19631
19632 10 => {
19633 if let Some(value) = self.config.take() {
19634 ::fidl_next::wire::Envelope::encode_value::<
19635 crate::wire::ConfigSchema<'static>,
19636 ___E,
19637 >(
19638 value, preallocated.encoder, &mut out, ()
19639 )?;
19640 } else {
19641 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19642 }
19643 }
19644
19645 9 => {
19646 if let Some(value) = self.facets.take() {
19647 ::fidl_next::wire::Envelope::encode_value::<
19648 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
19649 ___E,
19650 >(
19651 value, preallocated.encoder, &mut out, ()
19652 )?;
19653 } else {
19654 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19655 }
19656 }
19657
19658 8 => {
19659 if let Some(value) = self.environments.take() {
19660 ::fidl_next::wire::Envelope::encode_value::<
19661 ::fidl_next::wire::Vector<
19662 'static,
19663 crate::wire::Environment<'static>,
19664 >,
19665 ___E,
19666 >(
19667 value, preallocated.encoder, &mut out, (4294967295, ())
19668 )?;
19669 } else {
19670 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19671 }
19672 }
19673
19674 7 => {
19675 if let Some(value) = self.collections.take() {
19676 ::fidl_next::wire::Envelope::encode_value::<
19677 ::fidl_next::wire::Vector<
19678 'static,
19679 crate::wire::Collection<'static>,
19680 >,
19681 ___E,
19682 >(
19683 value, preallocated.encoder, &mut out, (4294967295, ())
19684 )?;
19685 } else {
19686 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19687 }
19688 }
19689
19690 6 => {
19691 if let Some(value) = self.children.take() {
19692 ::fidl_next::wire::Envelope::encode_value::<
19693 ::fidl_next::wire::Vector<'static, crate::wire::Child<'static>>,
19694 ___E,
19695 >(
19696 value, preallocated.encoder, &mut out, (4294967295, ())
19697 )?;
19698 } else {
19699 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19700 }
19701 }
19702
19703 5 => {
19704 if let Some(value) = self.capabilities.take() {
19705 ::fidl_next::wire::Envelope::encode_value::<
19706 ::fidl_next::wire::Vector<
19707 'static,
19708 crate::wire::Capability<'static>,
19709 >,
19710 ___E,
19711 >(
19712 value, preallocated.encoder, &mut out, (4294967295, ())
19713 )?;
19714 } else {
19715 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19716 }
19717 }
19718
19719 4 => {
19720 if let Some(value) = self.offers.take() {
19721 ::fidl_next::wire::Envelope::encode_value::<
19722 ::fidl_next::wire::Vector<'static, crate::wire::Offer<'static>>,
19723 ___E,
19724 >(
19725 value, preallocated.encoder, &mut out, (4294967295, ())
19726 )?;
19727 } else {
19728 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19729 }
19730 }
19731
19732 3 => {
19733 if let Some(value) = self.exposes.take() {
19734 ::fidl_next::wire::Envelope::encode_value::<
19735 ::fidl_next::wire::Vector<'static, crate::wire::Expose<'static>>,
19736 ___E,
19737 >(
19738 value, preallocated.encoder, &mut out, (4294967295, ())
19739 )?;
19740 } else {
19741 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19742 }
19743 }
19744
19745 2 => {
19746 if let Some(value) = self.uses.take() {
19747 ::fidl_next::wire::Envelope::encode_value::<
19748 ::fidl_next::wire::Vector<'static, crate::wire::Use<'static>>,
19749 ___E,
19750 >(
19751 value, preallocated.encoder, &mut out, (4294967295, ())
19752 )?;
19753 } else {
19754 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19755 }
19756 }
19757
19758 1 => {
19759 if let Some(value) = self.program.take() {
19760 ::fidl_next::wire::Envelope::encode_value::<
19761 crate::wire::Program<'static>,
19762 ___E,
19763 >(
19764 value, preallocated.encoder, &mut out, ()
19765 )?;
19766 } else {
19767 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19768 }
19769 }
19770
19771 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
19772 }
19773 unsafe {
19774 preallocated.write_next(out.assume_init_ref());
19775 }
19776 }
19777
19778 ::fidl_next::wire::Table::encode_len(table, max_ord);
19779
19780 Ok(())
19781 }
19782 }
19783
19784 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Component<'static>, ___E> for &'a Component
19785 where
19786 ___E: ::fidl_next::Encoder + ?Sized,
19787 {
19788 #[inline]
19789 fn encode(
19790 self,
19791 encoder: &mut ___E,
19792 out: &mut ::core::mem::MaybeUninit<crate::wire::Component<'static>>,
19793 _: (),
19794 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19795 ::fidl_next::munge!(let crate::wire::Component { table } = out);
19796
19797 let max_ord = self.__max_ordinal();
19798
19799 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
19800 ::fidl_next::Wire::zero_padding(&mut out);
19801
19802 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
19803 ::fidl_next::wire::Envelope,
19804 >(encoder, max_ord);
19805
19806 for i in 1..=max_ord {
19807 match i {
19808 11 => {
19809 if let Some(value) = &self.debug_info {
19810 ::fidl_next::wire::Envelope::encode_value::<
19811 crate::wire::DebugInfo<'static>,
19812 ___E,
19813 >(
19814 value, preallocated.encoder, &mut out, ()
19815 )?;
19816 } else {
19817 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19818 }
19819 }
19820
19821 10 => {
19822 if let Some(value) = &self.config {
19823 ::fidl_next::wire::Envelope::encode_value::<
19824 crate::wire::ConfigSchema<'static>,
19825 ___E,
19826 >(
19827 value, preallocated.encoder, &mut out, ()
19828 )?;
19829 } else {
19830 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19831 }
19832 }
19833
19834 9 => {
19835 if let Some(value) = &self.facets {
19836 ::fidl_next::wire::Envelope::encode_value::<
19837 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
19838 ___E,
19839 >(
19840 value, preallocated.encoder, &mut out, ()
19841 )?;
19842 } else {
19843 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19844 }
19845 }
19846
19847 8 => {
19848 if let Some(value) = &self.environments {
19849 ::fidl_next::wire::Envelope::encode_value::<
19850 ::fidl_next::wire::Vector<
19851 'static,
19852 crate::wire::Environment<'static>,
19853 >,
19854 ___E,
19855 >(
19856 value, preallocated.encoder, &mut out, (4294967295, ())
19857 )?;
19858 } else {
19859 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19860 }
19861 }
19862
19863 7 => {
19864 if let Some(value) = &self.collections {
19865 ::fidl_next::wire::Envelope::encode_value::<
19866 ::fidl_next::wire::Vector<
19867 'static,
19868 crate::wire::Collection<'static>,
19869 >,
19870 ___E,
19871 >(
19872 value, preallocated.encoder, &mut out, (4294967295, ())
19873 )?;
19874 } else {
19875 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19876 }
19877 }
19878
19879 6 => {
19880 if let Some(value) = &self.children {
19881 ::fidl_next::wire::Envelope::encode_value::<
19882 ::fidl_next::wire::Vector<'static, crate::wire::Child<'static>>,
19883 ___E,
19884 >(
19885 value, preallocated.encoder, &mut out, (4294967295, ())
19886 )?;
19887 } else {
19888 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19889 }
19890 }
19891
19892 5 => {
19893 if let Some(value) = &self.capabilities {
19894 ::fidl_next::wire::Envelope::encode_value::<
19895 ::fidl_next::wire::Vector<
19896 'static,
19897 crate::wire::Capability<'static>,
19898 >,
19899 ___E,
19900 >(
19901 value, preallocated.encoder, &mut out, (4294967295, ())
19902 )?;
19903 } else {
19904 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19905 }
19906 }
19907
19908 4 => {
19909 if let Some(value) = &self.offers {
19910 ::fidl_next::wire::Envelope::encode_value::<
19911 ::fidl_next::wire::Vector<'static, crate::wire::Offer<'static>>,
19912 ___E,
19913 >(
19914 value, preallocated.encoder, &mut out, (4294967295, ())
19915 )?;
19916 } else {
19917 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19918 }
19919 }
19920
19921 3 => {
19922 if let Some(value) = &self.exposes {
19923 ::fidl_next::wire::Envelope::encode_value::<
19924 ::fidl_next::wire::Vector<'static, crate::wire::Expose<'static>>,
19925 ___E,
19926 >(
19927 value, preallocated.encoder, &mut out, (4294967295, ())
19928 )?;
19929 } else {
19930 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19931 }
19932 }
19933
19934 2 => {
19935 if let Some(value) = &self.uses {
19936 ::fidl_next::wire::Envelope::encode_value::<
19937 ::fidl_next::wire::Vector<'static, crate::wire::Use<'static>>,
19938 ___E,
19939 >(
19940 value, preallocated.encoder, &mut out, (4294967295, ())
19941 )?;
19942 } else {
19943 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19944 }
19945 }
19946
19947 1 => {
19948 if let Some(value) = &self.program {
19949 ::fidl_next::wire::Envelope::encode_value::<
19950 crate::wire::Program<'static>,
19951 ___E,
19952 >(
19953 value, preallocated.encoder, &mut out, ()
19954 )?;
19955 } else {
19956 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19957 }
19958 }
19959
19960 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
19961 }
19962 unsafe {
19963 preallocated.write_next(out.assume_init_ref());
19964 }
19965 }
19966
19967 ::fidl_next::wire::Table::encode_len(table, max_ord);
19968
19969 Ok(())
19970 }
19971 }
19972
19973 impl<'de> ::fidl_next::FromWire<crate::wire::Component<'de>> for Component {
19974 #[inline]
19975 fn from_wire(wire_: crate::wire::Component<'de>) -> Self {
19976 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
19977
19978 let program = wire_.table.get(1);
19979
19980 let uses = wire_.table.get(2);
19981
19982 let exposes = wire_.table.get(3);
19983
19984 let offers = wire_.table.get(4);
19985
19986 let capabilities = wire_.table.get(5);
19987
19988 let children = wire_.table.get(6);
19989
19990 let collections = wire_.table.get(7);
19991
19992 let environments = wire_.table.get(8);
19993
19994 let facets = wire_.table.get(9);
19995
19996 let config = wire_.table.get(10);
19997
19998 let debug_info = wire_.table.get(11);
19999
20000 Self {
20001
20002
20003 program: program.map(|envelope| ::fidl_next::FromWire::from_wire(
20004 unsafe { envelope.read_unchecked::<crate::wire::Program<'de>>() }
20005 )),
20006
20007
20008 uses: uses.map(|envelope| ::fidl_next::FromWire::from_wire(
20009 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Use<'de>>>() }
20010 )),
20011
20012
20013 exposes: exposes.map(|envelope| ::fidl_next::FromWire::from_wire(
20014 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Expose<'de>>>() }
20015 )),
20016
20017
20018 offers: offers.map(|envelope| ::fidl_next::FromWire::from_wire(
20019 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Offer<'de>>>() }
20020 )),
20021
20022
20023 capabilities: capabilities.map(|envelope| ::fidl_next::FromWire::from_wire(
20024 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Capability<'de>>>() }
20025 )),
20026
20027
20028 children: children.map(|envelope| ::fidl_next::FromWire::from_wire(
20029 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Child<'de>>>() }
20030 )),
20031
20032
20033 collections: collections.map(|envelope| ::fidl_next::FromWire::from_wire(
20034 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Collection<'de>>>() }
20035 )),
20036
20037
20038 environments: environments.map(|envelope| ::fidl_next::FromWire::from_wire(
20039 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Environment<'de>>>() }
20040 )),
20041
20042
20043 facets: facets.map(|envelope| ::fidl_next::FromWire::from_wire(
20044 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
20045 )),
20046
20047
20048 config: config.map(|envelope| ::fidl_next::FromWire::from_wire(
20049 unsafe { envelope.read_unchecked::<crate::wire::ConfigSchema<'de>>() }
20050 )),
20051
20052
20053 debug_info: debug_info.map(|envelope| ::fidl_next::FromWire::from_wire(
20054 unsafe { envelope.read_unchecked::<crate::wire::DebugInfo<'de>>() }
20055 )),
20056
20057 }
20058 }
20059 }
20060
20061 impl<'de> ::fidl_next::FromWireRef<crate::wire::Component<'de>> for Component {
20062 #[inline]
20063 fn from_wire_ref(wire: &crate::wire::Component<'de>) -> Self {
20064 Self {
20065
20066
20067 program: wire.table.get(1)
20068 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20069 unsafe { envelope.deref_unchecked::<crate::wire::Program<'de>>() }
20070 )),
20071
20072
20073 uses: wire.table.get(2)
20074 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20075 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Use<'de>>>() }
20076 )),
20077
20078
20079 exposes: wire.table.get(3)
20080 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20081 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Expose<'de>>>() }
20082 )),
20083
20084
20085 offers: wire.table.get(4)
20086 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20087 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Offer<'de>>>() }
20088 )),
20089
20090
20091 capabilities: wire.table.get(5)
20092 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20093 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Capability<'de>>>() }
20094 )),
20095
20096
20097 children: wire.table.get(6)
20098 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20099 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Child<'de>>>() }
20100 )),
20101
20102
20103 collections: wire.table.get(7)
20104 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20105 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Collection<'de>>>() }
20106 )),
20107
20108
20109 environments: wire.table.get(8)
20110 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20111 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Environment<'de>>>() }
20112 )),
20113
20114
20115 facets: wire.table.get(9)
20116 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20117 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
20118 )),
20119
20120
20121 config: wire.table.get(10)
20122 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20123 unsafe { envelope.deref_unchecked::<crate::wire::ConfigSchema<'de>>() }
20124 )),
20125
20126
20127 debug_info: wire.table.get(11)
20128 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20129 unsafe { envelope.deref_unchecked::<crate::wire::DebugInfo<'de>>() }
20130 )),
20131
20132 }
20133 }
20134 }
20135
20136 #[doc = " An individual configuration value. It is matched against a specific configuration field based\n on its offset within `ValuesData.values`.\n"]
20137 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
20138 pub struct ConfigValueSpec {
20139 pub value: ::core::option::Option<crate::natural::ConfigValue>,
20140 }
20141
20142 impl ConfigValueSpec {
20143 fn __max_ordinal(&self) -> usize {
20144 if self.value.is_some() {
20145 return 1;
20146 }
20147
20148 0
20149 }
20150 }
20151
20152 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigValueSpec<'static>, ___E>
20153 for ConfigValueSpec
20154 where
20155 ___E: ::fidl_next::Encoder + ?Sized,
20156 {
20157 #[inline]
20158 fn encode(
20159 mut self,
20160 encoder: &mut ___E,
20161 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValueSpec<'static>>,
20162 _: (),
20163 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20164 ::fidl_next::munge!(let crate::wire::ConfigValueSpec { table } = out);
20165
20166 let max_ord = self.__max_ordinal();
20167
20168 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
20169 ::fidl_next::Wire::zero_padding(&mut out);
20170
20171 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
20172 ::fidl_next::wire::Envelope,
20173 >(encoder, max_ord);
20174
20175 for i in 1..=max_ord {
20176 match i {
20177 1 => {
20178 if let Some(value) = self.value.take() {
20179 ::fidl_next::wire::Envelope::encode_value::<
20180 crate::wire::ConfigValue<'static>,
20181 ___E,
20182 >(
20183 value, preallocated.encoder, &mut out, ()
20184 )?;
20185 } else {
20186 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20187 }
20188 }
20189
20190 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
20191 }
20192 unsafe {
20193 preallocated.write_next(out.assume_init_ref());
20194 }
20195 }
20196
20197 ::fidl_next::wire::Table::encode_len(table, max_ord);
20198
20199 Ok(())
20200 }
20201 }
20202
20203 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigValueSpec<'static>, ___E>
20204 for &'a ConfigValueSpec
20205 where
20206 ___E: ::fidl_next::Encoder + ?Sized,
20207 {
20208 #[inline]
20209 fn encode(
20210 self,
20211 encoder: &mut ___E,
20212 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValueSpec<'static>>,
20213 _: (),
20214 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20215 ::fidl_next::munge!(let crate::wire::ConfigValueSpec { table } = out);
20216
20217 let max_ord = self.__max_ordinal();
20218
20219 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
20220 ::fidl_next::Wire::zero_padding(&mut out);
20221
20222 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
20223 ::fidl_next::wire::Envelope,
20224 >(encoder, max_ord);
20225
20226 for i in 1..=max_ord {
20227 match i {
20228 1 => {
20229 if let Some(value) = &self.value {
20230 ::fidl_next::wire::Envelope::encode_value::<
20231 crate::wire::ConfigValue<'static>,
20232 ___E,
20233 >(
20234 value, preallocated.encoder, &mut out, ()
20235 )?;
20236 } else {
20237 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20238 }
20239 }
20240
20241 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
20242 }
20243 unsafe {
20244 preallocated.write_next(out.assume_init_ref());
20245 }
20246 }
20247
20248 ::fidl_next::wire::Table::encode_len(table, max_ord);
20249
20250 Ok(())
20251 }
20252 }
20253
20254 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigValueSpec<'de>> for ConfigValueSpec {
20255 #[inline]
20256 fn from_wire(wire_: crate::wire::ConfigValueSpec<'de>) -> Self {
20257 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
20258
20259 let value = wire_.table.get(1);
20260
20261 Self {
20262 value: value.map(|envelope| {
20263 ::fidl_next::FromWire::from_wire(unsafe {
20264 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
20265 })
20266 }),
20267 }
20268 }
20269 }
20270
20271 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigValueSpec<'de>> for ConfigValueSpec {
20272 #[inline]
20273 fn from_wire_ref(wire: &crate::wire::ConfigValueSpec<'de>) -> Self {
20274 Self {
20275 value: wire.table.get(1).map(|envelope| {
20276 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20277 envelope.deref_unchecked::<crate::wire::ConfigValue<'de>>()
20278 })
20279 }),
20280 }
20281 }
20282 }
20283
20284 #[doc = " Contents of the configuration value file. Defines the base values for a component\'s config.\n"]
20285 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
20286 pub struct ConfigValuesData {
20287 pub values: ::core::option::Option<::std::vec::Vec<crate::natural::ConfigValueSpec>>,
20288
20289 pub checksum: ::core::option::Option<crate::natural::ConfigChecksum>,
20290 }
20291
20292 impl ConfigValuesData {
20293 fn __max_ordinal(&self) -> usize {
20294 if self.checksum.is_some() {
20295 return 2;
20296 }
20297
20298 if self.values.is_some() {
20299 return 1;
20300 }
20301
20302 0
20303 }
20304 }
20305
20306 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigValuesData<'static>, ___E>
20307 for ConfigValuesData
20308 where
20309 ___E: ::fidl_next::Encoder + ?Sized,
20310 {
20311 #[inline]
20312 fn encode(
20313 mut self,
20314 encoder: &mut ___E,
20315 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValuesData<'static>>,
20316 _: (),
20317 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20318 ::fidl_next::munge!(let crate::wire::ConfigValuesData { table } = out);
20319
20320 let max_ord = self.__max_ordinal();
20321
20322 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
20323 ::fidl_next::Wire::zero_padding(&mut out);
20324
20325 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
20326 ::fidl_next::wire::Envelope,
20327 >(encoder, max_ord);
20328
20329 for i in 1..=max_ord {
20330 match i {
20331 2 => {
20332 if let Some(value) = self.checksum.take() {
20333 ::fidl_next::wire::Envelope::encode_value::<
20334 crate::wire::ConfigChecksum<'static>,
20335 ___E,
20336 >(
20337 value, preallocated.encoder, &mut out, ()
20338 )?;
20339 } else {
20340 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20341 }
20342 }
20343
20344 1 => {
20345 if let Some(value) = self.values.take() {
20346 ::fidl_next::wire::Envelope::encode_value::<
20347 ::fidl_next::wire::Vector<
20348 'static,
20349 crate::wire::ConfigValueSpec<'static>,
20350 >,
20351 ___E,
20352 >(
20353 value, preallocated.encoder, &mut out, (4294967295, ())
20354 )?;
20355 } else {
20356 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20357 }
20358 }
20359
20360 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
20361 }
20362 unsafe {
20363 preallocated.write_next(out.assume_init_ref());
20364 }
20365 }
20366
20367 ::fidl_next::wire::Table::encode_len(table, max_ord);
20368
20369 Ok(())
20370 }
20371 }
20372
20373 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigValuesData<'static>, ___E>
20374 for &'a ConfigValuesData
20375 where
20376 ___E: ::fidl_next::Encoder + ?Sized,
20377 {
20378 #[inline]
20379 fn encode(
20380 self,
20381 encoder: &mut ___E,
20382 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValuesData<'static>>,
20383 _: (),
20384 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20385 ::fidl_next::munge!(let crate::wire::ConfigValuesData { table } = out);
20386
20387 let max_ord = self.__max_ordinal();
20388
20389 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
20390 ::fidl_next::Wire::zero_padding(&mut out);
20391
20392 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
20393 ::fidl_next::wire::Envelope,
20394 >(encoder, max_ord);
20395
20396 for i in 1..=max_ord {
20397 match i {
20398 2 => {
20399 if let Some(value) = &self.checksum {
20400 ::fidl_next::wire::Envelope::encode_value::<
20401 crate::wire::ConfigChecksum<'static>,
20402 ___E,
20403 >(
20404 value, preallocated.encoder, &mut out, ()
20405 )?;
20406 } else {
20407 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20408 }
20409 }
20410
20411 1 => {
20412 if let Some(value) = &self.values {
20413 ::fidl_next::wire::Envelope::encode_value::<
20414 ::fidl_next::wire::Vector<
20415 'static,
20416 crate::wire::ConfigValueSpec<'static>,
20417 >,
20418 ___E,
20419 >(
20420 value, preallocated.encoder, &mut out, (4294967295, ())
20421 )?;
20422 } else {
20423 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20424 }
20425 }
20426
20427 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
20428 }
20429 unsafe {
20430 preallocated.write_next(out.assume_init_ref());
20431 }
20432 }
20433
20434 ::fidl_next::wire::Table::encode_len(table, max_ord);
20435
20436 Ok(())
20437 }
20438 }
20439
20440 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigValuesData<'de>> for ConfigValuesData {
20441 #[inline]
20442 fn from_wire(wire_: crate::wire::ConfigValuesData<'de>) -> Self {
20443 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
20444
20445 let values = wire_.table.get(1);
20446
20447 let checksum = wire_.table.get(2);
20448
20449 Self {
20450
20451
20452 values: values.map(|envelope| ::fidl_next::FromWire::from_wire(
20453 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigValueSpec<'de>>>() }
20454 )),
20455
20456
20457 checksum: checksum.map(|envelope| ::fidl_next::FromWire::from_wire(
20458 unsafe { envelope.read_unchecked::<crate::wire::ConfigChecksum<'de>>() }
20459 )),
20460
20461 }
20462 }
20463 }
20464
20465 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigValuesData<'de>> for ConfigValuesData {
20466 #[inline]
20467 fn from_wire_ref(wire: &crate::wire::ConfigValuesData<'de>) -> Self {
20468 Self {
20469
20470
20471 values: wire.table.get(1)
20472 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20473 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigValueSpec<'de>>>() }
20474 )),
20475
20476
20477 checksum: wire.table.get(2)
20478 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20479 unsafe { envelope.deref_unchecked::<crate::wire::ConfigChecksum<'de>>() }
20480 )),
20481
20482 }
20483 }
20484 }
20485
20486 #[doc = " Indicates the event name to subscribe to with a given event mode.\n"]
20487 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
20488 pub struct EventSubscription {
20489 pub event_name: ::core::option::Option<::std::string::String>,
20490 }
20491
20492 impl EventSubscription {
20493 fn __max_ordinal(&self) -> usize {
20494 if self.event_name.is_some() {
20495 return 1;
20496 }
20497
20498 0
20499 }
20500 }
20501
20502 unsafe impl<___E> ::fidl_next::Encode<crate::wire::EventSubscription<'static>, ___E>
20503 for EventSubscription
20504 where
20505 ___E: ::fidl_next::Encoder + ?Sized,
20506 {
20507 #[inline]
20508 fn encode(
20509 mut self,
20510 encoder: &mut ___E,
20511 out: &mut ::core::mem::MaybeUninit<crate::wire::EventSubscription<'static>>,
20512 _: (),
20513 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20514 ::fidl_next::munge!(let crate::wire::EventSubscription { table } = out);
20515
20516 let max_ord = self.__max_ordinal();
20517
20518 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
20519 ::fidl_next::Wire::zero_padding(&mut out);
20520
20521 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
20522 ::fidl_next::wire::Envelope,
20523 >(encoder, max_ord);
20524
20525 for i in 1..=max_ord {
20526 match i {
20527 1 => {
20528 if let Some(value) = self.event_name.take() {
20529 ::fidl_next::wire::Envelope::encode_value::<
20530 ::fidl_next::wire::String<'static>,
20531 ___E,
20532 >(
20533 value, preallocated.encoder, &mut out, 100
20534 )?;
20535 } else {
20536 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20537 }
20538 }
20539
20540 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
20541 }
20542 unsafe {
20543 preallocated.write_next(out.assume_init_ref());
20544 }
20545 }
20546
20547 ::fidl_next::wire::Table::encode_len(table, max_ord);
20548
20549 Ok(())
20550 }
20551 }
20552
20553 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EventSubscription<'static>, ___E>
20554 for &'a EventSubscription
20555 where
20556 ___E: ::fidl_next::Encoder + ?Sized,
20557 {
20558 #[inline]
20559 fn encode(
20560 self,
20561 encoder: &mut ___E,
20562 out: &mut ::core::mem::MaybeUninit<crate::wire::EventSubscription<'static>>,
20563 _: (),
20564 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20565 ::fidl_next::munge!(let crate::wire::EventSubscription { table } = out);
20566
20567 let max_ord = self.__max_ordinal();
20568
20569 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
20570 ::fidl_next::Wire::zero_padding(&mut out);
20571
20572 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
20573 ::fidl_next::wire::Envelope,
20574 >(encoder, max_ord);
20575
20576 for i in 1..=max_ord {
20577 match i {
20578 1 => {
20579 if let Some(value) = &self.event_name {
20580 ::fidl_next::wire::Envelope::encode_value::<
20581 ::fidl_next::wire::String<'static>,
20582 ___E,
20583 >(
20584 value, preallocated.encoder, &mut out, 100
20585 )?;
20586 } else {
20587 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20588 }
20589 }
20590
20591 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
20592 }
20593 unsafe {
20594 preallocated.write_next(out.assume_init_ref());
20595 }
20596 }
20597
20598 ::fidl_next::wire::Table::encode_len(table, max_ord);
20599
20600 Ok(())
20601 }
20602 }
20603
20604 impl<'de> ::fidl_next::FromWire<crate::wire::EventSubscription<'de>> for EventSubscription {
20605 #[inline]
20606 fn from_wire(wire_: crate::wire::EventSubscription<'de>) -> Self {
20607 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
20608
20609 let event_name = wire_.table.get(1);
20610
20611 Self {
20612 event_name: event_name.map(|envelope| {
20613 ::fidl_next::FromWire::from_wire(unsafe {
20614 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
20615 })
20616 }),
20617 }
20618 }
20619 }
20620
20621 impl<'de> ::fidl_next::FromWireRef<crate::wire::EventSubscription<'de>> for EventSubscription {
20622 #[inline]
20623 fn from_wire_ref(wire: &crate::wire::EventSubscription<'de>) -> Self {
20624 Self {
20625 event_name: wire.table.get(1).map(|envelope| {
20626 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20627 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
20628 })
20629 }),
20630 }
20631 }
20632 }
20633
20634 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
20635 pub enum LayoutParameter {
20636 NestedType(crate::natural::ConfigType),
20637
20638 UnknownOrdinal_(u64),
20639 }
20640
20641 impl LayoutParameter {
20642 pub fn is_unknown(&self) -> bool {
20643 #[allow(unreachable_patterns)]
20644 match self {
20645 Self::UnknownOrdinal_(_) => true,
20646 _ => false,
20647 }
20648 }
20649 }
20650
20651 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LayoutParameter<'static>, ___E>
20652 for LayoutParameter
20653 where
20654 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20655 ___E: ::fidl_next::Encoder,
20656 {
20657 #[inline]
20658 fn encode(
20659 self,
20660 encoder: &mut ___E,
20661 out: &mut ::core::mem::MaybeUninit<crate::wire::LayoutParameter<'static>>,
20662 _: (),
20663 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20664 ::fidl_next::munge!(let crate::wire::LayoutParameter { raw, _phantom: _ } = out);
20665
20666 match self {
20667 Self::NestedType(value) => ::fidl_next::wire::Union::encode_as::<
20668 ___E,
20669 crate::wire::ConfigType<'static>,
20670 >(value, 1, encoder, raw, ())?,
20671
20672 Self::UnknownOrdinal_(ordinal) => {
20673 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
20674 }
20675 }
20676
20677 Ok(())
20678 }
20679 }
20680
20681 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LayoutParameter<'static>, ___E>
20682 for &'a LayoutParameter
20683 where
20684 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20685 ___E: ::fidl_next::Encoder,
20686 {
20687 #[inline]
20688 fn encode(
20689 self,
20690 encoder: &mut ___E,
20691 out: &mut ::core::mem::MaybeUninit<crate::wire::LayoutParameter<'static>>,
20692 _: (),
20693 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20694 ::fidl_next::munge!(let crate::wire::LayoutParameter { raw, _phantom: _ } = out);
20695
20696 match self {
20697 LayoutParameter::NestedType(value) => ::fidl_next::wire::Union::encode_as::<
20698 ___E,
20699 crate::wire::ConfigType<'static>,
20700 >(value, 1, encoder, raw, ())?,
20701
20702 LayoutParameter::UnknownOrdinal_(ordinal) => {
20703 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
20704 }
20705 }
20706
20707 Ok(())
20708 }
20709 }
20710
20711 unsafe impl<___E>
20712 ::fidl_next::EncodeOption<crate::wire_optional::LayoutParameter<'static>, ___E>
20713 for LayoutParameter
20714 where
20715 ___E: ?Sized,
20716 LayoutParameter: ::fidl_next::Encode<crate::wire::LayoutParameter<'static>, ___E>,
20717 {
20718 #[inline]
20719 fn encode_option(
20720 this: ::core::option::Option<Self>,
20721 encoder: &mut ___E,
20722 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LayoutParameter<'static>>,
20723 _: (),
20724 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20725 ::fidl_next::munge!(let crate::wire_optional::LayoutParameter { raw, _phantom: _ } = &mut *out);
20726
20727 if let Some(inner) = this {
20728 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
20729 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
20730 } else {
20731 ::fidl_next::wire::Union::encode_absent(raw);
20732 }
20733
20734 Ok(())
20735 }
20736 }
20737
20738 unsafe impl<'a, ___E>
20739 ::fidl_next::EncodeOption<crate::wire_optional::LayoutParameter<'static>, ___E>
20740 for &'a LayoutParameter
20741 where
20742 ___E: ?Sized,
20743 &'a LayoutParameter: ::fidl_next::Encode<crate::wire::LayoutParameter<'static>, ___E>,
20744 {
20745 #[inline]
20746 fn encode_option(
20747 this: ::core::option::Option<Self>,
20748 encoder: &mut ___E,
20749 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LayoutParameter<'static>>,
20750 _: (),
20751 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20752 ::fidl_next::munge!(let crate::wire_optional::LayoutParameter { raw, _phantom: _ } = &mut *out);
20753
20754 if let Some(inner) = this {
20755 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
20756 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
20757 } else {
20758 ::fidl_next::wire::Union::encode_absent(raw);
20759 }
20760
20761 Ok(())
20762 }
20763 }
20764
20765 impl<'de> ::fidl_next::FromWire<crate::wire::LayoutParameter<'de>> for LayoutParameter {
20766 #[inline]
20767 fn from_wire(wire: crate::wire::LayoutParameter<'de>) -> Self {
20768 let wire = ::core::mem::ManuallyDrop::new(wire);
20769 match wire.raw.ordinal() {
20770 1 => Self::NestedType(::fidl_next::FromWire::from_wire(unsafe {
20771 wire.raw.get().read_unchecked::<crate::wire::ConfigType<'de>>()
20772 })),
20773
20774 ord => return Self::UnknownOrdinal_(ord as u64),
20775 }
20776 }
20777 }
20778
20779 impl<'de> ::fidl_next::FromWireRef<crate::wire::LayoutParameter<'de>> for LayoutParameter {
20780 #[inline]
20781 fn from_wire_ref(wire: &crate::wire::LayoutParameter<'de>) -> Self {
20782 match wire.raw.ordinal() {
20783 1 => Self::NestedType(::fidl_next::FromWireRef::from_wire_ref(unsafe {
20784 wire.raw.get().deref_unchecked::<crate::wire::ConfigType<'de>>()
20785 })),
20786
20787 ord => return Self::UnknownOrdinal_(ord as u64),
20788 }
20789 }
20790 }
20791
20792 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LayoutParameter<'de>>
20793 for LayoutParameter
20794 {
20795 #[inline]
20796 fn from_wire_option(
20797 wire: crate::wire_optional::LayoutParameter<'de>,
20798 ) -> ::core::option::Option<Self> {
20799 if let Some(inner) = wire.into_option() {
20800 Some(::fidl_next::FromWire::from_wire(inner))
20801 } else {
20802 None
20803 }
20804 }
20805 }
20806
20807 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LayoutParameter<'de>>
20808 for Box<LayoutParameter>
20809 {
20810 #[inline]
20811 fn from_wire_option(
20812 wire: crate::wire_optional::LayoutParameter<'de>,
20813 ) -> ::core::option::Option<Self> {
20814 <LayoutParameter as ::fidl_next::FromWireOption<
20815 crate::wire_optional::LayoutParameter<'de>,
20816 >>::from_wire_option(wire)
20817 .map(Box::new)
20818 }
20819 }
20820
20821 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::LayoutParameter<'de>>
20822 for Box<LayoutParameter>
20823 {
20824 #[inline]
20825 fn from_wire_option_ref(
20826 wire: &crate::wire_optional::LayoutParameter<'de>,
20827 ) -> ::core::option::Option<Self> {
20828 if let Some(inner) = wire.as_ref() {
20829 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
20830 } else {
20831 None
20832 }
20833 }
20834 }
20835
20836 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
20837 pub struct ResolvedConfigField {
20838 pub key: ::std::string::String,
20839
20840 pub value: crate::natural::ConfigValue,
20841 }
20842
20843 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ResolvedConfigField<'static>, ___E>
20844 for ResolvedConfigField
20845 where
20846 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20847 ___E: ::fidl_next::Encoder,
20848 {
20849 #[inline]
20850 fn encode(
20851 self,
20852 encoder_: &mut ___E,
20853 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfigField<'static>>,
20854 _: (),
20855 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20856 ::fidl_next::munge! {
20857 let crate::wire::ResolvedConfigField {
20858 key,
20859 value,
20860
20861 } = out_;
20862 }
20863
20864 ::fidl_next::Encode::encode(self.key, encoder_, key, 4294967295)?;
20865
20866 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(key.as_mut_ptr()) };
20867 ::fidl_next::Constrained::validate(_field, 4294967295)?;
20868
20869 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
20870
20871 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
20872
20873 Ok(())
20874 }
20875 }
20876
20877 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ResolvedConfigField<'static>, ___E>
20878 for &'a ResolvedConfigField
20879 where
20880 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20881 ___E: ::fidl_next::Encoder,
20882 {
20883 #[inline]
20884 fn encode(
20885 self,
20886 encoder_: &mut ___E,
20887 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfigField<'static>>,
20888 _: (),
20889 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20890 ::fidl_next::munge! {
20891 let crate::wire::ResolvedConfigField {
20892 key,
20893 value,
20894
20895 } = out_;
20896 }
20897
20898 ::fidl_next::Encode::encode(&self.key, encoder_, key, 4294967295)?;
20899
20900 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(key.as_mut_ptr()) };
20901 ::fidl_next::Constrained::validate(_field, 4294967295)?;
20902
20903 ::fidl_next::Encode::encode(&self.value, encoder_, value, ())?;
20904
20905 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
20906
20907 Ok(())
20908 }
20909 }
20910
20911 unsafe impl<___E>
20912 ::fidl_next::EncodeOption<
20913 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfigField<'static>>,
20914 ___E,
20915 > for ResolvedConfigField
20916 where
20917 ___E: ::fidl_next::Encoder + ?Sized,
20918 ResolvedConfigField: ::fidl_next::Encode<crate::wire::ResolvedConfigField<'static>, ___E>,
20919 {
20920 #[inline]
20921 fn encode_option(
20922 this: ::core::option::Option<Self>,
20923 encoder: &mut ___E,
20924 out: &mut ::core::mem::MaybeUninit<
20925 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfigField<'static>>,
20926 >,
20927 _: (),
20928 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20929 if let Some(inner) = this {
20930 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20931 ::fidl_next::wire::Box::encode_present(out);
20932 } else {
20933 ::fidl_next::wire::Box::encode_absent(out);
20934 }
20935
20936 Ok(())
20937 }
20938 }
20939
20940 unsafe impl<'a, ___E>
20941 ::fidl_next::EncodeOption<
20942 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfigField<'static>>,
20943 ___E,
20944 > for &'a ResolvedConfigField
20945 where
20946 ___E: ::fidl_next::Encoder + ?Sized,
20947 &'a ResolvedConfigField:
20948 ::fidl_next::Encode<crate::wire::ResolvedConfigField<'static>, ___E>,
20949 {
20950 #[inline]
20951 fn encode_option(
20952 this: ::core::option::Option<Self>,
20953 encoder: &mut ___E,
20954 out: &mut ::core::mem::MaybeUninit<
20955 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfigField<'static>>,
20956 >,
20957 _: (),
20958 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20959 if let Some(inner) = this {
20960 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
20961 ::fidl_next::wire::Box::encode_present(out);
20962 } else {
20963 ::fidl_next::wire::Box::encode_absent(out);
20964 }
20965
20966 Ok(())
20967 }
20968 }
20969
20970 impl<'de> ::fidl_next::FromWire<crate::wire::ResolvedConfigField<'de>> for ResolvedConfigField {
20971 #[inline]
20972 fn from_wire(wire: crate::wire::ResolvedConfigField<'de>) -> Self {
20973 Self {
20974 key: ::fidl_next::FromWire::from_wire(wire.key),
20975
20976 value: ::fidl_next::FromWire::from_wire(wire.value),
20977 }
20978 }
20979 }
20980
20981 impl<'de> ::fidl_next::FromWireRef<crate::wire::ResolvedConfigField<'de>> for ResolvedConfigField {
20982 #[inline]
20983 fn from_wire_ref(wire: &crate::wire::ResolvedConfigField<'de>) -> Self {
20984 Self {
20985 key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
20986
20987 value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value),
20988 }
20989 }
20990 }
20991
20992 #[doc = " A configuration that has been completely resolved by component manager.\n"]
20993 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
20994 pub struct ResolvedConfig {
20995 pub fields: ::std::vec::Vec<crate::natural::ResolvedConfigField>,
20996
20997 pub checksum: crate::natural::ConfigChecksum,
20998 }
20999
21000 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ResolvedConfig<'static>, ___E> for ResolvedConfig
21001 where
21002 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21003 ___E: ::fidl_next::Encoder,
21004 {
21005 #[inline]
21006 fn encode(
21007 self,
21008 encoder_: &mut ___E,
21009 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfig<'static>>,
21010 _: (),
21011 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21012 ::fidl_next::munge! {
21013 let crate::wire::ResolvedConfig {
21014 fields,
21015 checksum,
21016
21017 } = out_;
21018 }
21019
21020 ::fidl_next::Encode::encode(self.fields, encoder_, fields, (4294967295, ()))?;
21021
21022 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(fields.as_mut_ptr()) };
21023 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
21024
21025 ::fidl_next::Encode::encode(self.checksum, encoder_, checksum, ())?;
21026
21027 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(checksum.as_mut_ptr()) };
21028
21029 Ok(())
21030 }
21031 }
21032
21033 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ResolvedConfig<'static>, ___E>
21034 for &'a ResolvedConfig
21035 where
21036 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21037 ___E: ::fidl_next::Encoder,
21038 {
21039 #[inline]
21040 fn encode(
21041 self,
21042 encoder_: &mut ___E,
21043 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfig<'static>>,
21044 _: (),
21045 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21046 ::fidl_next::munge! {
21047 let crate::wire::ResolvedConfig {
21048 fields,
21049 checksum,
21050
21051 } = out_;
21052 }
21053
21054 ::fidl_next::Encode::encode(&self.fields, encoder_, fields, (4294967295, ()))?;
21055
21056 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(fields.as_mut_ptr()) };
21057 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
21058
21059 ::fidl_next::Encode::encode(&self.checksum, encoder_, checksum, ())?;
21060
21061 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(checksum.as_mut_ptr()) };
21062
21063 Ok(())
21064 }
21065 }
21066
21067 unsafe impl<___E>
21068 ::fidl_next::EncodeOption<
21069 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfig<'static>>,
21070 ___E,
21071 > for ResolvedConfig
21072 where
21073 ___E: ::fidl_next::Encoder + ?Sized,
21074 ResolvedConfig: ::fidl_next::Encode<crate::wire::ResolvedConfig<'static>, ___E>,
21075 {
21076 #[inline]
21077 fn encode_option(
21078 this: ::core::option::Option<Self>,
21079 encoder: &mut ___E,
21080 out: &mut ::core::mem::MaybeUninit<
21081 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfig<'static>>,
21082 >,
21083 _: (),
21084 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21085 if let Some(inner) = this {
21086 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21087 ::fidl_next::wire::Box::encode_present(out);
21088 } else {
21089 ::fidl_next::wire::Box::encode_absent(out);
21090 }
21091
21092 Ok(())
21093 }
21094 }
21095
21096 unsafe impl<'a, ___E>
21097 ::fidl_next::EncodeOption<
21098 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfig<'static>>,
21099 ___E,
21100 > for &'a ResolvedConfig
21101 where
21102 ___E: ::fidl_next::Encoder + ?Sized,
21103 &'a ResolvedConfig: ::fidl_next::Encode<crate::wire::ResolvedConfig<'static>, ___E>,
21104 {
21105 #[inline]
21106 fn encode_option(
21107 this: ::core::option::Option<Self>,
21108 encoder: &mut ___E,
21109 out: &mut ::core::mem::MaybeUninit<
21110 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfig<'static>>,
21111 >,
21112 _: (),
21113 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21114 if let Some(inner) = this {
21115 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21116 ::fidl_next::wire::Box::encode_present(out);
21117 } else {
21118 ::fidl_next::wire::Box::encode_absent(out);
21119 }
21120
21121 Ok(())
21122 }
21123 }
21124
21125 impl<'de> ::fidl_next::FromWire<crate::wire::ResolvedConfig<'de>> for ResolvedConfig {
21126 #[inline]
21127 fn from_wire(wire: crate::wire::ResolvedConfig<'de>) -> Self {
21128 Self {
21129 fields: ::fidl_next::FromWire::from_wire(wire.fields),
21130
21131 checksum: ::fidl_next::FromWire::from_wire(wire.checksum),
21132 }
21133 }
21134 }
21135
21136 impl<'de> ::fidl_next::FromWireRef<crate::wire::ResolvedConfig<'de>> for ResolvedConfig {
21137 #[inline]
21138 fn from_wire_ref(wire: &crate::wire::ResolvedConfig<'de>) -> Self {
21139 Self {
21140 fields: ::fidl_next::FromWireRef::from_wire_ref(&wire.fields),
21141
21142 checksum: ::fidl_next::FromWireRef::from_wire_ref(&wire.checksum),
21143 }
21144 }
21145 }
21146}
21147
21148pub mod wire {
21149
21150 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
21152 #[repr(transparent)]
21153 pub struct AllowedOffers {
21154 pub(crate) value: ::fidl_next::wire::Uint32,
21155 }
21156
21157 impl ::fidl_next::Constrained for AllowedOffers {
21158 type Constraint = ();
21159
21160 fn validate(
21161 _: ::fidl_next::Slot<'_, Self>,
21162 _: Self::Constraint,
21163 ) -> Result<(), ::fidl_next::ValidationError> {
21164 Ok(())
21165 }
21166 }
21167
21168 unsafe impl ::fidl_next::Wire for AllowedOffers {
21169 type Narrowed<'de> = Self;
21170
21171 #[inline]
21172 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
21173 }
21175 }
21176
21177 impl AllowedOffers {
21178 pub const STATIC_ONLY: AllowedOffers =
21179 AllowedOffers { value: ::fidl_next::wire::Uint32(1) };
21180
21181 pub const STATIC_AND_DYNAMIC: AllowedOffers =
21182 AllowedOffers { value: ::fidl_next::wire::Uint32(2) };
21183 }
21184
21185 unsafe impl<___D> ::fidl_next::Decode<___D> for AllowedOffers
21186 where
21187 ___D: ?Sized,
21188 {
21189 fn decode(
21190 slot: ::fidl_next::Slot<'_, Self>,
21191 _: &mut ___D,
21192 _: (),
21193 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21194 ::fidl_next::munge!(let Self { value } = slot);
21195
21196 match u32::from(*value) {
21197 1 | 2 => (),
21198 unknown => {
21199 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
21200 }
21201 }
21202
21203 Ok(())
21204 }
21205 }
21206
21207 impl ::core::convert::From<crate::natural::AllowedOffers> for AllowedOffers {
21208 fn from(natural: crate::natural::AllowedOffers) -> Self {
21209 match natural {
21210 crate::natural::AllowedOffers::StaticOnly => AllowedOffers::STATIC_ONLY,
21211
21212 crate::natural::AllowedOffers::StaticAndDynamic => {
21213 AllowedOffers::STATIC_AND_DYNAMIC
21214 }
21215 }
21216 }
21217 }
21218
21219 impl ::fidl_next::IntoNatural for AllowedOffers {
21220 type Natural = crate::natural::AllowedOffers;
21221 }
21222
21223 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
21225 #[repr(transparent)]
21226 pub struct Availability {
21227 pub(crate) value: ::fidl_next::wire::Uint32,
21228 }
21229
21230 impl ::fidl_next::Constrained for Availability {
21231 type Constraint = ();
21232
21233 fn validate(
21234 _: ::fidl_next::Slot<'_, Self>,
21235 _: Self::Constraint,
21236 ) -> Result<(), ::fidl_next::ValidationError> {
21237 Ok(())
21238 }
21239 }
21240
21241 unsafe impl ::fidl_next::Wire for Availability {
21242 type Narrowed<'de> = Self;
21243
21244 #[inline]
21245 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
21246 }
21248 }
21249
21250 impl Availability {
21251 pub const REQUIRED: Availability = Availability { value: ::fidl_next::wire::Uint32(1) };
21252
21253 pub const OPTIONAL: Availability = Availability { value: ::fidl_next::wire::Uint32(2) };
21254
21255 pub const SAME_AS_TARGET: Availability =
21256 Availability { value: ::fidl_next::wire::Uint32(3) };
21257
21258 pub const TRANSITIONAL: Availability = Availability { value: ::fidl_next::wire::Uint32(4) };
21259 }
21260
21261 unsafe impl<___D> ::fidl_next::Decode<___D> for Availability
21262 where
21263 ___D: ?Sized,
21264 {
21265 fn decode(
21266 slot: ::fidl_next::Slot<'_, Self>,
21267 _: &mut ___D,
21268 _: (),
21269 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21270 ::fidl_next::munge!(let Self { value } = slot);
21271
21272 match u32::from(*value) {
21273 1 | 2 | 3 | 4 => (),
21274 unknown => {
21275 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
21276 }
21277 }
21278
21279 Ok(())
21280 }
21281 }
21282
21283 impl ::core::convert::From<crate::natural::Availability> for Availability {
21284 fn from(natural: crate::natural::Availability) -> Self {
21285 match natural {
21286 crate::natural::Availability::Required => Availability::REQUIRED,
21287
21288 crate::natural::Availability::Optional => Availability::OPTIONAL,
21289
21290 crate::natural::Availability::SameAsTarget => Availability::SAME_AS_TARGET,
21291
21292 crate::natural::Availability::Transitional => Availability::TRANSITIONAL,
21293 }
21294 }
21295 }
21296
21297 impl ::fidl_next::IntoNatural for Availability {
21298 type Natural = crate::natural::Availability;
21299 }
21300
21301 pub type Name<'de> = ::fidl_next::wire::String<'de>;
21303
21304 #[repr(C)]
21306 pub struct Service<'de> {
21307 pub(crate) table: ::fidl_next::wire::Table<'de>,
21308 }
21309
21310 impl<'de> Drop for Service<'de> {
21311 fn drop(&mut self) {
21312 let _ = self.table.get(1).map(|envelope| unsafe {
21313 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
21314 });
21315
21316 let _ = self.table.get(2).map(|envelope| unsafe {
21317 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
21318 });
21319 }
21320 }
21321
21322 impl ::fidl_next::Constrained for Service<'_> {
21323 type Constraint = ();
21324
21325 fn validate(
21326 _: ::fidl_next::Slot<'_, Self>,
21327 _: Self::Constraint,
21328 ) -> Result<(), ::fidl_next::ValidationError> {
21329 Ok(())
21330 }
21331 }
21332
21333 unsafe impl ::fidl_next::Wire for Service<'static> {
21334 type Narrowed<'de> = Service<'de>;
21335
21336 #[inline]
21337 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
21338 ::fidl_next::munge!(let Self { table } = out);
21339 ::fidl_next::wire::Table::zero_padding(table);
21340 }
21341 }
21342
21343 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Service<'de>
21344 where
21345 ___D: ::fidl_next::Decoder<'de> + ?Sized,
21346 {
21347 fn decode(
21348 slot: ::fidl_next::Slot<'_, Self>,
21349 decoder: &mut ___D,
21350 _: (),
21351 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21352 ::fidl_next::munge!(let Self { table } = slot);
21353
21354 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
21355 match ordinal {
21356 0 => unsafe { ::core::hint::unreachable_unchecked() },
21357
21358 1 => {
21359 ::fidl_next::wire::Envelope::decode_as::<
21360 ___D,
21361 ::fidl_next::wire::String<'de>,
21362 >(slot.as_mut(), decoder, 100)?;
21363
21364 let value = unsafe {
21365 slot.deref_unchecked()
21366 .deref_unchecked::<::fidl_next::wire::String<'_>>()
21367 };
21368
21369 if value.len() > 100 {
21370 return Err(::fidl_next::DecodeError::VectorTooLong {
21371 size: value.len() as u64,
21372 limit: 100,
21373 });
21374 }
21375
21376 Ok(())
21377 }
21378
21379 2 => {
21380 ::fidl_next::wire::Envelope::decode_as::<
21381 ___D,
21382 ::fidl_next::wire::String<'de>,
21383 >(slot.as_mut(), decoder, 1024)?;
21384
21385 let value = unsafe {
21386 slot.deref_unchecked()
21387 .deref_unchecked::<::fidl_next::wire::String<'_>>()
21388 };
21389
21390 if value.len() > 1024 {
21391 return Err(::fidl_next::DecodeError::VectorTooLong {
21392 size: value.len() as u64,
21393 limit: 1024,
21394 });
21395 }
21396
21397 Ok(())
21398 }
21399
21400 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
21401 }
21402 })
21403 }
21404 }
21405
21406 impl<'de> Service<'de> {
21407 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
21408 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
21409 }
21410
21411 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
21412 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
21413 }
21414 }
21415
21416 impl<'de> ::core::fmt::Debug for Service<'de> {
21417 fn fmt(
21418 &self,
21419 f: &mut ::core::fmt::Formatter<'_>,
21420 ) -> ::core::result::Result<(), ::core::fmt::Error> {
21421 f.debug_struct("Service")
21422 .field("name", &self.name())
21423 .field("source_path", &self.source_path())
21424 .finish()
21425 }
21426 }
21427
21428 impl<'de> ::fidl_next::IntoNatural for Service<'de> {
21429 type Natural = crate::natural::Service;
21430 }
21431
21432 #[repr(C)]
21434 pub struct Directory<'de> {
21435 pub(crate) table: ::fidl_next::wire::Table<'de>,
21436 }
21437
21438 impl<'de> Drop for Directory<'de> {
21439 fn drop(&mut self) {
21440 let _ = self.table.get(1).map(|envelope| unsafe {
21441 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
21442 });
21443
21444 let _ = self.table.get(2).map(|envelope| unsafe {
21445 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
21446 });
21447
21448 let _ = self.table.get(3).map(|envelope| unsafe {
21449 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
21450 });
21451 }
21452 }
21453
21454 impl ::fidl_next::Constrained for Directory<'_> {
21455 type Constraint = ();
21456
21457 fn validate(
21458 _: ::fidl_next::Slot<'_, Self>,
21459 _: Self::Constraint,
21460 ) -> Result<(), ::fidl_next::ValidationError> {
21461 Ok(())
21462 }
21463 }
21464
21465 unsafe impl ::fidl_next::Wire for Directory<'static> {
21466 type Narrowed<'de> = Directory<'de>;
21467
21468 #[inline]
21469 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
21470 ::fidl_next::munge!(let Self { table } = out);
21471 ::fidl_next::wire::Table::zero_padding(table);
21472 }
21473 }
21474
21475 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Directory<'de>
21476 where
21477 ___D: ::fidl_next::Decoder<'de> + ?Sized,
21478 {
21479 fn decode(
21480 slot: ::fidl_next::Slot<'_, Self>,
21481 decoder: &mut ___D,
21482 _: (),
21483 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21484 ::fidl_next::munge!(let Self { table } = slot);
21485
21486 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
21487 match ordinal {
21488 0 => unsafe { ::core::hint::unreachable_unchecked() },
21489
21490 1 => {
21491 ::fidl_next::wire::Envelope::decode_as::<
21492 ___D,
21493 ::fidl_next::wire::String<'de>,
21494 >(slot.as_mut(), decoder, 100)?;
21495
21496 let value = unsafe {
21497 slot.deref_unchecked()
21498 .deref_unchecked::<::fidl_next::wire::String<'_>>()
21499 };
21500
21501 if value.len() > 100 {
21502 return Err(::fidl_next::DecodeError::VectorTooLong {
21503 size: value.len() as u64,
21504 limit: 100,
21505 });
21506 }
21507
21508 Ok(())
21509 }
21510
21511 2 => {
21512 ::fidl_next::wire::Envelope::decode_as::<
21513 ___D,
21514 ::fidl_next::wire::String<'de>,
21515 >(slot.as_mut(), decoder, 1024)?;
21516
21517 let value = unsafe {
21518 slot.deref_unchecked()
21519 .deref_unchecked::<::fidl_next::wire::String<'_>>()
21520 };
21521
21522 if value.len() > 1024 {
21523 return Err(::fidl_next::DecodeError::VectorTooLong {
21524 size: value.len() as u64,
21525 limit: 1024,
21526 });
21527 }
21528
21529 Ok(())
21530 }
21531
21532 3 => {
21533 ::fidl_next::wire::Envelope::decode_as::<
21534 ___D,
21535 ::fidl_next_common_fuchsia_io::wire::Operations,
21536 >(slot.as_mut(), decoder, ())?;
21537
21538 Ok(())
21539 }
21540
21541 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
21542 }
21543 })
21544 }
21545 }
21546
21547 impl<'de> Directory<'de> {
21548 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
21549 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
21550 }
21551
21552 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
21553 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
21554 }
21555
21556 pub fn rights(
21557 &self,
21558 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_io::wire::Operations> {
21559 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
21560 }
21561 }
21562
21563 impl<'de> ::core::fmt::Debug for Directory<'de> {
21564 fn fmt(
21565 &self,
21566 f: &mut ::core::fmt::Formatter<'_>,
21567 ) -> ::core::result::Result<(), ::core::fmt::Error> {
21568 f.debug_struct("Directory")
21569 .field("name", &self.name())
21570 .field("source_path", &self.source_path())
21571 .field("rights", &self.rights())
21572 .finish()
21573 }
21574 }
21575
21576 impl<'de> ::fidl_next::IntoNatural for Directory<'de> {
21577 type Natural = crate::natural::Directory;
21578 }
21579
21580 pub type ParentRef = ::fidl_next::wire::Unit;
21582
21583 pub type SelfRef = ::fidl_next::wire::Unit;
21585
21586 pub type ChildName<'de> = ::fidl_next::wire::String<'de>;
21588
21589 #[derive(Debug)]
21591 #[repr(C)]
21592 pub struct ChildRef<'de> {
21593 pub name: ::fidl_next::wire::String<'de>,
21594
21595 pub collection: ::fidl_next::wire::OptionalString<'de>,
21596 }
21597
21598 static_assertions::const_assert_eq!(std::mem::size_of::<ChildRef<'_>>(), 32);
21599 static_assertions::const_assert_eq!(std::mem::align_of::<ChildRef<'_>>(), 8);
21600
21601 static_assertions::const_assert_eq!(std::mem::offset_of!(ChildRef<'_>, name), 0);
21602
21603 static_assertions::const_assert_eq!(std::mem::offset_of!(ChildRef<'_>, collection), 16);
21604
21605 impl ::fidl_next::Constrained for ChildRef<'_> {
21606 type Constraint = ();
21607
21608 fn validate(
21609 _: ::fidl_next::Slot<'_, Self>,
21610 _: Self::Constraint,
21611 ) -> Result<(), ::fidl_next::ValidationError> {
21612 Ok(())
21613 }
21614 }
21615
21616 unsafe impl ::fidl_next::Wire for ChildRef<'static> {
21617 type Narrowed<'de> = ChildRef<'de>;
21618
21619 #[inline]
21620 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
21621 ::fidl_next::munge! {
21622 let Self {
21623 name,
21624 collection,
21625
21626 } = &mut *out_;
21627 }
21628
21629 ::fidl_next::Wire::zero_padding(name);
21630
21631 ::fidl_next::Wire::zero_padding(collection);
21632 }
21633 }
21634
21635 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ChildRef<'de>
21636 where
21637 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21638 ___D: ::fidl_next::Decoder<'de>,
21639 {
21640 fn decode(
21641 slot_: ::fidl_next::Slot<'_, Self>,
21642 decoder_: &mut ___D,
21643 _: (),
21644 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21645 ::fidl_next::munge! {
21646 let Self {
21647 mut name,
21648 mut collection,
21649
21650 } = slot_;
21651 }
21652
21653 let _field = name.as_mut();
21654 ::fidl_next::Constrained::validate(_field, 1024)?;
21655 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 1024)?;
21656
21657 let name = unsafe { name.deref_unchecked() };
21658
21659 if name.len() > 1024 {
21660 return Err(::fidl_next::DecodeError::VectorTooLong {
21661 size: name.len() as u64,
21662 limit: 1024,
21663 });
21664 }
21665
21666 let _field = collection.as_mut();
21667 ::fidl_next::Constrained::validate(_field, 100)?;
21668 ::fidl_next::Decode::decode(collection.as_mut(), decoder_, 100)?;
21669
21670 let collection = unsafe { collection.deref_unchecked() };
21671
21672 if let Some(collection) = collection.as_ref() {
21673 if collection.len() > 100 {
21674 return Err(::fidl_next::DecodeError::VectorTooLong {
21675 size: collection.len() as u64,
21676 limit: 100,
21677 });
21678 }
21679 }
21680
21681 Ok(())
21682 }
21683 }
21684
21685 impl<'de> ::fidl_next::IntoNatural for ChildRef<'de> {
21686 type Natural = crate::natural::ChildRef;
21687 }
21688
21689 #[derive(Debug)]
21691 #[repr(C)]
21692 pub struct CollectionRef<'de> {
21693 pub name: ::fidl_next::wire::String<'de>,
21694 }
21695
21696 static_assertions::const_assert_eq!(std::mem::size_of::<CollectionRef<'_>>(), 16);
21697 static_assertions::const_assert_eq!(std::mem::align_of::<CollectionRef<'_>>(), 8);
21698
21699 static_assertions::const_assert_eq!(std::mem::offset_of!(CollectionRef<'_>, name), 0);
21700
21701 impl ::fidl_next::Constrained for CollectionRef<'_> {
21702 type Constraint = ();
21703
21704 fn validate(
21705 _: ::fidl_next::Slot<'_, Self>,
21706 _: Self::Constraint,
21707 ) -> Result<(), ::fidl_next::ValidationError> {
21708 Ok(())
21709 }
21710 }
21711
21712 unsafe impl ::fidl_next::Wire for CollectionRef<'static> {
21713 type Narrowed<'de> = CollectionRef<'de>;
21714
21715 #[inline]
21716 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
21717 ::fidl_next::munge! {
21718 let Self {
21719 name,
21720
21721 } = &mut *out_;
21722 }
21723
21724 ::fidl_next::Wire::zero_padding(name);
21725 }
21726 }
21727
21728 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for CollectionRef<'de>
21729 where
21730 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21731 ___D: ::fidl_next::Decoder<'de>,
21732 {
21733 fn decode(
21734 slot_: ::fidl_next::Slot<'_, Self>,
21735 decoder_: &mut ___D,
21736 _: (),
21737 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21738 ::fidl_next::munge! {
21739 let Self {
21740 mut name,
21741
21742 } = slot_;
21743 }
21744
21745 let _field = name.as_mut();
21746 ::fidl_next::Constrained::validate(_field, 100)?;
21747 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 100)?;
21748
21749 let name = unsafe { name.deref_unchecked() };
21750
21751 if name.len() > 100 {
21752 return Err(::fidl_next::DecodeError::VectorTooLong {
21753 size: name.len() as u64,
21754 limit: 100,
21755 });
21756 }
21757
21758 Ok(())
21759 }
21760 }
21761
21762 impl<'de> ::fidl_next::IntoNatural for CollectionRef<'de> {
21763 type Natural = crate::natural::CollectionRef;
21764 }
21765
21766 pub type FrameworkRef = ::fidl_next::wire::Unit;
21768
21769 #[derive(Debug)]
21771 #[repr(C)]
21772 pub struct CapabilityRef<'de> {
21773 pub name: ::fidl_next::wire::String<'de>,
21774 }
21775
21776 static_assertions::const_assert_eq!(std::mem::size_of::<CapabilityRef<'_>>(), 16);
21777 static_assertions::const_assert_eq!(std::mem::align_of::<CapabilityRef<'_>>(), 8);
21778
21779 static_assertions::const_assert_eq!(std::mem::offset_of!(CapabilityRef<'_>, name), 0);
21780
21781 impl ::fidl_next::Constrained for CapabilityRef<'_> {
21782 type Constraint = ();
21783
21784 fn validate(
21785 _: ::fidl_next::Slot<'_, Self>,
21786 _: Self::Constraint,
21787 ) -> Result<(), ::fidl_next::ValidationError> {
21788 Ok(())
21789 }
21790 }
21791
21792 unsafe impl ::fidl_next::Wire for CapabilityRef<'static> {
21793 type Narrowed<'de> = CapabilityRef<'de>;
21794
21795 #[inline]
21796 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
21797 ::fidl_next::munge! {
21798 let Self {
21799 name,
21800
21801 } = &mut *out_;
21802 }
21803
21804 ::fidl_next::Wire::zero_padding(name);
21805 }
21806 }
21807
21808 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for CapabilityRef<'de>
21809 where
21810 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21811 ___D: ::fidl_next::Decoder<'de>,
21812 {
21813 fn decode(
21814 slot_: ::fidl_next::Slot<'_, Self>,
21815 decoder_: &mut ___D,
21816 _: (),
21817 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21818 ::fidl_next::munge! {
21819 let Self {
21820 mut name,
21821
21822 } = slot_;
21823 }
21824
21825 let _field = name.as_mut();
21826 ::fidl_next::Constrained::validate(_field, 100)?;
21827 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 100)?;
21828
21829 let name = unsafe { name.deref_unchecked() };
21830
21831 if name.len() > 100 {
21832 return Err(::fidl_next::DecodeError::VectorTooLong {
21833 size: name.len() as u64,
21834 limit: 100,
21835 });
21836 }
21837
21838 Ok(())
21839 }
21840 }
21841
21842 impl<'de> ::fidl_next::IntoNatural for CapabilityRef<'de> {
21843 type Natural = crate::natural::CapabilityRef;
21844 }
21845
21846 pub type DebugRef = ::fidl_next::wire::Unit;
21848
21849 pub type VoidRef = ::fidl_next::wire::Unit;
21851
21852 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
21854 #[repr(transparent)]
21855 pub struct StorageId {
21856 pub(crate) value: ::fidl_next::wire::Uint32,
21857 }
21858
21859 impl ::fidl_next::Constrained for StorageId {
21860 type Constraint = ();
21861
21862 fn validate(
21863 _: ::fidl_next::Slot<'_, Self>,
21864 _: Self::Constraint,
21865 ) -> Result<(), ::fidl_next::ValidationError> {
21866 Ok(())
21867 }
21868 }
21869
21870 unsafe impl ::fidl_next::Wire for StorageId {
21871 type Narrowed<'de> = Self;
21872
21873 #[inline]
21874 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
21875 }
21877 }
21878
21879 impl StorageId {
21880 pub const STATIC_INSTANCE_ID: StorageId = StorageId { value: ::fidl_next::wire::Uint32(1) };
21881
21882 pub const STATIC_INSTANCE_ID_OR_MONIKER: StorageId =
21883 StorageId { value: ::fidl_next::wire::Uint32(2) };
21884 }
21885
21886 unsafe impl<___D> ::fidl_next::Decode<___D> for StorageId
21887 where
21888 ___D: ?Sized,
21889 {
21890 fn decode(
21891 slot: ::fidl_next::Slot<'_, Self>,
21892 _: &mut ___D,
21893 _: (),
21894 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21895 ::fidl_next::munge!(let Self { value } = slot);
21896
21897 match u32::from(*value) {
21898 1 | 2 => (),
21899 unknown => {
21900 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
21901 }
21902 }
21903
21904 Ok(())
21905 }
21906 }
21907
21908 impl ::core::convert::From<crate::natural::StorageId> for StorageId {
21909 fn from(natural: crate::natural::StorageId) -> Self {
21910 match natural {
21911 crate::natural::StorageId::StaticInstanceId => StorageId::STATIC_INSTANCE_ID,
21912
21913 crate::natural::StorageId::StaticInstanceIdOrMoniker => {
21914 StorageId::STATIC_INSTANCE_ID_OR_MONIKER
21915 }
21916 }
21917 }
21918 }
21919
21920 impl ::fidl_next::IntoNatural for StorageId {
21921 type Natural = crate::natural::StorageId;
21922 }
21923
21924 #[repr(C)]
21926 pub struct Runner<'de> {
21927 pub(crate) table: ::fidl_next::wire::Table<'de>,
21928 }
21929
21930 impl<'de> Drop for Runner<'de> {
21931 fn drop(&mut self) {
21932 let _ = self.table.get(1).map(|envelope| unsafe {
21933 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
21934 });
21935
21936 let _ = self.table.get(2).map(|envelope| unsafe {
21937 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
21938 });
21939 }
21940 }
21941
21942 impl ::fidl_next::Constrained for Runner<'_> {
21943 type Constraint = ();
21944
21945 fn validate(
21946 _: ::fidl_next::Slot<'_, Self>,
21947 _: Self::Constraint,
21948 ) -> Result<(), ::fidl_next::ValidationError> {
21949 Ok(())
21950 }
21951 }
21952
21953 unsafe impl ::fidl_next::Wire for Runner<'static> {
21954 type Narrowed<'de> = Runner<'de>;
21955
21956 #[inline]
21957 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
21958 ::fidl_next::munge!(let Self { table } = out);
21959 ::fidl_next::wire::Table::zero_padding(table);
21960 }
21961 }
21962
21963 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Runner<'de>
21964 where
21965 ___D: ::fidl_next::Decoder<'de> + ?Sized,
21966 {
21967 fn decode(
21968 slot: ::fidl_next::Slot<'_, Self>,
21969 decoder: &mut ___D,
21970 _: (),
21971 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21972 ::fidl_next::munge!(let Self { table } = slot);
21973
21974 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
21975 match ordinal {
21976 0 => unsafe { ::core::hint::unreachable_unchecked() },
21977
21978 1 => {
21979 ::fidl_next::wire::Envelope::decode_as::<
21980 ___D,
21981 ::fidl_next::wire::String<'de>,
21982 >(slot.as_mut(), decoder, 100)?;
21983
21984 let value = unsafe {
21985 slot.deref_unchecked()
21986 .deref_unchecked::<::fidl_next::wire::String<'_>>()
21987 };
21988
21989 if value.len() > 100 {
21990 return Err(::fidl_next::DecodeError::VectorTooLong {
21991 size: value.len() as u64,
21992 limit: 100,
21993 });
21994 }
21995
21996 Ok(())
21997 }
21998
21999 2 => {
22000 ::fidl_next::wire::Envelope::decode_as::<
22001 ___D,
22002 ::fidl_next::wire::String<'de>,
22003 >(slot.as_mut(), decoder, 1024)?;
22004
22005 let value = unsafe {
22006 slot.deref_unchecked()
22007 .deref_unchecked::<::fidl_next::wire::String<'_>>()
22008 };
22009
22010 if value.len() > 1024 {
22011 return Err(::fidl_next::DecodeError::VectorTooLong {
22012 size: value.len() as u64,
22013 limit: 1024,
22014 });
22015 }
22016
22017 Ok(())
22018 }
22019
22020 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
22021 }
22022 })
22023 }
22024 }
22025
22026 impl<'de> Runner<'de> {
22027 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
22028 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
22029 }
22030
22031 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
22032 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
22033 }
22034 }
22035
22036 impl<'de> ::core::fmt::Debug for Runner<'de> {
22037 fn fmt(
22038 &self,
22039 f: &mut ::core::fmt::Formatter<'_>,
22040 ) -> ::core::result::Result<(), ::core::fmt::Error> {
22041 f.debug_struct("Runner")
22042 .field("name", &self.name())
22043 .field("source_path", &self.source_path())
22044 .finish()
22045 }
22046 }
22047
22048 impl<'de> ::fidl_next::IntoNatural for Runner<'de> {
22049 type Natural = crate::natural::Runner;
22050 }
22051
22052 #[repr(C)]
22054 pub struct Resolver<'de> {
22055 pub(crate) table: ::fidl_next::wire::Table<'de>,
22056 }
22057
22058 impl<'de> Drop for Resolver<'de> {
22059 fn drop(&mut self) {
22060 let _ = self.table.get(1).map(|envelope| unsafe {
22061 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
22062 });
22063
22064 let _ = self.table.get(2).map(|envelope| unsafe {
22065 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
22066 });
22067 }
22068 }
22069
22070 impl ::fidl_next::Constrained for Resolver<'_> {
22071 type Constraint = ();
22072
22073 fn validate(
22074 _: ::fidl_next::Slot<'_, Self>,
22075 _: Self::Constraint,
22076 ) -> Result<(), ::fidl_next::ValidationError> {
22077 Ok(())
22078 }
22079 }
22080
22081 unsafe impl ::fidl_next::Wire for Resolver<'static> {
22082 type Narrowed<'de> = Resolver<'de>;
22083
22084 #[inline]
22085 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22086 ::fidl_next::munge!(let Self { table } = out);
22087 ::fidl_next::wire::Table::zero_padding(table);
22088 }
22089 }
22090
22091 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Resolver<'de>
22092 where
22093 ___D: ::fidl_next::Decoder<'de> + ?Sized,
22094 {
22095 fn decode(
22096 slot: ::fidl_next::Slot<'_, Self>,
22097 decoder: &mut ___D,
22098 _: (),
22099 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22100 ::fidl_next::munge!(let Self { table } = slot);
22101
22102 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
22103 match ordinal {
22104 0 => unsafe { ::core::hint::unreachable_unchecked() },
22105
22106 1 => {
22107 ::fidl_next::wire::Envelope::decode_as::<
22108 ___D,
22109 ::fidl_next::wire::String<'de>,
22110 >(slot.as_mut(), decoder, 100)?;
22111
22112 let value = unsafe {
22113 slot.deref_unchecked()
22114 .deref_unchecked::<::fidl_next::wire::String<'_>>()
22115 };
22116
22117 if value.len() > 100 {
22118 return Err(::fidl_next::DecodeError::VectorTooLong {
22119 size: value.len() as u64,
22120 limit: 100,
22121 });
22122 }
22123
22124 Ok(())
22125 }
22126
22127 2 => {
22128 ::fidl_next::wire::Envelope::decode_as::<
22129 ___D,
22130 ::fidl_next::wire::String<'de>,
22131 >(slot.as_mut(), decoder, 1024)?;
22132
22133 let value = unsafe {
22134 slot.deref_unchecked()
22135 .deref_unchecked::<::fidl_next::wire::String<'_>>()
22136 };
22137
22138 if value.len() > 1024 {
22139 return Err(::fidl_next::DecodeError::VectorTooLong {
22140 size: value.len() as u64,
22141 limit: 1024,
22142 });
22143 }
22144
22145 Ok(())
22146 }
22147
22148 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
22149 }
22150 })
22151 }
22152 }
22153
22154 impl<'de> Resolver<'de> {
22155 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
22156 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
22157 }
22158
22159 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
22160 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
22161 }
22162 }
22163
22164 impl<'de> ::core::fmt::Debug for Resolver<'de> {
22165 fn fmt(
22166 &self,
22167 f: &mut ::core::fmt::Formatter<'_>,
22168 ) -> ::core::result::Result<(), ::core::fmt::Error> {
22169 f.debug_struct("Resolver")
22170 .field("name", &self.name())
22171 .field("source_path", &self.source_path())
22172 .finish()
22173 }
22174 }
22175
22176 impl<'de> ::fidl_next::IntoNatural for Resolver<'de> {
22177 type Natural = crate::natural::Resolver;
22178 }
22179
22180 #[repr(C)]
22182 pub struct EventStream<'de> {
22183 pub(crate) table: ::fidl_next::wire::Table<'de>,
22184 }
22185
22186 impl<'de> Drop for EventStream<'de> {
22187 fn drop(&mut self) {
22188 let _ = self.table.get(1).map(|envelope| unsafe {
22189 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
22190 });
22191 }
22192 }
22193
22194 impl ::fidl_next::Constrained for EventStream<'_> {
22195 type Constraint = ();
22196
22197 fn validate(
22198 _: ::fidl_next::Slot<'_, Self>,
22199 _: Self::Constraint,
22200 ) -> Result<(), ::fidl_next::ValidationError> {
22201 Ok(())
22202 }
22203 }
22204
22205 unsafe impl ::fidl_next::Wire for EventStream<'static> {
22206 type Narrowed<'de> = EventStream<'de>;
22207
22208 #[inline]
22209 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22210 ::fidl_next::munge!(let Self { table } = out);
22211 ::fidl_next::wire::Table::zero_padding(table);
22212 }
22213 }
22214
22215 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EventStream<'de>
22216 where
22217 ___D: ::fidl_next::Decoder<'de> + ?Sized,
22218 {
22219 fn decode(
22220 slot: ::fidl_next::Slot<'_, Self>,
22221 decoder: &mut ___D,
22222 _: (),
22223 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22224 ::fidl_next::munge!(let Self { table } = slot);
22225
22226 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
22227 match ordinal {
22228 0 => unsafe { ::core::hint::unreachable_unchecked() },
22229
22230 1 => {
22231 ::fidl_next::wire::Envelope::decode_as::<
22232 ___D,
22233 ::fidl_next::wire::String<'de>,
22234 >(slot.as_mut(), decoder, 100)?;
22235
22236 let value = unsafe {
22237 slot.deref_unchecked()
22238 .deref_unchecked::<::fidl_next::wire::String<'_>>()
22239 };
22240
22241 if value.len() > 100 {
22242 return Err(::fidl_next::DecodeError::VectorTooLong {
22243 size: value.len() as u64,
22244 limit: 100,
22245 });
22246 }
22247
22248 Ok(())
22249 }
22250
22251 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
22252 }
22253 })
22254 }
22255 }
22256
22257 impl<'de> EventStream<'de> {
22258 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
22259 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
22260 }
22261 }
22262
22263 impl<'de> ::core::fmt::Debug for EventStream<'de> {
22264 fn fmt(
22265 &self,
22266 f: &mut ::core::fmt::Formatter<'_>,
22267 ) -> ::core::result::Result<(), ::core::fmt::Error> {
22268 f.debug_struct("EventStream").field("name", &self.name()).finish()
22269 }
22270 }
22271
22272 impl<'de> ::fidl_next::IntoNatural for EventStream<'de> {
22273 type Natural = crate::natural::EventStream;
22274 }
22275
22276 #[repr(transparent)]
22278 pub struct ConfigSingleValue<'de> {
22279 pub(crate) raw: ::fidl_next::wire::Union,
22280 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
22281 }
22282
22283 impl<'de> Drop for ConfigSingleValue<'de> {
22284 fn drop(&mut self) {
22285 match self.raw.ordinal() {
22286 1 => {
22287 let _ = unsafe { self.raw.get().read_unchecked::<bool>() };
22288 }
22289
22290 2 => {
22291 let _ = unsafe { self.raw.get().read_unchecked::<u8>() };
22292 }
22293
22294 3 => {
22295 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Uint16>() };
22296 }
22297
22298 4 => {
22299 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Uint32>() };
22300 }
22301
22302 5 => {
22303 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Uint64>() };
22304 }
22305
22306 6 => {
22307 let _ = unsafe { self.raw.get().read_unchecked::<i8>() };
22308 }
22309
22310 7 => {
22311 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Int16>() };
22312 }
22313
22314 8 => {
22315 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Int32>() };
22316 }
22317
22318 9 => {
22319 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Int64>() };
22320 }
22321
22322 10 => {
22323 let _ = unsafe {
22324 self.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
22325 };
22326 }
22327
22328 _ => (),
22329 }
22330 }
22331 }
22332
22333 impl ::fidl_next::Constrained for ConfigSingleValue<'_> {
22334 type Constraint = ();
22335
22336 fn validate(
22337 _: ::fidl_next::Slot<'_, Self>,
22338 _: Self::Constraint,
22339 ) -> Result<(), ::fidl_next::ValidationError> {
22340 Ok(())
22341 }
22342 }
22343
22344 unsafe impl ::fidl_next::Wire for ConfigSingleValue<'static> {
22345 type Narrowed<'de> = ConfigSingleValue<'de>;
22346
22347 #[inline]
22348 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22349 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
22350 ::fidl_next::wire::Union::zero_padding(raw);
22351 }
22352 }
22353
22354 pub mod config_single_value {
22355 pub enum Ref<'de> {
22356 Bool(&'de bool),
22357
22358 Uint8(&'de u8),
22359
22360 Uint16(&'de ::fidl_next::wire::Uint16),
22361
22362 Uint32(&'de ::fidl_next::wire::Uint32),
22363
22364 Uint64(&'de ::fidl_next::wire::Uint64),
22365
22366 Int8(&'de i8),
22367
22368 Int16(&'de ::fidl_next::wire::Int16),
22369
22370 Int32(&'de ::fidl_next::wire::Int32),
22371
22372 Int64(&'de ::fidl_next::wire::Int64),
22373
22374 String(&'de ::fidl_next::wire::String<'de>),
22375
22376 UnknownOrdinal_(u64),
22377 }
22378 }
22379
22380 impl<'de> ConfigSingleValue<'de> {
22381 pub fn as_ref(&self) -> crate::wire::config_single_value::Ref<'_> {
22382 match self.raw.ordinal() {
22383 1 => crate::wire::config_single_value::Ref::Bool(unsafe {
22384 self.raw.get().deref_unchecked::<bool>()
22385 }),
22386
22387 2 => crate::wire::config_single_value::Ref::Uint8(unsafe {
22388 self.raw.get().deref_unchecked::<u8>()
22389 }),
22390
22391 3 => crate::wire::config_single_value::Ref::Uint16(unsafe {
22392 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint16>()
22393 }),
22394
22395 4 => crate::wire::config_single_value::Ref::Uint32(unsafe {
22396 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint32>()
22397 }),
22398
22399 5 => crate::wire::config_single_value::Ref::Uint64(unsafe {
22400 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint64>()
22401 }),
22402
22403 6 => crate::wire::config_single_value::Ref::Int8(unsafe {
22404 self.raw.get().deref_unchecked::<i8>()
22405 }),
22406
22407 7 => crate::wire::config_single_value::Ref::Int16(unsafe {
22408 self.raw.get().deref_unchecked::<::fidl_next::wire::Int16>()
22409 }),
22410
22411 8 => crate::wire::config_single_value::Ref::Int32(unsafe {
22412 self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>()
22413 }),
22414
22415 9 => crate::wire::config_single_value::Ref::Int64(unsafe {
22416 self.raw.get().deref_unchecked::<::fidl_next::wire::Int64>()
22417 }),
22418
22419 10 => crate::wire::config_single_value::Ref::String(unsafe {
22420 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
22421 }),
22422
22423 unknown => crate::wire::config_single_value::Ref::UnknownOrdinal_(unknown),
22424 }
22425 }
22426 }
22427
22428 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigSingleValue<'de>
22429 where
22430 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22431 ___D: ::fidl_next::Decoder<'de>,
22432 {
22433 fn decode(
22434 mut slot: ::fidl_next::Slot<'_, Self>,
22435 decoder: &mut ___D,
22436 _: (),
22437 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22438 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
22439 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
22440 1 => ::fidl_next::wire::Union::decode_as::<___D, bool>(raw, decoder, ())?,
22441
22442 2 => ::fidl_next::wire::Union::decode_as::<___D, u8>(raw, decoder, ())?,
22443
22444 3 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint16>(
22445 raw,
22446 decoder,
22447 (),
22448 )?,
22449
22450 4 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint32>(
22451 raw,
22452 decoder,
22453 (),
22454 )?,
22455
22456 5 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint64>(
22457 raw,
22458 decoder,
22459 (),
22460 )?,
22461
22462 6 => ::fidl_next::wire::Union::decode_as::<___D, i8>(raw, decoder, ())?,
22463
22464 7 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int16>(
22465 raw,
22466 decoder,
22467 (),
22468 )?,
22469
22470 8 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int32>(
22471 raw,
22472 decoder,
22473 (),
22474 )?,
22475
22476 9 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int64>(
22477 raw,
22478 decoder,
22479 (),
22480 )?,
22481
22482 10 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
22483 raw, decoder, 4294967295,
22484 )?,
22485
22486 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
22487 }
22488
22489 Ok(())
22490 }
22491 }
22492
22493 impl<'de> ::core::fmt::Debug for ConfigSingleValue<'de> {
22494 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
22495 match self.raw.ordinal() {
22496 1 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) },
22497 2 => unsafe { self.raw.get().deref_unchecked::<u8>().fmt(f) },
22498 3 => unsafe {
22499 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint16>().fmt(f)
22500 },
22501 4 => unsafe {
22502 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint32>().fmt(f)
22503 },
22504 5 => unsafe {
22505 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint64>().fmt(f)
22506 },
22507 6 => unsafe { self.raw.get().deref_unchecked::<i8>().fmt(f) },
22508 7 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::wire::Int16>().fmt(f) },
22509 8 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>().fmt(f) },
22510 9 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::wire::Int64>().fmt(f) },
22511 10 => unsafe {
22512 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
22513 },
22514 _ => unsafe { ::core::hint::unreachable_unchecked() },
22515 }
22516 }
22517 }
22518
22519 impl<'de> ::fidl_next::IntoNatural for ConfigSingleValue<'de> {
22520 type Natural = crate::natural::ConfigSingleValue;
22521 }
22522
22523 #[repr(transparent)]
22525 pub struct ConfigVectorValue<'de> {
22526 pub(crate) raw: ::fidl_next::wire::Union,
22527 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
22528 }
22529
22530 impl<'de> Drop for ConfigVectorValue<'de> {
22531 fn drop(&mut self) {
22532 match self.raw.ordinal() {
22533 1 => {
22534 let _ = unsafe {
22535 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, bool>>()
22536 };
22537 }
22538
22539 2 => {
22540 let _ = unsafe {
22541 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
22542 };
22543 }
22544
22545 3 => {
22546 let _ = unsafe {
22547 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint16>>()
22548 };
22549 }
22550
22551 4 => {
22552 let _ = unsafe {
22553 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>>()
22554 };
22555 }
22556
22557 5 => {
22558 let _ = unsafe {
22559 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint64>>()
22560 };
22561 }
22562
22563 6 => {
22564 let _ = unsafe {
22565 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, i8>>()
22566 };
22567 }
22568
22569 7 => {
22570 let _ = unsafe {
22571 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int16>>()
22572 };
22573 }
22574
22575 8 => {
22576 let _ = unsafe {
22577 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int32>>()
22578 };
22579 }
22580
22581 9 => {
22582 let _ = unsafe {
22583 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>>()
22584 };
22585 }
22586
22587 10 => {
22588 let _ = unsafe {
22589 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
22590 };
22591 }
22592
22593 _ => (),
22594 }
22595 }
22596 }
22597
22598 impl ::fidl_next::Constrained for ConfigVectorValue<'_> {
22599 type Constraint = ();
22600
22601 fn validate(
22602 _: ::fidl_next::Slot<'_, Self>,
22603 _: Self::Constraint,
22604 ) -> Result<(), ::fidl_next::ValidationError> {
22605 Ok(())
22606 }
22607 }
22608
22609 unsafe impl ::fidl_next::Wire for ConfigVectorValue<'static> {
22610 type Narrowed<'de> = ConfigVectorValue<'de>;
22611
22612 #[inline]
22613 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22614 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
22615 ::fidl_next::wire::Union::zero_padding(raw);
22616 }
22617 }
22618
22619 pub mod config_vector_value {
22620 pub enum Ref<'de> {
22621 BoolVector(&'de ::fidl_next::wire::Vector<'de, bool>),
22622
22623 Uint8Vector(&'de ::fidl_next::wire::Vector<'de, u8>),
22624
22625 Uint16Vector(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint16>),
22626
22627 Uint32Vector(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>),
22628
22629 Uint64Vector(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint64>),
22630
22631 Int8Vector(&'de ::fidl_next::wire::Vector<'de, i8>),
22632
22633 Int16Vector(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int16>),
22634
22635 Int32Vector(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int32>),
22636
22637 Int64Vector(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>),
22638
22639 StringVector(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>),
22640
22641 UnknownOrdinal_(u64),
22642 }
22643 }
22644
22645 impl<'de> ConfigVectorValue<'de> {
22646 pub fn as_ref(&self) -> crate::wire::config_vector_value::Ref<'_> {
22647 match self.raw.ordinal() {
22648 1 => crate::wire::config_vector_value::Ref::BoolVector(unsafe {
22649 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, bool>>()
22650 }),
22651
22652 2 => crate::wire::config_vector_value::Ref::Uint8Vector(unsafe {
22653 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, u8>>()
22654 }),
22655
22656 3 => crate::wire::config_vector_value::Ref::Uint16Vector(unsafe {
22657 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Uint16>>()
22658 }),
22659
22660 4 => crate::wire::config_vector_value::Ref::Uint32Vector(unsafe {
22661 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Uint32>>()
22662 }),
22663
22664 5 => crate::wire::config_vector_value::Ref::Uint64Vector(unsafe {
22665 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Uint64>>()
22666 }),
22667
22668 6 => crate::wire::config_vector_value::Ref::Int8Vector(unsafe {
22669 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, i8>>()
22670 }),
22671
22672 7 => {
22673 crate::wire::config_vector_value::Ref::Int16Vector(unsafe {
22674 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Int16>>()
22675 })
22676 }
22677
22678 8 => {
22679 crate::wire::config_vector_value::Ref::Int32Vector(unsafe {
22680 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Int32>>()
22681 })
22682 }
22683
22684 9 => {
22685 crate::wire::config_vector_value::Ref::Int64Vector(unsafe {
22686 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Int64>>()
22687 })
22688 }
22689
22690 10 => crate::wire::config_vector_value::Ref::StringVector(unsafe {
22691 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::String<'_>>>()
22692 }),
22693
22694 unknown => crate::wire::config_vector_value::Ref::UnknownOrdinal_(unknown),
22695 }
22696 }
22697 }
22698
22699 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigVectorValue<'de>
22700 where
22701 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22702 ___D: ::fidl_next::Decoder<'de>,
22703 {
22704 fn decode(
22705 mut slot: ::fidl_next::Slot<'_, Self>,
22706 decoder: &mut ___D,
22707 _: (),
22708 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22709 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
22710 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
22711 1 => ::fidl_next::wire::Union::decode_as::<
22712 ___D,
22713 ::fidl_next::wire::Vector<'de, bool>,
22714 >(raw, decoder, (4294967295, ()))?,
22715
22716 2 => {
22717 ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Vector<'de, u8>>(
22718 raw,
22719 decoder,
22720 (4294967295, ()),
22721 )?
22722 }
22723
22724 3 => ::fidl_next::wire::Union::decode_as::<
22725 ___D,
22726 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint16>,
22727 >(raw, decoder, (4294967295, ()))?,
22728
22729 4 => ::fidl_next::wire::Union::decode_as::<
22730 ___D,
22731 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>,
22732 >(raw, decoder, (4294967295, ()))?,
22733
22734 5 => ::fidl_next::wire::Union::decode_as::<
22735 ___D,
22736 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint64>,
22737 >(raw, decoder, (4294967295, ()))?,
22738
22739 6 => {
22740 ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Vector<'de, i8>>(
22741 raw,
22742 decoder,
22743 (4294967295, ()),
22744 )?
22745 }
22746
22747 7 => ::fidl_next::wire::Union::decode_as::<
22748 ___D,
22749 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int16>,
22750 >(raw, decoder, (4294967295, ()))?,
22751
22752 8 => ::fidl_next::wire::Union::decode_as::<
22753 ___D,
22754 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int32>,
22755 >(raw, decoder, (4294967295, ()))?,
22756
22757 9 => ::fidl_next::wire::Union::decode_as::<
22758 ___D,
22759 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>,
22760 >(raw, decoder, (4294967295, ()))?,
22761
22762 10 => ::fidl_next::wire::Union::decode_as::<
22763 ___D,
22764 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>,
22765 >(raw, decoder, (4294967295, 4294967295))?,
22766
22767 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
22768 }
22769
22770 Ok(())
22771 }
22772 }
22773
22774 impl<'de> ::core::fmt::Debug for ConfigVectorValue<'de> {
22775 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
22776 match self.raw.ordinal() {
22777 1 => unsafe {
22778 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, bool>>().fmt(f)
22779 },
22780 2 => unsafe {
22781 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, u8>>().fmt(f)
22782 },
22783 3 => unsafe {
22784 self.raw.get().deref_unchecked::<
22785 ::fidl_next::wire::Vector<'_, ::fidl_next::wire::Uint16>
22786 >().fmt(f)
22787 },
22788 4 => unsafe {
22789 self.raw.get().deref_unchecked::<
22790 ::fidl_next::wire::Vector<'_, ::fidl_next::wire::Uint32>
22791 >().fmt(f)
22792 },
22793 5 => unsafe {
22794 self.raw.get().deref_unchecked::<
22795 ::fidl_next::wire::Vector<'_, ::fidl_next::wire::Uint64>
22796 >().fmt(f)
22797 },
22798 6 => unsafe {
22799 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, i8>>().fmt(f)
22800 },
22801 7 => unsafe {
22802 self.raw
22803 .get()
22804 .deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Int16>>(
22805 )
22806 .fmt(f)
22807 },
22808 8 => unsafe {
22809 self.raw
22810 .get()
22811 .deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Int32>>(
22812 )
22813 .fmt(f)
22814 },
22815 9 => unsafe {
22816 self.raw
22817 .get()
22818 .deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Int64>>(
22819 )
22820 .fmt(f)
22821 },
22822 10 => unsafe {
22823 self.raw.get().deref_unchecked::<
22824 ::fidl_next::wire::Vector<'_, ::fidl_next::wire::String<'_>>
22825 >().fmt(f)
22826 },
22827 _ => unsafe { ::core::hint::unreachable_unchecked() },
22828 }
22829 }
22830 }
22831
22832 impl<'de> ::fidl_next::IntoNatural for ConfigVectorValue<'de> {
22833 type Natural = crate::natural::ConfigVectorValue;
22834 }
22835
22836 #[repr(transparent)]
22838 pub struct ConfigValue<'de> {
22839 pub(crate) raw: ::fidl_next::wire::Union,
22840 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
22841 }
22842
22843 impl<'de> Drop for ConfigValue<'de> {
22844 fn drop(&mut self) {
22845 match self.raw.ordinal() {
22846 1 => {
22847 let _ = unsafe {
22848 self.raw.get().read_unchecked::<crate::wire::ConfigSingleValue<'de>>()
22849 };
22850 }
22851
22852 2 => {
22853 let _ = unsafe {
22854 self.raw.get().read_unchecked::<crate::wire::ConfigVectorValue<'de>>()
22855 };
22856 }
22857
22858 _ => (),
22859 }
22860 }
22861 }
22862
22863 impl ::fidl_next::Constrained for ConfigValue<'_> {
22864 type Constraint = ();
22865
22866 fn validate(
22867 _: ::fidl_next::Slot<'_, Self>,
22868 _: Self::Constraint,
22869 ) -> Result<(), ::fidl_next::ValidationError> {
22870 Ok(())
22871 }
22872 }
22873
22874 unsafe impl ::fidl_next::Wire for ConfigValue<'static> {
22875 type Narrowed<'de> = ConfigValue<'de>;
22876
22877 #[inline]
22878 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22879 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
22880 ::fidl_next::wire::Union::zero_padding(raw);
22881 }
22882 }
22883
22884 pub mod config_value {
22885 pub enum Ref<'de> {
22886 Single(&'de crate::wire::ConfigSingleValue<'de>),
22887
22888 Vector(&'de crate::wire::ConfigVectorValue<'de>),
22889
22890 UnknownOrdinal_(u64),
22891 }
22892 }
22893
22894 impl<'de> ConfigValue<'de> {
22895 pub fn as_ref(&self) -> crate::wire::config_value::Ref<'_> {
22896 match self.raw.ordinal() {
22897 1 => crate::wire::config_value::Ref::Single(unsafe {
22898 self.raw.get().deref_unchecked::<crate::wire::ConfigSingleValue<'_>>()
22899 }),
22900
22901 2 => crate::wire::config_value::Ref::Vector(unsafe {
22902 self.raw.get().deref_unchecked::<crate::wire::ConfigVectorValue<'_>>()
22903 }),
22904
22905 unknown => crate::wire::config_value::Ref::UnknownOrdinal_(unknown),
22906 }
22907 }
22908 }
22909
22910 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigValue<'de>
22911 where
22912 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22913 ___D: ::fidl_next::Decoder<'de>,
22914 {
22915 fn decode(
22916 mut slot: ::fidl_next::Slot<'_, Self>,
22917 decoder: &mut ___D,
22918 _: (),
22919 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22920 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
22921 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
22922 1 => ::fidl_next::wire::Union::decode_as::<
22923 ___D,
22924 crate::wire::ConfigSingleValue<'de>,
22925 >(raw, decoder, ())?,
22926
22927 2 => ::fidl_next::wire::Union::decode_as::<
22928 ___D,
22929 crate::wire::ConfigVectorValue<'de>,
22930 >(raw, decoder, ())?,
22931
22932 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
22933 }
22934
22935 Ok(())
22936 }
22937 }
22938
22939 impl<'de> ::core::fmt::Debug for ConfigValue<'de> {
22940 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
22941 match self.raw.ordinal() {
22942 1 => unsafe {
22943 self.raw.get().deref_unchecked::<crate::wire::ConfigSingleValue<'_>>().fmt(f)
22944 },
22945 2 => unsafe {
22946 self.raw.get().deref_unchecked::<crate::wire::ConfigVectorValue<'_>>().fmt(f)
22947 },
22948 _ => unsafe { ::core::hint::unreachable_unchecked() },
22949 }
22950 }
22951 }
22952
22953 impl<'de> ::fidl_next::IntoNatural for ConfigValue<'de> {
22954 type Natural = crate::natural::ConfigValue;
22955 }
22956
22957 #[repr(C)]
22959 pub struct Configuration<'de> {
22960 pub(crate) table: ::fidl_next::wire::Table<'de>,
22961 }
22962
22963 impl<'de> Drop for Configuration<'de> {
22964 fn drop(&mut self) {
22965 let _ = self.table.get(1).map(|envelope| unsafe {
22966 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
22967 });
22968
22969 let _ = self.table.get(2).map(|envelope| unsafe {
22970 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
22971 });
22972 }
22973 }
22974
22975 impl ::fidl_next::Constrained for Configuration<'_> {
22976 type Constraint = ();
22977
22978 fn validate(
22979 _: ::fidl_next::Slot<'_, Self>,
22980 _: Self::Constraint,
22981 ) -> Result<(), ::fidl_next::ValidationError> {
22982 Ok(())
22983 }
22984 }
22985
22986 unsafe impl ::fidl_next::Wire for Configuration<'static> {
22987 type Narrowed<'de> = Configuration<'de>;
22988
22989 #[inline]
22990 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22991 ::fidl_next::munge!(let Self { table } = out);
22992 ::fidl_next::wire::Table::zero_padding(table);
22993 }
22994 }
22995
22996 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Configuration<'de>
22997 where
22998 ___D: ::fidl_next::Decoder<'de> + ?Sized,
22999 {
23000 fn decode(
23001 slot: ::fidl_next::Slot<'_, Self>,
23002 decoder: &mut ___D,
23003 _: (),
23004 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23005 ::fidl_next::munge!(let Self { table } = slot);
23006
23007 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
23008 match ordinal {
23009 0 => unsafe { ::core::hint::unreachable_unchecked() },
23010
23011 1 => {
23012 ::fidl_next::wire::Envelope::decode_as::<
23013 ___D,
23014 ::fidl_next::wire::String<'de>,
23015 >(slot.as_mut(), decoder, 100)?;
23016
23017 let value = unsafe {
23018 slot.deref_unchecked()
23019 .deref_unchecked::<::fidl_next::wire::String<'_>>()
23020 };
23021
23022 if value.len() > 100 {
23023 return Err(::fidl_next::DecodeError::VectorTooLong {
23024 size: value.len() as u64,
23025 limit: 100,
23026 });
23027 }
23028
23029 Ok(())
23030 }
23031
23032 2 => {
23033 ::fidl_next::wire::Envelope::decode_as::<
23034 ___D,
23035 crate::wire::ConfigValue<'de>,
23036 >(slot.as_mut(), decoder, ())?;
23037
23038 Ok(())
23039 }
23040
23041 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
23042 }
23043 })
23044 }
23045 }
23046
23047 impl<'de> Configuration<'de> {
23048 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
23049 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
23050 }
23051
23052 pub fn value(&self) -> ::core::option::Option<&crate::wire::ConfigValue<'de>> {
23053 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
23054 }
23055 }
23056
23057 impl<'de> ::core::fmt::Debug for Configuration<'de> {
23058 fn fmt(
23059 &self,
23060 f: &mut ::core::fmt::Formatter<'_>,
23061 ) -> ::core::result::Result<(), ::core::fmt::Error> {
23062 f.debug_struct("Configuration")
23063 .field("name", &self.name())
23064 .field("value", &self.value())
23065 .finish()
23066 }
23067 }
23068
23069 impl<'de> ::fidl_next::IntoNatural for Configuration<'de> {
23070 type Natural = crate::natural::Configuration;
23071 }
23072
23073 pub type DictionaryPath<'de> = ::fidl_next::wire::String<'de>;
23075
23076 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
23078 #[repr(transparent)]
23079 pub struct DeliveryType {
23080 pub(crate) value: ::fidl_next::wire::Uint32,
23081 }
23082
23083 impl ::fidl_next::Constrained for DeliveryType {
23084 type Constraint = ();
23085
23086 fn validate(
23087 _: ::fidl_next::Slot<'_, Self>,
23088 _: Self::Constraint,
23089 ) -> Result<(), ::fidl_next::ValidationError> {
23090 Ok(())
23091 }
23092 }
23093
23094 unsafe impl ::fidl_next::Wire for DeliveryType {
23095 type Narrowed<'de> = Self;
23096
23097 #[inline]
23098 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
23099 }
23101 }
23102
23103 impl DeliveryType {
23104 pub const IMMEDIATE: DeliveryType = DeliveryType { value: ::fidl_next::wire::Uint32(0) };
23105
23106 pub const ON_READABLE: DeliveryType = DeliveryType { value: ::fidl_next::wire::Uint32(1) };
23107 }
23108
23109 unsafe impl<___D> ::fidl_next::Decode<___D> for DeliveryType
23110 where
23111 ___D: ?Sized,
23112 {
23113 fn decode(
23114 slot: ::fidl_next::Slot<'_, Self>,
23115 _: &mut ___D,
23116 _: (),
23117 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23118 Ok(())
23119 }
23120 }
23121
23122 impl ::core::convert::From<crate::natural::DeliveryType> for DeliveryType {
23123 fn from(natural: crate::natural::DeliveryType) -> Self {
23124 match natural {
23125 crate::natural::DeliveryType::Immediate => DeliveryType::IMMEDIATE,
23126
23127 crate::natural::DeliveryType::OnReadable => DeliveryType::ON_READABLE,
23128
23129 crate::natural::DeliveryType::UnknownOrdinal_(value) => {
23130 DeliveryType { value: ::fidl_next::wire::Uint32::from(value) }
23131 }
23132 }
23133 }
23134 }
23135
23136 impl ::fidl_next::IntoNatural for DeliveryType {
23137 type Natural = crate::natural::DeliveryType;
23138 }
23139
23140 #[repr(C)]
23142 pub struct Protocol<'de> {
23143 pub(crate) table: ::fidl_next::wire::Table<'de>,
23144 }
23145
23146 impl<'de> Drop for Protocol<'de> {
23147 fn drop(&mut self) {
23148 let _ = self.table.get(1).map(|envelope| unsafe {
23149 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
23150 });
23151
23152 let _ = self.table.get(2).map(|envelope| unsafe {
23153 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
23154 });
23155
23156 let _ = self
23157 .table
23158 .get(3)
23159 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::DeliveryType>() });
23160 }
23161 }
23162
23163 impl ::fidl_next::Constrained for Protocol<'_> {
23164 type Constraint = ();
23165
23166 fn validate(
23167 _: ::fidl_next::Slot<'_, Self>,
23168 _: Self::Constraint,
23169 ) -> Result<(), ::fidl_next::ValidationError> {
23170 Ok(())
23171 }
23172 }
23173
23174 unsafe impl ::fidl_next::Wire for Protocol<'static> {
23175 type Narrowed<'de> = Protocol<'de>;
23176
23177 #[inline]
23178 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23179 ::fidl_next::munge!(let Self { table } = out);
23180 ::fidl_next::wire::Table::zero_padding(table);
23181 }
23182 }
23183
23184 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Protocol<'de>
23185 where
23186 ___D: ::fidl_next::Decoder<'de> + ?Sized,
23187 {
23188 fn decode(
23189 slot: ::fidl_next::Slot<'_, Self>,
23190 decoder: &mut ___D,
23191 _: (),
23192 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23193 ::fidl_next::munge!(let Self { table } = slot);
23194
23195 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
23196 match ordinal {
23197 0 => unsafe { ::core::hint::unreachable_unchecked() },
23198
23199 1 => {
23200 ::fidl_next::wire::Envelope::decode_as::<
23201 ___D,
23202 ::fidl_next::wire::String<'de>,
23203 >(slot.as_mut(), decoder, 100)?;
23204
23205 let value = unsafe {
23206 slot.deref_unchecked()
23207 .deref_unchecked::<::fidl_next::wire::String<'_>>()
23208 };
23209
23210 if value.len() > 100 {
23211 return Err(::fidl_next::DecodeError::VectorTooLong {
23212 size: value.len() as u64,
23213 limit: 100,
23214 });
23215 }
23216
23217 Ok(())
23218 }
23219
23220 2 => {
23221 ::fidl_next::wire::Envelope::decode_as::<
23222 ___D,
23223 ::fidl_next::wire::String<'de>,
23224 >(slot.as_mut(), decoder, 1024)?;
23225
23226 let value = unsafe {
23227 slot.deref_unchecked()
23228 .deref_unchecked::<::fidl_next::wire::String<'_>>()
23229 };
23230
23231 if value.len() > 1024 {
23232 return Err(::fidl_next::DecodeError::VectorTooLong {
23233 size: value.len() as u64,
23234 limit: 1024,
23235 });
23236 }
23237
23238 Ok(())
23239 }
23240
23241 3 => {
23242 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DeliveryType>(
23243 slot.as_mut(),
23244 decoder,
23245 (),
23246 )?;
23247
23248 Ok(())
23249 }
23250
23251 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
23252 }
23253 })
23254 }
23255 }
23256
23257 impl<'de> Protocol<'de> {
23258 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
23259 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
23260 }
23261
23262 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
23263 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
23264 }
23265
23266 pub fn delivery(&self) -> ::core::option::Option<&crate::wire::DeliveryType> {
23267 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
23268 }
23269 }
23270
23271 impl<'de> ::core::fmt::Debug for Protocol<'de> {
23272 fn fmt(
23273 &self,
23274 f: &mut ::core::fmt::Formatter<'_>,
23275 ) -> ::core::result::Result<(), ::core::fmt::Error> {
23276 f.debug_struct("Protocol")
23277 .field("name", &self.name())
23278 .field("source_path", &self.source_path())
23279 .field("delivery", &self.delivery())
23280 .finish()
23281 }
23282 }
23283
23284 impl<'de> ::fidl_next::IntoNatural for Protocol<'de> {
23285 type Natural = crate::natural::Protocol;
23286 }
23287
23288 pub type EnvironmentRef = ::fidl_next::wire::Unit;
23290
23291 #[repr(transparent)]
23293 pub struct Ref<'de> {
23294 pub(crate) raw: ::fidl_next::wire::Union,
23295 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
23296 }
23297
23298 impl<'de> Drop for Ref<'de> {
23299 fn drop(&mut self) {
23300 match self.raw.ordinal() {
23301 1 => {
23302 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::ParentRef>() };
23303 }
23304
23305 2 => {
23306 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::SelfRef>() };
23307 }
23308
23309 3 => {
23310 let _ =
23311 unsafe { self.raw.get().read_unchecked::<crate::wire::ChildRef<'de>>() };
23312 }
23313
23314 4 => {
23315 let _ = unsafe {
23316 self.raw.get().read_unchecked::<crate::wire::CollectionRef<'de>>()
23317 };
23318 }
23319
23320 5 => {
23321 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::FrameworkRef>() };
23322 }
23323
23324 6 => {
23325 let _ = unsafe {
23326 self.raw.get().read_unchecked::<crate::wire::CapabilityRef<'de>>()
23327 };
23328 }
23329
23330 7 => {
23331 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::DebugRef>() };
23332 }
23333
23334 8 => {
23335 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::VoidRef>() };
23336 }
23337
23338 9 => {
23339 let _ =
23340 unsafe { self.raw.get().read_unchecked::<crate::wire::EnvironmentRef>() };
23341 }
23342
23343 _ => (),
23344 }
23345 }
23346 }
23347
23348 impl ::fidl_next::Constrained for Ref<'_> {
23349 type Constraint = ();
23350
23351 fn validate(
23352 _: ::fidl_next::Slot<'_, Self>,
23353 _: Self::Constraint,
23354 ) -> Result<(), ::fidl_next::ValidationError> {
23355 Ok(())
23356 }
23357 }
23358
23359 unsafe impl ::fidl_next::Wire for Ref<'static> {
23360 type Narrowed<'de> = Ref<'de>;
23361
23362 #[inline]
23363 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23364 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
23365 ::fidl_next::wire::Union::zero_padding(raw);
23366 }
23367 }
23368
23369 pub mod ref_ {
23370 pub enum Ref<'de> {
23371 Parent(&'de crate::wire::ParentRef),
23372
23373 Self_(&'de crate::wire::SelfRef),
23374
23375 Child(&'de crate::wire::ChildRef<'de>),
23376
23377 Collection(&'de crate::wire::CollectionRef<'de>),
23378
23379 Framework(&'de crate::wire::FrameworkRef),
23380
23381 Capability(&'de crate::wire::CapabilityRef<'de>),
23382
23383 Debug(&'de crate::wire::DebugRef),
23384
23385 VoidType(&'de crate::wire::VoidRef),
23386
23387 Environment(&'de crate::wire::EnvironmentRef),
23388
23389 UnknownOrdinal_(u64),
23390 }
23391 }
23392
23393 impl<'de> Ref<'de> {
23394 pub fn as_ref(&self) -> crate::wire::ref_::Ref<'_> {
23395 match self.raw.ordinal() {
23396 1 => crate::wire::ref_::Ref::Parent(unsafe {
23397 self.raw.get().deref_unchecked::<crate::wire::ParentRef>()
23398 }),
23399
23400 2 => crate::wire::ref_::Ref::Self_(unsafe {
23401 self.raw.get().deref_unchecked::<crate::wire::SelfRef>()
23402 }),
23403
23404 3 => crate::wire::ref_::Ref::Child(unsafe {
23405 self.raw.get().deref_unchecked::<crate::wire::ChildRef<'_>>()
23406 }),
23407
23408 4 => crate::wire::ref_::Ref::Collection(unsafe {
23409 self.raw.get().deref_unchecked::<crate::wire::CollectionRef<'_>>()
23410 }),
23411
23412 5 => crate::wire::ref_::Ref::Framework(unsafe {
23413 self.raw.get().deref_unchecked::<crate::wire::FrameworkRef>()
23414 }),
23415
23416 6 => crate::wire::ref_::Ref::Capability(unsafe {
23417 self.raw.get().deref_unchecked::<crate::wire::CapabilityRef<'_>>()
23418 }),
23419
23420 7 => crate::wire::ref_::Ref::Debug(unsafe {
23421 self.raw.get().deref_unchecked::<crate::wire::DebugRef>()
23422 }),
23423
23424 8 => crate::wire::ref_::Ref::VoidType(unsafe {
23425 self.raw.get().deref_unchecked::<crate::wire::VoidRef>()
23426 }),
23427
23428 9 => crate::wire::ref_::Ref::Environment(unsafe {
23429 self.raw.get().deref_unchecked::<crate::wire::EnvironmentRef>()
23430 }),
23431
23432 unknown => crate::wire::ref_::Ref::UnknownOrdinal_(unknown),
23433 }
23434 }
23435 }
23436
23437 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Ref<'de>
23438 where
23439 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
23440 ___D: ::fidl_next::Decoder<'de>,
23441 {
23442 fn decode(
23443 mut slot: ::fidl_next::Slot<'_, Self>,
23444 decoder: &mut ___D,
23445 _: (),
23446 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23447 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
23448 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
23449 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ParentRef>(
23450 raw,
23451 decoder,
23452 (),
23453 )?,
23454
23455 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::SelfRef>(
23456 raw,
23457 decoder,
23458 (),
23459 )?,
23460
23461 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ChildRef<'de>>(
23462 raw,
23463 decoder,
23464 (),
23465 )?,
23466
23467 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::CollectionRef<'de>>(
23468 raw,
23469 decoder,
23470 (),
23471 )?,
23472
23473 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::FrameworkRef>(
23474 raw,
23475 decoder,
23476 (),
23477 )?,
23478
23479 6 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::CapabilityRef<'de>>(
23480 raw,
23481 decoder,
23482 (),
23483 )?,
23484
23485 7 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::DebugRef>(
23486 raw,
23487 decoder,
23488 (),
23489 )?,
23490
23491 8 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::VoidRef>(
23492 raw,
23493 decoder,
23494 (),
23495 )?,
23496
23497 9 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::EnvironmentRef>(
23498 raw,
23499 decoder,
23500 (),
23501 )?,
23502
23503 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
23504 }
23505
23506 Ok(())
23507 }
23508 }
23509
23510 impl<'de> ::core::fmt::Debug for Ref<'de> {
23511 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
23512 match self.raw.ordinal() {
23513 1 => unsafe { self.raw.get().deref_unchecked::<crate::wire::ParentRef>().fmt(f) },
23514 2 => unsafe { self.raw.get().deref_unchecked::<crate::wire::SelfRef>().fmt(f) },
23515 3 => unsafe {
23516 self.raw.get().deref_unchecked::<crate::wire::ChildRef<'_>>().fmt(f)
23517 },
23518 4 => unsafe {
23519 self.raw.get().deref_unchecked::<crate::wire::CollectionRef<'_>>().fmt(f)
23520 },
23521 5 => unsafe {
23522 self.raw.get().deref_unchecked::<crate::wire::FrameworkRef>().fmt(f)
23523 },
23524 6 => unsafe {
23525 self.raw.get().deref_unchecked::<crate::wire::CapabilityRef<'_>>().fmt(f)
23526 },
23527 7 => unsafe { self.raw.get().deref_unchecked::<crate::wire::DebugRef>().fmt(f) },
23528 8 => unsafe { self.raw.get().deref_unchecked::<crate::wire::VoidRef>().fmt(f) },
23529 9 => unsafe {
23530 self.raw.get().deref_unchecked::<crate::wire::EnvironmentRef>().fmt(f)
23531 },
23532 _ => unsafe { ::core::hint::unreachable_unchecked() },
23533 }
23534 }
23535 }
23536
23537 impl<'de> ::fidl_next::IntoNatural for Ref<'de> {
23538 type Natural = crate::natural::Ref;
23539 }
23540
23541 #[repr(C)]
23543 pub struct Storage<'de> {
23544 pub(crate) table: ::fidl_next::wire::Table<'de>,
23545 }
23546
23547 impl<'de> Drop for Storage<'de> {
23548 fn drop(&mut self) {
23549 let _ = self.table.get(1).map(|envelope| unsafe {
23550 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
23551 });
23552
23553 let _ = self
23554 .table
23555 .get(2)
23556 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
23557
23558 let _ = self.table.get(3).map(|envelope| unsafe {
23559 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
23560 });
23561
23562 let _ = self.table.get(4).map(|envelope| unsafe {
23563 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
23564 });
23565
23566 let _ = self
23567 .table
23568 .get(5)
23569 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::StorageId>() });
23570 }
23571 }
23572
23573 impl ::fidl_next::Constrained for Storage<'_> {
23574 type Constraint = ();
23575
23576 fn validate(
23577 _: ::fidl_next::Slot<'_, Self>,
23578 _: Self::Constraint,
23579 ) -> Result<(), ::fidl_next::ValidationError> {
23580 Ok(())
23581 }
23582 }
23583
23584 unsafe impl ::fidl_next::Wire for Storage<'static> {
23585 type Narrowed<'de> = Storage<'de>;
23586
23587 #[inline]
23588 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23589 ::fidl_next::munge!(let Self { table } = out);
23590 ::fidl_next::wire::Table::zero_padding(table);
23591 }
23592 }
23593
23594 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Storage<'de>
23595 where
23596 ___D: ::fidl_next::Decoder<'de> + ?Sized,
23597 {
23598 fn decode(
23599 slot: ::fidl_next::Slot<'_, Self>,
23600 decoder: &mut ___D,
23601 _: (),
23602 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23603 ::fidl_next::munge!(let Self { table } = slot);
23604
23605 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
23606 match ordinal {
23607 0 => unsafe { ::core::hint::unreachable_unchecked() },
23608
23609 1 => {
23610 ::fidl_next::wire::Envelope::decode_as::<
23611 ___D,
23612 ::fidl_next::wire::String<'de>,
23613 >(slot.as_mut(), decoder, 100)?;
23614
23615 let value = unsafe {
23616 slot.deref_unchecked()
23617 .deref_unchecked::<::fidl_next::wire::String<'_>>()
23618 };
23619
23620 if value.len() > 100 {
23621 return Err(::fidl_next::DecodeError::VectorTooLong {
23622 size: value.len() as u64,
23623 limit: 100,
23624 });
23625 }
23626
23627 Ok(())
23628 }
23629
23630 2 => {
23631 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
23632 slot.as_mut(),
23633 decoder,
23634 (),
23635 )?;
23636
23637 Ok(())
23638 }
23639
23640 3 => {
23641 ::fidl_next::wire::Envelope::decode_as::<
23642 ___D,
23643 ::fidl_next::wire::String<'de>,
23644 >(slot.as_mut(), decoder, 100)?;
23645
23646 let value = unsafe {
23647 slot.deref_unchecked()
23648 .deref_unchecked::<::fidl_next::wire::String<'_>>()
23649 };
23650
23651 if value.len() > 100 {
23652 return Err(::fidl_next::DecodeError::VectorTooLong {
23653 size: value.len() as u64,
23654 limit: 100,
23655 });
23656 }
23657
23658 Ok(())
23659 }
23660
23661 4 => {
23662 ::fidl_next::wire::Envelope::decode_as::<
23663 ___D,
23664 ::fidl_next::wire::String<'de>,
23665 >(slot.as_mut(), decoder, 1024)?;
23666
23667 let value = unsafe {
23668 slot.deref_unchecked()
23669 .deref_unchecked::<::fidl_next::wire::String<'_>>()
23670 };
23671
23672 if value.len() > 1024 {
23673 return Err(::fidl_next::DecodeError::VectorTooLong {
23674 size: value.len() as u64,
23675 limit: 1024,
23676 });
23677 }
23678
23679 Ok(())
23680 }
23681
23682 5 => {
23683 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::StorageId>(
23684 slot.as_mut(),
23685 decoder,
23686 (),
23687 )?;
23688
23689 Ok(())
23690 }
23691
23692 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
23693 }
23694 })
23695 }
23696 }
23697
23698 impl<'de> Storage<'de> {
23699 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
23700 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
23701 }
23702
23703 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
23704 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
23705 }
23706
23707 pub fn backing_dir(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
23708 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
23709 }
23710
23711 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
23712 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
23713 }
23714
23715 pub fn storage_id(&self) -> ::core::option::Option<&crate::wire::StorageId> {
23716 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
23717 }
23718 }
23719
23720 impl<'de> ::core::fmt::Debug for Storage<'de> {
23721 fn fmt(
23722 &self,
23723 f: &mut ::core::fmt::Formatter<'_>,
23724 ) -> ::core::result::Result<(), ::core::fmt::Error> {
23725 f.debug_struct("Storage")
23726 .field("name", &self.name())
23727 .field("source", &self.source())
23728 .field("backing_dir", &self.backing_dir())
23729 .field("subdir", &self.subdir())
23730 .field("storage_id", &self.storage_id())
23731 .finish()
23732 }
23733 }
23734
23735 impl<'de> ::fidl_next::IntoNatural for Storage<'de> {
23736 type Natural = crate::natural::Storage;
23737 }
23738
23739 #[repr(C)]
23741 pub struct Dictionary<'de> {
23742 pub(crate) table: ::fidl_next::wire::Table<'de>,
23743 }
23744
23745 impl<'de> Drop for Dictionary<'de> {
23746 fn drop(&mut self) {
23747 let _ = self.table.get(1).map(|envelope| unsafe {
23748 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
23749 });
23750
23751 let _ = self
23752 .table
23753 .get(2)
23754 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
23755
23756 let _ = self.table.get(3).map(|envelope| unsafe {
23757 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
23758 });
23759
23760 let _ = self.table.get(4).map(|envelope| unsafe {
23761 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
23762 });
23763 }
23764 }
23765
23766 impl ::fidl_next::Constrained for Dictionary<'_> {
23767 type Constraint = ();
23768
23769 fn validate(
23770 _: ::fidl_next::Slot<'_, Self>,
23771 _: Self::Constraint,
23772 ) -> Result<(), ::fidl_next::ValidationError> {
23773 Ok(())
23774 }
23775 }
23776
23777 unsafe impl ::fidl_next::Wire for Dictionary<'static> {
23778 type Narrowed<'de> = Dictionary<'de>;
23779
23780 #[inline]
23781 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23782 ::fidl_next::munge!(let Self { table } = out);
23783 ::fidl_next::wire::Table::zero_padding(table);
23784 }
23785 }
23786
23787 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Dictionary<'de>
23788 where
23789 ___D: ::fidl_next::Decoder<'de> + ?Sized,
23790 {
23791 fn decode(
23792 slot: ::fidl_next::Slot<'_, Self>,
23793 decoder: &mut ___D,
23794 _: (),
23795 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23796 ::fidl_next::munge!(let Self { table } = slot);
23797
23798 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
23799 match ordinal {
23800 0 => unsafe { ::core::hint::unreachable_unchecked() },
23801
23802 1 => {
23803 ::fidl_next::wire::Envelope::decode_as::<
23804 ___D,
23805 ::fidl_next::wire::String<'de>,
23806 >(slot.as_mut(), decoder, 100)?;
23807
23808 let value = unsafe {
23809 slot.deref_unchecked()
23810 .deref_unchecked::<::fidl_next::wire::String<'_>>()
23811 };
23812
23813 if value.len() > 100 {
23814 return Err(::fidl_next::DecodeError::VectorTooLong {
23815 size: value.len() as u64,
23816 limit: 100,
23817 });
23818 }
23819
23820 Ok(())
23821 }
23822
23823 2 => {
23824 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
23825 slot.as_mut(),
23826 decoder,
23827 (),
23828 )?;
23829
23830 Ok(())
23831 }
23832
23833 3 => {
23834 ::fidl_next::wire::Envelope::decode_as::<
23835 ___D,
23836 ::fidl_next::wire::String<'de>,
23837 >(slot.as_mut(), decoder, 1024)?;
23838
23839 let value = unsafe {
23840 slot.deref_unchecked()
23841 .deref_unchecked::<::fidl_next::wire::String<'_>>()
23842 };
23843
23844 if value.len() > 1024 {
23845 return Err(::fidl_next::DecodeError::VectorTooLong {
23846 size: value.len() as u64,
23847 limit: 1024,
23848 });
23849 }
23850
23851 Ok(())
23852 }
23853
23854 4 => {
23855 ::fidl_next::wire::Envelope::decode_as::<
23856 ___D,
23857 ::fidl_next::wire::String<'de>,
23858 >(slot.as_mut(), decoder, 1024)?;
23859
23860 let value = unsafe {
23861 slot.deref_unchecked()
23862 .deref_unchecked::<::fidl_next::wire::String<'_>>()
23863 };
23864
23865 if value.len() > 1024 {
23866 return Err(::fidl_next::DecodeError::VectorTooLong {
23867 size: value.len() as u64,
23868 limit: 1024,
23869 });
23870 }
23871
23872 Ok(())
23873 }
23874
23875 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
23876 }
23877 })
23878 }
23879 }
23880
23881 impl<'de> Dictionary<'de> {
23882 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
23883 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
23884 }
23885
23886 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
23887 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
23888 }
23889
23890 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
23891 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
23892 }
23893
23894 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
23895 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
23896 }
23897 }
23898
23899 impl<'de> ::core::fmt::Debug for Dictionary<'de> {
23900 fn fmt(
23901 &self,
23902 f: &mut ::core::fmt::Formatter<'_>,
23903 ) -> ::core::result::Result<(), ::core::fmt::Error> {
23904 f.debug_struct("Dictionary")
23905 .field("name", &self.name())
23906 .field("source", &self.source())
23907 .field("source_dictionary", &self.source_dictionary())
23908 .field("source_path", &self.source_path())
23909 .finish()
23910 }
23911 }
23912
23913 impl<'de> ::fidl_next::IntoNatural for Dictionary<'de> {
23914 type Natural = crate::natural::Dictionary;
23915 }
23916
23917 #[repr(transparent)]
23919 pub struct Capability<'de> {
23920 pub(crate) raw: ::fidl_next::wire::Union,
23921 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
23922 }
23923
23924 impl<'de> Drop for Capability<'de> {
23925 fn drop(&mut self) {
23926 match self.raw.ordinal() {
23927 1 => {
23928 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::Service<'de>>() };
23929 }
23930
23931 2 => {
23932 let _ =
23933 unsafe { self.raw.get().read_unchecked::<crate::wire::Protocol<'de>>() };
23934 }
23935
23936 3 => {
23937 let _ =
23938 unsafe { self.raw.get().read_unchecked::<crate::wire::Directory<'de>>() };
23939 }
23940
23941 4 => {
23942 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::Storage<'de>>() };
23943 }
23944
23945 5 => {
23946 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::Runner<'de>>() };
23947 }
23948
23949 6 => {
23950 let _ =
23951 unsafe { self.raw.get().read_unchecked::<crate::wire::Resolver<'de>>() };
23952 }
23953
23954 8 => {
23955 let _ =
23956 unsafe { self.raw.get().read_unchecked::<crate::wire::EventStream<'de>>() };
23957 }
23958
23959 9 => {
23960 let _ =
23961 unsafe { self.raw.get().read_unchecked::<crate::wire::Dictionary<'de>>() };
23962 }
23963
23964 10 => {
23965 let _ = unsafe {
23966 self.raw.get().read_unchecked::<crate::wire::Configuration<'de>>()
23967 };
23968 }
23969
23970 _ => (),
23971 }
23972 }
23973 }
23974
23975 impl ::fidl_next::Constrained for Capability<'_> {
23976 type Constraint = ();
23977
23978 fn validate(
23979 _: ::fidl_next::Slot<'_, Self>,
23980 _: Self::Constraint,
23981 ) -> Result<(), ::fidl_next::ValidationError> {
23982 Ok(())
23983 }
23984 }
23985
23986 unsafe impl ::fidl_next::Wire for Capability<'static> {
23987 type Narrowed<'de> = Capability<'de>;
23988
23989 #[inline]
23990 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23991 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
23992 ::fidl_next::wire::Union::zero_padding(raw);
23993 }
23994 }
23995
23996 pub mod capability {
23997 pub enum Ref<'de> {
23998 Service(&'de crate::wire::Service<'de>),
23999
24000 Protocol(&'de crate::wire::Protocol<'de>),
24001
24002 Directory(&'de crate::wire::Directory<'de>),
24003
24004 Storage(&'de crate::wire::Storage<'de>),
24005
24006 Runner(&'de crate::wire::Runner<'de>),
24007
24008 Resolver(&'de crate::wire::Resolver<'de>),
24009
24010 EventStream(&'de crate::wire::EventStream<'de>),
24011
24012 Dictionary(&'de crate::wire::Dictionary<'de>),
24013
24014 Config(&'de crate::wire::Configuration<'de>),
24015
24016 UnknownOrdinal_(u64),
24017 }
24018 }
24019
24020 impl<'de> Capability<'de> {
24021 pub fn as_ref(&self) -> crate::wire::capability::Ref<'_> {
24022 match self.raw.ordinal() {
24023 1 => crate::wire::capability::Ref::Service(unsafe {
24024 self.raw.get().deref_unchecked::<crate::wire::Service<'_>>()
24025 }),
24026
24027 2 => crate::wire::capability::Ref::Protocol(unsafe {
24028 self.raw.get().deref_unchecked::<crate::wire::Protocol<'_>>()
24029 }),
24030
24031 3 => crate::wire::capability::Ref::Directory(unsafe {
24032 self.raw.get().deref_unchecked::<crate::wire::Directory<'_>>()
24033 }),
24034
24035 4 => crate::wire::capability::Ref::Storage(unsafe {
24036 self.raw.get().deref_unchecked::<crate::wire::Storage<'_>>()
24037 }),
24038
24039 5 => crate::wire::capability::Ref::Runner(unsafe {
24040 self.raw.get().deref_unchecked::<crate::wire::Runner<'_>>()
24041 }),
24042
24043 6 => crate::wire::capability::Ref::Resolver(unsafe {
24044 self.raw.get().deref_unchecked::<crate::wire::Resolver<'_>>()
24045 }),
24046
24047 8 => crate::wire::capability::Ref::EventStream(unsafe {
24048 self.raw.get().deref_unchecked::<crate::wire::EventStream<'_>>()
24049 }),
24050
24051 9 => crate::wire::capability::Ref::Dictionary(unsafe {
24052 self.raw.get().deref_unchecked::<crate::wire::Dictionary<'_>>()
24053 }),
24054
24055 10 => crate::wire::capability::Ref::Config(unsafe {
24056 self.raw.get().deref_unchecked::<crate::wire::Configuration<'_>>()
24057 }),
24058
24059 unknown => crate::wire::capability::Ref::UnknownOrdinal_(unknown),
24060 }
24061 }
24062 }
24063
24064 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Capability<'de>
24065 where
24066 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
24067 ___D: ::fidl_next::Decoder<'de>,
24068 {
24069 fn decode(
24070 mut slot: ::fidl_next::Slot<'_, Self>,
24071 decoder: &mut ___D,
24072 _: (),
24073 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24074 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
24075 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
24076 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Service<'de>>(
24077 raw,
24078 decoder,
24079 (),
24080 )?,
24081
24082 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Protocol<'de>>(
24083 raw,
24084 decoder,
24085 (),
24086 )?,
24087
24088 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Directory<'de>>(
24089 raw,
24090 decoder,
24091 (),
24092 )?,
24093
24094 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Storage<'de>>(
24095 raw,
24096 decoder,
24097 (),
24098 )?,
24099
24100 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Runner<'de>>(
24101 raw,
24102 decoder,
24103 (),
24104 )?,
24105
24106 6 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Resolver<'de>>(
24107 raw,
24108 decoder,
24109 (),
24110 )?,
24111
24112 8 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::EventStream<'de>>(
24113 raw,
24114 decoder,
24115 (),
24116 )?,
24117
24118 9 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Dictionary<'de>>(
24119 raw,
24120 decoder,
24121 (),
24122 )?,
24123
24124 10 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Configuration<'de>>(
24125 raw,
24126 decoder,
24127 (),
24128 )?,
24129
24130 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
24131 }
24132
24133 Ok(())
24134 }
24135 }
24136
24137 impl<'de> ::core::fmt::Debug for Capability<'de> {
24138 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
24139 match self.raw.ordinal() {
24140 1 => unsafe { self.raw.get().deref_unchecked::<crate::wire::Service<'_>>().fmt(f) },
24141 2 => unsafe {
24142 self.raw.get().deref_unchecked::<crate::wire::Protocol<'_>>().fmt(f)
24143 },
24144 3 => unsafe {
24145 self.raw.get().deref_unchecked::<crate::wire::Directory<'_>>().fmt(f)
24146 },
24147 4 => unsafe { self.raw.get().deref_unchecked::<crate::wire::Storage<'_>>().fmt(f) },
24148 5 => unsafe { self.raw.get().deref_unchecked::<crate::wire::Runner<'_>>().fmt(f) },
24149 6 => unsafe {
24150 self.raw.get().deref_unchecked::<crate::wire::Resolver<'_>>().fmt(f)
24151 },
24152 8 => unsafe {
24153 self.raw.get().deref_unchecked::<crate::wire::EventStream<'_>>().fmt(f)
24154 },
24155 9 => unsafe {
24156 self.raw.get().deref_unchecked::<crate::wire::Dictionary<'_>>().fmt(f)
24157 },
24158 10 => unsafe {
24159 self.raw.get().deref_unchecked::<crate::wire::Configuration<'_>>().fmt(f)
24160 },
24161 _ => unsafe { ::core::hint::unreachable_unchecked() },
24162 }
24163 }
24164 }
24165
24166 impl<'de> ::fidl_next::IntoNatural for Capability<'de> {
24167 type Natural = crate::natural::Capability;
24168 }
24169
24170 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
24172 #[repr(transparent)]
24173 pub struct StartupMode {
24174 pub(crate) value: ::fidl_next::wire::Uint32,
24175 }
24176
24177 impl ::fidl_next::Constrained for StartupMode {
24178 type Constraint = ();
24179
24180 fn validate(
24181 _: ::fidl_next::Slot<'_, Self>,
24182 _: Self::Constraint,
24183 ) -> Result<(), ::fidl_next::ValidationError> {
24184 Ok(())
24185 }
24186 }
24187
24188 unsafe impl ::fidl_next::Wire for StartupMode {
24189 type Narrowed<'de> = Self;
24190
24191 #[inline]
24192 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
24193 }
24195 }
24196
24197 impl StartupMode {
24198 pub const LAZY: StartupMode = StartupMode { value: ::fidl_next::wire::Uint32(0) };
24199
24200 pub const EAGER: StartupMode = StartupMode { value: ::fidl_next::wire::Uint32(1) };
24201 }
24202
24203 unsafe impl<___D> ::fidl_next::Decode<___D> for StartupMode
24204 where
24205 ___D: ?Sized,
24206 {
24207 fn decode(
24208 slot: ::fidl_next::Slot<'_, Self>,
24209 _: &mut ___D,
24210 _: (),
24211 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24212 ::fidl_next::munge!(let Self { value } = slot);
24213
24214 match u32::from(*value) {
24215 0 | 1 => (),
24216 unknown => {
24217 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
24218 }
24219 }
24220
24221 Ok(())
24222 }
24223 }
24224
24225 impl ::core::convert::From<crate::natural::StartupMode> for StartupMode {
24226 fn from(natural: crate::natural::StartupMode) -> Self {
24227 match natural {
24228 crate::natural::StartupMode::Lazy => StartupMode::LAZY,
24229
24230 crate::natural::StartupMode::Eager => StartupMode::EAGER,
24231 }
24232 }
24233 }
24234
24235 impl ::fidl_next::IntoNatural for StartupMode {
24236 type Natural = crate::natural::StartupMode;
24237 }
24238
24239 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
24241 #[repr(transparent)]
24242 pub struct OnTerminate {
24243 pub(crate) value: ::fidl_next::wire::Uint32,
24244 }
24245
24246 impl ::fidl_next::Constrained for OnTerminate {
24247 type Constraint = ();
24248
24249 fn validate(
24250 _: ::fidl_next::Slot<'_, Self>,
24251 _: Self::Constraint,
24252 ) -> Result<(), ::fidl_next::ValidationError> {
24253 Ok(())
24254 }
24255 }
24256
24257 unsafe impl ::fidl_next::Wire for OnTerminate {
24258 type Narrowed<'de> = Self;
24259
24260 #[inline]
24261 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
24262 }
24264 }
24265
24266 impl OnTerminate {
24267 pub const NONE: OnTerminate = OnTerminate { value: ::fidl_next::wire::Uint32(0) };
24268
24269 pub const REBOOT: OnTerminate = OnTerminate { value: ::fidl_next::wire::Uint32(1) };
24270 }
24271
24272 unsafe impl<___D> ::fidl_next::Decode<___D> for OnTerminate
24273 where
24274 ___D: ?Sized,
24275 {
24276 fn decode(
24277 slot: ::fidl_next::Slot<'_, Self>,
24278 _: &mut ___D,
24279 _: (),
24280 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24281 ::fidl_next::munge!(let Self { value } = slot);
24282
24283 match u32::from(*value) {
24284 0 | 1 => (),
24285 unknown => {
24286 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
24287 }
24288 }
24289
24290 Ok(())
24291 }
24292 }
24293
24294 impl ::core::convert::From<crate::natural::OnTerminate> for OnTerminate {
24295 fn from(natural: crate::natural::OnTerminate) -> Self {
24296 match natural {
24297 crate::natural::OnTerminate::None => OnTerminate::NONE,
24298
24299 crate::natural::OnTerminate::Reboot => OnTerminate::REBOOT,
24300 }
24301 }
24302 }
24303
24304 impl ::fidl_next::IntoNatural for OnTerminate {
24305 type Natural = crate::natural::OnTerminate;
24306 }
24307
24308 pub type ConfigKey<'de> = ::fidl_next::wire::String<'de>;
24310
24311 #[repr(C)]
24313 pub struct ConfigOverride<'de> {
24314 pub(crate) table: ::fidl_next::wire::Table<'de>,
24315 }
24316
24317 impl<'de> Drop for ConfigOverride<'de> {
24318 fn drop(&mut self) {
24319 let _ = self.table.get(1).map(|envelope| unsafe {
24320 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
24321 });
24322
24323 let _ = self.table.get(2).map(|envelope| unsafe {
24324 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
24325 });
24326 }
24327 }
24328
24329 impl ::fidl_next::Constrained for ConfigOverride<'_> {
24330 type Constraint = ();
24331
24332 fn validate(
24333 _: ::fidl_next::Slot<'_, Self>,
24334 _: Self::Constraint,
24335 ) -> Result<(), ::fidl_next::ValidationError> {
24336 Ok(())
24337 }
24338 }
24339
24340 unsafe impl ::fidl_next::Wire for ConfigOverride<'static> {
24341 type Narrowed<'de> = ConfigOverride<'de>;
24342
24343 #[inline]
24344 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24345 ::fidl_next::munge!(let Self { table } = out);
24346 ::fidl_next::wire::Table::zero_padding(table);
24347 }
24348 }
24349
24350 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigOverride<'de>
24351 where
24352 ___D: ::fidl_next::Decoder<'de> + ?Sized,
24353 {
24354 fn decode(
24355 slot: ::fidl_next::Slot<'_, Self>,
24356 decoder: &mut ___D,
24357 _: (),
24358 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24359 ::fidl_next::munge!(let Self { table } = slot);
24360
24361 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
24362 match ordinal {
24363 0 => unsafe { ::core::hint::unreachable_unchecked() },
24364
24365 1 => {
24366 ::fidl_next::wire::Envelope::decode_as::<
24367 ___D,
24368 ::fidl_next::wire::String<'de>,
24369 >(slot.as_mut(), decoder, 64)?;
24370
24371 let value = unsafe {
24372 slot.deref_unchecked()
24373 .deref_unchecked::<::fidl_next::wire::String<'_>>()
24374 };
24375
24376 if value.len() > 64 {
24377 return Err(::fidl_next::DecodeError::VectorTooLong {
24378 size: value.len() as u64,
24379 limit: 64,
24380 });
24381 }
24382
24383 Ok(())
24384 }
24385
24386 2 => {
24387 ::fidl_next::wire::Envelope::decode_as::<
24388 ___D,
24389 crate::wire::ConfigValue<'de>,
24390 >(slot.as_mut(), decoder, ())?;
24391
24392 Ok(())
24393 }
24394
24395 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
24396 }
24397 })
24398 }
24399 }
24400
24401 impl<'de> ConfigOverride<'de> {
24402 pub fn key(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
24403 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
24404 }
24405
24406 pub fn value(&self) -> ::core::option::Option<&crate::wire::ConfigValue<'de>> {
24407 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
24408 }
24409 }
24410
24411 impl<'de> ::core::fmt::Debug for ConfigOverride<'de> {
24412 fn fmt(
24413 &self,
24414 f: &mut ::core::fmt::Formatter<'_>,
24415 ) -> ::core::result::Result<(), ::core::fmt::Error> {
24416 f.debug_struct("ConfigOverride")
24417 .field("key", &self.key())
24418 .field("value", &self.value())
24419 .finish()
24420 }
24421 }
24422
24423 impl<'de> ::fidl_next::IntoNatural for ConfigOverride<'de> {
24424 type Natural = crate::natural::ConfigOverride;
24425 }
24426
24427 #[repr(C)]
24429 pub struct Child<'de> {
24430 pub(crate) table: ::fidl_next::wire::Table<'de>,
24431 }
24432
24433 impl<'de> Drop for Child<'de> {
24434 fn drop(&mut self) {
24435 let _ = self.table.get(1).map(|envelope| unsafe {
24436 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
24437 });
24438
24439 let _ = self.table.get(2).map(|envelope| unsafe {
24440 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
24441 });
24442
24443 let _ = self
24444 .table
24445 .get(3)
24446 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::StartupMode>() });
24447
24448 let _ = self.table.get(4).map(|envelope| unsafe {
24449 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
24450 });
24451
24452 let _ = self
24453 .table
24454 .get(5)
24455 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::OnTerminate>() });
24456
24457 let _ = self.table.get(6)
24458 .map(|envelope| unsafe {
24459 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigOverride<'de>>>()
24460 });
24461 }
24462 }
24463
24464 impl ::fidl_next::Constrained for Child<'_> {
24465 type Constraint = ();
24466
24467 fn validate(
24468 _: ::fidl_next::Slot<'_, Self>,
24469 _: Self::Constraint,
24470 ) -> Result<(), ::fidl_next::ValidationError> {
24471 Ok(())
24472 }
24473 }
24474
24475 unsafe impl ::fidl_next::Wire for Child<'static> {
24476 type Narrowed<'de> = Child<'de>;
24477
24478 #[inline]
24479 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24480 ::fidl_next::munge!(let Self { table } = out);
24481 ::fidl_next::wire::Table::zero_padding(table);
24482 }
24483 }
24484
24485 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Child<'de>
24486 where
24487 ___D: ::fidl_next::Decoder<'de> + ?Sized,
24488 {
24489 fn decode(
24490 slot: ::fidl_next::Slot<'_, Self>,
24491 decoder: &mut ___D,
24492 _: (),
24493 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24494 ::fidl_next::munge!(let Self { table } = slot);
24495
24496 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
24497 match ordinal {
24498 0 => unsafe { ::core::hint::unreachable_unchecked() },
24499
24500 1 => {
24501 ::fidl_next::wire::Envelope::decode_as::<
24502 ___D,
24503 ::fidl_next::wire::String<'de>,
24504 >(slot.as_mut(), decoder, 1024)?;
24505
24506 let value = unsafe {
24507 slot.deref_unchecked()
24508 .deref_unchecked::<::fidl_next::wire::String<'_>>()
24509 };
24510
24511 if value.len() > 1024 {
24512 return Err(::fidl_next::DecodeError::VectorTooLong {
24513 size: value.len() as u64,
24514 limit: 1024,
24515 });
24516 }
24517
24518 Ok(())
24519 }
24520
24521 2 => {
24522 ::fidl_next::wire::Envelope::decode_as::<
24523 ___D,
24524 ::fidl_next::wire::String<'de>,
24525 >(slot.as_mut(), decoder, 4096)?;
24526
24527 let value = unsafe {
24528 slot.deref_unchecked()
24529 .deref_unchecked::<::fidl_next::wire::String<'_>>()
24530 };
24531
24532 if value.len() > 4096 {
24533 return Err(::fidl_next::DecodeError::VectorTooLong {
24534 size: value.len() as u64,
24535 limit: 4096,
24536 });
24537 }
24538
24539 Ok(())
24540 }
24541
24542 3 => {
24543 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::StartupMode>(
24544 slot.as_mut(),
24545 decoder,
24546 (),
24547 )?;
24548
24549 Ok(())
24550 }
24551
24552 4 => {
24553 ::fidl_next::wire::Envelope::decode_as::<
24554 ___D,
24555 ::fidl_next::wire::String<'de>,
24556 >(slot.as_mut(), decoder, 100)?;
24557
24558 let value = unsafe {
24559 slot.deref_unchecked()
24560 .deref_unchecked::<::fidl_next::wire::String<'_>>()
24561 };
24562
24563 if value.len() > 100 {
24564 return Err(::fidl_next::DecodeError::VectorTooLong {
24565 size: value.len() as u64,
24566 limit: 100,
24567 });
24568 }
24569
24570 Ok(())
24571 }
24572
24573 5 => {
24574 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::OnTerminate>(
24575 slot.as_mut(),
24576 decoder,
24577 (),
24578 )?;
24579
24580 Ok(())
24581 }
24582
24583 6 => {
24584 ::fidl_next::wire::Envelope::decode_as::<
24585 ___D,
24586 ::fidl_next::wire::Vector<'de, crate::wire::ConfigOverride<'de>>,
24587 >(slot.as_mut(), decoder, (4294967295, ()))?;
24588
24589 Ok(())
24590 }
24591
24592 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
24593 }
24594 })
24595 }
24596 }
24597
24598 impl<'de> Child<'de> {
24599 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
24600 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
24601 }
24602
24603 pub fn url(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
24604 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
24605 }
24606
24607 pub fn startup(&self) -> ::core::option::Option<&crate::wire::StartupMode> {
24608 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
24609 }
24610
24611 pub fn environment(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
24612 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
24613 }
24614
24615 pub fn on_terminate(&self) -> ::core::option::Option<&crate::wire::OnTerminate> {
24616 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
24617 }
24618
24619 pub fn config_overrides(
24620 &self,
24621 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::ConfigOverride<'de>>>
24622 {
24623 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
24624 }
24625 }
24626
24627 impl<'de> ::core::fmt::Debug for Child<'de> {
24628 fn fmt(
24629 &self,
24630 f: &mut ::core::fmt::Formatter<'_>,
24631 ) -> ::core::result::Result<(), ::core::fmt::Error> {
24632 f.debug_struct("Child")
24633 .field("name", &self.name())
24634 .field("url", &self.url())
24635 .field("startup", &self.startup())
24636 .field("environment", &self.environment())
24637 .field("on_terminate", &self.on_terminate())
24638 .field("config_overrides", &self.config_overrides())
24639 .finish()
24640 }
24641 }
24642
24643 impl<'de> ::fidl_next::IntoNatural for Child<'de> {
24644 type Natural = crate::natural::Child;
24645 }
24646
24647 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
24649 #[repr(transparent)]
24650 pub struct Durability {
24651 pub(crate) value: ::fidl_next::wire::Uint32,
24652 }
24653
24654 impl ::fidl_next::Constrained for Durability {
24655 type Constraint = ();
24656
24657 fn validate(
24658 _: ::fidl_next::Slot<'_, Self>,
24659 _: Self::Constraint,
24660 ) -> Result<(), ::fidl_next::ValidationError> {
24661 Ok(())
24662 }
24663 }
24664
24665 unsafe impl ::fidl_next::Wire for Durability {
24666 type Narrowed<'de> = Self;
24667
24668 #[inline]
24669 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
24670 }
24672 }
24673
24674 impl Durability {
24675 pub const TRANSIENT: Durability = Durability { value: ::fidl_next::wire::Uint32(2) };
24676
24677 pub const SINGLE_RUN: Durability = Durability { value: ::fidl_next::wire::Uint32(3) };
24678 }
24679
24680 unsafe impl<___D> ::fidl_next::Decode<___D> for Durability
24681 where
24682 ___D: ?Sized,
24683 {
24684 fn decode(
24685 slot: ::fidl_next::Slot<'_, Self>,
24686 _: &mut ___D,
24687 _: (),
24688 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24689 ::fidl_next::munge!(let Self { value } = slot);
24690
24691 match u32::from(*value) {
24692 2 | 3 => (),
24693 unknown => {
24694 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
24695 }
24696 }
24697
24698 Ok(())
24699 }
24700 }
24701
24702 impl ::core::convert::From<crate::natural::Durability> for Durability {
24703 fn from(natural: crate::natural::Durability) -> Self {
24704 match natural {
24705 crate::natural::Durability::Transient => Durability::TRANSIENT,
24706
24707 crate::natural::Durability::SingleRun => Durability::SINGLE_RUN,
24708 }
24709 }
24710 }
24711
24712 impl ::fidl_next::IntoNatural for Durability {
24713 type Natural = crate::natural::Durability;
24714 }
24715
24716 #[repr(C)]
24718 pub struct Collection<'de> {
24719 pub(crate) table: ::fidl_next::wire::Table<'de>,
24720 }
24721
24722 impl<'de> Drop for Collection<'de> {
24723 fn drop(&mut self) {
24724 let _ = self.table.get(1).map(|envelope| unsafe {
24725 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
24726 });
24727
24728 let _ = self
24729 .table
24730 .get(2)
24731 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Durability>() });
24732
24733 let _ = self.table.get(3).map(|envelope| unsafe {
24734 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
24735 });
24736
24737 let _ = self
24738 .table
24739 .get(4)
24740 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::AllowedOffers>() });
24741
24742 let _ = self.table.get(5).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
24743
24744 let _ = self.table.get(6).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
24745 }
24746 }
24747
24748 impl ::fidl_next::Constrained for Collection<'_> {
24749 type Constraint = ();
24750
24751 fn validate(
24752 _: ::fidl_next::Slot<'_, Self>,
24753 _: Self::Constraint,
24754 ) -> Result<(), ::fidl_next::ValidationError> {
24755 Ok(())
24756 }
24757 }
24758
24759 unsafe impl ::fidl_next::Wire for Collection<'static> {
24760 type Narrowed<'de> = Collection<'de>;
24761
24762 #[inline]
24763 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24764 ::fidl_next::munge!(let Self { table } = out);
24765 ::fidl_next::wire::Table::zero_padding(table);
24766 }
24767 }
24768
24769 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Collection<'de>
24770 where
24771 ___D: ::fidl_next::Decoder<'de> + ?Sized,
24772 {
24773 fn decode(
24774 slot: ::fidl_next::Slot<'_, Self>,
24775 decoder: &mut ___D,
24776 _: (),
24777 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24778 ::fidl_next::munge!(let Self { table } = slot);
24779
24780 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
24781 match ordinal {
24782 0 => unsafe { ::core::hint::unreachable_unchecked() },
24783
24784 1 => {
24785 ::fidl_next::wire::Envelope::decode_as::<
24786 ___D,
24787 ::fidl_next::wire::String<'de>,
24788 >(slot.as_mut(), decoder, 100)?;
24789
24790 let value = unsafe {
24791 slot.deref_unchecked()
24792 .deref_unchecked::<::fidl_next::wire::String<'_>>()
24793 };
24794
24795 if value.len() > 100 {
24796 return Err(::fidl_next::DecodeError::VectorTooLong {
24797 size: value.len() as u64,
24798 limit: 100,
24799 });
24800 }
24801
24802 Ok(())
24803 }
24804
24805 2 => {
24806 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Durability>(
24807 slot.as_mut(),
24808 decoder,
24809 (),
24810 )?;
24811
24812 Ok(())
24813 }
24814
24815 3 => {
24816 ::fidl_next::wire::Envelope::decode_as::<
24817 ___D,
24818 ::fidl_next::wire::String<'de>,
24819 >(slot.as_mut(), decoder, 100)?;
24820
24821 let value = unsafe {
24822 slot.deref_unchecked()
24823 .deref_unchecked::<::fidl_next::wire::String<'_>>()
24824 };
24825
24826 if value.len() > 100 {
24827 return Err(::fidl_next::DecodeError::VectorTooLong {
24828 size: value.len() as u64,
24829 limit: 100,
24830 });
24831 }
24832
24833 Ok(())
24834 }
24835
24836 4 => {
24837 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::AllowedOffers>(
24838 slot.as_mut(),
24839 decoder,
24840 (),
24841 )?;
24842
24843 Ok(())
24844 }
24845
24846 5 => {
24847 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
24848 slot.as_mut(),
24849 decoder,
24850 (),
24851 )?;
24852
24853 Ok(())
24854 }
24855
24856 6 => {
24857 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
24858 slot.as_mut(),
24859 decoder,
24860 (),
24861 )?;
24862
24863 Ok(())
24864 }
24865
24866 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
24867 }
24868 })
24869 }
24870 }
24871
24872 impl<'de> Collection<'de> {
24873 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
24874 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
24875 }
24876
24877 pub fn durability(&self) -> ::core::option::Option<&crate::wire::Durability> {
24878 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
24879 }
24880
24881 pub fn environment(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
24882 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
24883 }
24884
24885 pub fn allowed_offers(&self) -> ::core::option::Option<&crate::wire::AllowedOffers> {
24886 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
24887 }
24888
24889 pub fn allow_long_names(&self) -> ::core::option::Option<&bool> {
24890 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
24891 }
24892
24893 pub fn persistent_storage(&self) -> ::core::option::Option<&bool> {
24894 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
24895 }
24896 }
24897
24898 impl<'de> ::core::fmt::Debug for Collection<'de> {
24899 fn fmt(
24900 &self,
24901 f: &mut ::core::fmt::Formatter<'_>,
24902 ) -> ::core::result::Result<(), ::core::fmt::Error> {
24903 f.debug_struct("Collection")
24904 .field("name", &self.name())
24905 .field("durability", &self.durability())
24906 .field("environment", &self.environment())
24907 .field("allowed_offers", &self.allowed_offers())
24908 .field("allow_long_names", &self.allow_long_names())
24909 .field("persistent_storage", &self.persistent_storage())
24910 .finish()
24911 }
24912 }
24913
24914 impl<'de> ::fidl_next::IntoNatural for Collection<'de> {
24915 type Natural = crate::natural::Collection;
24916 }
24917
24918 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
24920 #[repr(transparent)]
24921 pub struct DependencyType {
24922 pub(crate) value: ::fidl_next::wire::Uint32,
24923 }
24924
24925 impl ::fidl_next::Constrained for DependencyType {
24926 type Constraint = ();
24927
24928 fn validate(
24929 _: ::fidl_next::Slot<'_, Self>,
24930 _: Self::Constraint,
24931 ) -> Result<(), ::fidl_next::ValidationError> {
24932 Ok(())
24933 }
24934 }
24935
24936 unsafe impl ::fidl_next::Wire for DependencyType {
24937 type Narrowed<'de> = Self;
24938
24939 #[inline]
24940 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
24941 }
24943 }
24944
24945 impl DependencyType {
24946 pub const STRONG: DependencyType = DependencyType { value: ::fidl_next::wire::Uint32(1) };
24947
24948 pub const WEAK: DependencyType = DependencyType { value: ::fidl_next::wire::Uint32(2) };
24949 }
24950
24951 unsafe impl<___D> ::fidl_next::Decode<___D> for DependencyType
24952 where
24953 ___D: ?Sized,
24954 {
24955 fn decode(
24956 slot: ::fidl_next::Slot<'_, Self>,
24957 _: &mut ___D,
24958 _: (),
24959 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24960 ::fidl_next::munge!(let Self { value } = slot);
24961
24962 match u32::from(*value) {
24963 1 | 2 => (),
24964 unknown => {
24965 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
24966 }
24967 }
24968
24969 Ok(())
24970 }
24971 }
24972
24973 impl ::core::convert::From<crate::natural::DependencyType> for DependencyType {
24974 fn from(natural: crate::natural::DependencyType) -> Self {
24975 match natural {
24976 crate::natural::DependencyType::Strong => DependencyType::STRONG,
24977
24978 crate::natural::DependencyType::Weak => DependencyType::WEAK,
24979 }
24980 }
24981 }
24982
24983 impl ::fidl_next::IntoNatural for DependencyType {
24984 type Natural = crate::natural::DependencyType;
24985 }
24986
24987 #[derive(Debug)]
24989 #[repr(C)]
24990 pub struct NameMapping<'de> {
24991 pub source_name: ::fidl_next::wire::String<'de>,
24992
24993 pub target_name: ::fidl_next::wire::String<'de>,
24994 }
24995
24996 static_assertions::const_assert_eq!(std::mem::size_of::<NameMapping<'_>>(), 32);
24997 static_assertions::const_assert_eq!(std::mem::align_of::<NameMapping<'_>>(), 8);
24998
24999 static_assertions::const_assert_eq!(std::mem::offset_of!(NameMapping<'_>, source_name), 0);
25000
25001 static_assertions::const_assert_eq!(std::mem::offset_of!(NameMapping<'_>, target_name), 16);
25002
25003 impl ::fidl_next::Constrained for NameMapping<'_> {
25004 type Constraint = ();
25005
25006 fn validate(
25007 _: ::fidl_next::Slot<'_, Self>,
25008 _: Self::Constraint,
25009 ) -> Result<(), ::fidl_next::ValidationError> {
25010 Ok(())
25011 }
25012 }
25013
25014 unsafe impl ::fidl_next::Wire for NameMapping<'static> {
25015 type Narrowed<'de> = NameMapping<'de>;
25016
25017 #[inline]
25018 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
25019 ::fidl_next::munge! {
25020 let Self {
25021 source_name,
25022 target_name,
25023
25024 } = &mut *out_;
25025 }
25026
25027 ::fidl_next::Wire::zero_padding(source_name);
25028
25029 ::fidl_next::Wire::zero_padding(target_name);
25030 }
25031 }
25032
25033 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NameMapping<'de>
25034 where
25035 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25036 ___D: ::fidl_next::Decoder<'de>,
25037 {
25038 fn decode(
25039 slot_: ::fidl_next::Slot<'_, Self>,
25040 decoder_: &mut ___D,
25041 _: (),
25042 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25043 ::fidl_next::munge! {
25044 let Self {
25045 mut source_name,
25046 mut target_name,
25047
25048 } = slot_;
25049 }
25050
25051 let _field = source_name.as_mut();
25052 ::fidl_next::Constrained::validate(_field, 100)?;
25053 ::fidl_next::Decode::decode(source_name.as_mut(), decoder_, 100)?;
25054
25055 let source_name = unsafe { source_name.deref_unchecked() };
25056
25057 if source_name.len() > 100 {
25058 return Err(::fidl_next::DecodeError::VectorTooLong {
25059 size: source_name.len() as u64,
25060 limit: 100,
25061 });
25062 }
25063
25064 let _field = target_name.as_mut();
25065 ::fidl_next::Constrained::validate(_field, 100)?;
25066 ::fidl_next::Decode::decode(target_name.as_mut(), decoder_, 100)?;
25067
25068 let target_name = unsafe { target_name.deref_unchecked() };
25069
25070 if target_name.len() > 100 {
25071 return Err(::fidl_next::DecodeError::VectorTooLong {
25072 size: target_name.len() as u64,
25073 limit: 100,
25074 });
25075 }
25076
25077 Ok(())
25078 }
25079 }
25080
25081 impl<'de> ::fidl_next::IntoNatural for NameMapping<'de> {
25082 type Natural = crate::natural::NameMapping;
25083 }
25084
25085 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
25087 #[repr(transparent)]
25088 pub struct EnvironmentExtends {
25089 pub(crate) value: ::fidl_next::wire::Uint32,
25090 }
25091
25092 impl ::fidl_next::Constrained for EnvironmentExtends {
25093 type Constraint = ();
25094
25095 fn validate(
25096 _: ::fidl_next::Slot<'_, Self>,
25097 _: Self::Constraint,
25098 ) -> Result<(), ::fidl_next::ValidationError> {
25099 Ok(())
25100 }
25101 }
25102
25103 unsafe impl ::fidl_next::Wire for EnvironmentExtends {
25104 type Narrowed<'de> = Self;
25105
25106 #[inline]
25107 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
25108 }
25110 }
25111
25112 impl EnvironmentExtends {
25113 pub const NONE: EnvironmentExtends =
25114 EnvironmentExtends { value: ::fidl_next::wire::Uint32(0) };
25115
25116 pub const REALM: EnvironmentExtends =
25117 EnvironmentExtends { value: ::fidl_next::wire::Uint32(1) };
25118 }
25119
25120 unsafe impl<___D> ::fidl_next::Decode<___D> for EnvironmentExtends
25121 where
25122 ___D: ?Sized,
25123 {
25124 fn decode(
25125 slot: ::fidl_next::Slot<'_, Self>,
25126 _: &mut ___D,
25127 _: (),
25128 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25129 ::fidl_next::munge!(let Self { value } = slot);
25130
25131 match u32::from(*value) {
25132 0 | 1 => (),
25133 unknown => {
25134 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
25135 }
25136 }
25137
25138 Ok(())
25139 }
25140 }
25141
25142 impl ::core::convert::From<crate::natural::EnvironmentExtends> for EnvironmentExtends {
25143 fn from(natural: crate::natural::EnvironmentExtends) -> Self {
25144 match natural {
25145 crate::natural::EnvironmentExtends::None => EnvironmentExtends::NONE,
25146
25147 crate::natural::EnvironmentExtends::Realm => EnvironmentExtends::REALM,
25148 }
25149 }
25150 }
25151
25152 impl ::fidl_next::IntoNatural for EnvironmentExtends {
25153 type Natural = crate::natural::EnvironmentExtends;
25154 }
25155
25156 pub type UrlScheme<'de> = ::fidl_next::wire::String<'de>;
25158
25159 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
25161 #[repr(transparent)]
25162 pub struct ConfigTypeLayout {
25163 pub(crate) value: ::fidl_next::wire::Uint32,
25164 }
25165
25166 impl ::fidl_next::Constrained for ConfigTypeLayout {
25167 type Constraint = ();
25168
25169 fn validate(
25170 _: ::fidl_next::Slot<'_, Self>,
25171 _: Self::Constraint,
25172 ) -> Result<(), ::fidl_next::ValidationError> {
25173 Ok(())
25174 }
25175 }
25176
25177 unsafe impl ::fidl_next::Wire for ConfigTypeLayout {
25178 type Narrowed<'de> = Self;
25179
25180 #[inline]
25181 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
25182 }
25184 }
25185
25186 impl ConfigTypeLayout {
25187 pub const BOOL: ConfigTypeLayout = ConfigTypeLayout { value: ::fidl_next::wire::Uint32(1) };
25188
25189 pub const UINT8: ConfigTypeLayout =
25190 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(2) };
25191
25192 pub const UINT16: ConfigTypeLayout =
25193 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(3) };
25194
25195 pub const UINT32: ConfigTypeLayout =
25196 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(4) };
25197
25198 pub const UINT64: ConfigTypeLayout =
25199 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(5) };
25200
25201 pub const INT8: ConfigTypeLayout = ConfigTypeLayout { value: ::fidl_next::wire::Uint32(6) };
25202
25203 pub const INT16: ConfigTypeLayout =
25204 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(7) };
25205
25206 pub const INT32: ConfigTypeLayout =
25207 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(8) };
25208
25209 pub const INT64: ConfigTypeLayout =
25210 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(9) };
25211
25212 pub const STRING: ConfigTypeLayout =
25213 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(10) };
25214
25215 pub const VECTOR: ConfigTypeLayout =
25216 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(11) };
25217 }
25218
25219 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigTypeLayout
25220 where
25221 ___D: ?Sized,
25222 {
25223 fn decode(
25224 slot: ::fidl_next::Slot<'_, Self>,
25225 _: &mut ___D,
25226 _: (),
25227 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25228 Ok(())
25229 }
25230 }
25231
25232 impl ::core::convert::From<crate::natural::ConfigTypeLayout> for ConfigTypeLayout {
25233 fn from(natural: crate::natural::ConfigTypeLayout) -> Self {
25234 match natural {
25235 crate::natural::ConfigTypeLayout::Bool => ConfigTypeLayout::BOOL,
25236
25237 crate::natural::ConfigTypeLayout::Uint8 => ConfigTypeLayout::UINT8,
25238
25239 crate::natural::ConfigTypeLayout::Uint16 => ConfigTypeLayout::UINT16,
25240
25241 crate::natural::ConfigTypeLayout::Uint32 => ConfigTypeLayout::UINT32,
25242
25243 crate::natural::ConfigTypeLayout::Uint64 => ConfigTypeLayout::UINT64,
25244
25245 crate::natural::ConfigTypeLayout::Int8 => ConfigTypeLayout::INT8,
25246
25247 crate::natural::ConfigTypeLayout::Int16 => ConfigTypeLayout::INT16,
25248
25249 crate::natural::ConfigTypeLayout::Int32 => ConfigTypeLayout::INT32,
25250
25251 crate::natural::ConfigTypeLayout::Int64 => ConfigTypeLayout::INT64,
25252
25253 crate::natural::ConfigTypeLayout::String => ConfigTypeLayout::STRING,
25254
25255 crate::natural::ConfigTypeLayout::Vector => ConfigTypeLayout::VECTOR,
25256
25257 crate::natural::ConfigTypeLayout::UnknownOrdinal_(value) => {
25258 ConfigTypeLayout { value: ::fidl_next::wire::Uint32::from(value) }
25259 }
25260 }
25261 }
25262 }
25263
25264 impl ::fidl_next::IntoNatural for ConfigTypeLayout {
25265 type Natural = crate::natural::ConfigTypeLayout;
25266 }
25267
25268 #[repr(transparent)]
25270 pub struct LayoutConstraint<'de> {
25271 pub(crate) raw: ::fidl_next::wire::Union,
25272 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
25273 }
25274
25275 impl<'de> Drop for LayoutConstraint<'de> {
25276 fn drop(&mut self) {
25277 match self.raw.ordinal() {
25278 1 => {
25279 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Uint32>() };
25280 }
25281
25282 _ => (),
25283 }
25284 }
25285 }
25286
25287 impl ::fidl_next::Constrained for LayoutConstraint<'_> {
25288 type Constraint = ();
25289
25290 fn validate(
25291 _: ::fidl_next::Slot<'_, Self>,
25292 _: Self::Constraint,
25293 ) -> Result<(), ::fidl_next::ValidationError> {
25294 Ok(())
25295 }
25296 }
25297
25298 unsafe impl ::fidl_next::Wire for LayoutConstraint<'static> {
25299 type Narrowed<'de> = LayoutConstraint<'de>;
25300
25301 #[inline]
25302 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25303 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
25304 ::fidl_next::wire::Union::zero_padding(raw);
25305 }
25306 }
25307
25308 pub mod layout_constraint {
25309 pub enum Ref<'de> {
25310 MaxSize(&'de ::fidl_next::wire::Uint32),
25311
25312 UnknownOrdinal_(u64),
25313 }
25314 }
25315
25316 impl<'de> LayoutConstraint<'de> {
25317 pub fn as_ref(&self) -> crate::wire::layout_constraint::Ref<'_> {
25318 match self.raw.ordinal() {
25319 1 => crate::wire::layout_constraint::Ref::MaxSize(unsafe {
25320 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint32>()
25321 }),
25322
25323 unknown => crate::wire::layout_constraint::Ref::UnknownOrdinal_(unknown),
25324 }
25325 }
25326 }
25327
25328 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LayoutConstraint<'de>
25329 where
25330 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25331 ___D: ::fidl_next::Decoder<'de>,
25332 {
25333 fn decode(
25334 mut slot: ::fidl_next::Slot<'_, Self>,
25335 decoder: &mut ___D,
25336 _: (),
25337 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25338 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
25339 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
25340 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint32>(
25341 raw,
25342 decoder,
25343 (),
25344 )?,
25345
25346 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
25347 }
25348
25349 Ok(())
25350 }
25351 }
25352
25353 impl<'de> ::core::fmt::Debug for LayoutConstraint<'de> {
25354 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
25355 match self.raw.ordinal() {
25356 1 => unsafe {
25357 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint32>().fmt(f)
25358 },
25359 _ => unsafe { ::core::hint::unreachable_unchecked() },
25360 }
25361 }
25362 }
25363
25364 impl<'de> ::fidl_next::IntoNatural for LayoutConstraint<'de> {
25365 type Natural = crate::natural::LayoutConstraint;
25366 }
25367
25368 #[derive(Debug)]
25370 #[repr(C)]
25371 pub struct ConfigType<'de> {
25372 pub layout: crate::wire::ConfigTypeLayout,
25373
25374 pub parameters: ::fidl_next::wire::OptionalVector<'de, crate::wire::LayoutParameter<'de>>,
25375
25376 pub constraints: ::fidl_next::wire::Vector<'de, crate::wire::LayoutConstraint<'de>>,
25377 }
25378
25379 static_assertions::const_assert_eq!(std::mem::size_of::<ConfigType<'_>>(), 40);
25380 static_assertions::const_assert_eq!(std::mem::align_of::<ConfigType<'_>>(), 8);
25381
25382 static_assertions::const_assert_eq!(std::mem::offset_of!(ConfigType<'_>, layout), 0);
25383
25384 static_assertions::const_assert_eq!(std::mem::offset_of!(ConfigType<'_>, parameters), 8);
25385
25386 static_assertions::const_assert_eq!(std::mem::offset_of!(ConfigType<'_>, constraints), 24);
25387
25388 impl ::fidl_next::Constrained for ConfigType<'_> {
25389 type Constraint = ();
25390
25391 fn validate(
25392 _: ::fidl_next::Slot<'_, Self>,
25393 _: Self::Constraint,
25394 ) -> Result<(), ::fidl_next::ValidationError> {
25395 Ok(())
25396 }
25397 }
25398
25399 unsafe impl ::fidl_next::Wire for ConfigType<'static> {
25400 type Narrowed<'de> = ConfigType<'de>;
25401
25402 #[inline]
25403 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
25404 ::fidl_next::munge! {
25405 let Self {
25406 layout,
25407 parameters,
25408 constraints,
25409
25410 } = &mut *out_;
25411 }
25412
25413 ::fidl_next::Wire::zero_padding(layout);
25414
25415 ::fidl_next::Wire::zero_padding(parameters);
25416
25417 ::fidl_next::Wire::zero_padding(constraints);
25418
25419 unsafe {
25420 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
25421 }
25422 }
25423 }
25424
25425 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigType<'de>
25426 where
25427 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25428 ___D: ::fidl_next::Decoder<'de>,
25429 {
25430 fn decode(
25431 slot_: ::fidl_next::Slot<'_, Self>,
25432 decoder_: &mut ___D,
25433 _: (),
25434 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25435 if slot_.as_bytes()[4..8] != [0u8; 4] {
25436 return Err(::fidl_next::DecodeError::InvalidPadding);
25437 }
25438
25439 ::fidl_next::munge! {
25440 let Self {
25441 mut layout,
25442 mut parameters,
25443 mut constraints,
25444
25445 } = slot_;
25446 }
25447
25448 let _field = layout.as_mut();
25449
25450 ::fidl_next::Decode::decode(layout.as_mut(), decoder_, ())?;
25451
25452 let _field = parameters.as_mut();
25453 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
25454 ::fidl_next::Decode::decode(parameters.as_mut(), decoder_, (4294967295, ()))?;
25455
25456 let _field = constraints.as_mut();
25457 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
25458 ::fidl_next::Decode::decode(constraints.as_mut(), decoder_, (4294967295, ()))?;
25459
25460 Ok(())
25461 }
25462 }
25463
25464 impl<'de> ::fidl_next::IntoNatural for ConfigType<'de> {
25465 type Natural = crate::natural::ConfigType;
25466 }
25467
25468 #[repr(transparent)]
25470 pub struct ConfigChecksum<'de> {
25471 pub(crate) raw: ::fidl_next::wire::Union,
25472 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
25473 }
25474
25475 impl<'de> Drop for ConfigChecksum<'de> {
25476 fn drop(&mut self) {
25477 match self.raw.ordinal() {
25478 1 => {
25479 let _ = unsafe { self.raw.get().read_unchecked::<[u8; 32]>() };
25480 }
25481
25482 _ => (),
25483 }
25484 }
25485 }
25486
25487 impl ::fidl_next::Constrained for ConfigChecksum<'_> {
25488 type Constraint = ();
25489
25490 fn validate(
25491 _: ::fidl_next::Slot<'_, Self>,
25492 _: Self::Constraint,
25493 ) -> Result<(), ::fidl_next::ValidationError> {
25494 Ok(())
25495 }
25496 }
25497
25498 unsafe impl ::fidl_next::Wire for ConfigChecksum<'static> {
25499 type Narrowed<'de> = ConfigChecksum<'de>;
25500
25501 #[inline]
25502 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25503 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
25504 ::fidl_next::wire::Union::zero_padding(raw);
25505 }
25506 }
25507
25508 pub mod config_checksum {
25509 pub enum Ref<'de> {
25510 Sha256(&'de [u8; 32]),
25511
25512 UnknownOrdinal_(u64),
25513 }
25514 }
25515
25516 impl<'de> ConfigChecksum<'de> {
25517 pub fn as_ref(&self) -> crate::wire::config_checksum::Ref<'_> {
25518 match self.raw.ordinal() {
25519 1 => crate::wire::config_checksum::Ref::Sha256(unsafe {
25520 self.raw.get().deref_unchecked::<[u8; 32]>()
25521 }),
25522
25523 unknown => crate::wire::config_checksum::Ref::UnknownOrdinal_(unknown),
25524 }
25525 }
25526 }
25527
25528 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigChecksum<'de>
25529 where
25530 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25531 ___D: ::fidl_next::Decoder<'de>,
25532 {
25533 fn decode(
25534 mut slot: ::fidl_next::Slot<'_, Self>,
25535 decoder: &mut ___D,
25536 _: (),
25537 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25538 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
25539 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
25540 1 => ::fidl_next::wire::Union::decode_as::<___D, [u8; 32]>(raw, decoder, ())?,
25541
25542 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
25543 }
25544
25545 Ok(())
25546 }
25547 }
25548
25549 impl<'de> ::core::fmt::Debug for ConfigChecksum<'de> {
25550 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
25551 match self.raw.ordinal() {
25552 1 => unsafe { self.raw.get().deref_unchecked::<[u8; 32]>().fmt(f) },
25553 _ => unsafe { ::core::hint::unreachable_unchecked() },
25554 }
25555 }
25556 }
25557
25558 impl<'de> ::fidl_next::IntoNatural for ConfigChecksum<'de> {
25559 type Natural = crate::natural::ConfigChecksum;
25560 }
25561
25562 #[repr(C)]
25564 pub struct UseStorage<'de> {
25565 pub(crate) table: ::fidl_next::wire::Table<'de>,
25566 }
25567
25568 impl<'de> Drop for UseStorage<'de> {
25569 fn drop(&mut self) {
25570 let _ = self.table.get(1).map(|envelope| unsafe {
25571 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
25572 });
25573
25574 let _ = self.table.get(2).map(|envelope| unsafe {
25575 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
25576 });
25577
25578 let _ = self
25579 .table
25580 .get(3)
25581 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
25582 }
25583 }
25584
25585 impl ::fidl_next::Constrained for UseStorage<'_> {
25586 type Constraint = ();
25587
25588 fn validate(
25589 _: ::fidl_next::Slot<'_, Self>,
25590 _: Self::Constraint,
25591 ) -> Result<(), ::fidl_next::ValidationError> {
25592 Ok(())
25593 }
25594 }
25595
25596 unsafe impl ::fidl_next::Wire for UseStorage<'static> {
25597 type Narrowed<'de> = UseStorage<'de>;
25598
25599 #[inline]
25600 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25601 ::fidl_next::munge!(let Self { table } = out);
25602 ::fidl_next::wire::Table::zero_padding(table);
25603 }
25604 }
25605
25606 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseStorage<'de>
25607 where
25608 ___D: ::fidl_next::Decoder<'de> + ?Sized,
25609 {
25610 fn decode(
25611 slot: ::fidl_next::Slot<'_, Self>,
25612 decoder: &mut ___D,
25613 _: (),
25614 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25615 ::fidl_next::munge!(let Self { table } = slot);
25616
25617 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
25618 match ordinal {
25619 0 => unsafe { ::core::hint::unreachable_unchecked() },
25620
25621 1 => {
25622 ::fidl_next::wire::Envelope::decode_as::<
25623 ___D,
25624 ::fidl_next::wire::String<'de>,
25625 >(slot.as_mut(), decoder, 100)?;
25626
25627 let value = unsafe {
25628 slot.deref_unchecked()
25629 .deref_unchecked::<::fidl_next::wire::String<'_>>()
25630 };
25631
25632 if value.len() > 100 {
25633 return Err(::fidl_next::DecodeError::VectorTooLong {
25634 size: value.len() as u64,
25635 limit: 100,
25636 });
25637 }
25638
25639 Ok(())
25640 }
25641
25642 2 => {
25643 ::fidl_next::wire::Envelope::decode_as::<
25644 ___D,
25645 ::fidl_next::wire::String<'de>,
25646 >(slot.as_mut(), decoder, 1024)?;
25647
25648 let value = unsafe {
25649 slot.deref_unchecked()
25650 .deref_unchecked::<::fidl_next::wire::String<'_>>()
25651 };
25652
25653 if value.len() > 1024 {
25654 return Err(::fidl_next::DecodeError::VectorTooLong {
25655 size: value.len() as u64,
25656 limit: 1024,
25657 });
25658 }
25659
25660 Ok(())
25661 }
25662
25663 3 => {
25664 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
25665 slot.as_mut(),
25666 decoder,
25667 (),
25668 )?;
25669
25670 Ok(())
25671 }
25672
25673 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
25674 }
25675 })
25676 }
25677 }
25678
25679 impl<'de> UseStorage<'de> {
25680 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
25681 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
25682 }
25683
25684 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
25685 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
25686 }
25687
25688 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
25689 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
25690 }
25691 }
25692
25693 impl<'de> ::core::fmt::Debug for UseStorage<'de> {
25694 fn fmt(
25695 &self,
25696 f: &mut ::core::fmt::Formatter<'_>,
25697 ) -> ::core::result::Result<(), ::core::fmt::Error> {
25698 f.debug_struct("UseStorage")
25699 .field("source_name", &self.source_name())
25700 .field("target_path", &self.target_path())
25701 .field("availability", &self.availability())
25702 .finish()
25703 }
25704 }
25705
25706 impl<'de> ::fidl_next::IntoNatural for UseStorage<'de> {
25707 type Natural = crate::natural::UseStorage;
25708 }
25709
25710 #[derive(Clone, Copy, Debug)]
25712 #[repr(transparent)]
25713 pub struct ConfigMutability {
25714 pub(crate) value: ::fidl_next::wire::Uint32,
25715 }
25716
25717 impl ::fidl_next::Constrained for ConfigMutability {
25718 type Constraint = ();
25719
25720 fn validate(
25721 _: ::fidl_next::Slot<'_, Self>,
25722 _: Self::Constraint,
25723 ) -> Result<(), ::fidl_next::ValidationError> {
25724 Ok(())
25725 }
25726 }
25727
25728 unsafe impl ::fidl_next::Wire for ConfigMutability {
25729 type Narrowed<'de> = Self;
25730
25731 #[inline]
25732 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
25733 }
25735 }
25736
25737 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigMutability
25738 where
25739 ___D: ?Sized,
25740 {
25741 fn decode(
25742 slot: ::fidl_next::Slot<'_, Self>,
25743 _: &mut ___D,
25744 _: (),
25745 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25746 Ok(())
25747 }
25748 }
25749
25750 impl ::core::convert::From<crate::natural::ConfigMutability> for ConfigMutability {
25751 fn from(natural: crate::natural::ConfigMutability) -> Self {
25752 Self { value: ::fidl_next::wire::Uint32::from(natural.bits()) }
25753 }
25754 }
25755
25756 impl ::fidl_next::IntoNatural for ConfigMutability {
25757 type Natural = crate::natural::ConfigMutability;
25758 }
25759
25760 #[repr(C)]
25762 pub struct ConfigField<'de> {
25763 pub(crate) table: ::fidl_next::wire::Table<'de>,
25764 }
25765
25766 impl<'de> Drop for ConfigField<'de> {
25767 fn drop(&mut self) {
25768 let _ = self.table.get(1).map(|envelope| unsafe {
25769 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
25770 });
25771
25772 let _ = self.table.get(2).map(|envelope| unsafe {
25773 envelope.read_unchecked::<crate::wire::ConfigType<'de>>()
25774 });
25775
25776 let _ = self.table.get(3).map(|envelope| unsafe {
25777 envelope.read_unchecked::<crate::wire::ConfigMutability>()
25778 });
25779 }
25780 }
25781
25782 impl ::fidl_next::Constrained for ConfigField<'_> {
25783 type Constraint = ();
25784
25785 fn validate(
25786 _: ::fidl_next::Slot<'_, Self>,
25787 _: Self::Constraint,
25788 ) -> Result<(), ::fidl_next::ValidationError> {
25789 Ok(())
25790 }
25791 }
25792
25793 unsafe impl ::fidl_next::Wire for ConfigField<'static> {
25794 type Narrowed<'de> = ConfigField<'de>;
25795
25796 #[inline]
25797 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25798 ::fidl_next::munge!(let Self { table } = out);
25799 ::fidl_next::wire::Table::zero_padding(table);
25800 }
25801 }
25802
25803 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigField<'de>
25804 where
25805 ___D: ::fidl_next::Decoder<'de> + ?Sized,
25806 {
25807 fn decode(
25808 slot: ::fidl_next::Slot<'_, Self>,
25809 decoder: &mut ___D,
25810 _: (),
25811 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25812 ::fidl_next::munge!(let Self { table } = slot);
25813
25814 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
25815 match ordinal {
25816 0 => unsafe { ::core::hint::unreachable_unchecked() },
25817
25818 1 => {
25819 ::fidl_next::wire::Envelope::decode_as::<
25820 ___D,
25821 ::fidl_next::wire::String<'de>,
25822 >(slot.as_mut(), decoder, 64)?;
25823
25824 let value = unsafe {
25825 slot.deref_unchecked()
25826 .deref_unchecked::<::fidl_next::wire::String<'_>>()
25827 };
25828
25829 if value.len() > 64 {
25830 return Err(::fidl_next::DecodeError::VectorTooLong {
25831 size: value.len() as u64,
25832 limit: 64,
25833 });
25834 }
25835
25836 Ok(())
25837 }
25838
25839 2 => {
25840 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::ConfigType<'de>>(
25841 slot.as_mut(),
25842 decoder,
25843 (),
25844 )?;
25845
25846 Ok(())
25847 }
25848
25849 3 => {
25850 ::fidl_next::wire::Envelope::decode_as::<
25851 ___D,
25852 crate::wire::ConfigMutability,
25853 >(slot.as_mut(), decoder, ())?;
25854
25855 Ok(())
25856 }
25857
25858 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
25859 }
25860 })
25861 }
25862 }
25863
25864 impl<'de> ConfigField<'de> {
25865 pub fn key(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
25866 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
25867 }
25868
25869 pub fn type_(&self) -> ::core::option::Option<&crate::wire::ConfigType<'de>> {
25870 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
25871 }
25872
25873 pub fn mutability(&self) -> ::core::option::Option<&crate::wire::ConfigMutability> {
25874 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
25875 }
25876 }
25877
25878 impl<'de> ::core::fmt::Debug for ConfigField<'de> {
25879 fn fmt(
25880 &self,
25881 f: &mut ::core::fmt::Formatter<'_>,
25882 ) -> ::core::result::Result<(), ::core::fmt::Error> {
25883 f.debug_struct("ConfigField")
25884 .field("key", &self.key())
25885 .field("type_", &self.type_())
25886 .field("mutability", &self.mutability())
25887 .finish()
25888 }
25889 }
25890
25891 impl<'de> ::fidl_next::IntoNatural for ConfigField<'de> {
25892 type Natural = crate::natural::ConfigField;
25893 }
25894
25895 #[repr(C)]
25897 pub struct Program<'de> {
25898 pub(crate) table: ::fidl_next::wire::Table<'de>,
25899 }
25900
25901 impl<'de> Drop for Program<'de> {
25902 fn drop(&mut self) {
25903 let _ = self.table.get(1).map(|envelope| unsafe {
25904 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
25905 });
25906
25907 let _ = self.table.get(2).map(|envelope| unsafe {
25908 envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>()
25909 });
25910 }
25911 }
25912
25913 impl ::fidl_next::Constrained for Program<'_> {
25914 type Constraint = ();
25915
25916 fn validate(
25917 _: ::fidl_next::Slot<'_, Self>,
25918 _: Self::Constraint,
25919 ) -> Result<(), ::fidl_next::ValidationError> {
25920 Ok(())
25921 }
25922 }
25923
25924 unsafe impl ::fidl_next::Wire for Program<'static> {
25925 type Narrowed<'de> = Program<'de>;
25926
25927 #[inline]
25928 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25929 ::fidl_next::munge!(let Self { table } = out);
25930 ::fidl_next::wire::Table::zero_padding(table);
25931 }
25932 }
25933
25934 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Program<'de>
25935 where
25936 ___D: ::fidl_next::Decoder<'de> + ?Sized,
25937 {
25938 fn decode(
25939 slot: ::fidl_next::Slot<'_, Self>,
25940 decoder: &mut ___D,
25941 _: (),
25942 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25943 ::fidl_next::munge!(let Self { table } = slot);
25944
25945 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
25946 match ordinal {
25947 0 => unsafe { ::core::hint::unreachable_unchecked() },
25948
25949 1 => {
25950 ::fidl_next::wire::Envelope::decode_as::<
25951 ___D,
25952 ::fidl_next::wire::String<'de>,
25953 >(slot.as_mut(), decoder, 100)?;
25954
25955 let value = unsafe {
25956 slot.deref_unchecked()
25957 .deref_unchecked::<::fidl_next::wire::String<'_>>()
25958 };
25959
25960 if value.len() > 100 {
25961 return Err(::fidl_next::DecodeError::VectorTooLong {
25962 size: value.len() as u64,
25963 limit: 100,
25964 });
25965 }
25966
25967 Ok(())
25968 }
25969
25970 2 => {
25971 ::fidl_next::wire::Envelope::decode_as::<
25972 ___D,
25973 ::fidl_next_common_fuchsia_data::wire::Dictionary<'de>,
25974 >(slot.as_mut(), decoder, ())?;
25975
25976 Ok(())
25977 }
25978
25979 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
25980 }
25981 })
25982 }
25983 }
25984
25985 impl<'de> Program<'de> {
25986 pub fn runner(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
25987 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
25988 }
25989
25990 pub fn info(
25991 &self,
25992 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>
25993 {
25994 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
25995 }
25996 }
25997
25998 impl<'de> ::core::fmt::Debug for Program<'de> {
25999 fn fmt(
26000 &self,
26001 f: &mut ::core::fmt::Formatter<'_>,
26002 ) -> ::core::result::Result<(), ::core::fmt::Error> {
26003 f.debug_struct("Program")
26004 .field("runner", &self.runner())
26005 .field("info", &self.info())
26006 .finish()
26007 }
26008 }
26009
26010 impl<'de> ::fidl_next::IntoNatural for Program<'de> {
26011 type Natural = crate::natural::Program;
26012 }
26013
26014 #[repr(C)]
26016 pub struct DebugInfo<'de> {
26017 pub(crate) table: ::fidl_next::wire::Table<'de>,
26018 }
26019
26020 impl<'de> Drop for DebugInfo<'de> {
26021 fn drop(&mut self) {
26022 let _ = self.table.get(1)
26023 .map(|envelope| unsafe {
26024 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
26025 });
26026 }
26027 }
26028
26029 impl ::fidl_next::Constrained for DebugInfo<'_> {
26030 type Constraint = ();
26031
26032 fn validate(
26033 _: ::fidl_next::Slot<'_, Self>,
26034 _: Self::Constraint,
26035 ) -> Result<(), ::fidl_next::ValidationError> {
26036 Ok(())
26037 }
26038 }
26039
26040 unsafe impl ::fidl_next::Wire for DebugInfo<'static> {
26041 type Narrowed<'de> = DebugInfo<'de>;
26042
26043 #[inline]
26044 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26045 ::fidl_next::munge!(let Self { table } = out);
26046 ::fidl_next::wire::Table::zero_padding(table);
26047 }
26048 }
26049
26050 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DebugInfo<'de>
26051 where
26052 ___D: ::fidl_next::Decoder<'de> + ?Sized,
26053 {
26054 fn decode(
26055 slot: ::fidl_next::Slot<'_, Self>,
26056 decoder: &mut ___D,
26057 _: (),
26058 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26059 ::fidl_next::munge!(let Self { table } = slot);
26060
26061 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
26062 match ordinal {
26063 0 => unsafe { ::core::hint::unreachable_unchecked() },
26064
26065 1 => {
26066 ::fidl_next::wire::Envelope::decode_as::<
26067 ___D,
26068 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>,
26069 >(slot.as_mut(), decoder, (4294967295, 4294967295))?;
26070
26071 Ok(())
26072 }
26073
26074 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
26075 }
26076 })
26077 }
26078 }
26079
26080 impl<'de> DebugInfo<'de> {
26081 pub fn manifest_sources(
26082 &self,
26083 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>
26084 {
26085 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26086 }
26087 }
26088
26089 impl<'de> ::core::fmt::Debug for DebugInfo<'de> {
26090 fn fmt(
26091 &self,
26092 f: &mut ::core::fmt::Formatter<'_>,
26093 ) -> ::core::result::Result<(), ::core::fmt::Error> {
26094 f.debug_struct("DebugInfo").field("manifest_sources", &self.manifest_sources()).finish()
26095 }
26096 }
26097
26098 impl<'de> ::fidl_next::IntoNatural for DebugInfo<'de> {
26099 type Natural = crate::natural::DebugInfo;
26100 }
26101
26102 #[repr(C)]
26104 pub struct UseService<'de> {
26105 pub(crate) table: ::fidl_next::wire::Table<'de>,
26106 }
26107
26108 impl<'de> Drop for UseService<'de> {
26109 fn drop(&mut self) {
26110 let _ = self
26111 .table
26112 .get(1)
26113 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
26114
26115 let _ = self.table.get(2).map(|envelope| unsafe {
26116 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
26117 });
26118
26119 let _ = self.table.get(3).map(|envelope| unsafe {
26120 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
26121 });
26122
26123 let _ = self.table.get(4).map(|envelope| unsafe {
26124 envelope.read_unchecked::<crate::wire::DependencyType>()
26125 });
26126
26127 let _ = self
26128 .table
26129 .get(5)
26130 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
26131
26132 let _ = self.table.get(6).map(|envelope| unsafe {
26133 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
26134 });
26135 }
26136 }
26137
26138 impl ::fidl_next::Constrained for UseService<'_> {
26139 type Constraint = ();
26140
26141 fn validate(
26142 _: ::fidl_next::Slot<'_, Self>,
26143 _: Self::Constraint,
26144 ) -> Result<(), ::fidl_next::ValidationError> {
26145 Ok(())
26146 }
26147 }
26148
26149 unsafe impl ::fidl_next::Wire for UseService<'static> {
26150 type Narrowed<'de> = UseService<'de>;
26151
26152 #[inline]
26153 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26154 ::fidl_next::munge!(let Self { table } = out);
26155 ::fidl_next::wire::Table::zero_padding(table);
26156 }
26157 }
26158
26159 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseService<'de>
26160 where
26161 ___D: ::fidl_next::Decoder<'de> + ?Sized,
26162 {
26163 fn decode(
26164 slot: ::fidl_next::Slot<'_, Self>,
26165 decoder: &mut ___D,
26166 _: (),
26167 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26168 ::fidl_next::munge!(let Self { table } = slot);
26169
26170 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
26171 match ordinal {
26172 0 => unsafe { ::core::hint::unreachable_unchecked() },
26173
26174 1 => {
26175 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
26176 slot.as_mut(),
26177 decoder,
26178 (),
26179 )?;
26180
26181 Ok(())
26182 }
26183
26184 2 => {
26185 ::fidl_next::wire::Envelope::decode_as::<
26186 ___D,
26187 ::fidl_next::wire::String<'de>,
26188 >(slot.as_mut(), decoder, 100)?;
26189
26190 let value = unsafe {
26191 slot.deref_unchecked()
26192 .deref_unchecked::<::fidl_next::wire::String<'_>>()
26193 };
26194
26195 if value.len() > 100 {
26196 return Err(::fidl_next::DecodeError::VectorTooLong {
26197 size: value.len() as u64,
26198 limit: 100,
26199 });
26200 }
26201
26202 Ok(())
26203 }
26204
26205 3 => {
26206 ::fidl_next::wire::Envelope::decode_as::<
26207 ___D,
26208 ::fidl_next::wire::String<'de>,
26209 >(slot.as_mut(), decoder, 1024)?;
26210
26211 let value = unsafe {
26212 slot.deref_unchecked()
26213 .deref_unchecked::<::fidl_next::wire::String<'_>>()
26214 };
26215
26216 if value.len() > 1024 {
26217 return Err(::fidl_next::DecodeError::VectorTooLong {
26218 size: value.len() as u64,
26219 limit: 1024,
26220 });
26221 }
26222
26223 Ok(())
26224 }
26225
26226 4 => {
26227 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
26228 slot.as_mut(),
26229 decoder,
26230 (),
26231 )?;
26232
26233 Ok(())
26234 }
26235
26236 5 => {
26237 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
26238 slot.as_mut(),
26239 decoder,
26240 (),
26241 )?;
26242
26243 Ok(())
26244 }
26245
26246 6 => {
26247 ::fidl_next::wire::Envelope::decode_as::<
26248 ___D,
26249 ::fidl_next::wire::String<'de>,
26250 >(slot.as_mut(), decoder, 1024)?;
26251
26252 let value = unsafe {
26253 slot.deref_unchecked()
26254 .deref_unchecked::<::fidl_next::wire::String<'_>>()
26255 };
26256
26257 if value.len() > 1024 {
26258 return Err(::fidl_next::DecodeError::VectorTooLong {
26259 size: value.len() as u64,
26260 limit: 1024,
26261 });
26262 }
26263
26264 Ok(())
26265 }
26266
26267 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
26268 }
26269 })
26270 }
26271 }
26272
26273 impl<'de> UseService<'de> {
26274 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
26275 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26276 }
26277
26278 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26279 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
26280 }
26281
26282 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26283 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
26284 }
26285
26286 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
26287 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
26288 }
26289
26290 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
26291 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
26292 }
26293
26294 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26295 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
26296 }
26297 }
26298
26299 impl<'de> ::core::fmt::Debug for UseService<'de> {
26300 fn fmt(
26301 &self,
26302 f: &mut ::core::fmt::Formatter<'_>,
26303 ) -> ::core::result::Result<(), ::core::fmt::Error> {
26304 f.debug_struct("UseService")
26305 .field("source", &self.source())
26306 .field("source_name", &self.source_name())
26307 .field("target_path", &self.target_path())
26308 .field("dependency_type", &self.dependency_type())
26309 .field("availability", &self.availability())
26310 .field("source_dictionary", &self.source_dictionary())
26311 .finish()
26312 }
26313 }
26314
26315 impl<'de> ::fidl_next::IntoNatural for UseService<'de> {
26316 type Natural = crate::natural::UseService;
26317 }
26318
26319 #[repr(C)]
26321 pub struct UseProtocol<'de> {
26322 pub(crate) table: ::fidl_next::wire::Table<'de>,
26323 }
26324
26325 impl<'de> Drop for UseProtocol<'de> {
26326 fn drop(&mut self) {
26327 let _ = self
26328 .table
26329 .get(1)
26330 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
26331
26332 let _ = self.table.get(2).map(|envelope| unsafe {
26333 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
26334 });
26335
26336 let _ = self.table.get(3).map(|envelope| unsafe {
26337 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
26338 });
26339
26340 let _ = self.table.get(4).map(|envelope| unsafe {
26341 envelope.read_unchecked::<crate::wire::DependencyType>()
26342 });
26343
26344 let _ = self
26345 .table
26346 .get(5)
26347 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
26348
26349 let _ = self.table.get(6).map(|envelope| unsafe {
26350 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
26351 });
26352
26353 let _ = self.table.get(7).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
26354 }
26355 }
26356
26357 impl ::fidl_next::Constrained for UseProtocol<'_> {
26358 type Constraint = ();
26359
26360 fn validate(
26361 _: ::fidl_next::Slot<'_, Self>,
26362 _: Self::Constraint,
26363 ) -> Result<(), ::fidl_next::ValidationError> {
26364 Ok(())
26365 }
26366 }
26367
26368 unsafe impl ::fidl_next::Wire for UseProtocol<'static> {
26369 type Narrowed<'de> = UseProtocol<'de>;
26370
26371 #[inline]
26372 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26373 ::fidl_next::munge!(let Self { table } = out);
26374 ::fidl_next::wire::Table::zero_padding(table);
26375 }
26376 }
26377
26378 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseProtocol<'de>
26379 where
26380 ___D: ::fidl_next::Decoder<'de> + ?Sized,
26381 {
26382 fn decode(
26383 slot: ::fidl_next::Slot<'_, Self>,
26384 decoder: &mut ___D,
26385 _: (),
26386 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26387 ::fidl_next::munge!(let Self { table } = slot);
26388
26389 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
26390 match ordinal {
26391 0 => unsafe { ::core::hint::unreachable_unchecked() },
26392
26393 1 => {
26394 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
26395 slot.as_mut(),
26396 decoder,
26397 (),
26398 )?;
26399
26400 Ok(())
26401 }
26402
26403 2 => {
26404 ::fidl_next::wire::Envelope::decode_as::<
26405 ___D,
26406 ::fidl_next::wire::String<'de>,
26407 >(slot.as_mut(), decoder, 100)?;
26408
26409 let value = unsafe {
26410 slot.deref_unchecked()
26411 .deref_unchecked::<::fidl_next::wire::String<'_>>()
26412 };
26413
26414 if value.len() > 100 {
26415 return Err(::fidl_next::DecodeError::VectorTooLong {
26416 size: value.len() as u64,
26417 limit: 100,
26418 });
26419 }
26420
26421 Ok(())
26422 }
26423
26424 3 => {
26425 ::fidl_next::wire::Envelope::decode_as::<
26426 ___D,
26427 ::fidl_next::wire::String<'de>,
26428 >(slot.as_mut(), decoder, 1024)?;
26429
26430 let value = unsafe {
26431 slot.deref_unchecked()
26432 .deref_unchecked::<::fidl_next::wire::String<'_>>()
26433 };
26434
26435 if value.len() > 1024 {
26436 return Err(::fidl_next::DecodeError::VectorTooLong {
26437 size: value.len() as u64,
26438 limit: 1024,
26439 });
26440 }
26441
26442 Ok(())
26443 }
26444
26445 4 => {
26446 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
26447 slot.as_mut(),
26448 decoder,
26449 (),
26450 )?;
26451
26452 Ok(())
26453 }
26454
26455 5 => {
26456 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
26457 slot.as_mut(),
26458 decoder,
26459 (),
26460 )?;
26461
26462 Ok(())
26463 }
26464
26465 6 => {
26466 ::fidl_next::wire::Envelope::decode_as::<
26467 ___D,
26468 ::fidl_next::wire::String<'de>,
26469 >(slot.as_mut(), decoder, 1024)?;
26470
26471 let value = unsafe {
26472 slot.deref_unchecked()
26473 .deref_unchecked::<::fidl_next::wire::String<'_>>()
26474 };
26475
26476 if value.len() > 1024 {
26477 return Err(::fidl_next::DecodeError::VectorTooLong {
26478 size: value.len() as u64,
26479 limit: 1024,
26480 });
26481 }
26482
26483 Ok(())
26484 }
26485
26486 7 => {
26487 ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
26488 slot.as_mut(),
26489 decoder,
26490 (),
26491 )?;
26492
26493 Ok(())
26494 }
26495
26496 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
26497 }
26498 })
26499 }
26500 }
26501
26502 impl<'de> UseProtocol<'de> {
26503 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
26504 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26505 }
26506
26507 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26508 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
26509 }
26510
26511 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26512 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
26513 }
26514
26515 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
26516 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
26517 }
26518
26519 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
26520 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
26521 }
26522
26523 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26524 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
26525 }
26526
26527 pub fn numbered_handle(&self) -> ::core::option::Option<&u8> {
26528 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
26529 }
26530 }
26531
26532 impl<'de> ::core::fmt::Debug for UseProtocol<'de> {
26533 fn fmt(
26534 &self,
26535 f: &mut ::core::fmt::Formatter<'_>,
26536 ) -> ::core::result::Result<(), ::core::fmt::Error> {
26537 f.debug_struct("UseProtocol")
26538 .field("source", &self.source())
26539 .field("source_name", &self.source_name())
26540 .field("target_path", &self.target_path())
26541 .field("dependency_type", &self.dependency_type())
26542 .field("availability", &self.availability())
26543 .field("source_dictionary", &self.source_dictionary())
26544 .field("numbered_handle", &self.numbered_handle())
26545 .finish()
26546 }
26547 }
26548
26549 impl<'de> ::fidl_next::IntoNatural for UseProtocol<'de> {
26550 type Natural = crate::natural::UseProtocol;
26551 }
26552
26553 #[repr(C)]
26555 pub struct UseDirectory<'de> {
26556 pub(crate) table: ::fidl_next::wire::Table<'de>,
26557 }
26558
26559 impl<'de> Drop for UseDirectory<'de> {
26560 fn drop(&mut self) {
26561 let _ = self
26562 .table
26563 .get(1)
26564 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
26565
26566 let _ = self.table.get(2).map(|envelope| unsafe {
26567 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
26568 });
26569
26570 let _ = self.table.get(3).map(|envelope| unsafe {
26571 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
26572 });
26573
26574 let _ = self.table.get(4).map(|envelope| unsafe {
26575 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
26576 });
26577
26578 let _ = self.table.get(5).map(|envelope| unsafe {
26579 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
26580 });
26581
26582 let _ = self.table.get(6).map(|envelope| unsafe {
26583 envelope.read_unchecked::<crate::wire::DependencyType>()
26584 });
26585
26586 let _ = self
26587 .table
26588 .get(7)
26589 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
26590
26591 let _ = self.table.get(8).map(|envelope| unsafe {
26592 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
26593 });
26594 }
26595 }
26596
26597 impl ::fidl_next::Constrained for UseDirectory<'_> {
26598 type Constraint = ();
26599
26600 fn validate(
26601 _: ::fidl_next::Slot<'_, Self>,
26602 _: Self::Constraint,
26603 ) -> Result<(), ::fidl_next::ValidationError> {
26604 Ok(())
26605 }
26606 }
26607
26608 unsafe impl ::fidl_next::Wire for UseDirectory<'static> {
26609 type Narrowed<'de> = UseDirectory<'de>;
26610
26611 #[inline]
26612 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26613 ::fidl_next::munge!(let Self { table } = out);
26614 ::fidl_next::wire::Table::zero_padding(table);
26615 }
26616 }
26617
26618 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseDirectory<'de>
26619 where
26620 ___D: ::fidl_next::Decoder<'de> + ?Sized,
26621 {
26622 fn decode(
26623 slot: ::fidl_next::Slot<'_, Self>,
26624 decoder: &mut ___D,
26625 _: (),
26626 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26627 ::fidl_next::munge!(let Self { table } = slot);
26628
26629 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
26630 match ordinal {
26631 0 => unsafe { ::core::hint::unreachable_unchecked() },
26632
26633 1 => {
26634 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
26635 slot.as_mut(),
26636 decoder,
26637 (),
26638 )?;
26639
26640 Ok(())
26641 }
26642
26643 2 => {
26644 ::fidl_next::wire::Envelope::decode_as::<
26645 ___D,
26646 ::fidl_next::wire::String<'de>,
26647 >(slot.as_mut(), decoder, 100)?;
26648
26649 let value = unsafe {
26650 slot.deref_unchecked()
26651 .deref_unchecked::<::fidl_next::wire::String<'_>>()
26652 };
26653
26654 if value.len() > 100 {
26655 return Err(::fidl_next::DecodeError::VectorTooLong {
26656 size: value.len() as u64,
26657 limit: 100,
26658 });
26659 }
26660
26661 Ok(())
26662 }
26663
26664 3 => {
26665 ::fidl_next::wire::Envelope::decode_as::<
26666 ___D,
26667 ::fidl_next::wire::String<'de>,
26668 >(slot.as_mut(), decoder, 1024)?;
26669
26670 let value = unsafe {
26671 slot.deref_unchecked()
26672 .deref_unchecked::<::fidl_next::wire::String<'_>>()
26673 };
26674
26675 if value.len() > 1024 {
26676 return Err(::fidl_next::DecodeError::VectorTooLong {
26677 size: value.len() as u64,
26678 limit: 1024,
26679 });
26680 }
26681
26682 Ok(())
26683 }
26684
26685 4 => {
26686 ::fidl_next::wire::Envelope::decode_as::<
26687 ___D,
26688 ::fidl_next_common_fuchsia_io::wire::Operations,
26689 >(slot.as_mut(), decoder, ())?;
26690
26691 Ok(())
26692 }
26693
26694 5 => {
26695 ::fidl_next::wire::Envelope::decode_as::<
26696 ___D,
26697 ::fidl_next::wire::String<'de>,
26698 >(slot.as_mut(), decoder, 1024)?;
26699
26700 let value = unsafe {
26701 slot.deref_unchecked()
26702 .deref_unchecked::<::fidl_next::wire::String<'_>>()
26703 };
26704
26705 if value.len() > 1024 {
26706 return Err(::fidl_next::DecodeError::VectorTooLong {
26707 size: value.len() as u64,
26708 limit: 1024,
26709 });
26710 }
26711
26712 Ok(())
26713 }
26714
26715 6 => {
26716 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
26717 slot.as_mut(),
26718 decoder,
26719 (),
26720 )?;
26721
26722 Ok(())
26723 }
26724
26725 7 => {
26726 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
26727 slot.as_mut(),
26728 decoder,
26729 (),
26730 )?;
26731
26732 Ok(())
26733 }
26734
26735 8 => {
26736 ::fidl_next::wire::Envelope::decode_as::<
26737 ___D,
26738 ::fidl_next::wire::String<'de>,
26739 >(slot.as_mut(), decoder, 1024)?;
26740
26741 let value = unsafe {
26742 slot.deref_unchecked()
26743 .deref_unchecked::<::fidl_next::wire::String<'_>>()
26744 };
26745
26746 if value.len() > 1024 {
26747 return Err(::fidl_next::DecodeError::VectorTooLong {
26748 size: value.len() as u64,
26749 limit: 1024,
26750 });
26751 }
26752
26753 Ok(())
26754 }
26755
26756 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
26757 }
26758 })
26759 }
26760 }
26761
26762 impl<'de> UseDirectory<'de> {
26763 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
26764 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26765 }
26766
26767 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26768 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
26769 }
26770
26771 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26772 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
26773 }
26774
26775 pub fn rights(
26776 &self,
26777 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_io::wire::Operations> {
26778 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
26779 }
26780
26781 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26782 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
26783 }
26784
26785 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
26786 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
26787 }
26788
26789 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
26790 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
26791 }
26792
26793 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26794 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
26795 }
26796 }
26797
26798 impl<'de> ::core::fmt::Debug for UseDirectory<'de> {
26799 fn fmt(
26800 &self,
26801 f: &mut ::core::fmt::Formatter<'_>,
26802 ) -> ::core::result::Result<(), ::core::fmt::Error> {
26803 f.debug_struct("UseDirectory")
26804 .field("source", &self.source())
26805 .field("source_name", &self.source_name())
26806 .field("target_path", &self.target_path())
26807 .field("rights", &self.rights())
26808 .field("subdir", &self.subdir())
26809 .field("dependency_type", &self.dependency_type())
26810 .field("availability", &self.availability())
26811 .field("source_dictionary", &self.source_dictionary())
26812 .finish()
26813 }
26814 }
26815
26816 impl<'de> ::fidl_next::IntoNatural for UseDirectory<'de> {
26817 type Natural = crate::natural::UseDirectory;
26818 }
26819
26820 #[repr(C)]
26822 pub struct UseEventStream<'de> {
26823 pub(crate) table: ::fidl_next::wire::Table<'de>,
26824 }
26825
26826 impl<'de> Drop for UseEventStream<'de> {
26827 fn drop(&mut self) {
26828 let _ = self.table.get(1).map(|envelope| unsafe {
26829 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
26830 });
26831
26832 let _ = self
26833 .table
26834 .get(2)
26835 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
26836
26837 let _ = self.table.get(3).map(|envelope| unsafe {
26838 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>()
26839 });
26840
26841 let _ = self.table.get(4).map(|envelope| unsafe {
26842 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
26843 });
26844
26845 let _ = self
26846 .table
26847 .get(5)
26848 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
26849
26850 let _ = self.table.get(6).map(|envelope| unsafe {
26851 envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>()
26852 });
26853 }
26854 }
26855
26856 impl ::fidl_next::Constrained for UseEventStream<'_> {
26857 type Constraint = ();
26858
26859 fn validate(
26860 _: ::fidl_next::Slot<'_, Self>,
26861 _: Self::Constraint,
26862 ) -> Result<(), ::fidl_next::ValidationError> {
26863 Ok(())
26864 }
26865 }
26866
26867 unsafe impl ::fidl_next::Wire for UseEventStream<'static> {
26868 type Narrowed<'de> = UseEventStream<'de>;
26869
26870 #[inline]
26871 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26872 ::fidl_next::munge!(let Self { table } = out);
26873 ::fidl_next::wire::Table::zero_padding(table);
26874 }
26875 }
26876
26877 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseEventStream<'de>
26878 where
26879 ___D: ::fidl_next::Decoder<'de> + ?Sized,
26880 {
26881 fn decode(
26882 slot: ::fidl_next::Slot<'_, Self>,
26883 decoder: &mut ___D,
26884 _: (),
26885 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26886 ::fidl_next::munge!(let Self { table } = slot);
26887
26888 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
26889 match ordinal {
26890 0 => unsafe { ::core::hint::unreachable_unchecked() },
26891
26892 1 => {
26893 ::fidl_next::wire::Envelope::decode_as::<
26894 ___D,
26895 ::fidl_next::wire::String<'de>,
26896 >(slot.as_mut(), decoder, 100)?;
26897
26898 let value = unsafe {
26899 slot.deref_unchecked()
26900 .deref_unchecked::<::fidl_next::wire::String<'_>>()
26901 };
26902
26903 if value.len() > 100 {
26904 return Err(::fidl_next::DecodeError::VectorTooLong {
26905 size: value.len() as u64,
26906 limit: 100,
26907 });
26908 }
26909
26910 Ok(())
26911 }
26912
26913 2 => {
26914 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
26915 slot.as_mut(),
26916 decoder,
26917 (),
26918 )?;
26919
26920 Ok(())
26921 }
26922
26923 3 => {
26924 ::fidl_next::wire::Envelope::decode_as::<
26925 ___D,
26926 ::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>,
26927 >(slot.as_mut(), decoder, (4294967295, ()))?;
26928
26929 Ok(())
26930 }
26931
26932 4 => {
26933 ::fidl_next::wire::Envelope::decode_as::<
26934 ___D,
26935 ::fidl_next::wire::String<'de>,
26936 >(slot.as_mut(), decoder, 100)?;
26937
26938 let value = unsafe {
26939 slot.deref_unchecked()
26940 .deref_unchecked::<::fidl_next::wire::String<'_>>()
26941 };
26942
26943 if value.len() > 100 {
26944 return Err(::fidl_next::DecodeError::VectorTooLong {
26945 size: value.len() as u64,
26946 limit: 100,
26947 });
26948 }
26949
26950 Ok(())
26951 }
26952
26953 5 => {
26954 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
26955 slot.as_mut(),
26956 decoder,
26957 (),
26958 )?;
26959
26960 Ok(())
26961 }
26962
26963 6 => {
26964 ::fidl_next::wire::Envelope::decode_as::<
26965 ___D,
26966 ::fidl_next_common_fuchsia_data::wire::Dictionary<'de>,
26967 >(slot.as_mut(), decoder, ())?;
26968
26969 Ok(())
26970 }
26971
26972 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
26973 }
26974 })
26975 }
26976 }
26977
26978 impl<'de> UseEventStream<'de> {
26979 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26980 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26981 }
26982
26983 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
26984 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
26985 }
26986
26987 pub fn scope(
26988 &self,
26989 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>
26990 {
26991 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
26992 }
26993
26994 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26995 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
26996 }
26997
26998 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
26999 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
27000 }
27001
27002 pub fn filter(
27003 &self,
27004 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>
27005 {
27006 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
27007 }
27008 }
27009
27010 impl<'de> ::core::fmt::Debug for UseEventStream<'de> {
27011 fn fmt(
27012 &self,
27013 f: &mut ::core::fmt::Formatter<'_>,
27014 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27015 f.debug_struct("UseEventStream")
27016 .field("source_name", &self.source_name())
27017 .field("source", &self.source())
27018 .field("scope", &self.scope())
27019 .field("target_path", &self.target_path())
27020 .field("availability", &self.availability())
27021 .field("filter", &self.filter())
27022 .finish()
27023 }
27024 }
27025
27026 impl<'de> ::fidl_next::IntoNatural for UseEventStream<'de> {
27027 type Natural = crate::natural::UseEventStream;
27028 }
27029
27030 #[repr(C)]
27032 pub struct UseRunner<'de> {
27033 pub(crate) table: ::fidl_next::wire::Table<'de>,
27034 }
27035
27036 impl<'de> Drop for UseRunner<'de> {
27037 fn drop(&mut self) {
27038 let _ = self
27039 .table
27040 .get(1)
27041 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
27042
27043 let _ = self.table.get(2).map(|envelope| unsafe {
27044 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27045 });
27046
27047 let _ = self.table.get(3).map(|envelope| unsafe {
27048 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27049 });
27050 }
27051 }
27052
27053 impl ::fidl_next::Constrained for UseRunner<'_> {
27054 type Constraint = ();
27055
27056 fn validate(
27057 _: ::fidl_next::Slot<'_, Self>,
27058 _: Self::Constraint,
27059 ) -> Result<(), ::fidl_next::ValidationError> {
27060 Ok(())
27061 }
27062 }
27063
27064 unsafe impl ::fidl_next::Wire for UseRunner<'static> {
27065 type Narrowed<'de> = UseRunner<'de>;
27066
27067 #[inline]
27068 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27069 ::fidl_next::munge!(let Self { table } = out);
27070 ::fidl_next::wire::Table::zero_padding(table);
27071 }
27072 }
27073
27074 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseRunner<'de>
27075 where
27076 ___D: ::fidl_next::Decoder<'de> + ?Sized,
27077 {
27078 fn decode(
27079 slot: ::fidl_next::Slot<'_, Self>,
27080 decoder: &mut ___D,
27081 _: (),
27082 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27083 ::fidl_next::munge!(let Self { table } = slot);
27084
27085 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27086 match ordinal {
27087 0 => unsafe { ::core::hint::unreachable_unchecked() },
27088
27089 1 => {
27090 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
27091 slot.as_mut(),
27092 decoder,
27093 (),
27094 )?;
27095
27096 Ok(())
27097 }
27098
27099 2 => {
27100 ::fidl_next::wire::Envelope::decode_as::<
27101 ___D,
27102 ::fidl_next::wire::String<'de>,
27103 >(slot.as_mut(), decoder, 100)?;
27104
27105 let value = unsafe {
27106 slot.deref_unchecked()
27107 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27108 };
27109
27110 if value.len() > 100 {
27111 return Err(::fidl_next::DecodeError::VectorTooLong {
27112 size: value.len() as u64,
27113 limit: 100,
27114 });
27115 }
27116
27117 Ok(())
27118 }
27119
27120 3 => {
27121 ::fidl_next::wire::Envelope::decode_as::<
27122 ___D,
27123 ::fidl_next::wire::String<'de>,
27124 >(slot.as_mut(), decoder, 1024)?;
27125
27126 let value = unsafe {
27127 slot.deref_unchecked()
27128 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27129 };
27130
27131 if value.len() > 1024 {
27132 return Err(::fidl_next::DecodeError::VectorTooLong {
27133 size: value.len() as u64,
27134 limit: 1024,
27135 });
27136 }
27137
27138 Ok(())
27139 }
27140
27141 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
27142 }
27143 })
27144 }
27145 }
27146
27147 impl<'de> UseRunner<'de> {
27148 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
27149 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27150 }
27151
27152 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27153 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27154 }
27155
27156 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27157 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27158 }
27159 }
27160
27161 impl<'de> ::core::fmt::Debug for UseRunner<'de> {
27162 fn fmt(
27163 &self,
27164 f: &mut ::core::fmt::Formatter<'_>,
27165 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27166 f.debug_struct("UseRunner")
27167 .field("source", &self.source())
27168 .field("source_name", &self.source_name())
27169 .field("source_dictionary", &self.source_dictionary())
27170 .finish()
27171 }
27172 }
27173
27174 impl<'de> ::fidl_next::IntoNatural for UseRunner<'de> {
27175 type Natural = crate::natural::UseRunner;
27176 }
27177
27178 #[repr(C)]
27180 pub struct UseConfiguration<'de> {
27181 pub(crate) table: ::fidl_next::wire::Table<'de>,
27182 }
27183
27184 impl<'de> Drop for UseConfiguration<'de> {
27185 fn drop(&mut self) {
27186 let _ = self
27187 .table
27188 .get(1)
27189 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
27190
27191 let _ = self.table.get(2).map(|envelope| unsafe {
27192 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27193 });
27194
27195 let _ = self.table.get(3).map(|envelope| unsafe {
27196 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27197 });
27198
27199 let _ = self
27200 .table
27201 .get(4)
27202 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
27203
27204 let _ = self.table.get(5).map(|envelope| unsafe {
27205 envelope.read_unchecked::<crate::wire::ConfigType<'de>>()
27206 });
27207
27208 let _ = self.table.get(6).map(|envelope| unsafe {
27209 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
27210 });
27211
27212 let _ = self.table.get(7).map(|envelope| unsafe {
27213 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27214 });
27215 }
27216 }
27217
27218 impl ::fidl_next::Constrained for UseConfiguration<'_> {
27219 type Constraint = ();
27220
27221 fn validate(
27222 _: ::fidl_next::Slot<'_, Self>,
27223 _: Self::Constraint,
27224 ) -> Result<(), ::fidl_next::ValidationError> {
27225 Ok(())
27226 }
27227 }
27228
27229 unsafe impl ::fidl_next::Wire for UseConfiguration<'static> {
27230 type Narrowed<'de> = UseConfiguration<'de>;
27231
27232 #[inline]
27233 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27234 ::fidl_next::munge!(let Self { table } = out);
27235 ::fidl_next::wire::Table::zero_padding(table);
27236 }
27237 }
27238
27239 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseConfiguration<'de>
27240 where
27241 ___D: ::fidl_next::Decoder<'de> + ?Sized,
27242 {
27243 fn decode(
27244 slot: ::fidl_next::Slot<'_, Self>,
27245 decoder: &mut ___D,
27246 _: (),
27247 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27248 ::fidl_next::munge!(let Self { table } = slot);
27249
27250 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27251 match ordinal {
27252 0 => unsafe { ::core::hint::unreachable_unchecked() },
27253
27254 1 => {
27255 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
27256 slot.as_mut(),
27257 decoder,
27258 (),
27259 )?;
27260
27261 Ok(())
27262 }
27263
27264 2 => {
27265 ::fidl_next::wire::Envelope::decode_as::<
27266 ___D,
27267 ::fidl_next::wire::String<'de>,
27268 >(slot.as_mut(), decoder, 100)?;
27269
27270 let value = unsafe {
27271 slot.deref_unchecked()
27272 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27273 };
27274
27275 if value.len() > 100 {
27276 return Err(::fidl_next::DecodeError::VectorTooLong {
27277 size: value.len() as u64,
27278 limit: 100,
27279 });
27280 }
27281
27282 Ok(())
27283 }
27284
27285 3 => {
27286 ::fidl_next::wire::Envelope::decode_as::<
27287 ___D,
27288 ::fidl_next::wire::String<'de>,
27289 >(slot.as_mut(), decoder, 100)?;
27290
27291 let value = unsafe {
27292 slot.deref_unchecked()
27293 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27294 };
27295
27296 if value.len() > 100 {
27297 return Err(::fidl_next::DecodeError::VectorTooLong {
27298 size: value.len() as u64,
27299 limit: 100,
27300 });
27301 }
27302
27303 Ok(())
27304 }
27305
27306 4 => {
27307 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
27308 slot.as_mut(),
27309 decoder,
27310 (),
27311 )?;
27312
27313 Ok(())
27314 }
27315
27316 5 => {
27317 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::ConfigType<'de>>(
27318 slot.as_mut(),
27319 decoder,
27320 (),
27321 )?;
27322
27323 Ok(())
27324 }
27325
27326 6 => {
27327 ::fidl_next::wire::Envelope::decode_as::<
27328 ___D,
27329 crate::wire::ConfigValue<'de>,
27330 >(slot.as_mut(), decoder, ())?;
27331
27332 Ok(())
27333 }
27334
27335 7 => {
27336 ::fidl_next::wire::Envelope::decode_as::<
27337 ___D,
27338 ::fidl_next::wire::String<'de>,
27339 >(slot.as_mut(), decoder, 1024)?;
27340
27341 let value = unsafe {
27342 slot.deref_unchecked()
27343 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27344 };
27345
27346 if value.len() > 1024 {
27347 return Err(::fidl_next::DecodeError::VectorTooLong {
27348 size: value.len() as u64,
27349 limit: 1024,
27350 });
27351 }
27352
27353 Ok(())
27354 }
27355
27356 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
27357 }
27358 })
27359 }
27360 }
27361
27362 impl<'de> UseConfiguration<'de> {
27363 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
27364 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27365 }
27366
27367 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27368 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27369 }
27370
27371 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27372 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27373 }
27374
27375 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
27376 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
27377 }
27378
27379 pub fn type_(&self) -> ::core::option::Option<&crate::wire::ConfigType<'de>> {
27380 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
27381 }
27382
27383 pub fn default(&self) -> ::core::option::Option<&crate::wire::ConfigValue<'de>> {
27384 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
27385 }
27386
27387 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27388 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
27389 }
27390 }
27391
27392 impl<'de> ::core::fmt::Debug for UseConfiguration<'de> {
27393 fn fmt(
27394 &self,
27395 f: &mut ::core::fmt::Formatter<'_>,
27396 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27397 f.debug_struct("UseConfiguration")
27398 .field("source", &self.source())
27399 .field("source_name", &self.source_name())
27400 .field("target_name", &self.target_name())
27401 .field("availability", &self.availability())
27402 .field("type_", &self.type_())
27403 .field("default", &self.default())
27404 .field("source_dictionary", &self.source_dictionary())
27405 .finish()
27406 }
27407 }
27408
27409 impl<'de> ::fidl_next::IntoNatural for UseConfiguration<'de> {
27410 type Natural = crate::natural::UseConfiguration;
27411 }
27412
27413 #[repr(C)]
27415 pub struct UseDictionary<'de> {
27416 pub(crate) table: ::fidl_next::wire::Table<'de>,
27417 }
27418
27419 impl<'de> Drop for UseDictionary<'de> {
27420 fn drop(&mut self) {
27421 let _ = self
27422 .table
27423 .get(1)
27424 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
27425
27426 let _ = self.table.get(2).map(|envelope| unsafe {
27427 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27428 });
27429
27430 let _ = self.table.get(3).map(|envelope| unsafe {
27431 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27432 });
27433
27434 let _ = self.table.get(6).map(|envelope| unsafe {
27435 envelope.read_unchecked::<crate::wire::DependencyType>()
27436 });
27437
27438 let _ = self
27439 .table
27440 .get(7)
27441 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
27442
27443 let _ = self.table.get(8).map(|envelope| unsafe {
27444 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27445 });
27446 }
27447 }
27448
27449 impl ::fidl_next::Constrained for UseDictionary<'_> {
27450 type Constraint = ();
27451
27452 fn validate(
27453 _: ::fidl_next::Slot<'_, Self>,
27454 _: Self::Constraint,
27455 ) -> Result<(), ::fidl_next::ValidationError> {
27456 Ok(())
27457 }
27458 }
27459
27460 unsafe impl ::fidl_next::Wire for UseDictionary<'static> {
27461 type Narrowed<'de> = UseDictionary<'de>;
27462
27463 #[inline]
27464 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27465 ::fidl_next::munge!(let Self { table } = out);
27466 ::fidl_next::wire::Table::zero_padding(table);
27467 }
27468 }
27469
27470 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseDictionary<'de>
27471 where
27472 ___D: ::fidl_next::Decoder<'de> + ?Sized,
27473 {
27474 fn decode(
27475 slot: ::fidl_next::Slot<'_, Self>,
27476 decoder: &mut ___D,
27477 _: (),
27478 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27479 ::fidl_next::munge!(let Self { table } = slot);
27480
27481 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27482 match ordinal {
27483 0 => unsafe { ::core::hint::unreachable_unchecked() },
27484
27485 1 => {
27486 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
27487 slot.as_mut(),
27488 decoder,
27489 (),
27490 )?;
27491
27492 Ok(())
27493 }
27494
27495 2 => {
27496 ::fidl_next::wire::Envelope::decode_as::<
27497 ___D,
27498 ::fidl_next::wire::String<'de>,
27499 >(slot.as_mut(), decoder, 100)?;
27500
27501 let value = unsafe {
27502 slot.deref_unchecked()
27503 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27504 };
27505
27506 if value.len() > 100 {
27507 return Err(::fidl_next::DecodeError::VectorTooLong {
27508 size: value.len() as u64,
27509 limit: 100,
27510 });
27511 }
27512
27513 Ok(())
27514 }
27515
27516 3 => {
27517 ::fidl_next::wire::Envelope::decode_as::<
27518 ___D,
27519 ::fidl_next::wire::String<'de>,
27520 >(slot.as_mut(), decoder, 1024)?;
27521
27522 let value = unsafe {
27523 slot.deref_unchecked()
27524 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27525 };
27526
27527 if value.len() > 1024 {
27528 return Err(::fidl_next::DecodeError::VectorTooLong {
27529 size: value.len() as u64,
27530 limit: 1024,
27531 });
27532 }
27533
27534 Ok(())
27535 }
27536
27537 6 => {
27538 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
27539 slot.as_mut(),
27540 decoder,
27541 (),
27542 )?;
27543
27544 Ok(())
27545 }
27546
27547 7 => {
27548 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
27549 slot.as_mut(),
27550 decoder,
27551 (),
27552 )?;
27553
27554 Ok(())
27555 }
27556
27557 8 => {
27558 ::fidl_next::wire::Envelope::decode_as::<
27559 ___D,
27560 ::fidl_next::wire::String<'de>,
27561 >(slot.as_mut(), decoder, 1024)?;
27562
27563 let value = unsafe {
27564 slot.deref_unchecked()
27565 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27566 };
27567
27568 if value.len() > 1024 {
27569 return Err(::fidl_next::DecodeError::VectorTooLong {
27570 size: value.len() as u64,
27571 limit: 1024,
27572 });
27573 }
27574
27575 Ok(())
27576 }
27577
27578 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
27579 }
27580 })
27581 }
27582 }
27583
27584 impl<'de> UseDictionary<'de> {
27585 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
27586 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27587 }
27588
27589 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27590 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27591 }
27592
27593 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27594 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27595 }
27596
27597 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
27598 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
27599 }
27600
27601 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
27602 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
27603 }
27604
27605 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27606 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
27607 }
27608 }
27609
27610 impl<'de> ::core::fmt::Debug for UseDictionary<'de> {
27611 fn fmt(
27612 &self,
27613 f: &mut ::core::fmt::Formatter<'_>,
27614 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27615 f.debug_struct("UseDictionary")
27616 .field("source", &self.source())
27617 .field("source_name", &self.source_name())
27618 .field("target_path", &self.target_path())
27619 .field("dependency_type", &self.dependency_type())
27620 .field("availability", &self.availability())
27621 .field("source_dictionary", &self.source_dictionary())
27622 .finish()
27623 }
27624 }
27625
27626 impl<'de> ::fidl_next::IntoNatural for UseDictionary<'de> {
27627 type Natural = crate::natural::UseDictionary;
27628 }
27629
27630 #[repr(transparent)]
27632 pub struct Use<'de> {
27633 pub(crate) raw: ::fidl_next::wire::Union,
27634 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
27635 }
27636
27637 impl<'de> Drop for Use<'de> {
27638 fn drop(&mut self) {
27639 match self.raw.ordinal() {
27640 1 => {
27641 let _ =
27642 unsafe { self.raw.get().read_unchecked::<crate::wire::UseService<'de>>() };
27643 }
27644
27645 2 => {
27646 let _ =
27647 unsafe { self.raw.get().read_unchecked::<crate::wire::UseProtocol<'de>>() };
27648 }
27649
27650 3 => {
27651 let _ = unsafe {
27652 self.raw.get().read_unchecked::<crate::wire::UseDirectory<'de>>()
27653 };
27654 }
27655
27656 4 => {
27657 let _ =
27658 unsafe { self.raw.get().read_unchecked::<crate::wire::UseStorage<'de>>() };
27659 }
27660
27661 7 => {
27662 let _ = unsafe {
27663 self.raw.get().read_unchecked::<crate::wire::UseEventStream<'de>>()
27664 };
27665 }
27666
27667 8 => {
27668 let _ =
27669 unsafe { self.raw.get().read_unchecked::<crate::wire::UseRunner<'de>>() };
27670 }
27671
27672 9 => {
27673 let _ = unsafe {
27674 self.raw.get().read_unchecked::<crate::wire::UseConfiguration<'de>>()
27675 };
27676 }
27677
27678 10 => {
27679 let _ = unsafe {
27680 self.raw.get().read_unchecked::<crate::wire::UseDictionary<'de>>()
27681 };
27682 }
27683
27684 _ => (),
27685 }
27686 }
27687 }
27688
27689 impl ::fidl_next::Constrained for Use<'_> {
27690 type Constraint = ();
27691
27692 fn validate(
27693 _: ::fidl_next::Slot<'_, Self>,
27694 _: Self::Constraint,
27695 ) -> Result<(), ::fidl_next::ValidationError> {
27696 Ok(())
27697 }
27698 }
27699
27700 unsafe impl ::fidl_next::Wire for Use<'static> {
27701 type Narrowed<'de> = Use<'de>;
27702
27703 #[inline]
27704 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27705 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
27706 ::fidl_next::wire::Union::zero_padding(raw);
27707 }
27708 }
27709
27710 pub mod use_ {
27711 pub enum Ref<'de> {
27712 Service(&'de crate::wire::UseService<'de>),
27713
27714 Protocol(&'de crate::wire::UseProtocol<'de>),
27715
27716 Directory(&'de crate::wire::UseDirectory<'de>),
27717
27718 Storage(&'de crate::wire::UseStorage<'de>),
27719
27720 EventStream(&'de crate::wire::UseEventStream<'de>),
27721
27722 Runner(&'de crate::wire::UseRunner<'de>),
27723
27724 Config(&'de crate::wire::UseConfiguration<'de>),
27725
27726 Dictionary(&'de crate::wire::UseDictionary<'de>),
27727
27728 UnknownOrdinal_(u64),
27729 }
27730 }
27731
27732 impl<'de> Use<'de> {
27733 pub fn as_ref(&self) -> crate::wire::use_::Ref<'_> {
27734 match self.raw.ordinal() {
27735 1 => crate::wire::use_::Ref::Service(unsafe {
27736 self.raw.get().deref_unchecked::<crate::wire::UseService<'_>>()
27737 }),
27738
27739 2 => crate::wire::use_::Ref::Protocol(unsafe {
27740 self.raw.get().deref_unchecked::<crate::wire::UseProtocol<'_>>()
27741 }),
27742
27743 3 => crate::wire::use_::Ref::Directory(unsafe {
27744 self.raw.get().deref_unchecked::<crate::wire::UseDirectory<'_>>()
27745 }),
27746
27747 4 => crate::wire::use_::Ref::Storage(unsafe {
27748 self.raw.get().deref_unchecked::<crate::wire::UseStorage<'_>>()
27749 }),
27750
27751 7 => crate::wire::use_::Ref::EventStream(unsafe {
27752 self.raw.get().deref_unchecked::<crate::wire::UseEventStream<'_>>()
27753 }),
27754
27755 8 => crate::wire::use_::Ref::Runner(unsafe {
27756 self.raw.get().deref_unchecked::<crate::wire::UseRunner<'_>>()
27757 }),
27758
27759 9 => crate::wire::use_::Ref::Config(unsafe {
27760 self.raw.get().deref_unchecked::<crate::wire::UseConfiguration<'_>>()
27761 }),
27762
27763 10 => crate::wire::use_::Ref::Dictionary(unsafe {
27764 self.raw.get().deref_unchecked::<crate::wire::UseDictionary<'_>>()
27765 }),
27766
27767 unknown => crate::wire::use_::Ref::UnknownOrdinal_(unknown),
27768 }
27769 }
27770 }
27771
27772 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Use<'de>
27773 where
27774 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
27775 ___D: ::fidl_next::Decoder<'de>,
27776 {
27777 fn decode(
27778 mut slot: ::fidl_next::Slot<'_, Self>,
27779 decoder: &mut ___D,
27780 _: (),
27781 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27782 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
27783 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
27784 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseService<'de>>(
27785 raw,
27786 decoder,
27787 (),
27788 )?,
27789
27790 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseProtocol<'de>>(
27791 raw,
27792 decoder,
27793 (),
27794 )?,
27795
27796 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseDirectory<'de>>(
27797 raw,
27798 decoder,
27799 (),
27800 )?,
27801
27802 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseStorage<'de>>(
27803 raw,
27804 decoder,
27805 (),
27806 )?,
27807
27808 7 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseEventStream<'de>>(
27809 raw,
27810 decoder,
27811 (),
27812 )?,
27813
27814 8 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseRunner<'de>>(
27815 raw,
27816 decoder,
27817 (),
27818 )?,
27819
27820 9 => {
27821 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseConfiguration<'de>>(
27822 raw,
27823 decoder,
27824 (),
27825 )?
27826 }
27827
27828 10 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseDictionary<'de>>(
27829 raw,
27830 decoder,
27831 (),
27832 )?,
27833
27834 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
27835 }
27836
27837 Ok(())
27838 }
27839 }
27840
27841 impl<'de> ::core::fmt::Debug for Use<'de> {
27842 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
27843 match self.raw.ordinal() {
27844 1 => unsafe {
27845 self.raw.get().deref_unchecked::<crate::wire::UseService<'_>>().fmt(f)
27846 },
27847 2 => unsafe {
27848 self.raw.get().deref_unchecked::<crate::wire::UseProtocol<'_>>().fmt(f)
27849 },
27850 3 => unsafe {
27851 self.raw.get().deref_unchecked::<crate::wire::UseDirectory<'_>>().fmt(f)
27852 },
27853 4 => unsafe {
27854 self.raw.get().deref_unchecked::<crate::wire::UseStorage<'_>>().fmt(f)
27855 },
27856 7 => unsafe {
27857 self.raw.get().deref_unchecked::<crate::wire::UseEventStream<'_>>().fmt(f)
27858 },
27859 8 => unsafe {
27860 self.raw.get().deref_unchecked::<crate::wire::UseRunner<'_>>().fmt(f)
27861 },
27862 9 => unsafe {
27863 self.raw.get().deref_unchecked::<crate::wire::UseConfiguration<'_>>().fmt(f)
27864 },
27865 10 => unsafe {
27866 self.raw.get().deref_unchecked::<crate::wire::UseDictionary<'_>>().fmt(f)
27867 },
27868 _ => unsafe { ::core::hint::unreachable_unchecked() },
27869 }
27870 }
27871 }
27872
27873 impl<'de> ::fidl_next::IntoNatural for Use<'de> {
27874 type Natural = crate::natural::Use;
27875 }
27876
27877 #[repr(C)]
27879 pub struct ExposeService<'de> {
27880 pub(crate) table: ::fidl_next::wire::Table<'de>,
27881 }
27882
27883 impl<'de> Drop for ExposeService<'de> {
27884 fn drop(&mut self) {
27885 let _ = self
27886 .table
27887 .get(1)
27888 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
27889
27890 let _ = self.table.get(2).map(|envelope| unsafe {
27891 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27892 });
27893
27894 let _ = self
27895 .table
27896 .get(3)
27897 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
27898
27899 let _ = self.table.get(4).map(|envelope| unsafe {
27900 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27901 });
27902
27903 let _ = self
27904 .table
27905 .get(5)
27906 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
27907
27908 let _ = self.table.get(6).map(|envelope| unsafe {
27909 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27910 });
27911 }
27912 }
27913
27914 impl ::fidl_next::Constrained for ExposeService<'_> {
27915 type Constraint = ();
27916
27917 fn validate(
27918 _: ::fidl_next::Slot<'_, Self>,
27919 _: Self::Constraint,
27920 ) -> Result<(), ::fidl_next::ValidationError> {
27921 Ok(())
27922 }
27923 }
27924
27925 unsafe impl ::fidl_next::Wire for ExposeService<'static> {
27926 type Narrowed<'de> = ExposeService<'de>;
27927
27928 #[inline]
27929 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27930 ::fidl_next::munge!(let Self { table } = out);
27931 ::fidl_next::wire::Table::zero_padding(table);
27932 }
27933 }
27934
27935 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExposeService<'de>
27936 where
27937 ___D: ::fidl_next::Decoder<'de> + ?Sized,
27938 {
27939 fn decode(
27940 slot: ::fidl_next::Slot<'_, Self>,
27941 decoder: &mut ___D,
27942 _: (),
27943 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27944 ::fidl_next::munge!(let Self { table } = slot);
27945
27946 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27947 match ordinal {
27948 0 => unsafe { ::core::hint::unreachable_unchecked() },
27949
27950 1 => {
27951 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
27952 slot.as_mut(),
27953 decoder,
27954 (),
27955 )?;
27956
27957 Ok(())
27958 }
27959
27960 2 => {
27961 ::fidl_next::wire::Envelope::decode_as::<
27962 ___D,
27963 ::fidl_next::wire::String<'de>,
27964 >(slot.as_mut(), decoder, 100)?;
27965
27966 let value = unsafe {
27967 slot.deref_unchecked()
27968 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27969 };
27970
27971 if value.len() > 100 {
27972 return Err(::fidl_next::DecodeError::VectorTooLong {
27973 size: value.len() as u64,
27974 limit: 100,
27975 });
27976 }
27977
27978 Ok(())
27979 }
27980
27981 3 => {
27982 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
27983 slot.as_mut(),
27984 decoder,
27985 (),
27986 )?;
27987
27988 Ok(())
27989 }
27990
27991 4 => {
27992 ::fidl_next::wire::Envelope::decode_as::<
27993 ___D,
27994 ::fidl_next::wire::String<'de>,
27995 >(slot.as_mut(), decoder, 100)?;
27996
27997 let value = unsafe {
27998 slot.deref_unchecked()
27999 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28000 };
28001
28002 if value.len() > 100 {
28003 return Err(::fidl_next::DecodeError::VectorTooLong {
28004 size: value.len() as u64,
28005 limit: 100,
28006 });
28007 }
28008
28009 Ok(())
28010 }
28011
28012 5 => {
28013 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
28014 slot.as_mut(),
28015 decoder,
28016 (),
28017 )?;
28018
28019 Ok(())
28020 }
28021
28022 6 => {
28023 ::fidl_next::wire::Envelope::decode_as::<
28024 ___D,
28025 ::fidl_next::wire::String<'de>,
28026 >(slot.as_mut(), decoder, 1024)?;
28027
28028 let value = unsafe {
28029 slot.deref_unchecked()
28030 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28031 };
28032
28033 if value.len() > 1024 {
28034 return Err(::fidl_next::DecodeError::VectorTooLong {
28035 size: value.len() as u64,
28036 limit: 1024,
28037 });
28038 }
28039
28040 Ok(())
28041 }
28042
28043 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
28044 }
28045 })
28046 }
28047 }
28048
28049 impl<'de> ExposeService<'de> {
28050 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28051 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28052 }
28053
28054 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28055 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28056 }
28057
28058 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28059 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28060 }
28061
28062 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28063 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
28064 }
28065
28066 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
28067 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
28068 }
28069
28070 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28071 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
28072 }
28073 }
28074
28075 impl<'de> ::core::fmt::Debug for ExposeService<'de> {
28076 fn fmt(
28077 &self,
28078 f: &mut ::core::fmt::Formatter<'_>,
28079 ) -> ::core::result::Result<(), ::core::fmt::Error> {
28080 f.debug_struct("ExposeService")
28081 .field("source", &self.source())
28082 .field("source_name", &self.source_name())
28083 .field("target", &self.target())
28084 .field("target_name", &self.target_name())
28085 .field("availability", &self.availability())
28086 .field("source_dictionary", &self.source_dictionary())
28087 .finish()
28088 }
28089 }
28090
28091 impl<'de> ::fidl_next::IntoNatural for ExposeService<'de> {
28092 type Natural = crate::natural::ExposeService;
28093 }
28094
28095 #[repr(C)]
28097 pub struct ExposeProtocol<'de> {
28098 pub(crate) table: ::fidl_next::wire::Table<'de>,
28099 }
28100
28101 impl<'de> Drop for ExposeProtocol<'de> {
28102 fn drop(&mut self) {
28103 let _ = self
28104 .table
28105 .get(1)
28106 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28107
28108 let _ = self.table.get(2).map(|envelope| unsafe {
28109 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28110 });
28111
28112 let _ = self
28113 .table
28114 .get(3)
28115 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28116
28117 let _ = self.table.get(4).map(|envelope| unsafe {
28118 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28119 });
28120
28121 let _ = self
28122 .table
28123 .get(5)
28124 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
28125
28126 let _ = self.table.get(6).map(|envelope| unsafe {
28127 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28128 });
28129 }
28130 }
28131
28132 impl ::fidl_next::Constrained for ExposeProtocol<'_> {
28133 type Constraint = ();
28134
28135 fn validate(
28136 _: ::fidl_next::Slot<'_, Self>,
28137 _: Self::Constraint,
28138 ) -> Result<(), ::fidl_next::ValidationError> {
28139 Ok(())
28140 }
28141 }
28142
28143 unsafe impl ::fidl_next::Wire for ExposeProtocol<'static> {
28144 type Narrowed<'de> = ExposeProtocol<'de>;
28145
28146 #[inline]
28147 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28148 ::fidl_next::munge!(let Self { table } = out);
28149 ::fidl_next::wire::Table::zero_padding(table);
28150 }
28151 }
28152
28153 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExposeProtocol<'de>
28154 where
28155 ___D: ::fidl_next::Decoder<'de> + ?Sized,
28156 {
28157 fn decode(
28158 slot: ::fidl_next::Slot<'_, Self>,
28159 decoder: &mut ___D,
28160 _: (),
28161 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28162 ::fidl_next::munge!(let Self { table } = slot);
28163
28164 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28165 match ordinal {
28166 0 => unsafe { ::core::hint::unreachable_unchecked() },
28167
28168 1 => {
28169 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
28170 slot.as_mut(),
28171 decoder,
28172 (),
28173 )?;
28174
28175 Ok(())
28176 }
28177
28178 2 => {
28179 ::fidl_next::wire::Envelope::decode_as::<
28180 ___D,
28181 ::fidl_next::wire::String<'de>,
28182 >(slot.as_mut(), decoder, 100)?;
28183
28184 let value = unsafe {
28185 slot.deref_unchecked()
28186 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28187 };
28188
28189 if value.len() > 100 {
28190 return Err(::fidl_next::DecodeError::VectorTooLong {
28191 size: value.len() as u64,
28192 limit: 100,
28193 });
28194 }
28195
28196 Ok(())
28197 }
28198
28199 3 => {
28200 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
28201 slot.as_mut(),
28202 decoder,
28203 (),
28204 )?;
28205
28206 Ok(())
28207 }
28208
28209 4 => {
28210 ::fidl_next::wire::Envelope::decode_as::<
28211 ___D,
28212 ::fidl_next::wire::String<'de>,
28213 >(slot.as_mut(), decoder, 100)?;
28214
28215 let value = unsafe {
28216 slot.deref_unchecked()
28217 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28218 };
28219
28220 if value.len() > 100 {
28221 return Err(::fidl_next::DecodeError::VectorTooLong {
28222 size: value.len() as u64,
28223 limit: 100,
28224 });
28225 }
28226
28227 Ok(())
28228 }
28229
28230 5 => {
28231 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
28232 slot.as_mut(),
28233 decoder,
28234 (),
28235 )?;
28236
28237 Ok(())
28238 }
28239
28240 6 => {
28241 ::fidl_next::wire::Envelope::decode_as::<
28242 ___D,
28243 ::fidl_next::wire::String<'de>,
28244 >(slot.as_mut(), decoder, 1024)?;
28245
28246 let value = unsafe {
28247 slot.deref_unchecked()
28248 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28249 };
28250
28251 if value.len() > 1024 {
28252 return Err(::fidl_next::DecodeError::VectorTooLong {
28253 size: value.len() as u64,
28254 limit: 1024,
28255 });
28256 }
28257
28258 Ok(())
28259 }
28260
28261 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
28262 }
28263 })
28264 }
28265 }
28266
28267 impl<'de> ExposeProtocol<'de> {
28268 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28269 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28270 }
28271
28272 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28273 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28274 }
28275
28276 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28277 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28278 }
28279
28280 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28281 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
28282 }
28283
28284 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
28285 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
28286 }
28287
28288 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28289 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
28290 }
28291 }
28292
28293 impl<'de> ::core::fmt::Debug for ExposeProtocol<'de> {
28294 fn fmt(
28295 &self,
28296 f: &mut ::core::fmt::Formatter<'_>,
28297 ) -> ::core::result::Result<(), ::core::fmt::Error> {
28298 f.debug_struct("ExposeProtocol")
28299 .field("source", &self.source())
28300 .field("source_name", &self.source_name())
28301 .field("target", &self.target())
28302 .field("target_name", &self.target_name())
28303 .field("availability", &self.availability())
28304 .field("source_dictionary", &self.source_dictionary())
28305 .finish()
28306 }
28307 }
28308
28309 impl<'de> ::fidl_next::IntoNatural for ExposeProtocol<'de> {
28310 type Natural = crate::natural::ExposeProtocol;
28311 }
28312
28313 #[repr(C)]
28315 pub struct ExposeDirectory<'de> {
28316 pub(crate) table: ::fidl_next::wire::Table<'de>,
28317 }
28318
28319 impl<'de> Drop for ExposeDirectory<'de> {
28320 fn drop(&mut self) {
28321 let _ = self
28322 .table
28323 .get(1)
28324 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28325
28326 let _ = self.table.get(2).map(|envelope| unsafe {
28327 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28328 });
28329
28330 let _ = self
28331 .table
28332 .get(3)
28333 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28334
28335 let _ = self.table.get(4).map(|envelope| unsafe {
28336 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28337 });
28338
28339 let _ = self.table.get(5).map(|envelope| unsafe {
28340 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
28341 });
28342
28343 let _ = self.table.get(6).map(|envelope| unsafe {
28344 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28345 });
28346
28347 let _ = self
28348 .table
28349 .get(7)
28350 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
28351
28352 let _ = self.table.get(8).map(|envelope| unsafe {
28353 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28354 });
28355 }
28356 }
28357
28358 impl ::fidl_next::Constrained for ExposeDirectory<'_> {
28359 type Constraint = ();
28360
28361 fn validate(
28362 _: ::fidl_next::Slot<'_, Self>,
28363 _: Self::Constraint,
28364 ) -> Result<(), ::fidl_next::ValidationError> {
28365 Ok(())
28366 }
28367 }
28368
28369 unsafe impl ::fidl_next::Wire for ExposeDirectory<'static> {
28370 type Narrowed<'de> = ExposeDirectory<'de>;
28371
28372 #[inline]
28373 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28374 ::fidl_next::munge!(let Self { table } = out);
28375 ::fidl_next::wire::Table::zero_padding(table);
28376 }
28377 }
28378
28379 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExposeDirectory<'de>
28380 where
28381 ___D: ::fidl_next::Decoder<'de> + ?Sized,
28382 {
28383 fn decode(
28384 slot: ::fidl_next::Slot<'_, Self>,
28385 decoder: &mut ___D,
28386 _: (),
28387 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28388 ::fidl_next::munge!(let Self { table } = slot);
28389
28390 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28391 match ordinal {
28392 0 => unsafe { ::core::hint::unreachable_unchecked() },
28393
28394 1 => {
28395 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
28396 slot.as_mut(),
28397 decoder,
28398 (),
28399 )?;
28400
28401 Ok(())
28402 }
28403
28404 2 => {
28405 ::fidl_next::wire::Envelope::decode_as::<
28406 ___D,
28407 ::fidl_next::wire::String<'de>,
28408 >(slot.as_mut(), decoder, 100)?;
28409
28410 let value = unsafe {
28411 slot.deref_unchecked()
28412 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28413 };
28414
28415 if value.len() > 100 {
28416 return Err(::fidl_next::DecodeError::VectorTooLong {
28417 size: value.len() as u64,
28418 limit: 100,
28419 });
28420 }
28421
28422 Ok(())
28423 }
28424
28425 3 => {
28426 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
28427 slot.as_mut(),
28428 decoder,
28429 (),
28430 )?;
28431
28432 Ok(())
28433 }
28434
28435 4 => {
28436 ::fidl_next::wire::Envelope::decode_as::<
28437 ___D,
28438 ::fidl_next::wire::String<'de>,
28439 >(slot.as_mut(), decoder, 100)?;
28440
28441 let value = unsafe {
28442 slot.deref_unchecked()
28443 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28444 };
28445
28446 if value.len() > 100 {
28447 return Err(::fidl_next::DecodeError::VectorTooLong {
28448 size: value.len() as u64,
28449 limit: 100,
28450 });
28451 }
28452
28453 Ok(())
28454 }
28455
28456 5 => {
28457 ::fidl_next::wire::Envelope::decode_as::<
28458 ___D,
28459 ::fidl_next_common_fuchsia_io::wire::Operations,
28460 >(slot.as_mut(), decoder, ())?;
28461
28462 Ok(())
28463 }
28464
28465 6 => {
28466 ::fidl_next::wire::Envelope::decode_as::<
28467 ___D,
28468 ::fidl_next::wire::String<'de>,
28469 >(slot.as_mut(), decoder, 1024)?;
28470
28471 let value = unsafe {
28472 slot.deref_unchecked()
28473 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28474 };
28475
28476 if value.len() > 1024 {
28477 return Err(::fidl_next::DecodeError::VectorTooLong {
28478 size: value.len() as u64,
28479 limit: 1024,
28480 });
28481 }
28482
28483 Ok(())
28484 }
28485
28486 7 => {
28487 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
28488 slot.as_mut(),
28489 decoder,
28490 (),
28491 )?;
28492
28493 Ok(())
28494 }
28495
28496 8 => {
28497 ::fidl_next::wire::Envelope::decode_as::<
28498 ___D,
28499 ::fidl_next::wire::String<'de>,
28500 >(slot.as_mut(), decoder, 1024)?;
28501
28502 let value = unsafe {
28503 slot.deref_unchecked()
28504 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28505 };
28506
28507 if value.len() > 1024 {
28508 return Err(::fidl_next::DecodeError::VectorTooLong {
28509 size: value.len() as u64,
28510 limit: 1024,
28511 });
28512 }
28513
28514 Ok(())
28515 }
28516
28517 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
28518 }
28519 })
28520 }
28521 }
28522
28523 impl<'de> ExposeDirectory<'de> {
28524 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28525 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28526 }
28527
28528 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28529 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28530 }
28531
28532 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28533 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28534 }
28535
28536 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28537 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
28538 }
28539
28540 pub fn rights(
28541 &self,
28542 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_io::wire::Operations> {
28543 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
28544 }
28545
28546 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28547 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
28548 }
28549
28550 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
28551 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
28552 }
28553
28554 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28555 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
28556 }
28557 }
28558
28559 impl<'de> ::core::fmt::Debug for ExposeDirectory<'de> {
28560 fn fmt(
28561 &self,
28562 f: &mut ::core::fmt::Formatter<'_>,
28563 ) -> ::core::result::Result<(), ::core::fmt::Error> {
28564 f.debug_struct("ExposeDirectory")
28565 .field("source", &self.source())
28566 .field("source_name", &self.source_name())
28567 .field("target", &self.target())
28568 .field("target_name", &self.target_name())
28569 .field("rights", &self.rights())
28570 .field("subdir", &self.subdir())
28571 .field("availability", &self.availability())
28572 .field("source_dictionary", &self.source_dictionary())
28573 .finish()
28574 }
28575 }
28576
28577 impl<'de> ::fidl_next::IntoNatural for ExposeDirectory<'de> {
28578 type Natural = crate::natural::ExposeDirectory;
28579 }
28580
28581 #[repr(C)]
28583 pub struct ExposeRunner<'de> {
28584 pub(crate) table: ::fidl_next::wire::Table<'de>,
28585 }
28586
28587 impl<'de> Drop for ExposeRunner<'de> {
28588 fn drop(&mut self) {
28589 let _ = self
28590 .table
28591 .get(1)
28592 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28593
28594 let _ = self.table.get(2).map(|envelope| unsafe {
28595 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28596 });
28597
28598 let _ = self
28599 .table
28600 .get(3)
28601 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28602
28603 let _ = self.table.get(4).map(|envelope| unsafe {
28604 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28605 });
28606
28607 let _ = self.table.get(6).map(|envelope| unsafe {
28608 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28609 });
28610 }
28611 }
28612
28613 impl ::fidl_next::Constrained for ExposeRunner<'_> {
28614 type Constraint = ();
28615
28616 fn validate(
28617 _: ::fidl_next::Slot<'_, Self>,
28618 _: Self::Constraint,
28619 ) -> Result<(), ::fidl_next::ValidationError> {
28620 Ok(())
28621 }
28622 }
28623
28624 unsafe impl ::fidl_next::Wire for ExposeRunner<'static> {
28625 type Narrowed<'de> = ExposeRunner<'de>;
28626
28627 #[inline]
28628 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28629 ::fidl_next::munge!(let Self { table } = out);
28630 ::fidl_next::wire::Table::zero_padding(table);
28631 }
28632 }
28633
28634 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExposeRunner<'de>
28635 where
28636 ___D: ::fidl_next::Decoder<'de> + ?Sized,
28637 {
28638 fn decode(
28639 slot: ::fidl_next::Slot<'_, Self>,
28640 decoder: &mut ___D,
28641 _: (),
28642 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28643 ::fidl_next::munge!(let Self { table } = slot);
28644
28645 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28646 match ordinal {
28647 0 => unsafe { ::core::hint::unreachable_unchecked() },
28648
28649 1 => {
28650 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
28651 slot.as_mut(),
28652 decoder,
28653 (),
28654 )?;
28655
28656 Ok(())
28657 }
28658
28659 2 => {
28660 ::fidl_next::wire::Envelope::decode_as::<
28661 ___D,
28662 ::fidl_next::wire::String<'de>,
28663 >(slot.as_mut(), decoder, 100)?;
28664
28665 let value = unsafe {
28666 slot.deref_unchecked()
28667 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28668 };
28669
28670 if value.len() > 100 {
28671 return Err(::fidl_next::DecodeError::VectorTooLong {
28672 size: value.len() as u64,
28673 limit: 100,
28674 });
28675 }
28676
28677 Ok(())
28678 }
28679
28680 3 => {
28681 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
28682 slot.as_mut(),
28683 decoder,
28684 (),
28685 )?;
28686
28687 Ok(())
28688 }
28689
28690 4 => {
28691 ::fidl_next::wire::Envelope::decode_as::<
28692 ___D,
28693 ::fidl_next::wire::String<'de>,
28694 >(slot.as_mut(), decoder, 100)?;
28695
28696 let value = unsafe {
28697 slot.deref_unchecked()
28698 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28699 };
28700
28701 if value.len() > 100 {
28702 return Err(::fidl_next::DecodeError::VectorTooLong {
28703 size: value.len() as u64,
28704 limit: 100,
28705 });
28706 }
28707
28708 Ok(())
28709 }
28710
28711 6 => {
28712 ::fidl_next::wire::Envelope::decode_as::<
28713 ___D,
28714 ::fidl_next::wire::String<'de>,
28715 >(slot.as_mut(), decoder, 1024)?;
28716
28717 let value = unsafe {
28718 slot.deref_unchecked()
28719 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28720 };
28721
28722 if value.len() > 1024 {
28723 return Err(::fidl_next::DecodeError::VectorTooLong {
28724 size: value.len() as u64,
28725 limit: 1024,
28726 });
28727 }
28728
28729 Ok(())
28730 }
28731
28732 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
28733 }
28734 })
28735 }
28736 }
28737
28738 impl<'de> ExposeRunner<'de> {
28739 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28740 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28741 }
28742
28743 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28744 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28745 }
28746
28747 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28748 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28749 }
28750
28751 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28752 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
28753 }
28754
28755 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28756 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
28757 }
28758 }
28759
28760 impl<'de> ::core::fmt::Debug for ExposeRunner<'de> {
28761 fn fmt(
28762 &self,
28763 f: &mut ::core::fmt::Formatter<'_>,
28764 ) -> ::core::result::Result<(), ::core::fmt::Error> {
28765 f.debug_struct("ExposeRunner")
28766 .field("source", &self.source())
28767 .field("source_name", &self.source_name())
28768 .field("target", &self.target())
28769 .field("target_name", &self.target_name())
28770 .field("source_dictionary", &self.source_dictionary())
28771 .finish()
28772 }
28773 }
28774
28775 impl<'de> ::fidl_next::IntoNatural for ExposeRunner<'de> {
28776 type Natural = crate::natural::ExposeRunner;
28777 }
28778
28779 #[repr(C)]
28781 pub struct ExposeResolver<'de> {
28782 pub(crate) table: ::fidl_next::wire::Table<'de>,
28783 }
28784
28785 impl<'de> Drop for ExposeResolver<'de> {
28786 fn drop(&mut self) {
28787 let _ = self
28788 .table
28789 .get(1)
28790 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28791
28792 let _ = self.table.get(2).map(|envelope| unsafe {
28793 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28794 });
28795
28796 let _ = self
28797 .table
28798 .get(3)
28799 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28800
28801 let _ = self.table.get(4).map(|envelope| unsafe {
28802 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28803 });
28804
28805 let _ = self.table.get(6).map(|envelope| unsafe {
28806 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28807 });
28808 }
28809 }
28810
28811 impl ::fidl_next::Constrained for ExposeResolver<'_> {
28812 type Constraint = ();
28813
28814 fn validate(
28815 _: ::fidl_next::Slot<'_, Self>,
28816 _: Self::Constraint,
28817 ) -> Result<(), ::fidl_next::ValidationError> {
28818 Ok(())
28819 }
28820 }
28821
28822 unsafe impl ::fidl_next::Wire for ExposeResolver<'static> {
28823 type Narrowed<'de> = ExposeResolver<'de>;
28824
28825 #[inline]
28826 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28827 ::fidl_next::munge!(let Self { table } = out);
28828 ::fidl_next::wire::Table::zero_padding(table);
28829 }
28830 }
28831
28832 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExposeResolver<'de>
28833 where
28834 ___D: ::fidl_next::Decoder<'de> + ?Sized,
28835 {
28836 fn decode(
28837 slot: ::fidl_next::Slot<'_, Self>,
28838 decoder: &mut ___D,
28839 _: (),
28840 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28841 ::fidl_next::munge!(let Self { table } = slot);
28842
28843 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28844 match ordinal {
28845 0 => unsafe { ::core::hint::unreachable_unchecked() },
28846
28847 1 => {
28848 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
28849 slot.as_mut(),
28850 decoder,
28851 (),
28852 )?;
28853
28854 Ok(())
28855 }
28856
28857 2 => {
28858 ::fidl_next::wire::Envelope::decode_as::<
28859 ___D,
28860 ::fidl_next::wire::String<'de>,
28861 >(slot.as_mut(), decoder, 100)?;
28862
28863 let value = unsafe {
28864 slot.deref_unchecked()
28865 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28866 };
28867
28868 if value.len() > 100 {
28869 return Err(::fidl_next::DecodeError::VectorTooLong {
28870 size: value.len() as u64,
28871 limit: 100,
28872 });
28873 }
28874
28875 Ok(())
28876 }
28877
28878 3 => {
28879 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
28880 slot.as_mut(),
28881 decoder,
28882 (),
28883 )?;
28884
28885 Ok(())
28886 }
28887
28888 4 => {
28889 ::fidl_next::wire::Envelope::decode_as::<
28890 ___D,
28891 ::fidl_next::wire::String<'de>,
28892 >(slot.as_mut(), decoder, 100)?;
28893
28894 let value = unsafe {
28895 slot.deref_unchecked()
28896 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28897 };
28898
28899 if value.len() > 100 {
28900 return Err(::fidl_next::DecodeError::VectorTooLong {
28901 size: value.len() as u64,
28902 limit: 100,
28903 });
28904 }
28905
28906 Ok(())
28907 }
28908
28909 6 => {
28910 ::fidl_next::wire::Envelope::decode_as::<
28911 ___D,
28912 ::fidl_next::wire::String<'de>,
28913 >(slot.as_mut(), decoder, 1024)?;
28914
28915 let value = unsafe {
28916 slot.deref_unchecked()
28917 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28918 };
28919
28920 if value.len() > 1024 {
28921 return Err(::fidl_next::DecodeError::VectorTooLong {
28922 size: value.len() as u64,
28923 limit: 1024,
28924 });
28925 }
28926
28927 Ok(())
28928 }
28929
28930 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
28931 }
28932 })
28933 }
28934 }
28935
28936 impl<'de> ExposeResolver<'de> {
28937 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28938 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28939 }
28940
28941 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28942 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28943 }
28944
28945 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28946 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28947 }
28948
28949 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28950 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
28951 }
28952
28953 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28954 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
28955 }
28956 }
28957
28958 impl<'de> ::core::fmt::Debug for ExposeResolver<'de> {
28959 fn fmt(
28960 &self,
28961 f: &mut ::core::fmt::Formatter<'_>,
28962 ) -> ::core::result::Result<(), ::core::fmt::Error> {
28963 f.debug_struct("ExposeResolver")
28964 .field("source", &self.source())
28965 .field("source_name", &self.source_name())
28966 .field("target", &self.target())
28967 .field("target_name", &self.target_name())
28968 .field("source_dictionary", &self.source_dictionary())
28969 .finish()
28970 }
28971 }
28972
28973 impl<'de> ::fidl_next::IntoNatural for ExposeResolver<'de> {
28974 type Natural = crate::natural::ExposeResolver;
28975 }
28976
28977 #[repr(C)]
28979 pub struct ExposeDictionary<'de> {
28980 pub(crate) table: ::fidl_next::wire::Table<'de>,
28981 }
28982
28983 impl<'de> Drop for ExposeDictionary<'de> {
28984 fn drop(&mut self) {
28985 let _ = self
28986 .table
28987 .get(1)
28988 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28989
28990 let _ = self.table.get(2).map(|envelope| unsafe {
28991 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28992 });
28993
28994 let _ = self
28995 .table
28996 .get(3)
28997 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28998
28999 let _ = self.table.get(4).map(|envelope| unsafe {
29000 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29001 });
29002
29003 let _ = self
29004 .table
29005 .get(5)
29006 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
29007
29008 let _ = self.table.get(6).map(|envelope| unsafe {
29009 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29010 });
29011 }
29012 }
29013
29014 impl ::fidl_next::Constrained for ExposeDictionary<'_> {
29015 type Constraint = ();
29016
29017 fn validate(
29018 _: ::fidl_next::Slot<'_, Self>,
29019 _: Self::Constraint,
29020 ) -> Result<(), ::fidl_next::ValidationError> {
29021 Ok(())
29022 }
29023 }
29024
29025 unsafe impl ::fidl_next::Wire for ExposeDictionary<'static> {
29026 type Narrowed<'de> = ExposeDictionary<'de>;
29027
29028 #[inline]
29029 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29030 ::fidl_next::munge!(let Self { table } = out);
29031 ::fidl_next::wire::Table::zero_padding(table);
29032 }
29033 }
29034
29035 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExposeDictionary<'de>
29036 where
29037 ___D: ::fidl_next::Decoder<'de> + ?Sized,
29038 {
29039 fn decode(
29040 slot: ::fidl_next::Slot<'_, Self>,
29041 decoder: &mut ___D,
29042 _: (),
29043 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29044 ::fidl_next::munge!(let Self { table } = slot);
29045
29046 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
29047 match ordinal {
29048 0 => unsafe { ::core::hint::unreachable_unchecked() },
29049
29050 1 => {
29051 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
29052 slot.as_mut(),
29053 decoder,
29054 (),
29055 )?;
29056
29057 Ok(())
29058 }
29059
29060 2 => {
29061 ::fidl_next::wire::Envelope::decode_as::<
29062 ___D,
29063 ::fidl_next::wire::String<'de>,
29064 >(slot.as_mut(), decoder, 100)?;
29065
29066 let value = unsafe {
29067 slot.deref_unchecked()
29068 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29069 };
29070
29071 if value.len() > 100 {
29072 return Err(::fidl_next::DecodeError::VectorTooLong {
29073 size: value.len() as u64,
29074 limit: 100,
29075 });
29076 }
29077
29078 Ok(())
29079 }
29080
29081 3 => {
29082 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
29083 slot.as_mut(),
29084 decoder,
29085 (),
29086 )?;
29087
29088 Ok(())
29089 }
29090
29091 4 => {
29092 ::fidl_next::wire::Envelope::decode_as::<
29093 ___D,
29094 ::fidl_next::wire::String<'de>,
29095 >(slot.as_mut(), decoder, 100)?;
29096
29097 let value = unsafe {
29098 slot.deref_unchecked()
29099 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29100 };
29101
29102 if value.len() > 100 {
29103 return Err(::fidl_next::DecodeError::VectorTooLong {
29104 size: value.len() as u64,
29105 limit: 100,
29106 });
29107 }
29108
29109 Ok(())
29110 }
29111
29112 5 => {
29113 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
29114 slot.as_mut(),
29115 decoder,
29116 (),
29117 )?;
29118
29119 Ok(())
29120 }
29121
29122 6 => {
29123 ::fidl_next::wire::Envelope::decode_as::<
29124 ___D,
29125 ::fidl_next::wire::String<'de>,
29126 >(slot.as_mut(), decoder, 1024)?;
29127
29128 let value = unsafe {
29129 slot.deref_unchecked()
29130 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29131 };
29132
29133 if value.len() > 1024 {
29134 return Err(::fidl_next::DecodeError::VectorTooLong {
29135 size: value.len() as u64,
29136 limit: 1024,
29137 });
29138 }
29139
29140 Ok(())
29141 }
29142
29143 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
29144 }
29145 })
29146 }
29147 }
29148
29149 impl<'de> ExposeDictionary<'de> {
29150 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29151 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
29152 }
29153
29154 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29155 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
29156 }
29157
29158 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29159 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
29160 }
29161
29162 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29163 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
29164 }
29165
29166 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
29167 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
29168 }
29169
29170 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29171 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
29172 }
29173 }
29174
29175 impl<'de> ::core::fmt::Debug for ExposeDictionary<'de> {
29176 fn fmt(
29177 &self,
29178 f: &mut ::core::fmt::Formatter<'_>,
29179 ) -> ::core::result::Result<(), ::core::fmt::Error> {
29180 f.debug_struct("ExposeDictionary")
29181 .field("source", &self.source())
29182 .field("source_name", &self.source_name())
29183 .field("target", &self.target())
29184 .field("target_name", &self.target_name())
29185 .field("availability", &self.availability())
29186 .field("source_dictionary", &self.source_dictionary())
29187 .finish()
29188 }
29189 }
29190
29191 impl<'de> ::fidl_next::IntoNatural for ExposeDictionary<'de> {
29192 type Natural = crate::natural::ExposeDictionary;
29193 }
29194
29195 #[repr(C)]
29197 pub struct ExposeConfiguration<'de> {
29198 pub(crate) table: ::fidl_next::wire::Table<'de>,
29199 }
29200
29201 impl<'de> Drop for ExposeConfiguration<'de> {
29202 fn drop(&mut self) {
29203 let _ = self
29204 .table
29205 .get(1)
29206 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29207
29208 let _ = self.table.get(2).map(|envelope| unsafe {
29209 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29210 });
29211
29212 let _ = self
29213 .table
29214 .get(3)
29215 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29216
29217 let _ = self.table.get(4).map(|envelope| unsafe {
29218 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29219 });
29220
29221 let _ = self
29222 .table
29223 .get(5)
29224 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
29225
29226 let _ = self.table.get(6).map(|envelope| unsafe {
29227 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29228 });
29229 }
29230 }
29231
29232 impl ::fidl_next::Constrained for ExposeConfiguration<'_> {
29233 type Constraint = ();
29234
29235 fn validate(
29236 _: ::fidl_next::Slot<'_, Self>,
29237 _: Self::Constraint,
29238 ) -> Result<(), ::fidl_next::ValidationError> {
29239 Ok(())
29240 }
29241 }
29242
29243 unsafe impl ::fidl_next::Wire for ExposeConfiguration<'static> {
29244 type Narrowed<'de> = ExposeConfiguration<'de>;
29245
29246 #[inline]
29247 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29248 ::fidl_next::munge!(let Self { table } = out);
29249 ::fidl_next::wire::Table::zero_padding(table);
29250 }
29251 }
29252
29253 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExposeConfiguration<'de>
29254 where
29255 ___D: ::fidl_next::Decoder<'de> + ?Sized,
29256 {
29257 fn decode(
29258 slot: ::fidl_next::Slot<'_, Self>,
29259 decoder: &mut ___D,
29260 _: (),
29261 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29262 ::fidl_next::munge!(let Self { table } = slot);
29263
29264 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
29265 match ordinal {
29266 0 => unsafe { ::core::hint::unreachable_unchecked() },
29267
29268 1 => {
29269 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
29270 slot.as_mut(),
29271 decoder,
29272 (),
29273 )?;
29274
29275 Ok(())
29276 }
29277
29278 2 => {
29279 ::fidl_next::wire::Envelope::decode_as::<
29280 ___D,
29281 ::fidl_next::wire::String<'de>,
29282 >(slot.as_mut(), decoder, 100)?;
29283
29284 let value = unsafe {
29285 slot.deref_unchecked()
29286 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29287 };
29288
29289 if value.len() > 100 {
29290 return Err(::fidl_next::DecodeError::VectorTooLong {
29291 size: value.len() as u64,
29292 limit: 100,
29293 });
29294 }
29295
29296 Ok(())
29297 }
29298
29299 3 => {
29300 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
29301 slot.as_mut(),
29302 decoder,
29303 (),
29304 )?;
29305
29306 Ok(())
29307 }
29308
29309 4 => {
29310 ::fidl_next::wire::Envelope::decode_as::<
29311 ___D,
29312 ::fidl_next::wire::String<'de>,
29313 >(slot.as_mut(), decoder, 100)?;
29314
29315 let value = unsafe {
29316 slot.deref_unchecked()
29317 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29318 };
29319
29320 if value.len() > 100 {
29321 return Err(::fidl_next::DecodeError::VectorTooLong {
29322 size: value.len() as u64,
29323 limit: 100,
29324 });
29325 }
29326
29327 Ok(())
29328 }
29329
29330 5 => {
29331 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
29332 slot.as_mut(),
29333 decoder,
29334 (),
29335 )?;
29336
29337 Ok(())
29338 }
29339
29340 6 => {
29341 ::fidl_next::wire::Envelope::decode_as::<
29342 ___D,
29343 ::fidl_next::wire::String<'de>,
29344 >(slot.as_mut(), decoder, 1024)?;
29345
29346 let value = unsafe {
29347 slot.deref_unchecked()
29348 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29349 };
29350
29351 if value.len() > 1024 {
29352 return Err(::fidl_next::DecodeError::VectorTooLong {
29353 size: value.len() as u64,
29354 limit: 1024,
29355 });
29356 }
29357
29358 Ok(())
29359 }
29360
29361 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
29362 }
29363 })
29364 }
29365 }
29366
29367 impl<'de> ExposeConfiguration<'de> {
29368 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29369 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
29370 }
29371
29372 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29373 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
29374 }
29375
29376 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29377 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
29378 }
29379
29380 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29381 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
29382 }
29383
29384 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
29385 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
29386 }
29387
29388 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29389 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
29390 }
29391 }
29392
29393 impl<'de> ::core::fmt::Debug for ExposeConfiguration<'de> {
29394 fn fmt(
29395 &self,
29396 f: &mut ::core::fmt::Formatter<'_>,
29397 ) -> ::core::result::Result<(), ::core::fmt::Error> {
29398 f.debug_struct("ExposeConfiguration")
29399 .field("source", &self.source())
29400 .field("source_name", &self.source_name())
29401 .field("target", &self.target())
29402 .field("target_name", &self.target_name())
29403 .field("availability", &self.availability())
29404 .field("source_dictionary", &self.source_dictionary())
29405 .finish()
29406 }
29407 }
29408
29409 impl<'de> ::fidl_next::IntoNatural for ExposeConfiguration<'de> {
29410 type Natural = crate::natural::ExposeConfiguration;
29411 }
29412
29413 #[repr(transparent)]
29415 pub struct Expose<'de> {
29416 pub(crate) raw: ::fidl_next::wire::Union,
29417 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
29418 }
29419
29420 impl<'de> Drop for Expose<'de> {
29421 fn drop(&mut self) {
29422 match self.raw.ordinal() {
29423 1 => {
29424 let _ = unsafe {
29425 self.raw.get().read_unchecked::<crate::wire::ExposeService<'de>>()
29426 };
29427 }
29428
29429 2 => {
29430 let _ = unsafe {
29431 self.raw.get().read_unchecked::<crate::wire::ExposeProtocol<'de>>()
29432 };
29433 }
29434
29435 3 => {
29436 let _ = unsafe {
29437 self.raw.get().read_unchecked::<crate::wire::ExposeDirectory<'de>>()
29438 };
29439 }
29440
29441 4 => {
29442 let _ = unsafe {
29443 self.raw.get().read_unchecked::<crate::wire::ExposeRunner<'de>>()
29444 };
29445 }
29446
29447 5 => {
29448 let _ = unsafe {
29449 self.raw.get().read_unchecked::<crate::wire::ExposeResolver<'de>>()
29450 };
29451 }
29452
29453 7 => {
29454 let _ = unsafe {
29455 self.raw.get().read_unchecked::<crate::wire::ExposeDictionary<'de>>()
29456 };
29457 }
29458
29459 8 => {
29460 let _ = unsafe {
29461 self.raw.get().read_unchecked::<crate::wire::ExposeConfiguration<'de>>()
29462 };
29463 }
29464
29465 _ => (),
29466 }
29467 }
29468 }
29469
29470 impl ::fidl_next::Constrained for Expose<'_> {
29471 type Constraint = ();
29472
29473 fn validate(
29474 _: ::fidl_next::Slot<'_, Self>,
29475 _: Self::Constraint,
29476 ) -> Result<(), ::fidl_next::ValidationError> {
29477 Ok(())
29478 }
29479 }
29480
29481 unsafe impl ::fidl_next::Wire for Expose<'static> {
29482 type Narrowed<'de> = Expose<'de>;
29483
29484 #[inline]
29485 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29486 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
29487 ::fidl_next::wire::Union::zero_padding(raw);
29488 }
29489 }
29490
29491 pub mod expose {
29492 pub enum Ref<'de> {
29493 Service(&'de crate::wire::ExposeService<'de>),
29494
29495 Protocol(&'de crate::wire::ExposeProtocol<'de>),
29496
29497 Directory(&'de crate::wire::ExposeDirectory<'de>),
29498
29499 Runner(&'de crate::wire::ExposeRunner<'de>),
29500
29501 Resolver(&'de crate::wire::ExposeResolver<'de>),
29502
29503 Dictionary(&'de crate::wire::ExposeDictionary<'de>),
29504
29505 Config(&'de crate::wire::ExposeConfiguration<'de>),
29506
29507 UnknownOrdinal_(u64),
29508 }
29509 }
29510
29511 impl<'de> Expose<'de> {
29512 pub fn as_ref(&self) -> crate::wire::expose::Ref<'_> {
29513 match self.raw.ordinal() {
29514 1 => crate::wire::expose::Ref::Service(unsafe {
29515 self.raw.get().deref_unchecked::<crate::wire::ExposeService<'_>>()
29516 }),
29517
29518 2 => crate::wire::expose::Ref::Protocol(unsafe {
29519 self.raw.get().deref_unchecked::<crate::wire::ExposeProtocol<'_>>()
29520 }),
29521
29522 3 => crate::wire::expose::Ref::Directory(unsafe {
29523 self.raw.get().deref_unchecked::<crate::wire::ExposeDirectory<'_>>()
29524 }),
29525
29526 4 => crate::wire::expose::Ref::Runner(unsafe {
29527 self.raw.get().deref_unchecked::<crate::wire::ExposeRunner<'_>>()
29528 }),
29529
29530 5 => crate::wire::expose::Ref::Resolver(unsafe {
29531 self.raw.get().deref_unchecked::<crate::wire::ExposeResolver<'_>>()
29532 }),
29533
29534 7 => crate::wire::expose::Ref::Dictionary(unsafe {
29535 self.raw.get().deref_unchecked::<crate::wire::ExposeDictionary<'_>>()
29536 }),
29537
29538 8 => crate::wire::expose::Ref::Config(unsafe {
29539 self.raw.get().deref_unchecked::<crate::wire::ExposeConfiguration<'_>>()
29540 }),
29541
29542 unknown => crate::wire::expose::Ref::UnknownOrdinal_(unknown),
29543 }
29544 }
29545 }
29546
29547 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Expose<'de>
29548 where
29549 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
29550 ___D: ::fidl_next::Decoder<'de>,
29551 {
29552 fn decode(
29553 mut slot: ::fidl_next::Slot<'_, Self>,
29554 decoder: &mut ___D,
29555 _: (),
29556 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29557 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
29558 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
29559 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeService<'de>>(
29560 raw,
29561 decoder,
29562 (),
29563 )?,
29564
29565 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeProtocol<'de>>(
29566 raw,
29567 decoder,
29568 (),
29569 )?,
29570
29571 3 => {
29572 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeDirectory<'de>>(
29573 raw,
29574 decoder,
29575 (),
29576 )?
29577 }
29578
29579 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeRunner<'de>>(
29580 raw,
29581 decoder,
29582 (),
29583 )?,
29584
29585 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeResolver<'de>>(
29586 raw,
29587 decoder,
29588 (),
29589 )?,
29590
29591 7 => {
29592 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeDictionary<'de>>(
29593 raw,
29594 decoder,
29595 (),
29596 )?
29597 }
29598
29599 8 => ::fidl_next::wire::Union::decode_as::<
29600 ___D,
29601 crate::wire::ExposeConfiguration<'de>,
29602 >(raw, decoder, ())?,
29603
29604 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
29605 }
29606
29607 Ok(())
29608 }
29609 }
29610
29611 impl<'de> ::core::fmt::Debug for Expose<'de> {
29612 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
29613 match self.raw.ordinal() {
29614 1 => unsafe {
29615 self.raw.get().deref_unchecked::<crate::wire::ExposeService<'_>>().fmt(f)
29616 },
29617 2 => unsafe {
29618 self.raw.get().deref_unchecked::<crate::wire::ExposeProtocol<'_>>().fmt(f)
29619 },
29620 3 => unsafe {
29621 self.raw.get().deref_unchecked::<crate::wire::ExposeDirectory<'_>>().fmt(f)
29622 },
29623 4 => unsafe {
29624 self.raw.get().deref_unchecked::<crate::wire::ExposeRunner<'_>>().fmt(f)
29625 },
29626 5 => unsafe {
29627 self.raw.get().deref_unchecked::<crate::wire::ExposeResolver<'_>>().fmt(f)
29628 },
29629 7 => unsafe {
29630 self.raw.get().deref_unchecked::<crate::wire::ExposeDictionary<'_>>().fmt(f)
29631 },
29632 8 => unsafe {
29633 self.raw.get().deref_unchecked::<crate::wire::ExposeConfiguration<'_>>().fmt(f)
29634 },
29635 _ => unsafe { ::core::hint::unreachable_unchecked() },
29636 }
29637 }
29638 }
29639
29640 impl<'de> ::fidl_next::IntoNatural for Expose<'de> {
29641 type Natural = crate::natural::Expose;
29642 }
29643
29644 #[repr(C)]
29646 pub struct OfferService<'de> {
29647 pub(crate) table: ::fidl_next::wire::Table<'de>,
29648 }
29649
29650 impl<'de> Drop for OfferService<'de> {
29651 fn drop(&mut self) {
29652 let _ = self
29653 .table
29654 .get(1)
29655 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29656
29657 let _ = self.table.get(2).map(|envelope| unsafe {
29658 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29659 });
29660
29661 let _ = self
29662 .table
29663 .get(3)
29664 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29665
29666 let _ = self.table.get(4).map(|envelope| unsafe {
29667 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29668 });
29669
29670 let _ = self.table.get(5)
29671 .map(|envelope| unsafe {
29672 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
29673 });
29674
29675 let _ = self.table.get(6)
29676 .map(|envelope| unsafe {
29677 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::NameMapping<'de>>>()
29678 });
29679
29680 let _ = self
29681 .table
29682 .get(7)
29683 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
29684
29685 let _ = self.table.get(8).map(|envelope| unsafe {
29686 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29687 });
29688
29689 let _ = self.table.get(9).map(|envelope| unsafe {
29690 envelope.read_unchecked::<crate::wire::DependencyType>()
29691 });
29692 }
29693 }
29694
29695 impl ::fidl_next::Constrained for OfferService<'_> {
29696 type Constraint = ();
29697
29698 fn validate(
29699 _: ::fidl_next::Slot<'_, Self>,
29700 _: Self::Constraint,
29701 ) -> Result<(), ::fidl_next::ValidationError> {
29702 Ok(())
29703 }
29704 }
29705
29706 unsafe impl ::fidl_next::Wire for OfferService<'static> {
29707 type Narrowed<'de> = OfferService<'de>;
29708
29709 #[inline]
29710 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29711 ::fidl_next::munge!(let Self { table } = out);
29712 ::fidl_next::wire::Table::zero_padding(table);
29713 }
29714 }
29715
29716 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferService<'de>
29717 where
29718 ___D: ::fidl_next::Decoder<'de> + ?Sized,
29719 {
29720 fn decode(
29721 slot: ::fidl_next::Slot<'_, Self>,
29722 decoder: &mut ___D,
29723 _: (),
29724 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29725 ::fidl_next::munge!(let Self { table } = slot);
29726
29727 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
29728 match ordinal {
29729 0 => unsafe { ::core::hint::unreachable_unchecked() },
29730
29731 1 => {
29732 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
29733 slot.as_mut(),
29734 decoder,
29735 (),
29736 )?;
29737
29738 Ok(())
29739 }
29740
29741 2 => {
29742 ::fidl_next::wire::Envelope::decode_as::<
29743 ___D,
29744 ::fidl_next::wire::String<'de>,
29745 >(slot.as_mut(), decoder, 100)?;
29746
29747 let value = unsafe {
29748 slot.deref_unchecked()
29749 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29750 };
29751
29752 if value.len() > 100 {
29753 return Err(::fidl_next::DecodeError::VectorTooLong {
29754 size: value.len() as u64,
29755 limit: 100,
29756 });
29757 }
29758
29759 Ok(())
29760 }
29761
29762 3 => {
29763 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
29764 slot.as_mut(),
29765 decoder,
29766 (),
29767 )?;
29768
29769 Ok(())
29770 }
29771
29772 4 => {
29773 ::fidl_next::wire::Envelope::decode_as::<
29774 ___D,
29775 ::fidl_next::wire::String<'de>,
29776 >(slot.as_mut(), decoder, 100)?;
29777
29778 let value = unsafe {
29779 slot.deref_unchecked()
29780 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29781 };
29782
29783 if value.len() > 100 {
29784 return Err(::fidl_next::DecodeError::VectorTooLong {
29785 size: value.len() as u64,
29786 limit: 100,
29787 });
29788 }
29789
29790 Ok(())
29791 }
29792
29793 5 => {
29794 ::fidl_next::wire::Envelope::decode_as::<
29795 ___D,
29796 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>,
29797 >(slot.as_mut(), decoder, (4294967295, 100))?;
29798
29799 Ok(())
29800 }
29801
29802 6 => {
29803 ::fidl_next::wire::Envelope::decode_as::<
29804 ___D,
29805 ::fidl_next::wire::Vector<'de, crate::wire::NameMapping<'de>>,
29806 >(slot.as_mut(), decoder, (4294967295, ()))?;
29807
29808 Ok(())
29809 }
29810
29811 7 => {
29812 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
29813 slot.as_mut(),
29814 decoder,
29815 (),
29816 )?;
29817
29818 Ok(())
29819 }
29820
29821 8 => {
29822 ::fidl_next::wire::Envelope::decode_as::<
29823 ___D,
29824 ::fidl_next::wire::String<'de>,
29825 >(slot.as_mut(), decoder, 1024)?;
29826
29827 let value = unsafe {
29828 slot.deref_unchecked()
29829 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29830 };
29831
29832 if value.len() > 1024 {
29833 return Err(::fidl_next::DecodeError::VectorTooLong {
29834 size: value.len() as u64,
29835 limit: 1024,
29836 });
29837 }
29838
29839 Ok(())
29840 }
29841
29842 9 => {
29843 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
29844 slot.as_mut(),
29845 decoder,
29846 (),
29847 )?;
29848
29849 Ok(())
29850 }
29851
29852 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
29853 }
29854 })
29855 }
29856 }
29857
29858 impl<'de> OfferService<'de> {
29859 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29860 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
29861 }
29862
29863 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29864 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
29865 }
29866
29867 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29868 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
29869 }
29870
29871 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29872 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
29873 }
29874
29875 pub fn source_instance_filter(
29876 &self,
29877 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>
29878 {
29879 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
29880 }
29881
29882 pub fn renamed_instances(
29883 &self,
29884 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::NameMapping<'de>>>
29885 {
29886 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
29887 }
29888
29889 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
29890 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
29891 }
29892
29893 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29894 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
29895 }
29896
29897 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
29898 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
29899 }
29900 }
29901
29902 impl<'de> ::core::fmt::Debug for OfferService<'de> {
29903 fn fmt(
29904 &self,
29905 f: &mut ::core::fmt::Formatter<'_>,
29906 ) -> ::core::result::Result<(), ::core::fmt::Error> {
29907 f.debug_struct("OfferService")
29908 .field("source", &self.source())
29909 .field("source_name", &self.source_name())
29910 .field("target", &self.target())
29911 .field("target_name", &self.target_name())
29912 .field("source_instance_filter", &self.source_instance_filter())
29913 .field("renamed_instances", &self.renamed_instances())
29914 .field("availability", &self.availability())
29915 .field("source_dictionary", &self.source_dictionary())
29916 .field("dependency_type", &self.dependency_type())
29917 .finish()
29918 }
29919 }
29920
29921 impl<'de> ::fidl_next::IntoNatural for OfferService<'de> {
29922 type Natural = crate::natural::OfferService;
29923 }
29924
29925 #[repr(C)]
29927 pub struct OfferProtocol<'de> {
29928 pub(crate) table: ::fidl_next::wire::Table<'de>,
29929 }
29930
29931 impl<'de> Drop for OfferProtocol<'de> {
29932 fn drop(&mut self) {
29933 let _ = self
29934 .table
29935 .get(1)
29936 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29937
29938 let _ = self.table.get(2).map(|envelope| unsafe {
29939 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29940 });
29941
29942 let _ = self
29943 .table
29944 .get(3)
29945 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29946
29947 let _ = self.table.get(4).map(|envelope| unsafe {
29948 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29949 });
29950
29951 let _ = self.table.get(5).map(|envelope| unsafe {
29952 envelope.read_unchecked::<crate::wire::DependencyType>()
29953 });
29954
29955 let _ = self
29956 .table
29957 .get(6)
29958 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
29959
29960 let _ = self.table.get(7).map(|envelope| unsafe {
29961 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29962 });
29963 }
29964 }
29965
29966 impl ::fidl_next::Constrained for OfferProtocol<'_> {
29967 type Constraint = ();
29968
29969 fn validate(
29970 _: ::fidl_next::Slot<'_, Self>,
29971 _: Self::Constraint,
29972 ) -> Result<(), ::fidl_next::ValidationError> {
29973 Ok(())
29974 }
29975 }
29976
29977 unsafe impl ::fidl_next::Wire for OfferProtocol<'static> {
29978 type Narrowed<'de> = OfferProtocol<'de>;
29979
29980 #[inline]
29981 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29982 ::fidl_next::munge!(let Self { table } = out);
29983 ::fidl_next::wire::Table::zero_padding(table);
29984 }
29985 }
29986
29987 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferProtocol<'de>
29988 where
29989 ___D: ::fidl_next::Decoder<'de> + ?Sized,
29990 {
29991 fn decode(
29992 slot: ::fidl_next::Slot<'_, Self>,
29993 decoder: &mut ___D,
29994 _: (),
29995 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29996 ::fidl_next::munge!(let Self { table } = slot);
29997
29998 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
29999 match ordinal {
30000 0 => unsafe { ::core::hint::unreachable_unchecked() },
30001
30002 1 => {
30003 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30004 slot.as_mut(),
30005 decoder,
30006 (),
30007 )?;
30008
30009 Ok(())
30010 }
30011
30012 2 => {
30013 ::fidl_next::wire::Envelope::decode_as::<
30014 ___D,
30015 ::fidl_next::wire::String<'de>,
30016 >(slot.as_mut(), decoder, 100)?;
30017
30018 let value = unsafe {
30019 slot.deref_unchecked()
30020 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30021 };
30022
30023 if value.len() > 100 {
30024 return Err(::fidl_next::DecodeError::VectorTooLong {
30025 size: value.len() as u64,
30026 limit: 100,
30027 });
30028 }
30029
30030 Ok(())
30031 }
30032
30033 3 => {
30034 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30035 slot.as_mut(),
30036 decoder,
30037 (),
30038 )?;
30039
30040 Ok(())
30041 }
30042
30043 4 => {
30044 ::fidl_next::wire::Envelope::decode_as::<
30045 ___D,
30046 ::fidl_next::wire::String<'de>,
30047 >(slot.as_mut(), decoder, 100)?;
30048
30049 let value = unsafe {
30050 slot.deref_unchecked()
30051 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30052 };
30053
30054 if value.len() > 100 {
30055 return Err(::fidl_next::DecodeError::VectorTooLong {
30056 size: value.len() as u64,
30057 limit: 100,
30058 });
30059 }
30060
30061 Ok(())
30062 }
30063
30064 5 => {
30065 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
30066 slot.as_mut(),
30067 decoder,
30068 (),
30069 )?;
30070
30071 Ok(())
30072 }
30073
30074 6 => {
30075 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
30076 slot.as_mut(),
30077 decoder,
30078 (),
30079 )?;
30080
30081 Ok(())
30082 }
30083
30084 7 => {
30085 ::fidl_next::wire::Envelope::decode_as::<
30086 ___D,
30087 ::fidl_next::wire::String<'de>,
30088 >(slot.as_mut(), decoder, 1024)?;
30089
30090 let value = unsafe {
30091 slot.deref_unchecked()
30092 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30093 };
30094
30095 if value.len() > 1024 {
30096 return Err(::fidl_next::DecodeError::VectorTooLong {
30097 size: value.len() as u64,
30098 limit: 1024,
30099 });
30100 }
30101
30102 Ok(())
30103 }
30104
30105 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
30106 }
30107 })
30108 }
30109 }
30110
30111 impl<'de> OfferProtocol<'de> {
30112 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30113 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30114 }
30115
30116 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30117 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30118 }
30119
30120 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30121 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
30122 }
30123
30124 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30125 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
30126 }
30127
30128 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
30129 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
30130 }
30131
30132 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
30133 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
30134 }
30135
30136 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30137 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
30138 }
30139 }
30140
30141 impl<'de> ::core::fmt::Debug for OfferProtocol<'de> {
30142 fn fmt(
30143 &self,
30144 f: &mut ::core::fmt::Formatter<'_>,
30145 ) -> ::core::result::Result<(), ::core::fmt::Error> {
30146 f.debug_struct("OfferProtocol")
30147 .field("source", &self.source())
30148 .field("source_name", &self.source_name())
30149 .field("target", &self.target())
30150 .field("target_name", &self.target_name())
30151 .field("dependency_type", &self.dependency_type())
30152 .field("availability", &self.availability())
30153 .field("source_dictionary", &self.source_dictionary())
30154 .finish()
30155 }
30156 }
30157
30158 impl<'de> ::fidl_next::IntoNatural for OfferProtocol<'de> {
30159 type Natural = crate::natural::OfferProtocol;
30160 }
30161
30162 #[repr(C)]
30164 pub struct OfferDirectory<'de> {
30165 pub(crate) table: ::fidl_next::wire::Table<'de>,
30166 }
30167
30168 impl<'de> Drop for OfferDirectory<'de> {
30169 fn drop(&mut self) {
30170 let _ = self
30171 .table
30172 .get(1)
30173 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30174
30175 let _ = self.table.get(2).map(|envelope| unsafe {
30176 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30177 });
30178
30179 let _ = self
30180 .table
30181 .get(3)
30182 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30183
30184 let _ = self.table.get(4).map(|envelope| unsafe {
30185 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30186 });
30187
30188 let _ = self.table.get(5).map(|envelope| unsafe {
30189 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
30190 });
30191
30192 let _ = self.table.get(6).map(|envelope| unsafe {
30193 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30194 });
30195
30196 let _ = self.table.get(7).map(|envelope| unsafe {
30197 envelope.read_unchecked::<crate::wire::DependencyType>()
30198 });
30199
30200 let _ = self
30201 .table
30202 .get(8)
30203 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
30204
30205 let _ = self.table.get(9).map(|envelope| unsafe {
30206 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30207 });
30208 }
30209 }
30210
30211 impl ::fidl_next::Constrained for OfferDirectory<'_> {
30212 type Constraint = ();
30213
30214 fn validate(
30215 _: ::fidl_next::Slot<'_, Self>,
30216 _: Self::Constraint,
30217 ) -> Result<(), ::fidl_next::ValidationError> {
30218 Ok(())
30219 }
30220 }
30221
30222 unsafe impl ::fidl_next::Wire for OfferDirectory<'static> {
30223 type Narrowed<'de> = OfferDirectory<'de>;
30224
30225 #[inline]
30226 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30227 ::fidl_next::munge!(let Self { table } = out);
30228 ::fidl_next::wire::Table::zero_padding(table);
30229 }
30230 }
30231
30232 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferDirectory<'de>
30233 where
30234 ___D: ::fidl_next::Decoder<'de> + ?Sized,
30235 {
30236 fn decode(
30237 slot: ::fidl_next::Slot<'_, Self>,
30238 decoder: &mut ___D,
30239 _: (),
30240 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30241 ::fidl_next::munge!(let Self { table } = slot);
30242
30243 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30244 match ordinal {
30245 0 => unsafe { ::core::hint::unreachable_unchecked() },
30246
30247 1 => {
30248 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30249 slot.as_mut(),
30250 decoder,
30251 (),
30252 )?;
30253
30254 Ok(())
30255 }
30256
30257 2 => {
30258 ::fidl_next::wire::Envelope::decode_as::<
30259 ___D,
30260 ::fidl_next::wire::String<'de>,
30261 >(slot.as_mut(), decoder, 100)?;
30262
30263 let value = unsafe {
30264 slot.deref_unchecked()
30265 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30266 };
30267
30268 if value.len() > 100 {
30269 return Err(::fidl_next::DecodeError::VectorTooLong {
30270 size: value.len() as u64,
30271 limit: 100,
30272 });
30273 }
30274
30275 Ok(())
30276 }
30277
30278 3 => {
30279 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30280 slot.as_mut(),
30281 decoder,
30282 (),
30283 )?;
30284
30285 Ok(())
30286 }
30287
30288 4 => {
30289 ::fidl_next::wire::Envelope::decode_as::<
30290 ___D,
30291 ::fidl_next::wire::String<'de>,
30292 >(slot.as_mut(), decoder, 100)?;
30293
30294 let value = unsafe {
30295 slot.deref_unchecked()
30296 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30297 };
30298
30299 if value.len() > 100 {
30300 return Err(::fidl_next::DecodeError::VectorTooLong {
30301 size: value.len() as u64,
30302 limit: 100,
30303 });
30304 }
30305
30306 Ok(())
30307 }
30308
30309 5 => {
30310 ::fidl_next::wire::Envelope::decode_as::<
30311 ___D,
30312 ::fidl_next_common_fuchsia_io::wire::Operations,
30313 >(slot.as_mut(), decoder, ())?;
30314
30315 Ok(())
30316 }
30317
30318 6 => {
30319 ::fidl_next::wire::Envelope::decode_as::<
30320 ___D,
30321 ::fidl_next::wire::String<'de>,
30322 >(slot.as_mut(), decoder, 1024)?;
30323
30324 let value = unsafe {
30325 slot.deref_unchecked()
30326 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30327 };
30328
30329 if value.len() > 1024 {
30330 return Err(::fidl_next::DecodeError::VectorTooLong {
30331 size: value.len() as u64,
30332 limit: 1024,
30333 });
30334 }
30335
30336 Ok(())
30337 }
30338
30339 7 => {
30340 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
30341 slot.as_mut(),
30342 decoder,
30343 (),
30344 )?;
30345
30346 Ok(())
30347 }
30348
30349 8 => {
30350 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
30351 slot.as_mut(),
30352 decoder,
30353 (),
30354 )?;
30355
30356 Ok(())
30357 }
30358
30359 9 => {
30360 ::fidl_next::wire::Envelope::decode_as::<
30361 ___D,
30362 ::fidl_next::wire::String<'de>,
30363 >(slot.as_mut(), decoder, 1024)?;
30364
30365 let value = unsafe {
30366 slot.deref_unchecked()
30367 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30368 };
30369
30370 if value.len() > 1024 {
30371 return Err(::fidl_next::DecodeError::VectorTooLong {
30372 size: value.len() as u64,
30373 limit: 1024,
30374 });
30375 }
30376
30377 Ok(())
30378 }
30379
30380 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
30381 }
30382 })
30383 }
30384 }
30385
30386 impl<'de> OfferDirectory<'de> {
30387 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30388 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30389 }
30390
30391 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30392 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30393 }
30394
30395 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30396 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
30397 }
30398
30399 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30400 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
30401 }
30402
30403 pub fn rights(
30404 &self,
30405 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_io::wire::Operations> {
30406 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
30407 }
30408
30409 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30410 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
30411 }
30412
30413 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
30414 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
30415 }
30416
30417 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
30418 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
30419 }
30420
30421 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30422 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
30423 }
30424 }
30425
30426 impl<'de> ::core::fmt::Debug for OfferDirectory<'de> {
30427 fn fmt(
30428 &self,
30429 f: &mut ::core::fmt::Formatter<'_>,
30430 ) -> ::core::result::Result<(), ::core::fmt::Error> {
30431 f.debug_struct("OfferDirectory")
30432 .field("source", &self.source())
30433 .field("source_name", &self.source_name())
30434 .field("target", &self.target())
30435 .field("target_name", &self.target_name())
30436 .field("rights", &self.rights())
30437 .field("subdir", &self.subdir())
30438 .field("dependency_type", &self.dependency_type())
30439 .field("availability", &self.availability())
30440 .field("source_dictionary", &self.source_dictionary())
30441 .finish()
30442 }
30443 }
30444
30445 impl<'de> ::fidl_next::IntoNatural for OfferDirectory<'de> {
30446 type Natural = crate::natural::OfferDirectory;
30447 }
30448
30449 #[repr(C)]
30451 pub struct OfferStorage<'de> {
30452 pub(crate) table: ::fidl_next::wire::Table<'de>,
30453 }
30454
30455 impl<'de> Drop for OfferStorage<'de> {
30456 fn drop(&mut self) {
30457 let _ = self.table.get(1).map(|envelope| unsafe {
30458 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30459 });
30460
30461 let _ = self
30462 .table
30463 .get(2)
30464 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30465
30466 let _ = self
30467 .table
30468 .get(3)
30469 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30470
30471 let _ = self.table.get(4).map(|envelope| unsafe {
30472 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30473 });
30474
30475 let _ = self
30476 .table
30477 .get(5)
30478 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
30479 }
30480 }
30481
30482 impl ::fidl_next::Constrained for OfferStorage<'_> {
30483 type Constraint = ();
30484
30485 fn validate(
30486 _: ::fidl_next::Slot<'_, Self>,
30487 _: Self::Constraint,
30488 ) -> Result<(), ::fidl_next::ValidationError> {
30489 Ok(())
30490 }
30491 }
30492
30493 unsafe impl ::fidl_next::Wire for OfferStorage<'static> {
30494 type Narrowed<'de> = OfferStorage<'de>;
30495
30496 #[inline]
30497 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30498 ::fidl_next::munge!(let Self { table } = out);
30499 ::fidl_next::wire::Table::zero_padding(table);
30500 }
30501 }
30502
30503 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferStorage<'de>
30504 where
30505 ___D: ::fidl_next::Decoder<'de> + ?Sized,
30506 {
30507 fn decode(
30508 slot: ::fidl_next::Slot<'_, Self>,
30509 decoder: &mut ___D,
30510 _: (),
30511 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30512 ::fidl_next::munge!(let Self { table } = slot);
30513
30514 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30515 match ordinal {
30516 0 => unsafe { ::core::hint::unreachable_unchecked() },
30517
30518 1 => {
30519 ::fidl_next::wire::Envelope::decode_as::<
30520 ___D,
30521 ::fidl_next::wire::String<'de>,
30522 >(slot.as_mut(), decoder, 100)?;
30523
30524 let value = unsafe {
30525 slot.deref_unchecked()
30526 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30527 };
30528
30529 if value.len() > 100 {
30530 return Err(::fidl_next::DecodeError::VectorTooLong {
30531 size: value.len() as u64,
30532 limit: 100,
30533 });
30534 }
30535
30536 Ok(())
30537 }
30538
30539 2 => {
30540 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30541 slot.as_mut(),
30542 decoder,
30543 (),
30544 )?;
30545
30546 Ok(())
30547 }
30548
30549 3 => {
30550 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30551 slot.as_mut(),
30552 decoder,
30553 (),
30554 )?;
30555
30556 Ok(())
30557 }
30558
30559 4 => {
30560 ::fidl_next::wire::Envelope::decode_as::<
30561 ___D,
30562 ::fidl_next::wire::String<'de>,
30563 >(slot.as_mut(), decoder, 100)?;
30564
30565 let value = unsafe {
30566 slot.deref_unchecked()
30567 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30568 };
30569
30570 if value.len() > 100 {
30571 return Err(::fidl_next::DecodeError::VectorTooLong {
30572 size: value.len() as u64,
30573 limit: 100,
30574 });
30575 }
30576
30577 Ok(())
30578 }
30579
30580 5 => {
30581 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
30582 slot.as_mut(),
30583 decoder,
30584 (),
30585 )?;
30586
30587 Ok(())
30588 }
30589
30590 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
30591 }
30592 })
30593 }
30594 }
30595
30596 impl<'de> OfferStorage<'de> {
30597 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30598 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30599 }
30600
30601 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30602 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30603 }
30604
30605 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30606 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
30607 }
30608
30609 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30610 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
30611 }
30612
30613 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
30614 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
30615 }
30616 }
30617
30618 impl<'de> ::core::fmt::Debug for OfferStorage<'de> {
30619 fn fmt(
30620 &self,
30621 f: &mut ::core::fmt::Formatter<'_>,
30622 ) -> ::core::result::Result<(), ::core::fmt::Error> {
30623 f.debug_struct("OfferStorage")
30624 .field("source_name", &self.source_name())
30625 .field("source", &self.source())
30626 .field("target", &self.target())
30627 .field("target_name", &self.target_name())
30628 .field("availability", &self.availability())
30629 .finish()
30630 }
30631 }
30632
30633 impl<'de> ::fidl_next::IntoNatural for OfferStorage<'de> {
30634 type Natural = crate::natural::OfferStorage;
30635 }
30636
30637 #[repr(C)]
30639 pub struct OfferRunner<'de> {
30640 pub(crate) table: ::fidl_next::wire::Table<'de>,
30641 }
30642
30643 impl<'de> Drop for OfferRunner<'de> {
30644 fn drop(&mut self) {
30645 let _ = self
30646 .table
30647 .get(1)
30648 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30649
30650 let _ = self.table.get(2).map(|envelope| unsafe {
30651 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30652 });
30653
30654 let _ = self
30655 .table
30656 .get(3)
30657 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30658
30659 let _ = self.table.get(4).map(|envelope| unsafe {
30660 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30661 });
30662
30663 let _ = self.table.get(5).map(|envelope| unsafe {
30664 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30665 });
30666 }
30667 }
30668
30669 impl ::fidl_next::Constrained for OfferRunner<'_> {
30670 type Constraint = ();
30671
30672 fn validate(
30673 _: ::fidl_next::Slot<'_, Self>,
30674 _: Self::Constraint,
30675 ) -> Result<(), ::fidl_next::ValidationError> {
30676 Ok(())
30677 }
30678 }
30679
30680 unsafe impl ::fidl_next::Wire for OfferRunner<'static> {
30681 type Narrowed<'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::wire::Table::zero_padding(table);
30687 }
30688 }
30689
30690 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferRunner<'de>
30691 where
30692 ___D: ::fidl_next::Decoder<'de> + ?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::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30702 match ordinal {
30703 0 => unsafe { ::core::hint::unreachable_unchecked() },
30704
30705 1 => {
30706 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30707 slot.as_mut(),
30708 decoder,
30709 (),
30710 )?;
30711
30712 Ok(())
30713 }
30714
30715 2 => {
30716 ::fidl_next::wire::Envelope::decode_as::<
30717 ___D,
30718 ::fidl_next::wire::String<'de>,
30719 >(slot.as_mut(), decoder, 100)?;
30720
30721 let value = unsafe {
30722 slot.deref_unchecked()
30723 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30724 };
30725
30726 if value.len() > 100 {
30727 return Err(::fidl_next::DecodeError::VectorTooLong {
30728 size: value.len() as u64,
30729 limit: 100,
30730 });
30731 }
30732
30733 Ok(())
30734 }
30735
30736 3 => {
30737 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30738 slot.as_mut(),
30739 decoder,
30740 (),
30741 )?;
30742
30743 Ok(())
30744 }
30745
30746 4 => {
30747 ::fidl_next::wire::Envelope::decode_as::<
30748 ___D,
30749 ::fidl_next::wire::String<'de>,
30750 >(slot.as_mut(), decoder, 100)?;
30751
30752 let value = unsafe {
30753 slot.deref_unchecked()
30754 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30755 };
30756
30757 if value.len() > 100 {
30758 return Err(::fidl_next::DecodeError::VectorTooLong {
30759 size: value.len() as u64,
30760 limit: 100,
30761 });
30762 }
30763
30764 Ok(())
30765 }
30766
30767 5 => {
30768 ::fidl_next::wire::Envelope::decode_as::<
30769 ___D,
30770 ::fidl_next::wire::String<'de>,
30771 >(slot.as_mut(), decoder, 1024)?;
30772
30773 let value = unsafe {
30774 slot.deref_unchecked()
30775 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30776 };
30777
30778 if value.len() > 1024 {
30779 return Err(::fidl_next::DecodeError::VectorTooLong {
30780 size: value.len() as u64,
30781 limit: 1024,
30782 });
30783 }
30784
30785 Ok(())
30786 }
30787
30788 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
30789 }
30790 })
30791 }
30792 }
30793
30794 impl<'de> OfferRunner<'de> {
30795 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30796 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30797 }
30798
30799 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30800 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30801 }
30802
30803 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30804 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
30805 }
30806
30807 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30808 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
30809 }
30810
30811 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30812 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
30813 }
30814 }
30815
30816 impl<'de> ::core::fmt::Debug for OfferRunner<'de> {
30817 fn fmt(
30818 &self,
30819 f: &mut ::core::fmt::Formatter<'_>,
30820 ) -> ::core::result::Result<(), ::core::fmt::Error> {
30821 f.debug_struct("OfferRunner")
30822 .field("source", &self.source())
30823 .field("source_name", &self.source_name())
30824 .field("target", &self.target())
30825 .field("target_name", &self.target_name())
30826 .field("source_dictionary", &self.source_dictionary())
30827 .finish()
30828 }
30829 }
30830
30831 impl<'de> ::fidl_next::IntoNatural for OfferRunner<'de> {
30832 type Natural = crate::natural::OfferRunner;
30833 }
30834
30835 #[repr(C)]
30837 pub struct OfferResolver<'de> {
30838 pub(crate) table: ::fidl_next::wire::Table<'de>,
30839 }
30840
30841 impl<'de> Drop for OfferResolver<'de> {
30842 fn drop(&mut self) {
30843 let _ = self
30844 .table
30845 .get(1)
30846 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30847
30848 let _ = self.table.get(2).map(|envelope| unsafe {
30849 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30850 });
30851
30852 let _ = self
30853 .table
30854 .get(3)
30855 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30856
30857 let _ = self.table.get(4).map(|envelope| unsafe {
30858 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30859 });
30860
30861 let _ = self.table.get(5).map(|envelope| unsafe {
30862 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30863 });
30864 }
30865 }
30866
30867 impl ::fidl_next::Constrained for OfferResolver<'_> {
30868 type Constraint = ();
30869
30870 fn validate(
30871 _: ::fidl_next::Slot<'_, Self>,
30872 _: Self::Constraint,
30873 ) -> Result<(), ::fidl_next::ValidationError> {
30874 Ok(())
30875 }
30876 }
30877
30878 unsafe impl ::fidl_next::Wire for OfferResolver<'static> {
30879 type Narrowed<'de> = OfferResolver<'de>;
30880
30881 #[inline]
30882 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30883 ::fidl_next::munge!(let Self { table } = out);
30884 ::fidl_next::wire::Table::zero_padding(table);
30885 }
30886 }
30887
30888 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferResolver<'de>
30889 where
30890 ___D: ::fidl_next::Decoder<'de> + ?Sized,
30891 {
30892 fn decode(
30893 slot: ::fidl_next::Slot<'_, Self>,
30894 decoder: &mut ___D,
30895 _: (),
30896 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30897 ::fidl_next::munge!(let Self { table } = slot);
30898
30899 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30900 match ordinal {
30901 0 => unsafe { ::core::hint::unreachable_unchecked() },
30902
30903 1 => {
30904 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30905 slot.as_mut(),
30906 decoder,
30907 (),
30908 )?;
30909
30910 Ok(())
30911 }
30912
30913 2 => {
30914 ::fidl_next::wire::Envelope::decode_as::<
30915 ___D,
30916 ::fidl_next::wire::String<'de>,
30917 >(slot.as_mut(), decoder, 100)?;
30918
30919 let value = unsafe {
30920 slot.deref_unchecked()
30921 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30922 };
30923
30924 if value.len() > 100 {
30925 return Err(::fidl_next::DecodeError::VectorTooLong {
30926 size: value.len() as u64,
30927 limit: 100,
30928 });
30929 }
30930
30931 Ok(())
30932 }
30933
30934 3 => {
30935 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30936 slot.as_mut(),
30937 decoder,
30938 (),
30939 )?;
30940
30941 Ok(())
30942 }
30943
30944 4 => {
30945 ::fidl_next::wire::Envelope::decode_as::<
30946 ___D,
30947 ::fidl_next::wire::String<'de>,
30948 >(slot.as_mut(), decoder, 100)?;
30949
30950 let value = unsafe {
30951 slot.deref_unchecked()
30952 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30953 };
30954
30955 if value.len() > 100 {
30956 return Err(::fidl_next::DecodeError::VectorTooLong {
30957 size: value.len() as u64,
30958 limit: 100,
30959 });
30960 }
30961
30962 Ok(())
30963 }
30964
30965 5 => {
30966 ::fidl_next::wire::Envelope::decode_as::<
30967 ___D,
30968 ::fidl_next::wire::String<'de>,
30969 >(slot.as_mut(), decoder, 1024)?;
30970
30971 let value = unsafe {
30972 slot.deref_unchecked()
30973 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30974 };
30975
30976 if value.len() > 1024 {
30977 return Err(::fidl_next::DecodeError::VectorTooLong {
30978 size: value.len() as u64,
30979 limit: 1024,
30980 });
30981 }
30982
30983 Ok(())
30984 }
30985
30986 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
30987 }
30988 })
30989 }
30990 }
30991
30992 impl<'de> OfferResolver<'de> {
30993 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30994 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30995 }
30996
30997 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30998 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30999 }
31000
31001 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31002 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
31003 }
31004
31005 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31006 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
31007 }
31008
31009 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31010 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
31011 }
31012 }
31013
31014 impl<'de> ::core::fmt::Debug for OfferResolver<'de> {
31015 fn fmt(
31016 &self,
31017 f: &mut ::core::fmt::Formatter<'_>,
31018 ) -> ::core::result::Result<(), ::core::fmt::Error> {
31019 f.debug_struct("OfferResolver")
31020 .field("source", &self.source())
31021 .field("source_name", &self.source_name())
31022 .field("target", &self.target())
31023 .field("target_name", &self.target_name())
31024 .field("source_dictionary", &self.source_dictionary())
31025 .finish()
31026 }
31027 }
31028
31029 impl<'de> ::fidl_next::IntoNatural for OfferResolver<'de> {
31030 type Natural = crate::natural::OfferResolver;
31031 }
31032
31033 #[repr(C)]
31035 pub struct OfferEventStream<'de> {
31036 pub(crate) table: ::fidl_next::wire::Table<'de>,
31037 }
31038
31039 impl<'de> Drop for OfferEventStream<'de> {
31040 fn drop(&mut self) {
31041 let _ = self
31042 .table
31043 .get(1)
31044 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31045
31046 let _ = self.table.get(2).map(|envelope| unsafe {
31047 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31048 });
31049
31050 let _ = self.table.get(3).map(|envelope| unsafe {
31051 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>()
31052 });
31053
31054 let _ = self
31055 .table
31056 .get(4)
31057 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31058
31059 let _ = self.table.get(5).map(|envelope| unsafe {
31060 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31061 });
31062
31063 let _ = self
31064 .table
31065 .get(7)
31066 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
31067 }
31068 }
31069
31070 impl ::fidl_next::Constrained for OfferEventStream<'_> {
31071 type Constraint = ();
31072
31073 fn validate(
31074 _: ::fidl_next::Slot<'_, Self>,
31075 _: Self::Constraint,
31076 ) -> Result<(), ::fidl_next::ValidationError> {
31077 Ok(())
31078 }
31079 }
31080
31081 unsafe impl ::fidl_next::Wire for OfferEventStream<'static> {
31082 type Narrowed<'de> = OfferEventStream<'de>;
31083
31084 #[inline]
31085 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31086 ::fidl_next::munge!(let Self { table } = out);
31087 ::fidl_next::wire::Table::zero_padding(table);
31088 }
31089 }
31090
31091 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferEventStream<'de>
31092 where
31093 ___D: ::fidl_next::Decoder<'de> + ?Sized,
31094 {
31095 fn decode(
31096 slot: ::fidl_next::Slot<'_, Self>,
31097 decoder: &mut ___D,
31098 _: (),
31099 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
31100 ::fidl_next::munge!(let Self { table } = slot);
31101
31102 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
31103 match ordinal {
31104 0 => unsafe { ::core::hint::unreachable_unchecked() },
31105
31106 1 => {
31107 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
31108 slot.as_mut(),
31109 decoder,
31110 (),
31111 )?;
31112
31113 Ok(())
31114 }
31115
31116 2 => {
31117 ::fidl_next::wire::Envelope::decode_as::<
31118 ___D,
31119 ::fidl_next::wire::String<'de>,
31120 >(slot.as_mut(), decoder, 100)?;
31121
31122 let value = unsafe {
31123 slot.deref_unchecked()
31124 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31125 };
31126
31127 if value.len() > 100 {
31128 return Err(::fidl_next::DecodeError::VectorTooLong {
31129 size: value.len() as u64,
31130 limit: 100,
31131 });
31132 }
31133
31134 Ok(())
31135 }
31136
31137 3 => {
31138 ::fidl_next::wire::Envelope::decode_as::<
31139 ___D,
31140 ::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>,
31141 >(slot.as_mut(), decoder, (4294967295, ()))?;
31142
31143 Ok(())
31144 }
31145
31146 4 => {
31147 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
31148 slot.as_mut(),
31149 decoder,
31150 (),
31151 )?;
31152
31153 Ok(())
31154 }
31155
31156 5 => {
31157 ::fidl_next::wire::Envelope::decode_as::<
31158 ___D,
31159 ::fidl_next::wire::String<'de>,
31160 >(slot.as_mut(), decoder, 100)?;
31161
31162 let value = unsafe {
31163 slot.deref_unchecked()
31164 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31165 };
31166
31167 if value.len() > 100 {
31168 return Err(::fidl_next::DecodeError::VectorTooLong {
31169 size: value.len() as u64,
31170 limit: 100,
31171 });
31172 }
31173
31174 Ok(())
31175 }
31176
31177 7 => {
31178 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
31179 slot.as_mut(),
31180 decoder,
31181 (),
31182 )?;
31183
31184 Ok(())
31185 }
31186
31187 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
31188 }
31189 })
31190 }
31191 }
31192
31193 impl<'de> OfferEventStream<'de> {
31194 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31195 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
31196 }
31197
31198 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31199 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
31200 }
31201
31202 pub fn scope(
31203 &self,
31204 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>
31205 {
31206 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
31207 }
31208
31209 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31210 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
31211 }
31212
31213 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31214 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
31215 }
31216
31217 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
31218 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
31219 }
31220 }
31221
31222 impl<'de> ::core::fmt::Debug for OfferEventStream<'de> {
31223 fn fmt(
31224 &self,
31225 f: &mut ::core::fmt::Formatter<'_>,
31226 ) -> ::core::result::Result<(), ::core::fmt::Error> {
31227 f.debug_struct("OfferEventStream")
31228 .field("source", &self.source())
31229 .field("source_name", &self.source_name())
31230 .field("scope", &self.scope())
31231 .field("target", &self.target())
31232 .field("target_name", &self.target_name())
31233 .field("availability", &self.availability())
31234 .finish()
31235 }
31236 }
31237
31238 impl<'de> ::fidl_next::IntoNatural for OfferEventStream<'de> {
31239 type Natural = crate::natural::OfferEventStream;
31240 }
31241
31242 #[repr(C)]
31244 pub struct OfferDictionary<'de> {
31245 pub(crate) table: ::fidl_next::wire::Table<'de>,
31246 }
31247
31248 impl<'de> Drop for OfferDictionary<'de> {
31249 fn drop(&mut self) {
31250 let _ = self
31251 .table
31252 .get(1)
31253 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31254
31255 let _ = self.table.get(2).map(|envelope| unsafe {
31256 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31257 });
31258
31259 let _ = self
31260 .table
31261 .get(3)
31262 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31263
31264 let _ = self.table.get(4).map(|envelope| unsafe {
31265 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31266 });
31267
31268 let _ = self.table.get(5).map(|envelope| unsafe {
31269 envelope.read_unchecked::<crate::wire::DependencyType>()
31270 });
31271
31272 let _ = self
31273 .table
31274 .get(6)
31275 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
31276
31277 let _ = self.table.get(7).map(|envelope| unsafe {
31278 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31279 });
31280 }
31281 }
31282
31283 impl ::fidl_next::Constrained for OfferDictionary<'_> {
31284 type Constraint = ();
31285
31286 fn validate(
31287 _: ::fidl_next::Slot<'_, Self>,
31288 _: Self::Constraint,
31289 ) -> Result<(), ::fidl_next::ValidationError> {
31290 Ok(())
31291 }
31292 }
31293
31294 unsafe impl ::fidl_next::Wire for OfferDictionary<'static> {
31295 type Narrowed<'de> = OfferDictionary<'de>;
31296
31297 #[inline]
31298 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31299 ::fidl_next::munge!(let Self { table } = out);
31300 ::fidl_next::wire::Table::zero_padding(table);
31301 }
31302 }
31303
31304 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferDictionary<'de>
31305 where
31306 ___D: ::fidl_next::Decoder<'de> + ?Sized,
31307 {
31308 fn decode(
31309 slot: ::fidl_next::Slot<'_, Self>,
31310 decoder: &mut ___D,
31311 _: (),
31312 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
31313 ::fidl_next::munge!(let Self { table } = slot);
31314
31315 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
31316 match ordinal {
31317 0 => unsafe { ::core::hint::unreachable_unchecked() },
31318
31319 1 => {
31320 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
31321 slot.as_mut(),
31322 decoder,
31323 (),
31324 )?;
31325
31326 Ok(())
31327 }
31328
31329 2 => {
31330 ::fidl_next::wire::Envelope::decode_as::<
31331 ___D,
31332 ::fidl_next::wire::String<'de>,
31333 >(slot.as_mut(), decoder, 100)?;
31334
31335 let value = unsafe {
31336 slot.deref_unchecked()
31337 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31338 };
31339
31340 if value.len() > 100 {
31341 return Err(::fidl_next::DecodeError::VectorTooLong {
31342 size: value.len() as u64,
31343 limit: 100,
31344 });
31345 }
31346
31347 Ok(())
31348 }
31349
31350 3 => {
31351 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
31352 slot.as_mut(),
31353 decoder,
31354 (),
31355 )?;
31356
31357 Ok(())
31358 }
31359
31360 4 => {
31361 ::fidl_next::wire::Envelope::decode_as::<
31362 ___D,
31363 ::fidl_next::wire::String<'de>,
31364 >(slot.as_mut(), decoder, 100)?;
31365
31366 let value = unsafe {
31367 slot.deref_unchecked()
31368 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31369 };
31370
31371 if value.len() > 100 {
31372 return Err(::fidl_next::DecodeError::VectorTooLong {
31373 size: value.len() as u64,
31374 limit: 100,
31375 });
31376 }
31377
31378 Ok(())
31379 }
31380
31381 5 => {
31382 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
31383 slot.as_mut(),
31384 decoder,
31385 (),
31386 )?;
31387
31388 Ok(())
31389 }
31390
31391 6 => {
31392 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
31393 slot.as_mut(),
31394 decoder,
31395 (),
31396 )?;
31397
31398 Ok(())
31399 }
31400
31401 7 => {
31402 ::fidl_next::wire::Envelope::decode_as::<
31403 ___D,
31404 ::fidl_next::wire::String<'de>,
31405 >(slot.as_mut(), decoder, 1024)?;
31406
31407 let value = unsafe {
31408 slot.deref_unchecked()
31409 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31410 };
31411
31412 if value.len() > 1024 {
31413 return Err(::fidl_next::DecodeError::VectorTooLong {
31414 size: value.len() as u64,
31415 limit: 1024,
31416 });
31417 }
31418
31419 Ok(())
31420 }
31421
31422 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
31423 }
31424 })
31425 }
31426 }
31427
31428 impl<'de> OfferDictionary<'de> {
31429 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31430 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
31431 }
31432
31433 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31434 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
31435 }
31436
31437 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31438 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
31439 }
31440
31441 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31442 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
31443 }
31444
31445 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
31446 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
31447 }
31448
31449 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
31450 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
31451 }
31452
31453 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31454 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
31455 }
31456 }
31457
31458 impl<'de> ::core::fmt::Debug for OfferDictionary<'de> {
31459 fn fmt(
31460 &self,
31461 f: &mut ::core::fmt::Formatter<'_>,
31462 ) -> ::core::result::Result<(), ::core::fmt::Error> {
31463 f.debug_struct("OfferDictionary")
31464 .field("source", &self.source())
31465 .field("source_name", &self.source_name())
31466 .field("target", &self.target())
31467 .field("target_name", &self.target_name())
31468 .field("dependency_type", &self.dependency_type())
31469 .field("availability", &self.availability())
31470 .field("source_dictionary", &self.source_dictionary())
31471 .finish()
31472 }
31473 }
31474
31475 impl<'de> ::fidl_next::IntoNatural for OfferDictionary<'de> {
31476 type Natural = crate::natural::OfferDictionary;
31477 }
31478
31479 #[repr(C)]
31481 pub struct OfferConfiguration<'de> {
31482 pub(crate) table: ::fidl_next::wire::Table<'de>,
31483 }
31484
31485 impl<'de> Drop for OfferConfiguration<'de> {
31486 fn drop(&mut self) {
31487 let _ = self
31488 .table
31489 .get(1)
31490 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31491
31492 let _ = self.table.get(2).map(|envelope| unsafe {
31493 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31494 });
31495
31496 let _ = self
31497 .table
31498 .get(3)
31499 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31500
31501 let _ = self.table.get(4).map(|envelope| unsafe {
31502 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31503 });
31504
31505 let _ = self
31506 .table
31507 .get(5)
31508 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
31509
31510 let _ = self.table.get(6).map(|envelope| unsafe {
31511 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31512 });
31513 }
31514 }
31515
31516 impl ::fidl_next::Constrained for OfferConfiguration<'_> {
31517 type Constraint = ();
31518
31519 fn validate(
31520 _: ::fidl_next::Slot<'_, Self>,
31521 _: Self::Constraint,
31522 ) -> Result<(), ::fidl_next::ValidationError> {
31523 Ok(())
31524 }
31525 }
31526
31527 unsafe impl ::fidl_next::Wire for OfferConfiguration<'static> {
31528 type Narrowed<'de> = OfferConfiguration<'de>;
31529
31530 #[inline]
31531 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31532 ::fidl_next::munge!(let Self { table } = out);
31533 ::fidl_next::wire::Table::zero_padding(table);
31534 }
31535 }
31536
31537 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferConfiguration<'de>
31538 where
31539 ___D: ::fidl_next::Decoder<'de> + ?Sized,
31540 {
31541 fn decode(
31542 slot: ::fidl_next::Slot<'_, Self>,
31543 decoder: &mut ___D,
31544 _: (),
31545 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
31546 ::fidl_next::munge!(let Self { table } = slot);
31547
31548 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
31549 match ordinal {
31550 0 => unsafe { ::core::hint::unreachable_unchecked() },
31551
31552 1 => {
31553 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
31554 slot.as_mut(),
31555 decoder,
31556 (),
31557 )?;
31558
31559 Ok(())
31560 }
31561
31562 2 => {
31563 ::fidl_next::wire::Envelope::decode_as::<
31564 ___D,
31565 ::fidl_next::wire::String<'de>,
31566 >(slot.as_mut(), decoder, 100)?;
31567
31568 let value = unsafe {
31569 slot.deref_unchecked()
31570 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31571 };
31572
31573 if value.len() > 100 {
31574 return Err(::fidl_next::DecodeError::VectorTooLong {
31575 size: value.len() as u64,
31576 limit: 100,
31577 });
31578 }
31579
31580 Ok(())
31581 }
31582
31583 3 => {
31584 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
31585 slot.as_mut(),
31586 decoder,
31587 (),
31588 )?;
31589
31590 Ok(())
31591 }
31592
31593 4 => {
31594 ::fidl_next::wire::Envelope::decode_as::<
31595 ___D,
31596 ::fidl_next::wire::String<'de>,
31597 >(slot.as_mut(), decoder, 100)?;
31598
31599 let value = unsafe {
31600 slot.deref_unchecked()
31601 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31602 };
31603
31604 if value.len() > 100 {
31605 return Err(::fidl_next::DecodeError::VectorTooLong {
31606 size: value.len() as u64,
31607 limit: 100,
31608 });
31609 }
31610
31611 Ok(())
31612 }
31613
31614 5 => {
31615 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
31616 slot.as_mut(),
31617 decoder,
31618 (),
31619 )?;
31620
31621 Ok(())
31622 }
31623
31624 6 => {
31625 ::fidl_next::wire::Envelope::decode_as::<
31626 ___D,
31627 ::fidl_next::wire::String<'de>,
31628 >(slot.as_mut(), decoder, 1024)?;
31629
31630 let value = unsafe {
31631 slot.deref_unchecked()
31632 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31633 };
31634
31635 if value.len() > 1024 {
31636 return Err(::fidl_next::DecodeError::VectorTooLong {
31637 size: value.len() as u64,
31638 limit: 1024,
31639 });
31640 }
31641
31642 Ok(())
31643 }
31644
31645 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
31646 }
31647 })
31648 }
31649 }
31650
31651 impl<'de> OfferConfiguration<'de> {
31652 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31653 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
31654 }
31655
31656 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31657 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
31658 }
31659
31660 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31661 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
31662 }
31663
31664 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31665 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
31666 }
31667
31668 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
31669 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
31670 }
31671
31672 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31673 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
31674 }
31675 }
31676
31677 impl<'de> ::core::fmt::Debug for OfferConfiguration<'de> {
31678 fn fmt(
31679 &self,
31680 f: &mut ::core::fmt::Formatter<'_>,
31681 ) -> ::core::result::Result<(), ::core::fmt::Error> {
31682 f.debug_struct("OfferConfiguration")
31683 .field("source", &self.source())
31684 .field("source_name", &self.source_name())
31685 .field("target", &self.target())
31686 .field("target_name", &self.target_name())
31687 .field("availability", &self.availability())
31688 .field("source_dictionary", &self.source_dictionary())
31689 .finish()
31690 }
31691 }
31692
31693 impl<'de> ::fidl_next::IntoNatural for OfferConfiguration<'de> {
31694 type Natural = crate::natural::OfferConfiguration;
31695 }
31696
31697 #[repr(transparent)]
31699 pub struct Offer<'de> {
31700 pub(crate) raw: ::fidl_next::wire::Union,
31701 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
31702 }
31703
31704 impl<'de> Drop for Offer<'de> {
31705 fn drop(&mut self) {
31706 match self.raw.ordinal() {
31707 1 => {
31708 let _ = unsafe {
31709 self.raw.get().read_unchecked::<crate::wire::OfferService<'de>>()
31710 };
31711 }
31712
31713 2 => {
31714 let _ = unsafe {
31715 self.raw.get().read_unchecked::<crate::wire::OfferProtocol<'de>>()
31716 };
31717 }
31718
31719 3 => {
31720 let _ = unsafe {
31721 self.raw.get().read_unchecked::<crate::wire::OfferDirectory<'de>>()
31722 };
31723 }
31724
31725 4 => {
31726 let _ = unsafe {
31727 self.raw.get().read_unchecked::<crate::wire::OfferStorage<'de>>()
31728 };
31729 }
31730
31731 5 => {
31732 let _ =
31733 unsafe { self.raw.get().read_unchecked::<crate::wire::OfferRunner<'de>>() };
31734 }
31735
31736 6 => {
31737 let _ = unsafe {
31738 self.raw.get().read_unchecked::<crate::wire::OfferResolver<'de>>()
31739 };
31740 }
31741
31742 8 => {
31743 let _ = unsafe {
31744 self.raw.get().read_unchecked::<crate::wire::OfferEventStream<'de>>()
31745 };
31746 }
31747
31748 9 => {
31749 let _ = unsafe {
31750 self.raw.get().read_unchecked::<crate::wire::OfferDictionary<'de>>()
31751 };
31752 }
31753
31754 10 => {
31755 let _ = unsafe {
31756 self.raw.get().read_unchecked::<crate::wire::OfferConfiguration<'de>>()
31757 };
31758 }
31759
31760 _ => (),
31761 }
31762 }
31763 }
31764
31765 impl ::fidl_next::Constrained for Offer<'_> {
31766 type Constraint = ();
31767
31768 fn validate(
31769 _: ::fidl_next::Slot<'_, Self>,
31770 _: Self::Constraint,
31771 ) -> Result<(), ::fidl_next::ValidationError> {
31772 Ok(())
31773 }
31774 }
31775
31776 unsafe impl ::fidl_next::Wire for Offer<'static> {
31777 type Narrowed<'de> = Offer<'de>;
31778
31779 #[inline]
31780 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31781 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
31782 ::fidl_next::wire::Union::zero_padding(raw);
31783 }
31784 }
31785
31786 pub mod offer {
31787 pub enum Ref<'de> {
31788 Service(&'de crate::wire::OfferService<'de>),
31789
31790 Protocol(&'de crate::wire::OfferProtocol<'de>),
31791
31792 Directory(&'de crate::wire::OfferDirectory<'de>),
31793
31794 Storage(&'de crate::wire::OfferStorage<'de>),
31795
31796 Runner(&'de crate::wire::OfferRunner<'de>),
31797
31798 Resolver(&'de crate::wire::OfferResolver<'de>),
31799
31800 EventStream(&'de crate::wire::OfferEventStream<'de>),
31801
31802 Dictionary(&'de crate::wire::OfferDictionary<'de>),
31803
31804 Config(&'de crate::wire::OfferConfiguration<'de>),
31805
31806 UnknownOrdinal_(u64),
31807 }
31808 }
31809
31810 impl<'de> Offer<'de> {
31811 pub fn as_ref(&self) -> crate::wire::offer::Ref<'_> {
31812 match self.raw.ordinal() {
31813 1 => crate::wire::offer::Ref::Service(unsafe {
31814 self.raw.get().deref_unchecked::<crate::wire::OfferService<'_>>()
31815 }),
31816
31817 2 => crate::wire::offer::Ref::Protocol(unsafe {
31818 self.raw.get().deref_unchecked::<crate::wire::OfferProtocol<'_>>()
31819 }),
31820
31821 3 => crate::wire::offer::Ref::Directory(unsafe {
31822 self.raw.get().deref_unchecked::<crate::wire::OfferDirectory<'_>>()
31823 }),
31824
31825 4 => crate::wire::offer::Ref::Storage(unsafe {
31826 self.raw.get().deref_unchecked::<crate::wire::OfferStorage<'_>>()
31827 }),
31828
31829 5 => crate::wire::offer::Ref::Runner(unsafe {
31830 self.raw.get().deref_unchecked::<crate::wire::OfferRunner<'_>>()
31831 }),
31832
31833 6 => crate::wire::offer::Ref::Resolver(unsafe {
31834 self.raw.get().deref_unchecked::<crate::wire::OfferResolver<'_>>()
31835 }),
31836
31837 8 => crate::wire::offer::Ref::EventStream(unsafe {
31838 self.raw.get().deref_unchecked::<crate::wire::OfferEventStream<'_>>()
31839 }),
31840
31841 9 => crate::wire::offer::Ref::Dictionary(unsafe {
31842 self.raw.get().deref_unchecked::<crate::wire::OfferDictionary<'_>>()
31843 }),
31844
31845 10 => crate::wire::offer::Ref::Config(unsafe {
31846 self.raw.get().deref_unchecked::<crate::wire::OfferConfiguration<'_>>()
31847 }),
31848
31849 unknown => crate::wire::offer::Ref::UnknownOrdinal_(unknown),
31850 }
31851 }
31852 }
31853
31854 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Offer<'de>
31855 where
31856 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
31857 ___D: ::fidl_next::Decoder<'de>,
31858 {
31859 fn decode(
31860 mut slot: ::fidl_next::Slot<'_, Self>,
31861 decoder: &mut ___D,
31862 _: (),
31863 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
31864 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
31865 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
31866 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferService<'de>>(
31867 raw,
31868 decoder,
31869 (),
31870 )?,
31871
31872 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferProtocol<'de>>(
31873 raw,
31874 decoder,
31875 (),
31876 )?,
31877
31878 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferDirectory<'de>>(
31879 raw,
31880 decoder,
31881 (),
31882 )?,
31883
31884 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferStorage<'de>>(
31885 raw,
31886 decoder,
31887 (),
31888 )?,
31889
31890 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferRunner<'de>>(
31891 raw,
31892 decoder,
31893 (),
31894 )?,
31895
31896 6 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferResolver<'de>>(
31897 raw,
31898 decoder,
31899 (),
31900 )?,
31901
31902 8 => {
31903 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferEventStream<'de>>(
31904 raw,
31905 decoder,
31906 (),
31907 )?
31908 }
31909
31910 9 => {
31911 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferDictionary<'de>>(
31912 raw,
31913 decoder,
31914 (),
31915 )?
31916 }
31917
31918 10 => ::fidl_next::wire::Union::decode_as::<
31919 ___D,
31920 crate::wire::OfferConfiguration<'de>,
31921 >(raw, decoder, ())?,
31922
31923 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
31924 }
31925
31926 Ok(())
31927 }
31928 }
31929
31930 impl<'de> ::core::fmt::Debug for Offer<'de> {
31931 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
31932 match self.raw.ordinal() {
31933 1 => unsafe {
31934 self.raw.get().deref_unchecked::<crate::wire::OfferService<'_>>().fmt(f)
31935 },
31936 2 => unsafe {
31937 self.raw.get().deref_unchecked::<crate::wire::OfferProtocol<'_>>().fmt(f)
31938 },
31939 3 => unsafe {
31940 self.raw.get().deref_unchecked::<crate::wire::OfferDirectory<'_>>().fmt(f)
31941 },
31942 4 => unsafe {
31943 self.raw.get().deref_unchecked::<crate::wire::OfferStorage<'_>>().fmt(f)
31944 },
31945 5 => unsafe {
31946 self.raw.get().deref_unchecked::<crate::wire::OfferRunner<'_>>().fmt(f)
31947 },
31948 6 => unsafe {
31949 self.raw.get().deref_unchecked::<crate::wire::OfferResolver<'_>>().fmt(f)
31950 },
31951 8 => unsafe {
31952 self.raw.get().deref_unchecked::<crate::wire::OfferEventStream<'_>>().fmt(f)
31953 },
31954 9 => unsafe {
31955 self.raw.get().deref_unchecked::<crate::wire::OfferDictionary<'_>>().fmt(f)
31956 },
31957 10 => unsafe {
31958 self.raw.get().deref_unchecked::<crate::wire::OfferConfiguration<'_>>().fmt(f)
31959 },
31960 _ => unsafe { ::core::hint::unreachable_unchecked() },
31961 }
31962 }
31963 }
31964
31965 impl<'de> ::fidl_next::IntoNatural for Offer<'de> {
31966 type Natural = crate::natural::Offer;
31967 }
31968
31969 #[repr(C)]
31971 pub struct RunnerRegistration<'de> {
31972 pub(crate) table: ::fidl_next::wire::Table<'de>,
31973 }
31974
31975 impl<'de> Drop for RunnerRegistration<'de> {
31976 fn drop(&mut self) {
31977 let _ = self.table.get(1).map(|envelope| unsafe {
31978 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31979 });
31980
31981 let _ = self
31982 .table
31983 .get(2)
31984 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31985
31986 let _ = self.table.get(3).map(|envelope| unsafe {
31987 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31988 });
31989 }
31990 }
31991
31992 impl ::fidl_next::Constrained for RunnerRegistration<'_> {
31993 type Constraint = ();
31994
31995 fn validate(
31996 _: ::fidl_next::Slot<'_, Self>,
31997 _: Self::Constraint,
31998 ) -> Result<(), ::fidl_next::ValidationError> {
31999 Ok(())
32000 }
32001 }
32002
32003 unsafe impl ::fidl_next::Wire for RunnerRegistration<'static> {
32004 type Narrowed<'de> = RunnerRegistration<'de>;
32005
32006 #[inline]
32007 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32008 ::fidl_next::munge!(let Self { table } = out);
32009 ::fidl_next::wire::Table::zero_padding(table);
32010 }
32011 }
32012
32013 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for RunnerRegistration<'de>
32014 where
32015 ___D: ::fidl_next::Decoder<'de> + ?Sized,
32016 {
32017 fn decode(
32018 slot: ::fidl_next::Slot<'_, Self>,
32019 decoder: &mut ___D,
32020 _: (),
32021 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32022 ::fidl_next::munge!(let Self { table } = slot);
32023
32024 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32025 match ordinal {
32026 0 => unsafe { ::core::hint::unreachable_unchecked() },
32027
32028 1 => {
32029 ::fidl_next::wire::Envelope::decode_as::<
32030 ___D,
32031 ::fidl_next::wire::String<'de>,
32032 >(slot.as_mut(), decoder, 100)?;
32033
32034 let value = unsafe {
32035 slot.deref_unchecked()
32036 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32037 };
32038
32039 if value.len() > 100 {
32040 return Err(::fidl_next::DecodeError::VectorTooLong {
32041 size: value.len() as u64,
32042 limit: 100,
32043 });
32044 }
32045
32046 Ok(())
32047 }
32048
32049 2 => {
32050 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
32051 slot.as_mut(),
32052 decoder,
32053 (),
32054 )?;
32055
32056 Ok(())
32057 }
32058
32059 3 => {
32060 ::fidl_next::wire::Envelope::decode_as::<
32061 ___D,
32062 ::fidl_next::wire::String<'de>,
32063 >(slot.as_mut(), decoder, 100)?;
32064
32065 let value = unsafe {
32066 slot.deref_unchecked()
32067 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32068 };
32069
32070 if value.len() > 100 {
32071 return Err(::fidl_next::DecodeError::VectorTooLong {
32072 size: value.len() as u64,
32073 limit: 100,
32074 });
32075 }
32076
32077 Ok(())
32078 }
32079
32080 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
32081 }
32082 })
32083 }
32084 }
32085
32086 impl<'de> RunnerRegistration<'de> {
32087 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32088 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32089 }
32090
32091 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
32092 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
32093 }
32094
32095 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32096 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
32097 }
32098 }
32099
32100 impl<'de> ::core::fmt::Debug for RunnerRegistration<'de> {
32101 fn fmt(
32102 &self,
32103 f: &mut ::core::fmt::Formatter<'_>,
32104 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32105 f.debug_struct("RunnerRegistration")
32106 .field("source_name", &self.source_name())
32107 .field("source", &self.source())
32108 .field("target_name", &self.target_name())
32109 .finish()
32110 }
32111 }
32112
32113 impl<'de> ::fidl_next::IntoNatural for RunnerRegistration<'de> {
32114 type Natural = crate::natural::RunnerRegistration;
32115 }
32116
32117 #[repr(C)]
32119 pub struct ResolverRegistration<'de> {
32120 pub(crate) table: ::fidl_next::wire::Table<'de>,
32121 }
32122
32123 impl<'de> Drop for ResolverRegistration<'de> {
32124 fn drop(&mut self) {
32125 let _ = self.table.get(1).map(|envelope| unsafe {
32126 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
32127 });
32128
32129 let _ = self
32130 .table
32131 .get(2)
32132 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
32133
32134 let _ = self.table.get(3).map(|envelope| unsafe {
32135 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
32136 });
32137 }
32138 }
32139
32140 impl ::fidl_next::Constrained for ResolverRegistration<'_> {
32141 type Constraint = ();
32142
32143 fn validate(
32144 _: ::fidl_next::Slot<'_, Self>,
32145 _: Self::Constraint,
32146 ) -> Result<(), ::fidl_next::ValidationError> {
32147 Ok(())
32148 }
32149 }
32150
32151 unsafe impl ::fidl_next::Wire for ResolverRegistration<'static> {
32152 type Narrowed<'de> = ResolverRegistration<'de>;
32153
32154 #[inline]
32155 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32156 ::fidl_next::munge!(let Self { table } = out);
32157 ::fidl_next::wire::Table::zero_padding(table);
32158 }
32159 }
32160
32161 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ResolverRegistration<'de>
32162 where
32163 ___D: ::fidl_next::Decoder<'de> + ?Sized,
32164 {
32165 fn decode(
32166 slot: ::fidl_next::Slot<'_, Self>,
32167 decoder: &mut ___D,
32168 _: (),
32169 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32170 ::fidl_next::munge!(let Self { table } = slot);
32171
32172 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32173 match ordinal {
32174 0 => unsafe { ::core::hint::unreachable_unchecked() },
32175
32176 1 => {
32177 ::fidl_next::wire::Envelope::decode_as::<
32178 ___D,
32179 ::fidl_next::wire::String<'de>,
32180 >(slot.as_mut(), decoder, 100)?;
32181
32182 let value = unsafe {
32183 slot.deref_unchecked()
32184 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32185 };
32186
32187 if value.len() > 100 {
32188 return Err(::fidl_next::DecodeError::VectorTooLong {
32189 size: value.len() as u64,
32190 limit: 100,
32191 });
32192 }
32193
32194 Ok(())
32195 }
32196
32197 2 => {
32198 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
32199 slot.as_mut(),
32200 decoder,
32201 (),
32202 )?;
32203
32204 Ok(())
32205 }
32206
32207 3 => {
32208 ::fidl_next::wire::Envelope::decode_as::<
32209 ___D,
32210 ::fidl_next::wire::String<'de>,
32211 >(slot.as_mut(), decoder, 100)?;
32212
32213 let value = unsafe {
32214 slot.deref_unchecked()
32215 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32216 };
32217
32218 if value.len() > 100 {
32219 return Err(::fidl_next::DecodeError::VectorTooLong {
32220 size: value.len() as u64,
32221 limit: 100,
32222 });
32223 }
32224
32225 Ok(())
32226 }
32227
32228 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
32229 }
32230 })
32231 }
32232 }
32233
32234 impl<'de> ResolverRegistration<'de> {
32235 pub fn resolver(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32236 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32237 }
32238
32239 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
32240 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
32241 }
32242
32243 pub fn scheme(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32244 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
32245 }
32246 }
32247
32248 impl<'de> ::core::fmt::Debug for ResolverRegistration<'de> {
32249 fn fmt(
32250 &self,
32251 f: &mut ::core::fmt::Formatter<'_>,
32252 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32253 f.debug_struct("ResolverRegistration")
32254 .field("resolver", &self.resolver())
32255 .field("source", &self.source())
32256 .field("scheme", &self.scheme())
32257 .finish()
32258 }
32259 }
32260
32261 impl<'de> ::fidl_next::IntoNatural for ResolverRegistration<'de> {
32262 type Natural = crate::natural::ResolverRegistration;
32263 }
32264
32265 #[repr(C)]
32267 pub struct DebugProtocolRegistration<'de> {
32268 pub(crate) table: ::fidl_next::wire::Table<'de>,
32269 }
32270
32271 impl<'de> Drop for DebugProtocolRegistration<'de> {
32272 fn drop(&mut self) {
32273 let _ = self
32274 .table
32275 .get(1)
32276 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
32277
32278 let _ = self.table.get(2).map(|envelope| unsafe {
32279 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
32280 });
32281
32282 let _ = self.table.get(3).map(|envelope| unsafe {
32283 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
32284 });
32285 }
32286 }
32287
32288 impl ::fidl_next::Constrained for DebugProtocolRegistration<'_> {
32289 type Constraint = ();
32290
32291 fn validate(
32292 _: ::fidl_next::Slot<'_, Self>,
32293 _: Self::Constraint,
32294 ) -> Result<(), ::fidl_next::ValidationError> {
32295 Ok(())
32296 }
32297 }
32298
32299 unsafe impl ::fidl_next::Wire for DebugProtocolRegistration<'static> {
32300 type Narrowed<'de> = DebugProtocolRegistration<'de>;
32301
32302 #[inline]
32303 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32304 ::fidl_next::munge!(let Self { table } = out);
32305 ::fidl_next::wire::Table::zero_padding(table);
32306 }
32307 }
32308
32309 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DebugProtocolRegistration<'de>
32310 where
32311 ___D: ::fidl_next::Decoder<'de> + ?Sized,
32312 {
32313 fn decode(
32314 slot: ::fidl_next::Slot<'_, Self>,
32315 decoder: &mut ___D,
32316 _: (),
32317 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32318 ::fidl_next::munge!(let Self { table } = slot);
32319
32320 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32321 match ordinal {
32322 0 => unsafe { ::core::hint::unreachable_unchecked() },
32323
32324 1 => {
32325 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
32326 slot.as_mut(),
32327 decoder,
32328 (),
32329 )?;
32330
32331 Ok(())
32332 }
32333
32334 2 => {
32335 ::fidl_next::wire::Envelope::decode_as::<
32336 ___D,
32337 ::fidl_next::wire::String<'de>,
32338 >(slot.as_mut(), decoder, 100)?;
32339
32340 let value = unsafe {
32341 slot.deref_unchecked()
32342 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32343 };
32344
32345 if value.len() > 100 {
32346 return Err(::fidl_next::DecodeError::VectorTooLong {
32347 size: value.len() as u64,
32348 limit: 100,
32349 });
32350 }
32351
32352 Ok(())
32353 }
32354
32355 3 => {
32356 ::fidl_next::wire::Envelope::decode_as::<
32357 ___D,
32358 ::fidl_next::wire::String<'de>,
32359 >(slot.as_mut(), decoder, 100)?;
32360
32361 let value = unsafe {
32362 slot.deref_unchecked()
32363 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32364 };
32365
32366 if value.len() > 100 {
32367 return Err(::fidl_next::DecodeError::VectorTooLong {
32368 size: value.len() as u64,
32369 limit: 100,
32370 });
32371 }
32372
32373 Ok(())
32374 }
32375
32376 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
32377 }
32378 })
32379 }
32380 }
32381
32382 impl<'de> DebugProtocolRegistration<'de> {
32383 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
32384 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32385 }
32386
32387 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32388 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
32389 }
32390
32391 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32392 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
32393 }
32394 }
32395
32396 impl<'de> ::core::fmt::Debug for DebugProtocolRegistration<'de> {
32397 fn fmt(
32398 &self,
32399 f: &mut ::core::fmt::Formatter<'_>,
32400 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32401 f.debug_struct("DebugProtocolRegistration")
32402 .field("source", &self.source())
32403 .field("source_name", &self.source_name())
32404 .field("target_name", &self.target_name())
32405 .finish()
32406 }
32407 }
32408
32409 impl<'de> ::fidl_next::IntoNatural for DebugProtocolRegistration<'de> {
32410 type Natural = crate::natural::DebugProtocolRegistration;
32411 }
32412
32413 #[repr(transparent)]
32415 pub struct DebugRegistration<'de> {
32416 pub(crate) raw: ::fidl_next::wire::Union,
32417 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
32418 }
32419
32420 impl<'de> Drop for DebugRegistration<'de> {
32421 fn drop(&mut self) {
32422 match self.raw.ordinal() {
32423 1 => {
32424 let _ = unsafe {
32425 self.raw
32426 .get()
32427 .read_unchecked::<crate::wire::DebugProtocolRegistration<'de>>()
32428 };
32429 }
32430
32431 _ => (),
32432 }
32433 }
32434 }
32435
32436 impl ::fidl_next::Constrained for DebugRegistration<'_> {
32437 type Constraint = ();
32438
32439 fn validate(
32440 _: ::fidl_next::Slot<'_, Self>,
32441 _: Self::Constraint,
32442 ) -> Result<(), ::fidl_next::ValidationError> {
32443 Ok(())
32444 }
32445 }
32446
32447 unsafe impl ::fidl_next::Wire for DebugRegistration<'static> {
32448 type Narrowed<'de> = DebugRegistration<'de>;
32449
32450 #[inline]
32451 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32452 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
32453 ::fidl_next::wire::Union::zero_padding(raw);
32454 }
32455 }
32456
32457 pub mod debug_registration {
32458 pub enum Ref<'de> {
32459 Protocol(&'de crate::wire::DebugProtocolRegistration<'de>),
32460
32461 UnknownOrdinal_(u64),
32462 }
32463 }
32464
32465 impl<'de> DebugRegistration<'de> {
32466 pub fn as_ref(&self) -> crate::wire::debug_registration::Ref<'_> {
32467 match self.raw.ordinal() {
32468 1 => crate::wire::debug_registration::Ref::Protocol(unsafe {
32469 self.raw.get().deref_unchecked::<crate::wire::DebugProtocolRegistration<'_>>()
32470 }),
32471
32472 unknown => crate::wire::debug_registration::Ref::UnknownOrdinal_(unknown),
32473 }
32474 }
32475 }
32476
32477 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DebugRegistration<'de>
32478 where
32479 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
32480 ___D: ::fidl_next::Decoder<'de>,
32481 {
32482 fn decode(
32483 mut slot: ::fidl_next::Slot<'_, Self>,
32484 decoder: &mut ___D,
32485 _: (),
32486 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32487 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
32488 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
32489 1 => ::fidl_next::wire::Union::decode_as::<
32490 ___D,
32491 crate::wire::DebugProtocolRegistration<'de>,
32492 >(raw, decoder, ())?,
32493
32494 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
32495 }
32496
32497 Ok(())
32498 }
32499 }
32500
32501 impl<'de> ::core::fmt::Debug for DebugRegistration<'de> {
32502 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
32503 match self.raw.ordinal() {
32504 1 => unsafe {
32505 self.raw
32506 .get()
32507 .deref_unchecked::<crate::wire::DebugProtocolRegistration<'_>>()
32508 .fmt(f)
32509 },
32510 _ => unsafe { ::core::hint::unreachable_unchecked() },
32511 }
32512 }
32513 }
32514
32515 impl<'de> ::fidl_next::IntoNatural for DebugRegistration<'de> {
32516 type Natural = crate::natural::DebugRegistration;
32517 }
32518
32519 #[repr(C)]
32521 pub struct Environment<'de> {
32522 pub(crate) table: ::fidl_next::wire::Table<'de>,
32523 }
32524
32525 impl<'de> Drop for Environment<'de> {
32526 fn drop(&mut self) {
32527 let _ = self.table.get(1).map(|envelope| unsafe {
32528 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
32529 });
32530
32531 let _ = self.table.get(2).map(|envelope| unsafe {
32532 envelope.read_unchecked::<crate::wire::EnvironmentExtends>()
32533 });
32534
32535 let _ = self.table.get(3)
32536 .map(|envelope| unsafe {
32537 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::RunnerRegistration<'de>>>()
32538 });
32539
32540 let _ = self.table.get(4)
32541 .map(|envelope| unsafe {
32542 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ResolverRegistration<'de>>>()
32543 });
32544
32545 let _ = self.table.get(5)
32546 .map(|envelope| unsafe {
32547 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DebugRegistration<'de>>>()
32548 });
32549
32550 let _ = self
32551 .table
32552 .get(6)
32553 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
32554 }
32555 }
32556
32557 impl ::fidl_next::Constrained for Environment<'_> {
32558 type Constraint = ();
32559
32560 fn validate(
32561 _: ::fidl_next::Slot<'_, Self>,
32562 _: Self::Constraint,
32563 ) -> Result<(), ::fidl_next::ValidationError> {
32564 Ok(())
32565 }
32566 }
32567
32568 unsafe impl ::fidl_next::Wire for Environment<'static> {
32569 type Narrowed<'de> = Environment<'de>;
32570
32571 #[inline]
32572 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32573 ::fidl_next::munge!(let Self { table } = out);
32574 ::fidl_next::wire::Table::zero_padding(table);
32575 }
32576 }
32577
32578 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Environment<'de>
32579 where
32580 ___D: ::fidl_next::Decoder<'de> + ?Sized,
32581 {
32582 fn decode(
32583 slot: ::fidl_next::Slot<'_, Self>,
32584 decoder: &mut ___D,
32585 _: (),
32586 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32587 ::fidl_next::munge!(let Self { table } = slot);
32588
32589 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32590 match ordinal {
32591 0 => unsafe { ::core::hint::unreachable_unchecked() },
32592
32593 1 => {
32594 ::fidl_next::wire::Envelope::decode_as::<
32595 ___D,
32596 ::fidl_next::wire::String<'de>,
32597 >(slot.as_mut(), decoder, 100)?;
32598
32599 let value = unsafe {
32600 slot.deref_unchecked()
32601 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32602 };
32603
32604 if value.len() > 100 {
32605 return Err(::fidl_next::DecodeError::VectorTooLong {
32606 size: value.len() as u64,
32607 limit: 100,
32608 });
32609 }
32610
32611 Ok(())
32612 }
32613
32614 2 => {
32615 ::fidl_next::wire::Envelope::decode_as::<
32616 ___D,
32617 crate::wire::EnvironmentExtends,
32618 >(slot.as_mut(), decoder, ())?;
32619
32620 Ok(())
32621 }
32622
32623 3 => {
32624 ::fidl_next::wire::Envelope::decode_as::<
32625 ___D,
32626 ::fidl_next::wire::Vector<'de, crate::wire::RunnerRegistration<'de>>,
32627 >(slot.as_mut(), decoder, (4294967295, ()))?;
32628
32629 Ok(())
32630 }
32631
32632 4 => {
32633 ::fidl_next::wire::Envelope::decode_as::<
32634 ___D,
32635 ::fidl_next::wire::Vector<'de, crate::wire::ResolverRegistration<'de>>,
32636 >(slot.as_mut(), decoder, (4294967295, ()))?;
32637
32638 Ok(())
32639 }
32640
32641 5 => {
32642 ::fidl_next::wire::Envelope::decode_as::<
32643 ___D,
32644 ::fidl_next::wire::Vector<'de, crate::wire::DebugRegistration<'de>>,
32645 >(slot.as_mut(), decoder, (4294967295, ()))?;
32646
32647 Ok(())
32648 }
32649
32650 6 => {
32651 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
32652 slot.as_mut(),
32653 decoder,
32654 (),
32655 )?;
32656
32657 Ok(())
32658 }
32659
32660 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
32661 }
32662 })
32663 }
32664 }
32665
32666 impl<'de> Environment<'de> {
32667 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32668 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32669 }
32670
32671 pub fn extends(&self) -> ::core::option::Option<&crate::wire::EnvironmentExtends> {
32672 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
32673 }
32674
32675 pub fn runners(
32676 &self,
32677 ) -> ::core::option::Option<
32678 &::fidl_next::wire::Vector<'de, crate::wire::RunnerRegistration<'de>>,
32679 > {
32680 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
32681 }
32682
32683 pub fn resolvers(
32684 &self,
32685 ) -> ::core::option::Option<
32686 &::fidl_next::wire::Vector<'de, crate::wire::ResolverRegistration<'de>>,
32687 > {
32688 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
32689 }
32690
32691 pub fn debug_capabilities(
32692 &self,
32693 ) -> ::core::option::Option<
32694 &::fidl_next::wire::Vector<'de, crate::wire::DebugRegistration<'de>>,
32695 > {
32696 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
32697 }
32698
32699 pub fn stop_timeout_ms(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
32700 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
32701 }
32702 }
32703
32704 impl<'de> ::core::fmt::Debug for Environment<'de> {
32705 fn fmt(
32706 &self,
32707 f: &mut ::core::fmt::Formatter<'_>,
32708 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32709 f.debug_struct("Environment")
32710 .field("name", &self.name())
32711 .field("extends", &self.extends())
32712 .field("runners", &self.runners())
32713 .field("resolvers", &self.resolvers())
32714 .field("debug_capabilities", &self.debug_capabilities())
32715 .field("stop_timeout_ms", &self.stop_timeout_ms())
32716 .finish()
32717 }
32718 }
32719
32720 impl<'de> ::fidl_next::IntoNatural for Environment<'de> {
32721 type Natural = crate::natural::Environment;
32722 }
32723
32724 #[repr(C)]
32726 pub struct ConfigSourceCapabilities<'de> {
32727 pub(crate) table: ::fidl_next::wire::Table<'de>,
32728 }
32729
32730 impl<'de> Drop for ConfigSourceCapabilities<'de> {
32731 fn drop(&mut self) {}
32732 }
32733
32734 impl ::fidl_next::Constrained for ConfigSourceCapabilities<'_> {
32735 type Constraint = ();
32736
32737 fn validate(
32738 _: ::fidl_next::Slot<'_, Self>,
32739 _: Self::Constraint,
32740 ) -> Result<(), ::fidl_next::ValidationError> {
32741 Ok(())
32742 }
32743 }
32744
32745 unsafe impl ::fidl_next::Wire for ConfigSourceCapabilities<'static> {
32746 type Narrowed<'de> = ConfigSourceCapabilities<'de>;
32747
32748 #[inline]
32749 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32750 ::fidl_next::munge!(let Self { table } = out);
32751 ::fidl_next::wire::Table::zero_padding(table);
32752 }
32753 }
32754
32755 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigSourceCapabilities<'de>
32756 where
32757 ___D: ::fidl_next::Decoder<'de> + ?Sized,
32758 {
32759 fn decode(
32760 slot: ::fidl_next::Slot<'_, Self>,
32761 decoder: &mut ___D,
32762 _: (),
32763 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32764 ::fidl_next::munge!(let Self { table } = slot);
32765
32766 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32767 match ordinal {
32768 0 => unsafe { ::core::hint::unreachable_unchecked() },
32769
32770 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
32771 }
32772 })
32773 }
32774 }
32775
32776 impl<'de> ConfigSourceCapabilities<'de> {}
32777
32778 impl<'de> ::core::fmt::Debug for ConfigSourceCapabilities<'de> {
32779 fn fmt(
32780 &self,
32781 f: &mut ::core::fmt::Formatter<'_>,
32782 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32783 f.debug_struct("ConfigSourceCapabilities").finish()
32784 }
32785 }
32786
32787 impl<'de> ::fidl_next::IntoNatural for ConfigSourceCapabilities<'de> {
32788 type Natural = crate::natural::ConfigSourceCapabilities;
32789 }
32790
32791 #[repr(transparent)]
32793 pub struct ConfigValueSource<'de> {
32794 pub(crate) raw: ::fidl_next::wire::Union,
32795 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
32796 }
32797
32798 impl<'de> Drop for ConfigValueSource<'de> {
32799 fn drop(&mut self) {
32800 match self.raw.ordinal() {
32801 1 => {
32802 let _ = unsafe {
32803 self.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
32804 };
32805 }
32806
32807 2 => {
32808 let _ = unsafe {
32809 self.raw
32810 .get()
32811 .read_unchecked::<crate::wire::ConfigSourceCapabilities<'de>>()
32812 };
32813 }
32814
32815 _ => (),
32816 }
32817 }
32818 }
32819
32820 impl ::fidl_next::Constrained for ConfigValueSource<'_> {
32821 type Constraint = ();
32822
32823 fn validate(
32824 _: ::fidl_next::Slot<'_, Self>,
32825 _: Self::Constraint,
32826 ) -> Result<(), ::fidl_next::ValidationError> {
32827 Ok(())
32828 }
32829 }
32830
32831 unsafe impl ::fidl_next::Wire for ConfigValueSource<'static> {
32832 type Narrowed<'de> = ConfigValueSource<'de>;
32833
32834 #[inline]
32835 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32836 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
32837 ::fidl_next::wire::Union::zero_padding(raw);
32838 }
32839 }
32840
32841 pub mod config_value_source {
32842 pub enum Ref<'de> {
32843 PackagePath(&'de ::fidl_next::wire::String<'de>),
32844
32845 Capabilities(&'de crate::wire::ConfigSourceCapabilities<'de>),
32846
32847 UnknownOrdinal_(u64),
32848 }
32849 }
32850
32851 impl<'de> ConfigValueSource<'de> {
32852 pub fn as_ref(&self) -> crate::wire::config_value_source::Ref<'_> {
32853 match self.raw.ordinal() {
32854 1 => crate::wire::config_value_source::Ref::PackagePath(unsafe {
32855 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
32856 }),
32857
32858 2 => crate::wire::config_value_source::Ref::Capabilities(unsafe {
32859 self.raw.get().deref_unchecked::<crate::wire::ConfigSourceCapabilities<'_>>()
32860 }),
32861
32862 unknown => crate::wire::config_value_source::Ref::UnknownOrdinal_(unknown),
32863 }
32864 }
32865 }
32866
32867 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigValueSource<'de>
32868 where
32869 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
32870 ___D: ::fidl_next::Decoder<'de>,
32871 {
32872 fn decode(
32873 mut slot: ::fidl_next::Slot<'_, Self>,
32874 decoder: &mut ___D,
32875 _: (),
32876 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32877 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
32878 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
32879 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
32880 raw, decoder, 4294967295,
32881 )?,
32882
32883 2 => ::fidl_next::wire::Union::decode_as::<
32884 ___D,
32885 crate::wire::ConfigSourceCapabilities<'de>,
32886 >(raw, decoder, ())?,
32887
32888 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
32889 }
32890
32891 Ok(())
32892 }
32893 }
32894
32895 impl<'de> ::core::fmt::Debug for ConfigValueSource<'de> {
32896 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
32897 match self.raw.ordinal() {
32898 1 => unsafe {
32899 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
32900 },
32901 2 => unsafe {
32902 self.raw
32903 .get()
32904 .deref_unchecked::<crate::wire::ConfigSourceCapabilities<'_>>()
32905 .fmt(f)
32906 },
32907 _ => unsafe { ::core::hint::unreachable_unchecked() },
32908 }
32909 }
32910 }
32911
32912 impl<'de> ::fidl_next::IntoNatural for ConfigValueSource<'de> {
32913 type Natural = crate::natural::ConfigValueSource;
32914 }
32915
32916 #[repr(C)]
32918 pub struct ConfigSchema<'de> {
32919 pub(crate) table: ::fidl_next::wire::Table<'de>,
32920 }
32921
32922 impl<'de> Drop for ConfigSchema<'de> {
32923 fn drop(&mut self) {
32924 let _ = self.table.get(1)
32925 .map(|envelope| unsafe {
32926 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigField<'de>>>()
32927 });
32928
32929 let _ = self.table.get(2).map(|envelope| unsafe {
32930 envelope.read_unchecked::<crate::wire::ConfigChecksum<'de>>()
32931 });
32932
32933 let _ = self.table.get(3).map(|envelope| unsafe {
32934 envelope.read_unchecked::<crate::wire::ConfigValueSource<'de>>()
32935 });
32936 }
32937 }
32938
32939 impl ::fidl_next::Constrained for ConfigSchema<'_> {
32940 type Constraint = ();
32941
32942 fn validate(
32943 _: ::fidl_next::Slot<'_, Self>,
32944 _: Self::Constraint,
32945 ) -> Result<(), ::fidl_next::ValidationError> {
32946 Ok(())
32947 }
32948 }
32949
32950 unsafe impl ::fidl_next::Wire for ConfigSchema<'static> {
32951 type Narrowed<'de> = ConfigSchema<'de>;
32952
32953 #[inline]
32954 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32955 ::fidl_next::munge!(let Self { table } = out);
32956 ::fidl_next::wire::Table::zero_padding(table);
32957 }
32958 }
32959
32960 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigSchema<'de>
32961 where
32962 ___D: ::fidl_next::Decoder<'de> + ?Sized,
32963 {
32964 fn decode(
32965 slot: ::fidl_next::Slot<'_, Self>,
32966 decoder: &mut ___D,
32967 _: (),
32968 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32969 ::fidl_next::munge!(let Self { table } = slot);
32970
32971 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32972 match ordinal {
32973 0 => unsafe { ::core::hint::unreachable_unchecked() },
32974
32975 1 => {
32976 ::fidl_next::wire::Envelope::decode_as::<
32977 ___D,
32978 ::fidl_next::wire::Vector<'de, crate::wire::ConfigField<'de>>,
32979 >(slot.as_mut(), decoder, (4294967295, ()))?;
32980
32981 Ok(())
32982 }
32983
32984 2 => {
32985 ::fidl_next::wire::Envelope::decode_as::<
32986 ___D,
32987 crate::wire::ConfigChecksum<'de>,
32988 >(slot.as_mut(), decoder, ())?;
32989
32990 Ok(())
32991 }
32992
32993 3 => {
32994 ::fidl_next::wire::Envelope::decode_as::<
32995 ___D,
32996 crate::wire::ConfigValueSource<'de>,
32997 >(slot.as_mut(), decoder, ())?;
32998
32999 Ok(())
33000 }
33001
33002 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
33003 }
33004 })
33005 }
33006 }
33007
33008 impl<'de> ConfigSchema<'de> {
33009 pub fn fields(
33010 &self,
33011 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::ConfigField<'de>>>
33012 {
33013 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
33014 }
33015
33016 pub fn checksum(&self) -> ::core::option::Option<&crate::wire::ConfigChecksum<'de>> {
33017 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
33018 }
33019
33020 pub fn value_source(&self) -> ::core::option::Option<&crate::wire::ConfigValueSource<'de>> {
33021 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
33022 }
33023 }
33024
33025 impl<'de> ::core::fmt::Debug for ConfigSchema<'de> {
33026 fn fmt(
33027 &self,
33028 f: &mut ::core::fmt::Formatter<'_>,
33029 ) -> ::core::result::Result<(), ::core::fmt::Error> {
33030 f.debug_struct("ConfigSchema")
33031 .field("fields", &self.fields())
33032 .field("checksum", &self.checksum())
33033 .field("value_source", &self.value_source())
33034 .finish()
33035 }
33036 }
33037
33038 impl<'de> ::fidl_next::IntoNatural for ConfigSchema<'de> {
33039 type Natural = crate::natural::ConfigSchema;
33040 }
33041
33042 #[repr(C)]
33044 pub struct Component<'de> {
33045 pub(crate) table: ::fidl_next::wire::Table<'de>,
33046 }
33047
33048 impl<'de> Drop for Component<'de> {
33049 fn drop(&mut self) {
33050 let _ = self
33051 .table
33052 .get(1)
33053 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Program<'de>>() });
33054
33055 let _ = self.table.get(2).map(|envelope| unsafe {
33056 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Use<'de>>>()
33057 });
33058
33059 let _ = self.table.get(3).map(|envelope| unsafe {
33060 envelope
33061 .read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Expose<'de>>>()
33062 });
33063
33064 let _ = self.table.get(4).map(|envelope| unsafe {
33065 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Offer<'de>>>()
33066 });
33067
33068 let _ = self.table.get(5).map(|envelope| unsafe {
33069 envelope
33070 .read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Capability<'de>>>(
33071 )
33072 });
33073
33074 let _ = self.table.get(6).map(|envelope| unsafe {
33075 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Child<'de>>>()
33076 });
33077
33078 let _ = self.table.get(7).map(|envelope| unsafe {
33079 envelope
33080 .read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Collection<'de>>>(
33081 )
33082 });
33083
33084 let _ = self.table.get(8)
33085 .map(|envelope| unsafe {
33086 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Environment<'de>>>()
33087 });
33088
33089 let _ = self.table.get(9).map(|envelope| unsafe {
33090 envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>()
33091 });
33092
33093 let _ = self.table.get(10).map(|envelope| unsafe {
33094 envelope.read_unchecked::<crate::wire::ConfigSchema<'de>>()
33095 });
33096
33097 let _ = self.table.get(11).map(|envelope| unsafe {
33098 envelope.read_unchecked::<crate::wire::DebugInfo<'de>>()
33099 });
33100 }
33101 }
33102
33103 impl ::fidl_next::Constrained for Component<'_> {
33104 type Constraint = ();
33105
33106 fn validate(
33107 _: ::fidl_next::Slot<'_, Self>,
33108 _: Self::Constraint,
33109 ) -> Result<(), ::fidl_next::ValidationError> {
33110 Ok(())
33111 }
33112 }
33113
33114 unsafe impl ::fidl_next::Wire for Component<'static> {
33115 type Narrowed<'de> = Component<'de>;
33116
33117 #[inline]
33118 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33119 ::fidl_next::munge!(let Self { table } = out);
33120 ::fidl_next::wire::Table::zero_padding(table);
33121 }
33122 }
33123
33124 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Component<'de>
33125 where
33126 ___D: ::fidl_next::Decoder<'de> + ?Sized,
33127 {
33128 fn decode(
33129 slot: ::fidl_next::Slot<'_, Self>,
33130 decoder: &mut ___D,
33131 _: (),
33132 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33133 ::fidl_next::munge!(let Self { table } = slot);
33134
33135 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
33136 match ordinal {
33137 0 => unsafe { ::core::hint::unreachable_unchecked() },
33138
33139 1 => {
33140 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Program<'de>>(
33141 slot.as_mut(),
33142 decoder,
33143 (),
33144 )?;
33145
33146 Ok(())
33147 }
33148
33149 2 => {
33150 ::fidl_next::wire::Envelope::decode_as::<
33151 ___D,
33152 ::fidl_next::wire::Vector<'de, crate::wire::Use<'de>>,
33153 >(slot.as_mut(), decoder, (4294967295, ()))?;
33154
33155 Ok(())
33156 }
33157
33158 3 => {
33159 ::fidl_next::wire::Envelope::decode_as::<
33160 ___D,
33161 ::fidl_next::wire::Vector<'de, crate::wire::Expose<'de>>,
33162 >(slot.as_mut(), decoder, (4294967295, ()))?;
33163
33164 Ok(())
33165 }
33166
33167 4 => {
33168 ::fidl_next::wire::Envelope::decode_as::<
33169 ___D,
33170 ::fidl_next::wire::Vector<'de, crate::wire::Offer<'de>>,
33171 >(slot.as_mut(), decoder, (4294967295, ()))?;
33172
33173 Ok(())
33174 }
33175
33176 5 => {
33177 ::fidl_next::wire::Envelope::decode_as::<
33178 ___D,
33179 ::fidl_next::wire::Vector<'de, crate::wire::Capability<'de>>,
33180 >(slot.as_mut(), decoder, (4294967295, ()))?;
33181
33182 Ok(())
33183 }
33184
33185 6 => {
33186 ::fidl_next::wire::Envelope::decode_as::<
33187 ___D,
33188 ::fidl_next::wire::Vector<'de, crate::wire::Child<'de>>,
33189 >(slot.as_mut(), decoder, (4294967295, ()))?;
33190
33191 Ok(())
33192 }
33193
33194 7 => {
33195 ::fidl_next::wire::Envelope::decode_as::<
33196 ___D,
33197 ::fidl_next::wire::Vector<'de, crate::wire::Collection<'de>>,
33198 >(slot.as_mut(), decoder, (4294967295, ()))?;
33199
33200 Ok(())
33201 }
33202
33203 8 => {
33204 ::fidl_next::wire::Envelope::decode_as::<
33205 ___D,
33206 ::fidl_next::wire::Vector<'de, crate::wire::Environment<'de>>,
33207 >(slot.as_mut(), decoder, (4294967295, ()))?;
33208
33209 Ok(())
33210 }
33211
33212 9 => {
33213 ::fidl_next::wire::Envelope::decode_as::<
33214 ___D,
33215 ::fidl_next_common_fuchsia_data::wire::Dictionary<'de>,
33216 >(slot.as_mut(), decoder, ())?;
33217
33218 Ok(())
33219 }
33220
33221 10 => {
33222 ::fidl_next::wire::Envelope::decode_as::<
33223 ___D,
33224 crate::wire::ConfigSchema<'de>,
33225 >(slot.as_mut(), decoder, ())?;
33226
33227 Ok(())
33228 }
33229
33230 11 => {
33231 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DebugInfo<'de>>(
33232 slot.as_mut(),
33233 decoder,
33234 (),
33235 )?;
33236
33237 Ok(())
33238 }
33239
33240 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
33241 }
33242 })
33243 }
33244 }
33245
33246 impl<'de> Component<'de> {
33247 pub fn program(&self) -> ::core::option::Option<&crate::wire::Program<'de>> {
33248 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
33249 }
33250
33251 pub fn uses(
33252 &self,
33253 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Use<'de>>>
33254 {
33255 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
33256 }
33257
33258 pub fn exposes(
33259 &self,
33260 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Expose<'de>>>
33261 {
33262 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
33263 }
33264
33265 pub fn offers(
33266 &self,
33267 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Offer<'de>>>
33268 {
33269 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
33270 }
33271
33272 pub fn capabilities(
33273 &self,
33274 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Capability<'de>>>
33275 {
33276 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
33277 }
33278
33279 pub fn children(
33280 &self,
33281 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Child<'de>>>
33282 {
33283 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
33284 }
33285
33286 pub fn collections(
33287 &self,
33288 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Collection<'de>>>
33289 {
33290 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
33291 }
33292
33293 pub fn environments(
33294 &self,
33295 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Environment<'de>>>
33296 {
33297 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
33298 }
33299
33300 pub fn facets(
33301 &self,
33302 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>
33303 {
33304 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
33305 }
33306
33307 pub fn config(&self) -> ::core::option::Option<&crate::wire::ConfigSchema<'de>> {
33308 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
33309 }
33310
33311 pub fn debug_info(&self) -> ::core::option::Option<&crate::wire::DebugInfo<'de>> {
33312 unsafe { Some(self.table.get(11)?.deref_unchecked()) }
33313 }
33314 }
33315
33316 impl<'de> ::core::fmt::Debug for Component<'de> {
33317 fn fmt(
33318 &self,
33319 f: &mut ::core::fmt::Formatter<'_>,
33320 ) -> ::core::result::Result<(), ::core::fmt::Error> {
33321 f.debug_struct("Component")
33322 .field("program", &self.program())
33323 .field("uses", &self.uses())
33324 .field("exposes", &self.exposes())
33325 .field("offers", &self.offers())
33326 .field("capabilities", &self.capabilities())
33327 .field("children", &self.children())
33328 .field("collections", &self.collections())
33329 .field("environments", &self.environments())
33330 .field("facets", &self.facets())
33331 .field("config", &self.config())
33332 .field("debug_info", &self.debug_info())
33333 .finish()
33334 }
33335 }
33336
33337 impl<'de> ::fidl_next::IntoNatural for Component<'de> {
33338 type Natural = crate::natural::Component;
33339 }
33340
33341 #[repr(C)]
33343 pub struct ConfigValueSpec<'de> {
33344 pub(crate) table: ::fidl_next::wire::Table<'de>,
33345 }
33346
33347 impl<'de> Drop for ConfigValueSpec<'de> {
33348 fn drop(&mut self) {
33349 let _ = self.table.get(1).map(|envelope| unsafe {
33350 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
33351 });
33352 }
33353 }
33354
33355 impl ::fidl_next::Constrained for ConfigValueSpec<'_> {
33356 type Constraint = ();
33357
33358 fn validate(
33359 _: ::fidl_next::Slot<'_, Self>,
33360 _: Self::Constraint,
33361 ) -> Result<(), ::fidl_next::ValidationError> {
33362 Ok(())
33363 }
33364 }
33365
33366 unsafe impl ::fidl_next::Wire for ConfigValueSpec<'static> {
33367 type Narrowed<'de> = ConfigValueSpec<'de>;
33368
33369 #[inline]
33370 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33371 ::fidl_next::munge!(let Self { table } = out);
33372 ::fidl_next::wire::Table::zero_padding(table);
33373 }
33374 }
33375
33376 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigValueSpec<'de>
33377 where
33378 ___D: ::fidl_next::Decoder<'de> + ?Sized,
33379 {
33380 fn decode(
33381 slot: ::fidl_next::Slot<'_, Self>,
33382 decoder: &mut ___D,
33383 _: (),
33384 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33385 ::fidl_next::munge!(let Self { table } = slot);
33386
33387 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
33388 match ordinal {
33389 0 => unsafe { ::core::hint::unreachable_unchecked() },
33390
33391 1 => {
33392 ::fidl_next::wire::Envelope::decode_as::<
33393 ___D,
33394 crate::wire::ConfigValue<'de>,
33395 >(slot.as_mut(), decoder, ())?;
33396
33397 Ok(())
33398 }
33399
33400 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
33401 }
33402 })
33403 }
33404 }
33405
33406 impl<'de> ConfigValueSpec<'de> {
33407 pub fn value(&self) -> ::core::option::Option<&crate::wire::ConfigValue<'de>> {
33408 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
33409 }
33410 }
33411
33412 impl<'de> ::core::fmt::Debug for ConfigValueSpec<'de> {
33413 fn fmt(
33414 &self,
33415 f: &mut ::core::fmt::Formatter<'_>,
33416 ) -> ::core::result::Result<(), ::core::fmt::Error> {
33417 f.debug_struct("ConfigValueSpec").field("value", &self.value()).finish()
33418 }
33419 }
33420
33421 impl<'de> ::fidl_next::IntoNatural for ConfigValueSpec<'de> {
33422 type Natural = crate::natural::ConfigValueSpec;
33423 }
33424
33425 #[repr(C)]
33427 pub struct ConfigValuesData<'de> {
33428 pub(crate) table: ::fidl_next::wire::Table<'de>,
33429 }
33430
33431 impl<'de> Drop for ConfigValuesData<'de> {
33432 fn drop(&mut self) {
33433 let _ = self.table.get(1)
33434 .map(|envelope| unsafe {
33435 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigValueSpec<'de>>>()
33436 });
33437
33438 let _ = self.table.get(2).map(|envelope| unsafe {
33439 envelope.read_unchecked::<crate::wire::ConfigChecksum<'de>>()
33440 });
33441 }
33442 }
33443
33444 impl ::fidl_next::Constrained for ConfigValuesData<'_> {
33445 type Constraint = ();
33446
33447 fn validate(
33448 _: ::fidl_next::Slot<'_, Self>,
33449 _: Self::Constraint,
33450 ) -> Result<(), ::fidl_next::ValidationError> {
33451 Ok(())
33452 }
33453 }
33454
33455 unsafe impl ::fidl_next::Wire for ConfigValuesData<'static> {
33456 type Narrowed<'de> = ConfigValuesData<'de>;
33457
33458 #[inline]
33459 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33460 ::fidl_next::munge!(let Self { table } = out);
33461 ::fidl_next::wire::Table::zero_padding(table);
33462 }
33463 }
33464
33465 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigValuesData<'de>
33466 where
33467 ___D: ::fidl_next::Decoder<'de> + ?Sized,
33468 {
33469 fn decode(
33470 slot: ::fidl_next::Slot<'_, Self>,
33471 decoder: &mut ___D,
33472 _: (),
33473 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33474 ::fidl_next::munge!(let Self { table } = slot);
33475
33476 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
33477 match ordinal {
33478 0 => unsafe { ::core::hint::unreachable_unchecked() },
33479
33480 1 => {
33481 ::fidl_next::wire::Envelope::decode_as::<
33482 ___D,
33483 ::fidl_next::wire::Vector<'de, crate::wire::ConfigValueSpec<'de>>,
33484 >(slot.as_mut(), decoder, (4294967295, ()))?;
33485
33486 Ok(())
33487 }
33488
33489 2 => {
33490 ::fidl_next::wire::Envelope::decode_as::<
33491 ___D,
33492 crate::wire::ConfigChecksum<'de>,
33493 >(slot.as_mut(), decoder, ())?;
33494
33495 Ok(())
33496 }
33497
33498 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
33499 }
33500 })
33501 }
33502 }
33503
33504 impl<'de> ConfigValuesData<'de> {
33505 pub fn values(
33506 &self,
33507 ) -> ::core::option::Option<
33508 &::fidl_next::wire::Vector<'de, crate::wire::ConfigValueSpec<'de>>,
33509 > {
33510 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
33511 }
33512
33513 pub fn checksum(&self) -> ::core::option::Option<&crate::wire::ConfigChecksum<'de>> {
33514 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
33515 }
33516 }
33517
33518 impl<'de> ::core::fmt::Debug for ConfigValuesData<'de> {
33519 fn fmt(
33520 &self,
33521 f: &mut ::core::fmt::Formatter<'_>,
33522 ) -> ::core::result::Result<(), ::core::fmt::Error> {
33523 f.debug_struct("ConfigValuesData")
33524 .field("values", &self.values())
33525 .field("checksum", &self.checksum())
33526 .finish()
33527 }
33528 }
33529
33530 impl<'de> ::fidl_next::IntoNatural for ConfigValuesData<'de> {
33531 type Natural = crate::natural::ConfigValuesData;
33532 }
33533
33534 #[repr(C)]
33536 pub struct EventSubscription<'de> {
33537 pub(crate) table: ::fidl_next::wire::Table<'de>,
33538 }
33539
33540 impl<'de> Drop for EventSubscription<'de> {
33541 fn drop(&mut self) {
33542 let _ = self.table.get(1).map(|envelope| unsafe {
33543 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
33544 });
33545 }
33546 }
33547
33548 impl ::fidl_next::Constrained for EventSubscription<'_> {
33549 type Constraint = ();
33550
33551 fn validate(
33552 _: ::fidl_next::Slot<'_, Self>,
33553 _: Self::Constraint,
33554 ) -> Result<(), ::fidl_next::ValidationError> {
33555 Ok(())
33556 }
33557 }
33558
33559 unsafe impl ::fidl_next::Wire for EventSubscription<'static> {
33560 type Narrowed<'de> = EventSubscription<'de>;
33561
33562 #[inline]
33563 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33564 ::fidl_next::munge!(let Self { table } = out);
33565 ::fidl_next::wire::Table::zero_padding(table);
33566 }
33567 }
33568
33569 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EventSubscription<'de>
33570 where
33571 ___D: ::fidl_next::Decoder<'de> + ?Sized,
33572 {
33573 fn decode(
33574 slot: ::fidl_next::Slot<'_, Self>,
33575 decoder: &mut ___D,
33576 _: (),
33577 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33578 ::fidl_next::munge!(let Self { table } = slot);
33579
33580 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
33581 match ordinal {
33582 0 => unsafe { ::core::hint::unreachable_unchecked() },
33583
33584 1 => {
33585 ::fidl_next::wire::Envelope::decode_as::<
33586 ___D,
33587 ::fidl_next::wire::String<'de>,
33588 >(slot.as_mut(), decoder, 100)?;
33589
33590 let value = unsafe {
33591 slot.deref_unchecked()
33592 .deref_unchecked::<::fidl_next::wire::String<'_>>()
33593 };
33594
33595 if value.len() > 100 {
33596 return Err(::fidl_next::DecodeError::VectorTooLong {
33597 size: value.len() as u64,
33598 limit: 100,
33599 });
33600 }
33601
33602 Ok(())
33603 }
33604
33605 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
33606 }
33607 })
33608 }
33609 }
33610
33611 impl<'de> EventSubscription<'de> {
33612 pub fn event_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
33613 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
33614 }
33615 }
33616
33617 impl<'de> ::core::fmt::Debug for EventSubscription<'de> {
33618 fn fmt(
33619 &self,
33620 f: &mut ::core::fmt::Formatter<'_>,
33621 ) -> ::core::result::Result<(), ::core::fmt::Error> {
33622 f.debug_struct("EventSubscription").field("event_name", &self.event_name()).finish()
33623 }
33624 }
33625
33626 impl<'de> ::fidl_next::IntoNatural for EventSubscription<'de> {
33627 type Natural = crate::natural::EventSubscription;
33628 }
33629
33630 #[repr(transparent)]
33632 pub struct LayoutParameter<'de> {
33633 pub(crate) raw: ::fidl_next::wire::Union,
33634 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
33635 }
33636
33637 impl<'de> Drop for LayoutParameter<'de> {
33638 fn drop(&mut self) {
33639 match self.raw.ordinal() {
33640 1 => {
33641 let _ =
33642 unsafe { self.raw.get().read_unchecked::<crate::wire::ConfigType<'de>>() };
33643 }
33644
33645 _ => (),
33646 }
33647 }
33648 }
33649
33650 impl ::fidl_next::Constrained for LayoutParameter<'_> {
33651 type Constraint = ();
33652
33653 fn validate(
33654 _: ::fidl_next::Slot<'_, Self>,
33655 _: Self::Constraint,
33656 ) -> Result<(), ::fidl_next::ValidationError> {
33657 Ok(())
33658 }
33659 }
33660
33661 unsafe impl ::fidl_next::Wire for LayoutParameter<'static> {
33662 type Narrowed<'de> = LayoutParameter<'de>;
33663
33664 #[inline]
33665 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33666 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
33667 ::fidl_next::wire::Union::zero_padding(raw);
33668 }
33669 }
33670
33671 pub mod layout_parameter {
33672 pub enum Ref<'de> {
33673 NestedType(&'de crate::wire::ConfigType<'de>),
33674
33675 UnknownOrdinal_(u64),
33676 }
33677 }
33678
33679 impl<'de> LayoutParameter<'de> {
33680 pub fn as_ref(&self) -> crate::wire::layout_parameter::Ref<'_> {
33681 match self.raw.ordinal() {
33682 1 => crate::wire::layout_parameter::Ref::NestedType(unsafe {
33683 self.raw.get().deref_unchecked::<crate::wire::ConfigType<'_>>()
33684 }),
33685
33686 unknown => crate::wire::layout_parameter::Ref::UnknownOrdinal_(unknown),
33687 }
33688 }
33689 }
33690
33691 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LayoutParameter<'de>
33692 where
33693 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
33694 ___D: ::fidl_next::Decoder<'de>,
33695 {
33696 fn decode(
33697 mut slot: ::fidl_next::Slot<'_, Self>,
33698 decoder: &mut ___D,
33699 _: (),
33700 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33701 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
33702 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
33703 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ConfigType<'de>>(
33704 raw,
33705 decoder,
33706 (),
33707 )?,
33708
33709 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
33710 }
33711
33712 Ok(())
33713 }
33714 }
33715
33716 impl<'de> ::core::fmt::Debug for LayoutParameter<'de> {
33717 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
33718 match self.raw.ordinal() {
33719 1 => unsafe {
33720 self.raw.get().deref_unchecked::<crate::wire::ConfigType<'_>>().fmt(f)
33721 },
33722 _ => unsafe { ::core::hint::unreachable_unchecked() },
33723 }
33724 }
33725 }
33726
33727 impl<'de> ::fidl_next::IntoNatural for LayoutParameter<'de> {
33728 type Natural = crate::natural::LayoutParameter;
33729 }
33730
33731 #[derive(Debug)]
33733 #[repr(C)]
33734 pub struct ResolvedConfigField<'de> {
33735 pub key: ::fidl_next::wire::String<'de>,
33736
33737 pub value: crate::wire::ConfigValue<'de>,
33738 }
33739
33740 static_assertions::const_assert_eq!(std::mem::size_of::<ResolvedConfigField<'_>>(), 32);
33741 static_assertions::const_assert_eq!(std::mem::align_of::<ResolvedConfigField<'_>>(), 8);
33742
33743 static_assertions::const_assert_eq!(std::mem::offset_of!(ResolvedConfigField<'_>, key), 0);
33744
33745 static_assertions::const_assert_eq!(std::mem::offset_of!(ResolvedConfigField<'_>, value), 16);
33746
33747 impl ::fidl_next::Constrained for ResolvedConfigField<'_> {
33748 type Constraint = ();
33749
33750 fn validate(
33751 _: ::fidl_next::Slot<'_, Self>,
33752 _: Self::Constraint,
33753 ) -> Result<(), ::fidl_next::ValidationError> {
33754 Ok(())
33755 }
33756 }
33757
33758 unsafe impl ::fidl_next::Wire for ResolvedConfigField<'static> {
33759 type Narrowed<'de> = ResolvedConfigField<'de>;
33760
33761 #[inline]
33762 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
33763 ::fidl_next::munge! {
33764 let Self {
33765 key,
33766 value,
33767
33768 } = &mut *out_;
33769 }
33770
33771 ::fidl_next::Wire::zero_padding(key);
33772
33773 ::fidl_next::Wire::zero_padding(value);
33774 }
33775 }
33776
33777 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ResolvedConfigField<'de>
33778 where
33779 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
33780 ___D: ::fidl_next::Decoder<'de>,
33781 {
33782 fn decode(
33783 slot_: ::fidl_next::Slot<'_, Self>,
33784 decoder_: &mut ___D,
33785 _: (),
33786 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33787 ::fidl_next::munge! {
33788 let Self {
33789 mut key,
33790 mut value,
33791
33792 } = slot_;
33793 }
33794
33795 let _field = key.as_mut();
33796 ::fidl_next::Constrained::validate(_field, 4294967295)?;
33797 ::fidl_next::Decode::decode(key.as_mut(), decoder_, 4294967295)?;
33798
33799 let _field = value.as_mut();
33800
33801 ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?;
33802
33803 Ok(())
33804 }
33805 }
33806
33807 impl<'de> ::fidl_next::IntoNatural for ResolvedConfigField<'de> {
33808 type Natural = crate::natural::ResolvedConfigField;
33809 }
33810
33811 #[derive(Debug)]
33813 #[repr(C)]
33814 pub struct ResolvedConfig<'de> {
33815 pub fields: ::fidl_next::wire::Vector<'de, crate::wire::ResolvedConfigField<'de>>,
33816
33817 pub checksum: crate::wire::ConfigChecksum<'de>,
33818 }
33819
33820 static_assertions::const_assert_eq!(std::mem::size_of::<ResolvedConfig<'_>>(), 32);
33821 static_assertions::const_assert_eq!(std::mem::align_of::<ResolvedConfig<'_>>(), 8);
33822
33823 static_assertions::const_assert_eq!(std::mem::offset_of!(ResolvedConfig<'_>, fields), 0);
33824
33825 static_assertions::const_assert_eq!(std::mem::offset_of!(ResolvedConfig<'_>, checksum), 16);
33826
33827 impl ::fidl_next::Constrained for ResolvedConfig<'_> {
33828 type Constraint = ();
33829
33830 fn validate(
33831 _: ::fidl_next::Slot<'_, Self>,
33832 _: Self::Constraint,
33833 ) -> Result<(), ::fidl_next::ValidationError> {
33834 Ok(())
33835 }
33836 }
33837
33838 unsafe impl ::fidl_next::Wire for ResolvedConfig<'static> {
33839 type Narrowed<'de> = ResolvedConfig<'de>;
33840
33841 #[inline]
33842 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
33843 ::fidl_next::munge! {
33844 let Self {
33845 fields,
33846 checksum,
33847
33848 } = &mut *out_;
33849 }
33850
33851 ::fidl_next::Wire::zero_padding(fields);
33852
33853 ::fidl_next::Wire::zero_padding(checksum);
33854 }
33855 }
33856
33857 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ResolvedConfig<'de>
33858 where
33859 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
33860 ___D: ::fidl_next::Decoder<'de>,
33861 {
33862 fn decode(
33863 slot_: ::fidl_next::Slot<'_, Self>,
33864 decoder_: &mut ___D,
33865 _: (),
33866 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33867 ::fidl_next::munge! {
33868 let Self {
33869 mut fields,
33870 mut checksum,
33871
33872 } = slot_;
33873 }
33874
33875 let _field = fields.as_mut();
33876 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
33877 ::fidl_next::Decode::decode(fields.as_mut(), decoder_, (4294967295, ()))?;
33878
33879 let _field = checksum.as_mut();
33880
33881 ::fidl_next::Decode::decode(checksum.as_mut(), decoder_, ())?;
33882
33883 Ok(())
33884 }
33885 }
33886
33887 impl<'de> ::fidl_next::IntoNatural for ResolvedConfig<'de> {
33888 type Natural = crate::natural::ResolvedConfig;
33889 }
33890}
33891
33892pub mod wire_optional {
33893
33894 #[repr(transparent)]
33895 pub struct ConfigSingleValue<'de> {
33896 pub(crate) raw: ::fidl_next::wire::Union,
33897 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
33898 }
33899
33900 impl ::fidl_next::Constrained for ConfigSingleValue<'_> {
33901 type Constraint = ();
33902
33903 fn validate(
33904 _: ::fidl_next::Slot<'_, Self>,
33905 _: Self::Constraint,
33906 ) -> Result<(), ::fidl_next::ValidationError> {
33907 Ok(())
33908 }
33909 }
33910
33911 unsafe impl ::fidl_next::Wire for ConfigSingleValue<'static> {
33912 type Narrowed<'de> = ConfigSingleValue<'de>;
33913
33914 #[inline]
33915 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33916 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
33917 ::fidl_next::wire::Union::zero_padding(raw);
33918 }
33919 }
33920
33921 impl<'de> ConfigSingleValue<'de> {
33922 pub fn is_some(&self) -> bool {
33923 self.raw.is_some()
33924 }
33925
33926 pub fn is_none(&self) -> bool {
33927 self.raw.is_none()
33928 }
33929
33930 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ConfigSingleValue<'de>> {
33931 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
33932 }
33933
33934 pub fn into_option(self) -> ::core::option::Option<crate::wire::ConfigSingleValue<'de>> {
33935 if self.is_some() {
33936 Some(crate::wire::ConfigSingleValue {
33937 raw: self.raw,
33938 _phantom: ::core::marker::PhantomData,
33939 })
33940 } else {
33941 None
33942 }
33943 }
33944 }
33945
33946 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigSingleValue<'de>
33947 where
33948 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
33949 ___D: ::fidl_next::Decoder<'de>,
33950 {
33951 fn decode(
33952 mut slot: ::fidl_next::Slot<'_, Self>,
33953 decoder: &mut ___D,
33954 _: (),
33955 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33956 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
33957 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
33958 1 => ::fidl_next::wire::Union::decode_as::<___D, bool>(raw, decoder, ())?,
33959
33960 2 => ::fidl_next::wire::Union::decode_as::<___D, u8>(raw, decoder, ())?,
33961
33962 3 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint16>(
33963 raw,
33964 decoder,
33965 (),
33966 )?,
33967
33968 4 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint32>(
33969 raw,
33970 decoder,
33971 (),
33972 )?,
33973
33974 5 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint64>(
33975 raw,
33976 decoder,
33977 (),
33978 )?,
33979
33980 6 => ::fidl_next::wire::Union::decode_as::<___D, i8>(raw, decoder, ())?,
33981
33982 7 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int16>(
33983 raw,
33984 decoder,
33985 (),
33986 )?,
33987
33988 8 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int32>(
33989 raw,
33990 decoder,
33991 (),
33992 )?,
33993
33994 9 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int64>(
33995 raw,
33996 decoder,
33997 (),
33998 )?,
33999
34000 10 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
34001 raw, decoder, 4294967295,
34002 )?,
34003
34004 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
34005 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
34006 }
34007
34008 Ok(())
34009 }
34010 }
34011
34012 impl<'de> ::core::fmt::Debug for ConfigSingleValue<'de> {
34013 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34014 self.as_ref().fmt(f)
34015 }
34016 }
34017
34018 impl<'de> ::fidl_next::IntoNatural for ConfigSingleValue<'de> {
34019 type Natural = ::core::option::Option<crate::natural::ConfigSingleValue>;
34020 }
34021
34022 #[repr(transparent)]
34023 pub struct ConfigVectorValue<'de> {
34024 pub(crate) raw: ::fidl_next::wire::Union,
34025 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34026 }
34027
34028 impl ::fidl_next::Constrained for ConfigVectorValue<'_> {
34029 type Constraint = ();
34030
34031 fn validate(
34032 _: ::fidl_next::Slot<'_, Self>,
34033 _: Self::Constraint,
34034 ) -> Result<(), ::fidl_next::ValidationError> {
34035 Ok(())
34036 }
34037 }
34038
34039 unsafe impl ::fidl_next::Wire for ConfigVectorValue<'static> {
34040 type Narrowed<'de> = ConfigVectorValue<'de>;
34041
34042 #[inline]
34043 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34044 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34045 ::fidl_next::wire::Union::zero_padding(raw);
34046 }
34047 }
34048
34049 impl<'de> ConfigVectorValue<'de> {
34050 pub fn is_some(&self) -> bool {
34051 self.raw.is_some()
34052 }
34053
34054 pub fn is_none(&self) -> bool {
34055 self.raw.is_none()
34056 }
34057
34058 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ConfigVectorValue<'de>> {
34059 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34060 }
34061
34062 pub fn into_option(self) -> ::core::option::Option<crate::wire::ConfigVectorValue<'de>> {
34063 if self.is_some() {
34064 Some(crate::wire::ConfigVectorValue {
34065 raw: self.raw,
34066 _phantom: ::core::marker::PhantomData,
34067 })
34068 } else {
34069 None
34070 }
34071 }
34072 }
34073
34074 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigVectorValue<'de>
34075 where
34076 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34077 ___D: ::fidl_next::Decoder<'de>,
34078 {
34079 fn decode(
34080 mut slot: ::fidl_next::Slot<'_, Self>,
34081 decoder: &mut ___D,
34082 _: (),
34083 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34084 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34085 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
34086 1 => ::fidl_next::wire::Union::decode_as::<
34087 ___D,
34088 ::fidl_next::wire::Vector<'de, bool>,
34089 >(raw, decoder, (4294967295, ()))?,
34090
34091 2 => {
34092 ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Vector<'de, u8>>(
34093 raw,
34094 decoder,
34095 (4294967295, ()),
34096 )?
34097 }
34098
34099 3 => ::fidl_next::wire::Union::decode_as::<
34100 ___D,
34101 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint16>,
34102 >(raw, decoder, (4294967295, ()))?,
34103
34104 4 => ::fidl_next::wire::Union::decode_as::<
34105 ___D,
34106 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>,
34107 >(raw, decoder, (4294967295, ()))?,
34108
34109 5 => ::fidl_next::wire::Union::decode_as::<
34110 ___D,
34111 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint64>,
34112 >(raw, decoder, (4294967295, ()))?,
34113
34114 6 => {
34115 ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Vector<'de, i8>>(
34116 raw,
34117 decoder,
34118 (4294967295, ()),
34119 )?
34120 }
34121
34122 7 => ::fidl_next::wire::Union::decode_as::<
34123 ___D,
34124 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int16>,
34125 >(raw, decoder, (4294967295, ()))?,
34126
34127 8 => ::fidl_next::wire::Union::decode_as::<
34128 ___D,
34129 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int32>,
34130 >(raw, decoder, (4294967295, ()))?,
34131
34132 9 => ::fidl_next::wire::Union::decode_as::<
34133 ___D,
34134 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>,
34135 >(raw, decoder, (4294967295, ()))?,
34136
34137 10 => ::fidl_next::wire::Union::decode_as::<
34138 ___D,
34139 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>,
34140 >(raw, decoder, (4294967295, 4294967295))?,
34141
34142 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
34143 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
34144 }
34145
34146 Ok(())
34147 }
34148 }
34149
34150 impl<'de> ::core::fmt::Debug for ConfigVectorValue<'de> {
34151 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34152 self.as_ref().fmt(f)
34153 }
34154 }
34155
34156 impl<'de> ::fidl_next::IntoNatural for ConfigVectorValue<'de> {
34157 type Natural = ::core::option::Option<crate::natural::ConfigVectorValue>;
34158 }
34159
34160 #[repr(transparent)]
34161 pub struct ConfigValue<'de> {
34162 pub(crate) raw: ::fidl_next::wire::Union,
34163 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34164 }
34165
34166 impl ::fidl_next::Constrained for ConfigValue<'_> {
34167 type Constraint = ();
34168
34169 fn validate(
34170 _: ::fidl_next::Slot<'_, Self>,
34171 _: Self::Constraint,
34172 ) -> Result<(), ::fidl_next::ValidationError> {
34173 Ok(())
34174 }
34175 }
34176
34177 unsafe impl ::fidl_next::Wire for ConfigValue<'static> {
34178 type Narrowed<'de> = ConfigValue<'de>;
34179
34180 #[inline]
34181 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34182 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34183 ::fidl_next::wire::Union::zero_padding(raw);
34184 }
34185 }
34186
34187 impl<'de> ConfigValue<'de> {
34188 pub fn is_some(&self) -> bool {
34189 self.raw.is_some()
34190 }
34191
34192 pub fn is_none(&self) -> bool {
34193 self.raw.is_none()
34194 }
34195
34196 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ConfigValue<'de>> {
34197 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34198 }
34199
34200 pub fn into_option(self) -> ::core::option::Option<crate::wire::ConfigValue<'de>> {
34201 if self.is_some() {
34202 Some(crate::wire::ConfigValue {
34203 raw: self.raw,
34204 _phantom: ::core::marker::PhantomData,
34205 })
34206 } else {
34207 None
34208 }
34209 }
34210 }
34211
34212 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigValue<'de>
34213 where
34214 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34215 ___D: ::fidl_next::Decoder<'de>,
34216 {
34217 fn decode(
34218 mut slot: ::fidl_next::Slot<'_, Self>,
34219 decoder: &mut ___D,
34220 _: (),
34221 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34222 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34223 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
34224 1 => ::fidl_next::wire::Union::decode_as::<
34225 ___D,
34226 crate::wire::ConfigSingleValue<'de>,
34227 >(raw, decoder, ())?,
34228
34229 2 => ::fidl_next::wire::Union::decode_as::<
34230 ___D,
34231 crate::wire::ConfigVectorValue<'de>,
34232 >(raw, decoder, ())?,
34233
34234 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
34235 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
34236 }
34237
34238 Ok(())
34239 }
34240 }
34241
34242 impl<'de> ::core::fmt::Debug for ConfigValue<'de> {
34243 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34244 self.as_ref().fmt(f)
34245 }
34246 }
34247
34248 impl<'de> ::fidl_next::IntoNatural for ConfigValue<'de> {
34249 type Natural = ::core::option::Option<crate::natural::ConfigValue>;
34250 }
34251
34252 #[repr(transparent)]
34253 pub struct Ref<'de> {
34254 pub(crate) raw: ::fidl_next::wire::Union,
34255 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34256 }
34257
34258 impl ::fidl_next::Constrained for Ref<'_> {
34259 type Constraint = ();
34260
34261 fn validate(
34262 _: ::fidl_next::Slot<'_, Self>,
34263 _: Self::Constraint,
34264 ) -> Result<(), ::fidl_next::ValidationError> {
34265 Ok(())
34266 }
34267 }
34268
34269 unsafe impl ::fidl_next::Wire for Ref<'static> {
34270 type Narrowed<'de> = Ref<'de>;
34271
34272 #[inline]
34273 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34274 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34275 ::fidl_next::wire::Union::zero_padding(raw);
34276 }
34277 }
34278
34279 impl<'de> Ref<'de> {
34280 pub fn is_some(&self) -> bool {
34281 self.raw.is_some()
34282 }
34283
34284 pub fn is_none(&self) -> bool {
34285 self.raw.is_none()
34286 }
34287
34288 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
34289 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34290 }
34291
34292 pub fn into_option(self) -> ::core::option::Option<crate::wire::Ref<'de>> {
34293 if self.is_some() {
34294 Some(crate::wire::Ref { raw: self.raw, _phantom: ::core::marker::PhantomData })
34295 } else {
34296 None
34297 }
34298 }
34299 }
34300
34301 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Ref<'de>
34302 where
34303 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34304 ___D: ::fidl_next::Decoder<'de>,
34305 {
34306 fn decode(
34307 mut slot: ::fidl_next::Slot<'_, Self>,
34308 decoder: &mut ___D,
34309 _: (),
34310 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34311 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34312 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
34313 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ParentRef>(
34314 raw,
34315 decoder,
34316 (),
34317 )?,
34318
34319 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::SelfRef>(
34320 raw,
34321 decoder,
34322 (),
34323 )?,
34324
34325 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ChildRef<'de>>(
34326 raw,
34327 decoder,
34328 (),
34329 )?,
34330
34331 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::CollectionRef<'de>>(
34332 raw,
34333 decoder,
34334 (),
34335 )?,
34336
34337 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::FrameworkRef>(
34338 raw,
34339 decoder,
34340 (),
34341 )?,
34342
34343 6 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::CapabilityRef<'de>>(
34344 raw,
34345 decoder,
34346 (),
34347 )?,
34348
34349 7 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::DebugRef>(
34350 raw,
34351 decoder,
34352 (),
34353 )?,
34354
34355 8 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::VoidRef>(
34356 raw,
34357 decoder,
34358 (),
34359 )?,
34360
34361 9 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::EnvironmentRef>(
34362 raw,
34363 decoder,
34364 (),
34365 )?,
34366
34367 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
34368 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
34369 }
34370
34371 Ok(())
34372 }
34373 }
34374
34375 impl<'de> ::core::fmt::Debug for Ref<'de> {
34376 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34377 self.as_ref().fmt(f)
34378 }
34379 }
34380
34381 impl<'de> ::fidl_next::IntoNatural for Ref<'de> {
34382 type Natural = ::core::option::Option<crate::natural::Ref>;
34383 }
34384
34385 #[repr(transparent)]
34386 pub struct Capability<'de> {
34387 pub(crate) raw: ::fidl_next::wire::Union,
34388 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34389 }
34390
34391 impl ::fidl_next::Constrained for Capability<'_> {
34392 type Constraint = ();
34393
34394 fn validate(
34395 _: ::fidl_next::Slot<'_, Self>,
34396 _: Self::Constraint,
34397 ) -> Result<(), ::fidl_next::ValidationError> {
34398 Ok(())
34399 }
34400 }
34401
34402 unsafe impl ::fidl_next::Wire for Capability<'static> {
34403 type Narrowed<'de> = Capability<'de>;
34404
34405 #[inline]
34406 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34407 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34408 ::fidl_next::wire::Union::zero_padding(raw);
34409 }
34410 }
34411
34412 impl<'de> Capability<'de> {
34413 pub fn is_some(&self) -> bool {
34414 self.raw.is_some()
34415 }
34416
34417 pub fn is_none(&self) -> bool {
34418 self.raw.is_none()
34419 }
34420
34421 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Capability<'de>> {
34422 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34423 }
34424
34425 pub fn into_option(self) -> ::core::option::Option<crate::wire::Capability<'de>> {
34426 if self.is_some() {
34427 Some(crate::wire::Capability {
34428 raw: self.raw,
34429 _phantom: ::core::marker::PhantomData,
34430 })
34431 } else {
34432 None
34433 }
34434 }
34435 }
34436
34437 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Capability<'de>
34438 where
34439 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34440 ___D: ::fidl_next::Decoder<'de>,
34441 {
34442 fn decode(
34443 mut slot: ::fidl_next::Slot<'_, Self>,
34444 decoder: &mut ___D,
34445 _: (),
34446 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34447 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34448 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
34449 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Service<'de>>(
34450 raw,
34451 decoder,
34452 (),
34453 )?,
34454
34455 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Protocol<'de>>(
34456 raw,
34457 decoder,
34458 (),
34459 )?,
34460
34461 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Directory<'de>>(
34462 raw,
34463 decoder,
34464 (),
34465 )?,
34466
34467 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Storage<'de>>(
34468 raw,
34469 decoder,
34470 (),
34471 )?,
34472
34473 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Runner<'de>>(
34474 raw,
34475 decoder,
34476 (),
34477 )?,
34478
34479 6 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Resolver<'de>>(
34480 raw,
34481 decoder,
34482 (),
34483 )?,
34484
34485 8 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::EventStream<'de>>(
34486 raw,
34487 decoder,
34488 (),
34489 )?,
34490
34491 9 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Dictionary<'de>>(
34492 raw,
34493 decoder,
34494 (),
34495 )?,
34496
34497 10 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Configuration<'de>>(
34498 raw,
34499 decoder,
34500 (),
34501 )?,
34502
34503 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
34504 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
34505 }
34506
34507 Ok(())
34508 }
34509 }
34510
34511 impl<'de> ::core::fmt::Debug for Capability<'de> {
34512 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34513 self.as_ref().fmt(f)
34514 }
34515 }
34516
34517 impl<'de> ::fidl_next::IntoNatural for Capability<'de> {
34518 type Natural = ::core::option::Option<crate::natural::Capability>;
34519 }
34520
34521 #[repr(transparent)]
34522 pub struct LayoutConstraint<'de> {
34523 pub(crate) raw: ::fidl_next::wire::Union,
34524 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34525 }
34526
34527 impl ::fidl_next::Constrained for LayoutConstraint<'_> {
34528 type Constraint = ();
34529
34530 fn validate(
34531 _: ::fidl_next::Slot<'_, Self>,
34532 _: Self::Constraint,
34533 ) -> Result<(), ::fidl_next::ValidationError> {
34534 Ok(())
34535 }
34536 }
34537
34538 unsafe impl ::fidl_next::Wire for LayoutConstraint<'static> {
34539 type Narrowed<'de> = LayoutConstraint<'de>;
34540
34541 #[inline]
34542 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34543 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34544 ::fidl_next::wire::Union::zero_padding(raw);
34545 }
34546 }
34547
34548 impl<'de> LayoutConstraint<'de> {
34549 pub fn is_some(&self) -> bool {
34550 self.raw.is_some()
34551 }
34552
34553 pub fn is_none(&self) -> bool {
34554 self.raw.is_none()
34555 }
34556
34557 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::LayoutConstraint<'de>> {
34558 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34559 }
34560
34561 pub fn into_option(self) -> ::core::option::Option<crate::wire::LayoutConstraint<'de>> {
34562 if self.is_some() {
34563 Some(crate::wire::LayoutConstraint {
34564 raw: self.raw,
34565 _phantom: ::core::marker::PhantomData,
34566 })
34567 } else {
34568 None
34569 }
34570 }
34571 }
34572
34573 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LayoutConstraint<'de>
34574 where
34575 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34576 ___D: ::fidl_next::Decoder<'de>,
34577 {
34578 fn decode(
34579 mut slot: ::fidl_next::Slot<'_, Self>,
34580 decoder: &mut ___D,
34581 _: (),
34582 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34583 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34584 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
34585 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint32>(
34586 raw,
34587 decoder,
34588 (),
34589 )?,
34590
34591 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
34592 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
34593 }
34594
34595 Ok(())
34596 }
34597 }
34598
34599 impl<'de> ::core::fmt::Debug for LayoutConstraint<'de> {
34600 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34601 self.as_ref().fmt(f)
34602 }
34603 }
34604
34605 impl<'de> ::fidl_next::IntoNatural for LayoutConstraint<'de> {
34606 type Natural = ::core::option::Option<crate::natural::LayoutConstraint>;
34607 }
34608
34609 #[repr(transparent)]
34610 pub struct ConfigChecksum<'de> {
34611 pub(crate) raw: ::fidl_next::wire::Union,
34612 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34613 }
34614
34615 impl ::fidl_next::Constrained for ConfigChecksum<'_> {
34616 type Constraint = ();
34617
34618 fn validate(
34619 _: ::fidl_next::Slot<'_, Self>,
34620 _: Self::Constraint,
34621 ) -> Result<(), ::fidl_next::ValidationError> {
34622 Ok(())
34623 }
34624 }
34625
34626 unsafe impl ::fidl_next::Wire for ConfigChecksum<'static> {
34627 type Narrowed<'de> = ConfigChecksum<'de>;
34628
34629 #[inline]
34630 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34631 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34632 ::fidl_next::wire::Union::zero_padding(raw);
34633 }
34634 }
34635
34636 impl<'de> ConfigChecksum<'de> {
34637 pub fn is_some(&self) -> bool {
34638 self.raw.is_some()
34639 }
34640
34641 pub fn is_none(&self) -> bool {
34642 self.raw.is_none()
34643 }
34644
34645 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ConfigChecksum<'de>> {
34646 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34647 }
34648
34649 pub fn into_option(self) -> ::core::option::Option<crate::wire::ConfigChecksum<'de>> {
34650 if self.is_some() {
34651 Some(crate::wire::ConfigChecksum {
34652 raw: self.raw,
34653 _phantom: ::core::marker::PhantomData,
34654 })
34655 } else {
34656 None
34657 }
34658 }
34659 }
34660
34661 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigChecksum<'de>
34662 where
34663 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34664 ___D: ::fidl_next::Decoder<'de>,
34665 {
34666 fn decode(
34667 mut slot: ::fidl_next::Slot<'_, Self>,
34668 decoder: &mut ___D,
34669 _: (),
34670 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34671 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34672 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
34673 1 => ::fidl_next::wire::Union::decode_as::<___D, [u8; 32]>(raw, decoder, ())?,
34674
34675 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
34676 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
34677 }
34678
34679 Ok(())
34680 }
34681 }
34682
34683 impl<'de> ::core::fmt::Debug for ConfigChecksum<'de> {
34684 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34685 self.as_ref().fmt(f)
34686 }
34687 }
34688
34689 impl<'de> ::fidl_next::IntoNatural for ConfigChecksum<'de> {
34690 type Natural = ::core::option::Option<crate::natural::ConfigChecksum>;
34691 }
34692
34693 #[repr(transparent)]
34694 pub struct Use<'de> {
34695 pub(crate) raw: ::fidl_next::wire::Union,
34696 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34697 }
34698
34699 impl ::fidl_next::Constrained for Use<'_> {
34700 type Constraint = ();
34701
34702 fn validate(
34703 _: ::fidl_next::Slot<'_, Self>,
34704 _: Self::Constraint,
34705 ) -> Result<(), ::fidl_next::ValidationError> {
34706 Ok(())
34707 }
34708 }
34709
34710 unsafe impl ::fidl_next::Wire for Use<'static> {
34711 type Narrowed<'de> = Use<'de>;
34712
34713 #[inline]
34714 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34715 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34716 ::fidl_next::wire::Union::zero_padding(raw);
34717 }
34718 }
34719
34720 impl<'de> Use<'de> {
34721 pub fn is_some(&self) -> bool {
34722 self.raw.is_some()
34723 }
34724
34725 pub fn is_none(&self) -> bool {
34726 self.raw.is_none()
34727 }
34728
34729 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Use<'de>> {
34730 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34731 }
34732
34733 pub fn into_option(self) -> ::core::option::Option<crate::wire::Use<'de>> {
34734 if self.is_some() {
34735 Some(crate::wire::Use { raw: self.raw, _phantom: ::core::marker::PhantomData })
34736 } else {
34737 None
34738 }
34739 }
34740 }
34741
34742 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Use<'de>
34743 where
34744 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34745 ___D: ::fidl_next::Decoder<'de>,
34746 {
34747 fn decode(
34748 mut slot: ::fidl_next::Slot<'_, Self>,
34749 decoder: &mut ___D,
34750 _: (),
34751 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34752 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34753 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
34754 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseService<'de>>(
34755 raw,
34756 decoder,
34757 (),
34758 )?,
34759
34760 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseProtocol<'de>>(
34761 raw,
34762 decoder,
34763 (),
34764 )?,
34765
34766 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseDirectory<'de>>(
34767 raw,
34768 decoder,
34769 (),
34770 )?,
34771
34772 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseStorage<'de>>(
34773 raw,
34774 decoder,
34775 (),
34776 )?,
34777
34778 7 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseEventStream<'de>>(
34779 raw,
34780 decoder,
34781 (),
34782 )?,
34783
34784 8 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseRunner<'de>>(
34785 raw,
34786 decoder,
34787 (),
34788 )?,
34789
34790 9 => {
34791 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseConfiguration<'de>>(
34792 raw,
34793 decoder,
34794 (),
34795 )?
34796 }
34797
34798 10 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseDictionary<'de>>(
34799 raw,
34800 decoder,
34801 (),
34802 )?,
34803
34804 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
34805 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
34806 }
34807
34808 Ok(())
34809 }
34810 }
34811
34812 impl<'de> ::core::fmt::Debug for Use<'de> {
34813 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34814 self.as_ref().fmt(f)
34815 }
34816 }
34817
34818 impl<'de> ::fidl_next::IntoNatural for Use<'de> {
34819 type Natural = ::core::option::Option<crate::natural::Use>;
34820 }
34821
34822 #[repr(transparent)]
34823 pub struct Expose<'de> {
34824 pub(crate) raw: ::fidl_next::wire::Union,
34825 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34826 }
34827
34828 impl ::fidl_next::Constrained for Expose<'_> {
34829 type Constraint = ();
34830
34831 fn validate(
34832 _: ::fidl_next::Slot<'_, Self>,
34833 _: Self::Constraint,
34834 ) -> Result<(), ::fidl_next::ValidationError> {
34835 Ok(())
34836 }
34837 }
34838
34839 unsafe impl ::fidl_next::Wire for Expose<'static> {
34840 type Narrowed<'de> = Expose<'de>;
34841
34842 #[inline]
34843 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34844 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34845 ::fidl_next::wire::Union::zero_padding(raw);
34846 }
34847 }
34848
34849 impl<'de> Expose<'de> {
34850 pub fn is_some(&self) -> bool {
34851 self.raw.is_some()
34852 }
34853
34854 pub fn is_none(&self) -> bool {
34855 self.raw.is_none()
34856 }
34857
34858 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Expose<'de>> {
34859 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34860 }
34861
34862 pub fn into_option(self) -> ::core::option::Option<crate::wire::Expose<'de>> {
34863 if self.is_some() {
34864 Some(crate::wire::Expose { raw: self.raw, _phantom: ::core::marker::PhantomData })
34865 } else {
34866 None
34867 }
34868 }
34869 }
34870
34871 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Expose<'de>
34872 where
34873 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34874 ___D: ::fidl_next::Decoder<'de>,
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::wire::Union::encoded_ordinal(raw.as_mut()) {
34883 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeService<'de>>(
34884 raw,
34885 decoder,
34886 (),
34887 )?,
34888
34889 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeProtocol<'de>>(
34890 raw,
34891 decoder,
34892 (),
34893 )?,
34894
34895 3 => {
34896 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeDirectory<'de>>(
34897 raw,
34898 decoder,
34899 (),
34900 )?
34901 }
34902
34903 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeRunner<'de>>(
34904 raw,
34905 decoder,
34906 (),
34907 )?,
34908
34909 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeResolver<'de>>(
34910 raw,
34911 decoder,
34912 (),
34913 )?,
34914
34915 7 => {
34916 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeDictionary<'de>>(
34917 raw,
34918 decoder,
34919 (),
34920 )?
34921 }
34922
34923 8 => ::fidl_next::wire::Union::decode_as::<
34924 ___D,
34925 crate::wire::ExposeConfiguration<'de>,
34926 >(raw, decoder, ())?,
34927
34928 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
34929 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
34930 }
34931
34932 Ok(())
34933 }
34934 }
34935
34936 impl<'de> ::core::fmt::Debug for Expose<'de> {
34937 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34938 self.as_ref().fmt(f)
34939 }
34940 }
34941
34942 impl<'de> ::fidl_next::IntoNatural for Expose<'de> {
34943 type Natural = ::core::option::Option<crate::natural::Expose>;
34944 }
34945
34946 #[repr(transparent)]
34947 pub struct Offer<'de> {
34948 pub(crate) raw: ::fidl_next::wire::Union,
34949 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34950 }
34951
34952 impl ::fidl_next::Constrained for Offer<'_> {
34953 type Constraint = ();
34954
34955 fn validate(
34956 _: ::fidl_next::Slot<'_, Self>,
34957 _: Self::Constraint,
34958 ) -> Result<(), ::fidl_next::ValidationError> {
34959 Ok(())
34960 }
34961 }
34962
34963 unsafe impl ::fidl_next::Wire for Offer<'static> {
34964 type Narrowed<'de> = Offer<'de>;
34965
34966 #[inline]
34967 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34968 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34969 ::fidl_next::wire::Union::zero_padding(raw);
34970 }
34971 }
34972
34973 impl<'de> Offer<'de> {
34974 pub fn is_some(&self) -> bool {
34975 self.raw.is_some()
34976 }
34977
34978 pub fn is_none(&self) -> bool {
34979 self.raw.is_none()
34980 }
34981
34982 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Offer<'de>> {
34983 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34984 }
34985
34986 pub fn into_option(self) -> ::core::option::Option<crate::wire::Offer<'de>> {
34987 if self.is_some() {
34988 Some(crate::wire::Offer { raw: self.raw, _phantom: ::core::marker::PhantomData })
34989 } else {
34990 None
34991 }
34992 }
34993 }
34994
34995 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Offer<'de>
34996 where
34997 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34998 ___D: ::fidl_next::Decoder<'de>,
34999 {
35000 fn decode(
35001 mut slot: ::fidl_next::Slot<'_, Self>,
35002 decoder: &mut ___D,
35003 _: (),
35004 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
35005 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
35006 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
35007 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferService<'de>>(
35008 raw,
35009 decoder,
35010 (),
35011 )?,
35012
35013 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferProtocol<'de>>(
35014 raw,
35015 decoder,
35016 (),
35017 )?,
35018
35019 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferDirectory<'de>>(
35020 raw,
35021 decoder,
35022 (),
35023 )?,
35024
35025 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferStorage<'de>>(
35026 raw,
35027 decoder,
35028 (),
35029 )?,
35030
35031 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferRunner<'de>>(
35032 raw,
35033 decoder,
35034 (),
35035 )?,
35036
35037 6 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferResolver<'de>>(
35038 raw,
35039 decoder,
35040 (),
35041 )?,
35042
35043 8 => {
35044 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferEventStream<'de>>(
35045 raw,
35046 decoder,
35047 (),
35048 )?
35049 }
35050
35051 9 => {
35052 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferDictionary<'de>>(
35053 raw,
35054 decoder,
35055 (),
35056 )?
35057 }
35058
35059 10 => ::fidl_next::wire::Union::decode_as::<
35060 ___D,
35061 crate::wire::OfferConfiguration<'de>,
35062 >(raw, decoder, ())?,
35063
35064 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
35065 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
35066 }
35067
35068 Ok(())
35069 }
35070 }
35071
35072 impl<'de> ::core::fmt::Debug for Offer<'de> {
35073 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
35074 self.as_ref().fmt(f)
35075 }
35076 }
35077
35078 impl<'de> ::fidl_next::IntoNatural for Offer<'de> {
35079 type Natural = ::core::option::Option<crate::natural::Offer>;
35080 }
35081
35082 #[repr(transparent)]
35083 pub struct DebugRegistration<'de> {
35084 pub(crate) raw: ::fidl_next::wire::Union,
35085 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
35086 }
35087
35088 impl ::fidl_next::Constrained for DebugRegistration<'_> {
35089 type Constraint = ();
35090
35091 fn validate(
35092 _: ::fidl_next::Slot<'_, Self>,
35093 _: Self::Constraint,
35094 ) -> Result<(), ::fidl_next::ValidationError> {
35095 Ok(())
35096 }
35097 }
35098
35099 unsafe impl ::fidl_next::Wire for DebugRegistration<'static> {
35100 type Narrowed<'de> = DebugRegistration<'de>;
35101
35102 #[inline]
35103 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
35104 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
35105 ::fidl_next::wire::Union::zero_padding(raw);
35106 }
35107 }
35108
35109 impl<'de> DebugRegistration<'de> {
35110 pub fn is_some(&self) -> bool {
35111 self.raw.is_some()
35112 }
35113
35114 pub fn is_none(&self) -> bool {
35115 self.raw.is_none()
35116 }
35117
35118 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::DebugRegistration<'de>> {
35119 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
35120 }
35121
35122 pub fn into_option(self) -> ::core::option::Option<crate::wire::DebugRegistration<'de>> {
35123 if self.is_some() {
35124 Some(crate::wire::DebugRegistration {
35125 raw: self.raw,
35126 _phantom: ::core::marker::PhantomData,
35127 })
35128 } else {
35129 None
35130 }
35131 }
35132 }
35133
35134 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DebugRegistration<'de>
35135 where
35136 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
35137 ___D: ::fidl_next::Decoder<'de>,
35138 {
35139 fn decode(
35140 mut slot: ::fidl_next::Slot<'_, Self>,
35141 decoder: &mut ___D,
35142 _: (),
35143 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
35144 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
35145 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
35146 1 => ::fidl_next::wire::Union::decode_as::<
35147 ___D,
35148 crate::wire::DebugProtocolRegistration<'de>,
35149 >(raw, decoder, ())?,
35150
35151 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
35152 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
35153 }
35154
35155 Ok(())
35156 }
35157 }
35158
35159 impl<'de> ::core::fmt::Debug for DebugRegistration<'de> {
35160 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
35161 self.as_ref().fmt(f)
35162 }
35163 }
35164
35165 impl<'de> ::fidl_next::IntoNatural for DebugRegistration<'de> {
35166 type Natural = ::core::option::Option<crate::natural::DebugRegistration>;
35167 }
35168
35169 #[repr(transparent)]
35170 pub struct ConfigValueSource<'de> {
35171 pub(crate) raw: ::fidl_next::wire::Union,
35172 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
35173 }
35174
35175 impl ::fidl_next::Constrained for ConfigValueSource<'_> {
35176 type Constraint = ();
35177
35178 fn validate(
35179 _: ::fidl_next::Slot<'_, Self>,
35180 _: Self::Constraint,
35181 ) -> Result<(), ::fidl_next::ValidationError> {
35182 Ok(())
35183 }
35184 }
35185
35186 unsafe impl ::fidl_next::Wire for ConfigValueSource<'static> {
35187 type Narrowed<'de> = ConfigValueSource<'de>;
35188
35189 #[inline]
35190 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
35191 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
35192 ::fidl_next::wire::Union::zero_padding(raw);
35193 }
35194 }
35195
35196 impl<'de> ConfigValueSource<'de> {
35197 pub fn is_some(&self) -> bool {
35198 self.raw.is_some()
35199 }
35200
35201 pub fn is_none(&self) -> bool {
35202 self.raw.is_none()
35203 }
35204
35205 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ConfigValueSource<'de>> {
35206 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
35207 }
35208
35209 pub fn into_option(self) -> ::core::option::Option<crate::wire::ConfigValueSource<'de>> {
35210 if self.is_some() {
35211 Some(crate::wire::ConfigValueSource {
35212 raw: self.raw,
35213 _phantom: ::core::marker::PhantomData,
35214 })
35215 } else {
35216 None
35217 }
35218 }
35219 }
35220
35221 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigValueSource<'de>
35222 where
35223 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
35224 ___D: ::fidl_next::Decoder<'de>,
35225 {
35226 fn decode(
35227 mut slot: ::fidl_next::Slot<'_, Self>,
35228 decoder: &mut ___D,
35229 _: (),
35230 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
35231 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
35232 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
35233 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
35234 raw, decoder, 4294967295,
35235 )?,
35236
35237 2 => ::fidl_next::wire::Union::decode_as::<
35238 ___D,
35239 crate::wire::ConfigSourceCapabilities<'de>,
35240 >(raw, decoder, ())?,
35241
35242 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
35243 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
35244 }
35245
35246 Ok(())
35247 }
35248 }
35249
35250 impl<'de> ::core::fmt::Debug for ConfigValueSource<'de> {
35251 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
35252 self.as_ref().fmt(f)
35253 }
35254 }
35255
35256 impl<'de> ::fidl_next::IntoNatural for ConfigValueSource<'de> {
35257 type Natural = ::core::option::Option<crate::natural::ConfigValueSource>;
35258 }
35259
35260 #[repr(transparent)]
35261 pub struct LayoutParameter<'de> {
35262 pub(crate) raw: ::fidl_next::wire::Union,
35263 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
35264 }
35265
35266 impl ::fidl_next::Constrained for LayoutParameter<'_> {
35267 type Constraint = ();
35268
35269 fn validate(
35270 _: ::fidl_next::Slot<'_, Self>,
35271 _: Self::Constraint,
35272 ) -> Result<(), ::fidl_next::ValidationError> {
35273 Ok(())
35274 }
35275 }
35276
35277 unsafe impl ::fidl_next::Wire for LayoutParameter<'static> {
35278 type Narrowed<'de> = LayoutParameter<'de>;
35279
35280 #[inline]
35281 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
35282 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
35283 ::fidl_next::wire::Union::zero_padding(raw);
35284 }
35285 }
35286
35287 impl<'de> LayoutParameter<'de> {
35288 pub fn is_some(&self) -> bool {
35289 self.raw.is_some()
35290 }
35291
35292 pub fn is_none(&self) -> bool {
35293 self.raw.is_none()
35294 }
35295
35296 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::LayoutParameter<'de>> {
35297 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
35298 }
35299
35300 pub fn into_option(self) -> ::core::option::Option<crate::wire::LayoutParameter<'de>> {
35301 if self.is_some() {
35302 Some(crate::wire::LayoutParameter {
35303 raw: self.raw,
35304 _phantom: ::core::marker::PhantomData,
35305 })
35306 } else {
35307 None
35308 }
35309 }
35310 }
35311
35312 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LayoutParameter<'de>
35313 where
35314 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
35315 ___D: ::fidl_next::Decoder<'de>,
35316 {
35317 fn decode(
35318 mut slot: ::fidl_next::Slot<'_, Self>,
35319 decoder: &mut ___D,
35320 _: (),
35321 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
35322 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
35323 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
35324 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ConfigType<'de>>(
35325 raw,
35326 decoder,
35327 (),
35328 )?,
35329
35330 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
35331 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
35332 }
35333
35334 Ok(())
35335 }
35336 }
35337
35338 impl<'de> ::core::fmt::Debug for LayoutParameter<'de> {
35339 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
35340 self.as_ref().fmt(f)
35341 }
35342 }
35343
35344 impl<'de> ::fidl_next::IntoNatural for LayoutParameter<'de> {
35345 type Natural = ::core::option::Option<crate::natural::LayoutParameter>;
35346 }
35347}
35348
35349pub mod generic {
35350
35351 pub type ParentRef = ();
35353
35354 pub type SelfRef = ();
35356
35357 pub struct ChildRef<T0, T1> {
35359 pub name: T0,
35360
35361 pub collection: T1,
35362 }
35363
35364 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::ChildRef<'static>, ___E>
35365 for ChildRef<T0, T1>
35366 where
35367 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35368 ___E: ::fidl_next::Encoder,
35369 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
35370 T1: ::fidl_next::Encode<::fidl_next::wire::OptionalString<'static>, ___E>,
35371 {
35372 #[inline]
35373 fn encode(
35374 self,
35375 encoder_: &mut ___E,
35376 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChildRef<'static>>,
35377 _: (),
35378 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35379 ::fidl_next::munge! {
35380 let crate::wire::ChildRef {
35381 name,
35382 collection,
35383
35384 } = out_;
35385 }
35386
35387 ::fidl_next::Encode::encode(self.name, encoder_, name, 1024)?;
35388
35389 ::fidl_next::Encode::encode(self.collection, encoder_, collection, 100)?;
35390
35391 Ok(())
35392 }
35393 }
35394
35395 pub struct CollectionRef<T0> {
35397 pub name: T0,
35398 }
35399
35400 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::CollectionRef<'static>, ___E>
35401 for CollectionRef<T0>
35402 where
35403 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35404 ___E: ::fidl_next::Encoder,
35405 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
35406 {
35407 #[inline]
35408 fn encode(
35409 self,
35410 encoder_: &mut ___E,
35411 out_: &mut ::core::mem::MaybeUninit<crate::wire::CollectionRef<'static>>,
35412 _: (),
35413 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35414 ::fidl_next::munge! {
35415 let crate::wire::CollectionRef {
35416 name,
35417
35418 } = out_;
35419 }
35420
35421 ::fidl_next::Encode::encode(self.name, encoder_, name, 100)?;
35422
35423 Ok(())
35424 }
35425 }
35426
35427 pub type FrameworkRef = ();
35429
35430 pub struct CapabilityRef<T0> {
35432 pub name: T0,
35433 }
35434
35435 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::CapabilityRef<'static>, ___E>
35436 for CapabilityRef<T0>
35437 where
35438 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35439 ___E: ::fidl_next::Encoder,
35440 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
35441 {
35442 #[inline]
35443 fn encode(
35444 self,
35445 encoder_: &mut ___E,
35446 out_: &mut ::core::mem::MaybeUninit<crate::wire::CapabilityRef<'static>>,
35447 _: (),
35448 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35449 ::fidl_next::munge! {
35450 let crate::wire::CapabilityRef {
35451 name,
35452
35453 } = out_;
35454 }
35455
35456 ::fidl_next::Encode::encode(self.name, encoder_, name, 100)?;
35457
35458 Ok(())
35459 }
35460 }
35461
35462 pub type DebugRef = ();
35464
35465 pub type VoidRef = ();
35467
35468 pub type EnvironmentRef = ();
35470
35471 pub struct NameMapping<T0, T1> {
35473 pub source_name: T0,
35474
35475 pub target_name: T1,
35476 }
35477
35478 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::NameMapping<'static>, ___E>
35479 for NameMapping<T0, T1>
35480 where
35481 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35482 ___E: ::fidl_next::Encoder,
35483 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
35484 T1: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
35485 {
35486 #[inline]
35487 fn encode(
35488 self,
35489 encoder_: &mut ___E,
35490 out_: &mut ::core::mem::MaybeUninit<crate::wire::NameMapping<'static>>,
35491 _: (),
35492 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35493 ::fidl_next::munge! {
35494 let crate::wire::NameMapping {
35495 source_name,
35496 target_name,
35497
35498 } = out_;
35499 }
35500
35501 ::fidl_next::Encode::encode(self.source_name, encoder_, source_name, 100)?;
35502
35503 ::fidl_next::Encode::encode(self.target_name, encoder_, target_name, 100)?;
35504
35505 Ok(())
35506 }
35507 }
35508
35509 pub struct ConfigType<T0, T1, T2> {
35511 pub layout: T0,
35512
35513 pub parameters: T1,
35514
35515 pub constraints: T2,
35516 }
35517
35518 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<crate::wire::ConfigType<'static>, ___E>
35519 for ConfigType<T0, T1, T2>
35520 where
35521 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35522 ___E: ::fidl_next::Encoder,
35523 T0: ::fidl_next::Encode<crate::wire::ConfigTypeLayout, ___E>,
35524 T1: ::fidl_next::Encode<
35525 ::fidl_next::wire::OptionalVector<'static, crate::wire::LayoutParameter<'static>>,
35526 ___E,
35527 >,
35528 T2: ::fidl_next::Encode<
35529 ::fidl_next::wire::Vector<'static, crate::wire::LayoutConstraint<'static>>,
35530 ___E,
35531 >,
35532 {
35533 #[inline]
35534 fn encode(
35535 self,
35536 encoder_: &mut ___E,
35537 out_: &mut ::core::mem::MaybeUninit<crate::wire::ConfigType<'static>>,
35538 _: (),
35539 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35540 ::fidl_next::munge! {
35541 let crate::wire::ConfigType {
35542 layout,
35543 parameters,
35544 constraints,
35545
35546 } = out_;
35547 }
35548
35549 ::fidl_next::Encode::encode(self.layout, encoder_, layout, ())?;
35550
35551 ::fidl_next::Encode::encode(self.parameters, encoder_, parameters, (4294967295, ()))?;
35552
35553 ::fidl_next::Encode::encode(self.constraints, encoder_, constraints, (4294967295, ()))?;
35554
35555 Ok(())
35556 }
35557 }
35558
35559 pub struct ResolvedConfigField<T0, T1> {
35561 pub key: T0,
35562
35563 pub value: T1,
35564 }
35565
35566 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::ResolvedConfigField<'static>, ___E>
35567 for ResolvedConfigField<T0, T1>
35568 where
35569 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35570 ___E: ::fidl_next::Encoder,
35571 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
35572 T1: ::fidl_next::Encode<crate::wire::ConfigValue<'static>, ___E>,
35573 {
35574 #[inline]
35575 fn encode(
35576 self,
35577 encoder_: &mut ___E,
35578 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfigField<'static>>,
35579 _: (),
35580 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35581 ::fidl_next::munge! {
35582 let crate::wire::ResolvedConfigField {
35583 key,
35584 value,
35585
35586 } = out_;
35587 }
35588
35589 ::fidl_next::Encode::encode(self.key, encoder_, key, 4294967295)?;
35590
35591 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
35592
35593 Ok(())
35594 }
35595 }
35596
35597 pub struct ResolvedConfig<T0, T1> {
35599 pub fields: T0,
35600
35601 pub checksum: T1,
35602 }
35603
35604 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::ResolvedConfig<'static>, ___E>
35605 for ResolvedConfig<T0, T1>
35606 where
35607 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35608 ___E: ::fidl_next::Encoder,
35609 T0: ::fidl_next::Encode<
35610 ::fidl_next::wire::Vector<'static, crate::wire::ResolvedConfigField<'static>>,
35611 ___E,
35612 >,
35613 T1: ::fidl_next::Encode<crate::wire::ConfigChecksum<'static>, ___E>,
35614 {
35615 #[inline]
35616 fn encode(
35617 self,
35618 encoder_: &mut ___E,
35619 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfig<'static>>,
35620 _: (),
35621 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35622 ::fidl_next::munge! {
35623 let crate::wire::ResolvedConfig {
35624 fields,
35625 checksum,
35626
35627 } = out_;
35628 }
35629
35630 ::fidl_next::Encode::encode(self.fields, encoder_, fields, (4294967295, ()))?;
35631
35632 ::fidl_next::Encode::encode(self.checksum, encoder_, checksum, ())?;
35633
35634 Ok(())
35635 }
35636 }
35637}
35638
35639pub use self::natural::*;
35640
35641#[doc = " Config keys can only consist of these many bytes\n"]
35642pub const CONFIG_KEY_MAX_SIZE: u32 = 64 as u32;
35643
35644pub const MAX_NAME_LENGTH: u32 = 100 as u32;
35645
35646pub const MAX_PATH_LENGTH: u32 = 1024 as u32;
35647
35648pub const MAX_CHILD_NAME_LENGTH: u32 = 1024 as u32;
35649
35650pub const MAX_URL_SCHEME_LENGTH: u32 = 100 as u32;
35651
35652pub const MAX_MONIKER_LENGTH: u32 = 4096 as u32;
35653
35654#[doc = " The maximum number of EventSubscriptions in an EventStream.\n"]
35655pub const MAX_NUM_EVENT_STREAM_SUBSCRIPTIONS: u64 = 100 as u64;