1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5#[doc = " The kinds of offers that can target the children in a collection.\n"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7#[repr(u32)]
8pub enum AllowedOffers {
9 StaticOnly = 1,
10 StaticAndDynamic = 2,
11}
12
13impl ::fidl_next::Encodable for AllowedOffers {
14 type Encoded = WireAllowedOffers;
15}
16impl ::std::convert::TryFrom<u32> for AllowedOffers {
17 type Error = ::fidl_next::UnknownStrictEnumMemberError;
18 fn try_from(value: u32) -> Result<Self, Self::Error> {
19 match value {
20 1 => Ok(Self::StaticOnly),
21 2 => Ok(Self::StaticAndDynamic),
22
23 _ => Err(Self::Error::new(value.into())),
24 }
25 }
26}
27
28unsafe impl<___E> ::fidl_next::Encode<___E> for AllowedOffers
29where
30 ___E: ?Sized,
31{
32 #[inline]
33 fn encode(
34 self,
35 encoder: &mut ___E,
36 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
37 ) -> Result<(), ::fidl_next::EncodeError> {
38 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
39 }
40}
41
42unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AllowedOffers
43where
44 ___E: ?Sized,
45{
46 #[inline]
47 fn encode_ref(
48 &self,
49 encoder: &mut ___E,
50 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
51 ) -> Result<(), ::fidl_next::EncodeError> {
52 ::fidl_next::munge!(let WireAllowedOffers { value } = out);
53 let _ = value.write(::fidl_next::WireU32::from(match *self {
54 Self::StaticOnly => 1,
55
56 Self::StaticAndDynamic => 2,
57 }));
58
59 Ok(())
60 }
61}
62
63impl ::core::convert::From<WireAllowedOffers> for AllowedOffers {
64 fn from(wire: WireAllowedOffers) -> Self {
65 match u32::from(wire.value) {
66 1 => Self::StaticOnly,
67
68 2 => Self::StaticAndDynamic,
69
70 _ => unsafe { ::core::hint::unreachable_unchecked() },
71 }
72 }
73}
74
75impl ::fidl_next::FromWire<WireAllowedOffers> for AllowedOffers {
76 #[inline]
77 fn from_wire(wire: WireAllowedOffers) -> Self {
78 Self::from(wire)
79 }
80}
81
82impl ::fidl_next::FromWireRef<WireAllowedOffers> for AllowedOffers {
83 #[inline]
84 fn from_wire_ref(wire: &WireAllowedOffers) -> Self {
85 Self::from(*wire)
86 }
87}
88
89#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91#[repr(transparent)]
92pub struct WireAllowedOffers {
93 value: ::fidl_next::WireU32,
94}
95
96unsafe impl ::fidl_next::Wire for WireAllowedOffers {
97 type Decoded<'de> = Self;
98
99 #[inline]
100 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
101 }
103}
104
105impl WireAllowedOffers {
106 pub const STATIC_ONLY: WireAllowedOffers = WireAllowedOffers { value: ::fidl_next::WireU32(1) };
107
108 pub const STATIC_AND_DYNAMIC: WireAllowedOffers =
109 WireAllowedOffers { value: ::fidl_next::WireU32(2) };
110}
111
112unsafe impl<___D> ::fidl_next::Decode<___D> for WireAllowedOffers
113where
114 ___D: ?Sized,
115{
116 fn decode(
117 slot: ::fidl_next::Slot<'_, Self>,
118 _: &mut ___D,
119 ) -> Result<(), ::fidl_next::DecodeError> {
120 ::fidl_next::munge!(let Self { value } = slot);
121
122 match u32::from(*value) {
123 1 | 2 => (),
124 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
125 }
126
127 Ok(())
128 }
129}
130
131impl ::core::convert::From<AllowedOffers> for WireAllowedOffers {
132 fn from(natural: AllowedOffers) -> Self {
133 match natural {
134 AllowedOffers::StaticOnly => WireAllowedOffers::STATIC_ONLY,
135
136 AllowedOffers::StaticAndDynamic => WireAllowedOffers::STATIC_AND_DYNAMIC,
137 }
138 }
139}
140
141#[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"]
142#[derive(Clone, Copy, Debug, PartialEq, Eq)]
143#[repr(u32)]
144pub enum Availability {
145 Required = 1,
146 Optional = 2,
147 SameAsTarget = 3,
148 Transitional = 4,
149}
150
151impl ::fidl_next::Encodable for Availability {
152 type Encoded = WireAvailability;
153}
154impl ::std::convert::TryFrom<u32> for Availability {
155 type Error = ::fidl_next::UnknownStrictEnumMemberError;
156 fn try_from(value: u32) -> Result<Self, Self::Error> {
157 match value {
158 1 => Ok(Self::Required),
159 2 => Ok(Self::Optional),
160 3 => Ok(Self::SameAsTarget),
161 4 => Ok(Self::Transitional),
162
163 _ => Err(Self::Error::new(value.into())),
164 }
165 }
166}
167
168unsafe impl<___E> ::fidl_next::Encode<___E> for Availability
169where
170 ___E: ?Sized,
171{
172 #[inline]
173 fn encode(
174 self,
175 encoder: &mut ___E,
176 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
177 ) -> Result<(), ::fidl_next::EncodeError> {
178 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
179 }
180}
181
182unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Availability
183where
184 ___E: ?Sized,
185{
186 #[inline]
187 fn encode_ref(
188 &self,
189 encoder: &mut ___E,
190 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
191 ) -> Result<(), ::fidl_next::EncodeError> {
192 ::fidl_next::munge!(let WireAvailability { value } = out);
193 let _ = value.write(::fidl_next::WireU32::from(match *self {
194 Self::Required => 1,
195
196 Self::Optional => 2,
197
198 Self::SameAsTarget => 3,
199
200 Self::Transitional => 4,
201 }));
202
203 Ok(())
204 }
205}
206
207impl ::core::convert::From<WireAvailability> for Availability {
208 fn from(wire: WireAvailability) -> Self {
209 match u32::from(wire.value) {
210 1 => Self::Required,
211
212 2 => Self::Optional,
213
214 3 => Self::SameAsTarget,
215
216 4 => Self::Transitional,
217
218 _ => unsafe { ::core::hint::unreachable_unchecked() },
219 }
220 }
221}
222
223impl ::fidl_next::FromWire<WireAvailability> for Availability {
224 #[inline]
225 fn from_wire(wire: WireAvailability) -> Self {
226 Self::from(wire)
227 }
228}
229
230impl ::fidl_next::FromWireRef<WireAvailability> for Availability {
231 #[inline]
232 fn from_wire_ref(wire: &WireAvailability) -> Self {
233 Self::from(*wire)
234 }
235}
236
237#[derive(Clone, Copy, Debug, PartialEq, Eq)]
239#[repr(transparent)]
240pub struct WireAvailability {
241 value: ::fidl_next::WireU32,
242}
243
244unsafe impl ::fidl_next::Wire for WireAvailability {
245 type Decoded<'de> = Self;
246
247 #[inline]
248 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
249 }
251}
252
253impl WireAvailability {
254 pub const REQUIRED: WireAvailability = WireAvailability { value: ::fidl_next::WireU32(1) };
255
256 pub const OPTIONAL: WireAvailability = WireAvailability { value: ::fidl_next::WireU32(2) };
257
258 pub const SAME_AS_TARGET: WireAvailability =
259 WireAvailability { value: ::fidl_next::WireU32(3) };
260
261 pub const TRANSITIONAL: WireAvailability = WireAvailability { value: ::fidl_next::WireU32(4) };
262}
263
264unsafe impl<___D> ::fidl_next::Decode<___D> for WireAvailability
265where
266 ___D: ?Sized,
267{
268 fn decode(
269 slot: ::fidl_next::Slot<'_, Self>,
270 _: &mut ___D,
271 ) -> Result<(), ::fidl_next::DecodeError> {
272 ::fidl_next::munge!(let Self { value } = slot);
273
274 match u32::from(*value) {
275 1 | 2 | 3 | 4 => (),
276 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
277 }
278
279 Ok(())
280 }
281}
282
283impl ::core::convert::From<Availability> for WireAvailability {
284 fn from(natural: Availability) -> Self {
285 match natural {
286 Availability::Required => WireAvailability::REQUIRED,
287
288 Availability::Optional => WireAvailability::OPTIONAL,
289
290 Availability::SameAsTarget => WireAvailability::SAME_AS_TARGET,
291
292 Availability::Transitional => WireAvailability::TRANSITIONAL,
293 }
294 }
295}
296
297#[doc = " Config keys can only consist of these many bytes\n"]
298pub const CONFIG_KEY_MAX_SIZE: u32 = 64;
299
300pub const MAX_NAME_LENGTH: u32 = 100;
301
302pub type Name = String;
303
304pub type WireName<'de> = ::fidl_next::WireString<'de>;
306
307pub const MAX_PATH_LENGTH: u32 = 1024;
308
309#[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"]
310#[derive(Clone, Debug, Default)]
311pub struct Service {
312 pub name: Option<String>,
313
314 pub source_path: Option<String>,
315}
316
317impl Service {
318 fn __max_ordinal(&self) -> usize {
319 if self.source_path.is_some() {
320 return 2;
321 }
322
323 if self.name.is_some() {
324 return 1;
325 }
326
327 0
328 }
329}
330
331impl ::fidl_next::Encodable for Service {
332 type Encoded = WireService<'static>;
333}
334
335unsafe impl<___E> ::fidl_next::Encode<___E> for Service
336where
337 ___E: ::fidl_next::Encoder + ?Sized,
338{
339 #[inline]
340 fn encode(
341 mut self,
342 encoder: &mut ___E,
343 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
344 ) -> Result<(), ::fidl_next::EncodeError> {
345 ::fidl_next::munge!(let WireService { table } = out);
346
347 let max_ord = self.__max_ordinal();
348
349 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
350 ::fidl_next::Wire::zero_padding(&mut out);
351
352 let mut preallocated =
353 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
354
355 for i in 1..=max_ord {
356 match i {
357 2 => {
358 if let Some(source_path) = self.source_path.take() {
359 ::fidl_next::WireEnvelope::encode_value(
360 source_path,
361 preallocated.encoder,
362 &mut out,
363 )?;
364 } else {
365 ::fidl_next::WireEnvelope::encode_zero(&mut out)
366 }
367 }
368
369 1 => {
370 if let Some(name) = self.name.take() {
371 ::fidl_next::WireEnvelope::encode_value(
372 name,
373 preallocated.encoder,
374 &mut out,
375 )?;
376 } else {
377 ::fidl_next::WireEnvelope::encode_zero(&mut out)
378 }
379 }
380
381 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
382 }
383 unsafe {
384 preallocated.write_next(out.assume_init_ref());
385 }
386 }
387
388 ::fidl_next::WireTable::encode_len(table, max_ord);
389
390 Ok(())
391 }
392}
393
394unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Service
395where
396 ___E: ::fidl_next::Encoder + ?Sized,
397{
398 #[inline]
399 fn encode_ref(
400 &self,
401 encoder: &mut ___E,
402 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
403 ) -> Result<(), ::fidl_next::EncodeError> {
404 ::fidl_next::munge!(let WireService { table } = out);
405
406 let max_ord = self.__max_ordinal();
407
408 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
409 ::fidl_next::Wire::zero_padding(&mut out);
410
411 let mut preallocated =
412 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
413
414 for i in 1..=max_ord {
415 match i {
416 2 => {
417 if let Some(source_path) = &self.source_path {
418 ::fidl_next::WireEnvelope::encode_value(
419 source_path,
420 preallocated.encoder,
421 &mut out,
422 )?;
423 } else {
424 ::fidl_next::WireEnvelope::encode_zero(&mut out)
425 }
426 }
427
428 1 => {
429 if let Some(name) = &self.name {
430 ::fidl_next::WireEnvelope::encode_value(
431 name,
432 preallocated.encoder,
433 &mut out,
434 )?;
435 } else {
436 ::fidl_next::WireEnvelope::encode_zero(&mut out)
437 }
438 }
439
440 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
441 }
442 unsafe {
443 preallocated.write_next(out.assume_init_ref());
444 }
445 }
446
447 ::fidl_next::WireTable::encode_len(table, max_ord);
448
449 Ok(())
450 }
451}
452
453impl<'de> ::fidl_next::FromWire<WireService<'de>> for Service {
454 #[inline]
455 fn from_wire(wire: WireService<'de>) -> Self {
456 let wire = ::core::mem::ManuallyDrop::new(wire);
457
458 let name = wire.table.get(1);
459
460 let source_path = wire.table.get(2);
461
462 Self {
463 name: name.map(|envelope| {
464 ::fidl_next::FromWire::from_wire(unsafe {
465 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
466 })
467 }),
468
469 source_path: source_path.map(|envelope| {
470 ::fidl_next::FromWire::from_wire(unsafe {
471 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
472 })
473 }),
474 }
475 }
476}
477
478impl<'de> ::fidl_next::FromWireRef<WireService<'de>> for Service {
479 #[inline]
480 fn from_wire_ref(wire: &WireService<'de>) -> Self {
481 Self {
482 name: wire.table.get(1).map(|envelope| {
483 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
484 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
485 })
486 }),
487
488 source_path: wire.table.get(2).map(|envelope| {
489 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
490 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
491 })
492 }),
493 }
494 }
495}
496
497#[repr(C)]
499pub struct WireService<'de> {
500 table: ::fidl_next::WireTable<'de>,
501}
502
503impl<'de> Drop for WireService<'de> {
504 fn drop(&mut self) {
505 let _ = self
506 .table
507 .get(1)
508 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
509
510 let _ = self
511 .table
512 .get(2)
513 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
514 }
515}
516
517unsafe impl ::fidl_next::Wire for WireService<'static> {
518 type Decoded<'de> = WireService<'de>;
519
520 #[inline]
521 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
522 ::fidl_next::munge!(let Self { table } = out);
523 ::fidl_next::WireTable::zero_padding(table);
524 }
525}
526
527unsafe impl<___D> ::fidl_next::Decode<___D> for WireService<'static>
528where
529 ___D: ::fidl_next::Decoder + ?Sized,
530{
531 fn decode(
532 slot: ::fidl_next::Slot<'_, Self>,
533 decoder: &mut ___D,
534 ) -> Result<(), ::fidl_next::DecodeError> {
535 ::fidl_next::munge!(let Self { table } = slot);
536
537 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
538 match ordinal {
539 0 => unsafe { ::core::hint::unreachable_unchecked() },
540
541 1 => {
542 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
543 slot.as_mut(),
544 decoder,
545 )?;
546
547 let name = unsafe {
548 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
549 };
550
551 if name.len() > 100 {
552 return Err(::fidl_next::DecodeError::VectorTooLong {
553 size: name.len() as u64,
554 limit: 100,
555 });
556 }
557
558 Ok(())
559 }
560
561 2 => {
562 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
563 slot.as_mut(),
564 decoder,
565 )?;
566
567 let source_path = unsafe {
568 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
569 };
570
571 if source_path.len() > 1024 {
572 return Err(::fidl_next::DecodeError::VectorTooLong {
573 size: source_path.len() as u64,
574 limit: 1024,
575 });
576 }
577
578 Ok(())
579 }
580
581 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
582 }
583 })
584 }
585}
586
587impl<'de> WireService<'de> {
588 pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
589 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
590 }
591
592 pub fn source_path(&self) -> Option<&::fidl_next::WireString<'de>> {
593 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
594 }
595}
596
597impl<'de> ::core::fmt::Debug for WireService<'de> {
598 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
599 f.debug_struct("Service")
600 .field("name", &self.name())
601 .field("source_path", &self.source_path())
602 .finish()
603 }
604}
605
606#[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"]
607#[derive(Clone, Debug, Default)]
608pub struct Directory {
609 pub name: Option<String>,
610
611 pub source_path: Option<String>,
612
613 pub rights: Option<::fidl_next_fuchsia_io::Operations>,
614}
615
616impl Directory {
617 fn __max_ordinal(&self) -> usize {
618 if self.rights.is_some() {
619 return 3;
620 }
621
622 if self.source_path.is_some() {
623 return 2;
624 }
625
626 if self.name.is_some() {
627 return 1;
628 }
629
630 0
631 }
632}
633
634impl ::fidl_next::Encodable for Directory {
635 type Encoded = WireDirectory<'static>;
636}
637
638unsafe impl<___E> ::fidl_next::Encode<___E> for Directory
639where
640 ___E: ::fidl_next::Encoder + ?Sized,
641{
642 #[inline]
643 fn encode(
644 mut self,
645 encoder: &mut ___E,
646 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
647 ) -> Result<(), ::fidl_next::EncodeError> {
648 ::fidl_next::munge!(let WireDirectory { table } = out);
649
650 let max_ord = self.__max_ordinal();
651
652 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
653 ::fidl_next::Wire::zero_padding(&mut out);
654
655 let mut preallocated =
656 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
657
658 for i in 1..=max_ord {
659 match i {
660 3 => {
661 if let Some(rights) = self.rights.take() {
662 ::fidl_next::WireEnvelope::encode_value(
663 rights,
664 preallocated.encoder,
665 &mut out,
666 )?;
667 } else {
668 ::fidl_next::WireEnvelope::encode_zero(&mut out)
669 }
670 }
671
672 2 => {
673 if let Some(source_path) = self.source_path.take() {
674 ::fidl_next::WireEnvelope::encode_value(
675 source_path,
676 preallocated.encoder,
677 &mut out,
678 )?;
679 } else {
680 ::fidl_next::WireEnvelope::encode_zero(&mut out)
681 }
682 }
683
684 1 => {
685 if let Some(name) = self.name.take() {
686 ::fidl_next::WireEnvelope::encode_value(
687 name,
688 preallocated.encoder,
689 &mut out,
690 )?;
691 } else {
692 ::fidl_next::WireEnvelope::encode_zero(&mut out)
693 }
694 }
695
696 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
697 }
698 unsafe {
699 preallocated.write_next(out.assume_init_ref());
700 }
701 }
702
703 ::fidl_next::WireTable::encode_len(table, max_ord);
704
705 Ok(())
706 }
707}
708
709unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Directory
710where
711 ___E: ::fidl_next::Encoder + ?Sized,
712{
713 #[inline]
714 fn encode_ref(
715 &self,
716 encoder: &mut ___E,
717 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
718 ) -> Result<(), ::fidl_next::EncodeError> {
719 ::fidl_next::munge!(let WireDirectory { table } = out);
720
721 let max_ord = self.__max_ordinal();
722
723 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
724 ::fidl_next::Wire::zero_padding(&mut out);
725
726 let mut preallocated =
727 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
728
729 for i in 1..=max_ord {
730 match i {
731 3 => {
732 if let Some(rights) = &self.rights {
733 ::fidl_next::WireEnvelope::encode_value(
734 rights,
735 preallocated.encoder,
736 &mut out,
737 )?;
738 } else {
739 ::fidl_next::WireEnvelope::encode_zero(&mut out)
740 }
741 }
742
743 2 => {
744 if let Some(source_path) = &self.source_path {
745 ::fidl_next::WireEnvelope::encode_value(
746 source_path,
747 preallocated.encoder,
748 &mut out,
749 )?;
750 } else {
751 ::fidl_next::WireEnvelope::encode_zero(&mut out)
752 }
753 }
754
755 1 => {
756 if let Some(name) = &self.name {
757 ::fidl_next::WireEnvelope::encode_value(
758 name,
759 preallocated.encoder,
760 &mut out,
761 )?;
762 } else {
763 ::fidl_next::WireEnvelope::encode_zero(&mut out)
764 }
765 }
766
767 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
768 }
769 unsafe {
770 preallocated.write_next(out.assume_init_ref());
771 }
772 }
773
774 ::fidl_next::WireTable::encode_len(table, max_ord);
775
776 Ok(())
777 }
778}
779
780impl<'de> ::fidl_next::FromWire<WireDirectory<'de>> for Directory {
781 #[inline]
782 fn from_wire(wire: WireDirectory<'de>) -> Self {
783 let wire = ::core::mem::ManuallyDrop::new(wire);
784
785 let name = wire.table.get(1);
786
787 let source_path = wire.table.get(2);
788
789 let rights = wire.table.get(3);
790
791 Self {
792 name: name.map(|envelope| {
793 ::fidl_next::FromWire::from_wire(unsafe {
794 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
795 })
796 }),
797
798 source_path: source_path.map(|envelope| {
799 ::fidl_next::FromWire::from_wire(unsafe {
800 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
801 })
802 }),
803
804 rights: rights.map(|envelope| {
805 ::fidl_next::FromWire::from_wire(unsafe {
806 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
807 })
808 }),
809 }
810 }
811}
812
813impl<'de> ::fidl_next::FromWireRef<WireDirectory<'de>> for Directory {
814 #[inline]
815 fn from_wire_ref(wire: &WireDirectory<'de>) -> Self {
816 Self {
817 name: wire.table.get(1).map(|envelope| {
818 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
819 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
820 })
821 }),
822
823 source_path: wire.table.get(2).map(|envelope| {
824 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
825 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
826 })
827 }),
828
829 rights: wire.table.get(3).map(|envelope| {
830 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
831 envelope.deref_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
832 })
833 }),
834 }
835 }
836}
837
838#[repr(C)]
840pub struct WireDirectory<'de> {
841 table: ::fidl_next::WireTable<'de>,
842}
843
844impl<'de> Drop for WireDirectory<'de> {
845 fn drop(&mut self) {
846 let _ = self
847 .table
848 .get(1)
849 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
850
851 let _ = self
852 .table
853 .get(2)
854 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
855
856 let _ = self.table.get(3).map(|envelope| unsafe {
857 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
858 });
859 }
860}
861
862unsafe impl ::fidl_next::Wire for WireDirectory<'static> {
863 type Decoded<'de> = WireDirectory<'de>;
864
865 #[inline]
866 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
867 ::fidl_next::munge!(let Self { table } = out);
868 ::fidl_next::WireTable::zero_padding(table);
869 }
870}
871
872unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectory<'static>
873where
874 ___D: ::fidl_next::Decoder + ?Sized,
875{
876 fn decode(
877 slot: ::fidl_next::Slot<'_, Self>,
878 decoder: &mut ___D,
879 ) -> Result<(), ::fidl_next::DecodeError> {
880 ::fidl_next::munge!(let Self { table } = slot);
881
882 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
883 match ordinal {
884 0 => unsafe { ::core::hint::unreachable_unchecked() },
885
886 1 => {
887 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
888 slot.as_mut(),
889 decoder,
890 )?;
891
892 let name = unsafe {
893 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
894 };
895
896 if name.len() > 100 {
897 return Err(::fidl_next::DecodeError::VectorTooLong {
898 size: name.len() as u64,
899 limit: 100,
900 });
901 }
902
903 Ok(())
904 }
905
906 2 => {
907 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
908 slot.as_mut(),
909 decoder,
910 )?;
911
912 let source_path = unsafe {
913 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
914 };
915
916 if source_path.len() > 1024 {
917 return Err(::fidl_next::DecodeError::VectorTooLong {
918 size: source_path.len() as u64,
919 limit: 1024,
920 });
921 }
922
923 Ok(())
924 }
925
926 3 => {
927 ::fidl_next::WireEnvelope::decode_as::<
928 ___D,
929 ::fidl_next_fuchsia_io::WireOperations,
930 >(slot.as_mut(), decoder)?;
931
932 Ok(())
933 }
934
935 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
936 }
937 })
938 }
939}
940
941impl<'de> WireDirectory<'de> {
942 pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
943 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
944 }
945
946 pub fn source_path(&self) -> Option<&::fidl_next::WireString<'de>> {
947 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
948 }
949
950 pub fn rights(&self) -> Option<&::fidl_next_fuchsia_io::WireOperations> {
951 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
952 }
953}
954
955impl<'de> ::core::fmt::Debug for WireDirectory<'de> {
956 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
957 f.debug_struct("Directory")
958 .field("name", &self.name())
959 .field("source_path", &self.source_path())
960 .field("rights", &self.rights())
961 .finish()
962 }
963}
964
965#[doc = " A reference to a component\'s parent instance.\n"]
966#[derive(Clone, Debug)]
967#[repr(C)]
968pub struct ParentRef {}
969
970impl ::fidl_next::Encodable for ParentRef {
971 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireParentRef> =
972 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
973
974 type Encoded = WireParentRef;
975}
976
977unsafe impl<___E> ::fidl_next::Encode<___E> for ParentRef
978where
979 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
980{
981 #[inline]
982 fn encode(
983 self,
984 encoder: &mut ___E,
985 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
986 ) -> Result<(), ::fidl_next::EncodeError> {
987 ::fidl_next::munge! {
988 let Self::Encoded {
989
990 } = out;
991 }
992
993 Ok(())
994 }
995}
996
997unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ParentRef
998where
999 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1000{
1001 #[inline]
1002 fn encode_ref(
1003 &self,
1004 encoder: &mut ___E,
1005 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1006 ) -> Result<(), ::fidl_next::EncodeError> {
1007 ::fidl_next::munge! {
1008 let Self::Encoded {
1009
1010 } = out;
1011 }
1012
1013 Ok(())
1014 }
1015}
1016
1017impl ::fidl_next::EncodableOption for ParentRef {
1018 type EncodedOption = ::fidl_next::WireBox<'static, WireParentRef>;
1019}
1020
1021unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ParentRef
1022where
1023 ___E: ::fidl_next::Encoder + ?Sized,
1024 ParentRef: ::fidl_next::Encode<___E>,
1025{
1026 #[inline]
1027 fn encode_option(
1028 this: Option<Self>,
1029 encoder: &mut ___E,
1030 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1031 ) -> Result<(), ::fidl_next::EncodeError> {
1032 if let Some(inner) = this {
1033 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1034 ::fidl_next::WireBox::encode_present(out);
1035 } else {
1036 ::fidl_next::WireBox::encode_absent(out);
1037 }
1038
1039 Ok(())
1040 }
1041}
1042
1043unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ParentRef
1044where
1045 ___E: ::fidl_next::Encoder + ?Sized,
1046 ParentRef: ::fidl_next::EncodeRef<___E>,
1047{
1048 #[inline]
1049 fn encode_option_ref(
1050 this: Option<&Self>,
1051 encoder: &mut ___E,
1052 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1053 ) -> Result<(), ::fidl_next::EncodeError> {
1054 if let Some(inner) = this {
1055 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1056 ::fidl_next::WireBox::encode_present(out);
1057 } else {
1058 ::fidl_next::WireBox::encode_absent(out);
1059 }
1060
1061 Ok(())
1062 }
1063}
1064
1065impl ::fidl_next::FromWire<WireParentRef> for ParentRef {
1066 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireParentRef, Self> =
1067 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1068
1069 #[inline]
1070 fn from_wire(wire: WireParentRef) -> Self {
1071 Self {}
1072 }
1073}
1074
1075impl ::fidl_next::FromWireRef<WireParentRef> for ParentRef {
1076 #[inline]
1077 fn from_wire_ref(wire: &WireParentRef) -> Self {
1078 Self {}
1079 }
1080}
1081
1082#[derive(Clone, Debug)]
1084#[repr(C)]
1085pub struct WireParentRef {}
1086
1087unsafe impl ::fidl_next::Wire for WireParentRef {
1088 type Decoded<'de> = WireParentRef;
1089
1090 #[inline]
1091 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1092}
1093
1094unsafe impl<___D> ::fidl_next::Decode<___D> for WireParentRef
1095where
1096 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1097{
1098 fn decode(
1099 slot: ::fidl_next::Slot<'_, Self>,
1100 decoder: &mut ___D,
1101 ) -> Result<(), ::fidl_next::DecodeError> {
1102 ::fidl_next::munge! {
1103 let Self {
1104
1105 } = slot;
1106 }
1107
1108 Ok(())
1109 }
1110}
1111
1112#[doc = " A reference to the component itself.\n"]
1113#[derive(Clone, Debug)]
1114#[repr(C)]
1115pub struct SelfRef {}
1116
1117impl ::fidl_next::Encodable for SelfRef {
1118 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireSelfRef> =
1119 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1120
1121 type Encoded = WireSelfRef;
1122}
1123
1124unsafe impl<___E> ::fidl_next::Encode<___E> for SelfRef
1125where
1126 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1127{
1128 #[inline]
1129 fn encode(
1130 self,
1131 encoder: &mut ___E,
1132 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1133 ) -> Result<(), ::fidl_next::EncodeError> {
1134 ::fidl_next::munge! {
1135 let Self::Encoded {
1136
1137 } = out;
1138 }
1139
1140 Ok(())
1141 }
1142}
1143
1144unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SelfRef
1145where
1146 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1147{
1148 #[inline]
1149 fn encode_ref(
1150 &self,
1151 encoder: &mut ___E,
1152 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1153 ) -> Result<(), ::fidl_next::EncodeError> {
1154 ::fidl_next::munge! {
1155 let Self::Encoded {
1156
1157 } = out;
1158 }
1159
1160 Ok(())
1161 }
1162}
1163
1164impl ::fidl_next::EncodableOption for SelfRef {
1165 type EncodedOption = ::fidl_next::WireBox<'static, WireSelfRef>;
1166}
1167
1168unsafe impl<___E> ::fidl_next::EncodeOption<___E> for SelfRef
1169where
1170 ___E: ::fidl_next::Encoder + ?Sized,
1171 SelfRef: ::fidl_next::Encode<___E>,
1172{
1173 #[inline]
1174 fn encode_option(
1175 this: Option<Self>,
1176 encoder: &mut ___E,
1177 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1178 ) -> Result<(), ::fidl_next::EncodeError> {
1179 if let Some(inner) = this {
1180 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1181 ::fidl_next::WireBox::encode_present(out);
1182 } else {
1183 ::fidl_next::WireBox::encode_absent(out);
1184 }
1185
1186 Ok(())
1187 }
1188}
1189
1190unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for SelfRef
1191where
1192 ___E: ::fidl_next::Encoder + ?Sized,
1193 SelfRef: ::fidl_next::EncodeRef<___E>,
1194{
1195 #[inline]
1196 fn encode_option_ref(
1197 this: Option<&Self>,
1198 encoder: &mut ___E,
1199 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1200 ) -> Result<(), ::fidl_next::EncodeError> {
1201 if let Some(inner) = this {
1202 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1203 ::fidl_next::WireBox::encode_present(out);
1204 } else {
1205 ::fidl_next::WireBox::encode_absent(out);
1206 }
1207
1208 Ok(())
1209 }
1210}
1211
1212impl ::fidl_next::FromWire<WireSelfRef> for SelfRef {
1213 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireSelfRef, Self> =
1214 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1215
1216 #[inline]
1217 fn from_wire(wire: WireSelfRef) -> Self {
1218 Self {}
1219 }
1220}
1221
1222impl ::fidl_next::FromWireRef<WireSelfRef> for SelfRef {
1223 #[inline]
1224 fn from_wire_ref(wire: &WireSelfRef) -> Self {
1225 Self {}
1226 }
1227}
1228
1229#[derive(Clone, Debug)]
1231#[repr(C)]
1232pub struct WireSelfRef {}
1233
1234unsafe impl ::fidl_next::Wire for WireSelfRef {
1235 type Decoded<'de> = WireSelfRef;
1236
1237 #[inline]
1238 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1239}
1240
1241unsafe impl<___D> ::fidl_next::Decode<___D> for WireSelfRef
1242where
1243 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1244{
1245 fn decode(
1246 slot: ::fidl_next::Slot<'_, Self>,
1247 decoder: &mut ___D,
1248 ) -> Result<(), ::fidl_next::DecodeError> {
1249 ::fidl_next::munge! {
1250 let Self {
1251
1252 } = slot;
1253 }
1254
1255 Ok(())
1256 }
1257}
1258
1259pub const MAX_CHILD_NAME_LENGTH: u32 = 1024;
1260
1261pub type ChildName = String;
1262
1263pub type WireChildName<'de> = ::fidl_next::WireString<'de>;
1265
1266#[doc = " A reference to one of the component\'s child instances.\n"]
1267#[derive(Clone, Debug)]
1268pub struct ChildRef {
1269 pub name: String,
1270
1271 pub collection: Option<String>,
1272}
1273
1274impl ::fidl_next::Encodable for ChildRef {
1275 type Encoded = WireChildRef<'static>;
1276}
1277
1278unsafe impl<___E> ::fidl_next::Encode<___E> for ChildRef
1279where
1280 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1281 ___E: ::fidl_next::Encoder,
1282{
1283 #[inline]
1284 fn encode(
1285 self,
1286 encoder: &mut ___E,
1287 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1288 ) -> Result<(), ::fidl_next::EncodeError> {
1289 ::fidl_next::munge! {
1290 let Self::Encoded {
1291 name,
1292 collection,
1293
1294 } = out;
1295 }
1296
1297 ::fidl_next::Encode::encode(self.name, encoder, name)?;
1298
1299 ::fidl_next::Encode::encode(self.collection, encoder, collection)?;
1300
1301 Ok(())
1302 }
1303}
1304
1305unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ChildRef
1306where
1307 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1308 ___E: ::fidl_next::Encoder,
1309{
1310 #[inline]
1311 fn encode_ref(
1312 &self,
1313 encoder: &mut ___E,
1314 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1315 ) -> Result<(), ::fidl_next::EncodeError> {
1316 ::fidl_next::munge! {
1317 let Self::Encoded {
1318 name,
1319 collection,
1320
1321 } = out;
1322 }
1323
1324 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
1325
1326 ::fidl_next::EncodeRef::encode_ref(&self.collection, encoder, collection)?;
1327
1328 Ok(())
1329 }
1330}
1331
1332impl ::fidl_next::EncodableOption for ChildRef {
1333 type EncodedOption = ::fidl_next::WireBox<'static, WireChildRef<'static>>;
1334}
1335
1336unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ChildRef
1337where
1338 ___E: ::fidl_next::Encoder + ?Sized,
1339 ChildRef: ::fidl_next::Encode<___E>,
1340{
1341 #[inline]
1342 fn encode_option(
1343 this: Option<Self>,
1344 encoder: &mut ___E,
1345 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1346 ) -> Result<(), ::fidl_next::EncodeError> {
1347 if let Some(inner) = this {
1348 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1349 ::fidl_next::WireBox::encode_present(out);
1350 } else {
1351 ::fidl_next::WireBox::encode_absent(out);
1352 }
1353
1354 Ok(())
1355 }
1356}
1357
1358unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ChildRef
1359where
1360 ___E: ::fidl_next::Encoder + ?Sized,
1361 ChildRef: ::fidl_next::EncodeRef<___E>,
1362{
1363 #[inline]
1364 fn encode_option_ref(
1365 this: Option<&Self>,
1366 encoder: &mut ___E,
1367 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1368 ) -> Result<(), ::fidl_next::EncodeError> {
1369 if let Some(inner) = this {
1370 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1371 ::fidl_next::WireBox::encode_present(out);
1372 } else {
1373 ::fidl_next::WireBox::encode_absent(out);
1374 }
1375
1376 Ok(())
1377 }
1378}
1379
1380impl<'de> ::fidl_next::FromWire<WireChildRef<'de>> for ChildRef {
1381 #[inline]
1382 fn from_wire(wire: WireChildRef<'de>) -> Self {
1383 Self {
1384 name: ::fidl_next::FromWire::from_wire(wire.name),
1385
1386 collection: ::fidl_next::FromWire::from_wire(wire.collection),
1387 }
1388 }
1389}
1390
1391impl<'de> ::fidl_next::FromWireRef<WireChildRef<'de>> for ChildRef {
1392 #[inline]
1393 fn from_wire_ref(wire: &WireChildRef<'de>) -> Self {
1394 Self {
1395 name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
1396
1397 collection: ::fidl_next::FromWireRef::from_wire_ref(&wire.collection),
1398 }
1399 }
1400}
1401
1402#[derive(Debug)]
1404#[repr(C)]
1405pub struct WireChildRef<'de> {
1406 pub name: ::fidl_next::WireString<'de>,
1407
1408 pub collection: ::fidl_next::WireOptionalString<'de>,
1409}
1410
1411unsafe impl ::fidl_next::Wire for WireChildRef<'static> {
1412 type Decoded<'de> = WireChildRef<'de>;
1413
1414 #[inline]
1415 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1416}
1417
1418unsafe impl<___D> ::fidl_next::Decode<___D> for WireChildRef<'static>
1419where
1420 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1421 ___D: ::fidl_next::Decoder,
1422{
1423 fn decode(
1424 slot: ::fidl_next::Slot<'_, Self>,
1425 decoder: &mut ___D,
1426 ) -> Result<(), ::fidl_next::DecodeError> {
1427 ::fidl_next::munge! {
1428 let Self {
1429 mut name,
1430 mut collection,
1431
1432 } = slot;
1433 }
1434
1435 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
1436
1437 let name = unsafe { name.deref_unchecked() };
1438
1439 if name.len() > 1024 {
1440 return Err(::fidl_next::DecodeError::VectorTooLong {
1441 size: name.len() as u64,
1442 limit: 1024,
1443 });
1444 }
1445
1446 ::fidl_next::Decode::decode(collection.as_mut(), decoder)?;
1447
1448 let collection = unsafe { collection.deref_unchecked() };
1449
1450 if let Some(collection) = collection.as_ref() {
1451 if collection.len() > 100 {
1452 return Err(::fidl_next::DecodeError::VectorTooLong {
1453 size: collection.len() as u64,
1454 limit: 100,
1455 });
1456 }
1457 }
1458
1459 Ok(())
1460 }
1461}
1462
1463#[doc = " A reference to one of the component\'s collections.\n"]
1464#[derive(Clone, Debug)]
1465pub struct CollectionRef {
1466 pub name: String,
1467}
1468
1469impl ::fidl_next::Encodable for CollectionRef {
1470 type Encoded = WireCollectionRef<'static>;
1471}
1472
1473unsafe impl<___E> ::fidl_next::Encode<___E> for CollectionRef
1474where
1475 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1476 ___E: ::fidl_next::Encoder,
1477{
1478 #[inline]
1479 fn encode(
1480 self,
1481 encoder: &mut ___E,
1482 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1483 ) -> Result<(), ::fidl_next::EncodeError> {
1484 ::fidl_next::munge! {
1485 let Self::Encoded {
1486 name,
1487
1488 } = out;
1489 }
1490
1491 ::fidl_next::Encode::encode(self.name, encoder, name)?;
1492
1493 Ok(())
1494 }
1495}
1496
1497unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CollectionRef
1498where
1499 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1500 ___E: ::fidl_next::Encoder,
1501{
1502 #[inline]
1503 fn encode_ref(
1504 &self,
1505 encoder: &mut ___E,
1506 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1507 ) -> Result<(), ::fidl_next::EncodeError> {
1508 ::fidl_next::munge! {
1509 let Self::Encoded {
1510 name,
1511
1512 } = out;
1513 }
1514
1515 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
1516
1517 Ok(())
1518 }
1519}
1520
1521impl ::fidl_next::EncodableOption for CollectionRef {
1522 type EncodedOption = ::fidl_next::WireBox<'static, WireCollectionRef<'static>>;
1523}
1524
1525unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CollectionRef
1526where
1527 ___E: ::fidl_next::Encoder + ?Sized,
1528 CollectionRef: ::fidl_next::Encode<___E>,
1529{
1530 #[inline]
1531 fn encode_option(
1532 this: Option<Self>,
1533 encoder: &mut ___E,
1534 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1535 ) -> Result<(), ::fidl_next::EncodeError> {
1536 if let Some(inner) = this {
1537 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1538 ::fidl_next::WireBox::encode_present(out);
1539 } else {
1540 ::fidl_next::WireBox::encode_absent(out);
1541 }
1542
1543 Ok(())
1544 }
1545}
1546
1547unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CollectionRef
1548where
1549 ___E: ::fidl_next::Encoder + ?Sized,
1550 CollectionRef: ::fidl_next::EncodeRef<___E>,
1551{
1552 #[inline]
1553 fn encode_option_ref(
1554 this: Option<&Self>,
1555 encoder: &mut ___E,
1556 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1557 ) -> Result<(), ::fidl_next::EncodeError> {
1558 if let Some(inner) = this {
1559 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1560 ::fidl_next::WireBox::encode_present(out);
1561 } else {
1562 ::fidl_next::WireBox::encode_absent(out);
1563 }
1564
1565 Ok(())
1566 }
1567}
1568
1569impl<'de> ::fidl_next::FromWire<WireCollectionRef<'de>> for CollectionRef {
1570 #[inline]
1571 fn from_wire(wire: WireCollectionRef<'de>) -> Self {
1572 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
1573 }
1574}
1575
1576impl<'de> ::fidl_next::FromWireRef<WireCollectionRef<'de>> for CollectionRef {
1577 #[inline]
1578 fn from_wire_ref(wire: &WireCollectionRef<'de>) -> Self {
1579 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
1580 }
1581}
1582
1583#[derive(Debug)]
1585#[repr(C)]
1586pub struct WireCollectionRef<'de> {
1587 pub name: ::fidl_next::WireString<'de>,
1588}
1589
1590unsafe impl ::fidl_next::Wire for WireCollectionRef<'static> {
1591 type Decoded<'de> = WireCollectionRef<'de>;
1592
1593 #[inline]
1594 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1595}
1596
1597unsafe impl<___D> ::fidl_next::Decode<___D> for WireCollectionRef<'static>
1598where
1599 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1600 ___D: ::fidl_next::Decoder,
1601{
1602 fn decode(
1603 slot: ::fidl_next::Slot<'_, Self>,
1604 decoder: &mut ___D,
1605 ) -> Result<(), ::fidl_next::DecodeError> {
1606 ::fidl_next::munge! {
1607 let Self {
1608 mut name,
1609
1610 } = slot;
1611 }
1612
1613 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
1614
1615 let name = unsafe { name.deref_unchecked() };
1616
1617 if name.len() > 100 {
1618 return Err(::fidl_next::DecodeError::VectorTooLong {
1619 size: name.len() as u64,
1620 limit: 100,
1621 });
1622 }
1623
1624 Ok(())
1625 }
1626}
1627
1628#[doc = " A reference to the component framework itself.\n"]
1629#[derive(Clone, Debug)]
1630#[repr(C)]
1631pub struct FrameworkRef {}
1632
1633impl ::fidl_next::Encodable for FrameworkRef {
1634 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireFrameworkRef> =
1635 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1636
1637 type Encoded = WireFrameworkRef;
1638}
1639
1640unsafe impl<___E> ::fidl_next::Encode<___E> for FrameworkRef
1641where
1642 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1643{
1644 #[inline]
1645 fn encode(
1646 self,
1647 encoder: &mut ___E,
1648 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1649 ) -> Result<(), ::fidl_next::EncodeError> {
1650 ::fidl_next::munge! {
1651 let Self::Encoded {
1652
1653 } = out;
1654 }
1655
1656 Ok(())
1657 }
1658}
1659
1660unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FrameworkRef
1661where
1662 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1663{
1664 #[inline]
1665 fn encode_ref(
1666 &self,
1667 encoder: &mut ___E,
1668 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1669 ) -> Result<(), ::fidl_next::EncodeError> {
1670 ::fidl_next::munge! {
1671 let Self::Encoded {
1672
1673 } = out;
1674 }
1675
1676 Ok(())
1677 }
1678}
1679
1680impl ::fidl_next::EncodableOption for FrameworkRef {
1681 type EncodedOption = ::fidl_next::WireBox<'static, WireFrameworkRef>;
1682}
1683
1684unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FrameworkRef
1685where
1686 ___E: ::fidl_next::Encoder + ?Sized,
1687 FrameworkRef: ::fidl_next::Encode<___E>,
1688{
1689 #[inline]
1690 fn encode_option(
1691 this: Option<Self>,
1692 encoder: &mut ___E,
1693 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1694 ) -> Result<(), ::fidl_next::EncodeError> {
1695 if let Some(inner) = this {
1696 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1697 ::fidl_next::WireBox::encode_present(out);
1698 } else {
1699 ::fidl_next::WireBox::encode_absent(out);
1700 }
1701
1702 Ok(())
1703 }
1704}
1705
1706unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FrameworkRef
1707where
1708 ___E: ::fidl_next::Encoder + ?Sized,
1709 FrameworkRef: ::fidl_next::EncodeRef<___E>,
1710{
1711 #[inline]
1712 fn encode_option_ref(
1713 this: Option<&Self>,
1714 encoder: &mut ___E,
1715 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1716 ) -> Result<(), ::fidl_next::EncodeError> {
1717 if let Some(inner) = this {
1718 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1719 ::fidl_next::WireBox::encode_present(out);
1720 } else {
1721 ::fidl_next::WireBox::encode_absent(out);
1722 }
1723
1724 Ok(())
1725 }
1726}
1727
1728impl ::fidl_next::FromWire<WireFrameworkRef> for FrameworkRef {
1729 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFrameworkRef, Self> =
1730 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1731
1732 #[inline]
1733 fn from_wire(wire: WireFrameworkRef) -> Self {
1734 Self {}
1735 }
1736}
1737
1738impl ::fidl_next::FromWireRef<WireFrameworkRef> for FrameworkRef {
1739 #[inline]
1740 fn from_wire_ref(wire: &WireFrameworkRef) -> Self {
1741 Self {}
1742 }
1743}
1744
1745#[derive(Clone, Debug)]
1747#[repr(C)]
1748pub struct WireFrameworkRef {}
1749
1750unsafe impl ::fidl_next::Wire for WireFrameworkRef {
1751 type Decoded<'de> = WireFrameworkRef;
1752
1753 #[inline]
1754 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1755}
1756
1757unsafe impl<___D> ::fidl_next::Decode<___D> for WireFrameworkRef
1758where
1759 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1760{
1761 fn decode(
1762 slot: ::fidl_next::Slot<'_, Self>,
1763 decoder: &mut ___D,
1764 ) -> Result<(), ::fidl_next::DecodeError> {
1765 ::fidl_next::munge! {
1766 let Self {
1767
1768 } = slot;
1769 }
1770
1771 Ok(())
1772 }
1773}
1774
1775#[doc = " A reference to a capability declared in this component.\n"]
1776#[derive(Clone, Debug)]
1777pub struct CapabilityRef {
1778 pub name: String,
1779}
1780
1781impl ::fidl_next::Encodable for CapabilityRef {
1782 type Encoded = WireCapabilityRef<'static>;
1783}
1784
1785unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityRef
1786where
1787 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1788 ___E: ::fidl_next::Encoder,
1789{
1790 #[inline]
1791 fn encode(
1792 self,
1793 encoder: &mut ___E,
1794 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1795 ) -> Result<(), ::fidl_next::EncodeError> {
1796 ::fidl_next::munge! {
1797 let Self::Encoded {
1798 name,
1799
1800 } = out;
1801 }
1802
1803 ::fidl_next::Encode::encode(self.name, encoder, name)?;
1804
1805 Ok(())
1806 }
1807}
1808
1809unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityRef
1810where
1811 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1812 ___E: ::fidl_next::Encoder,
1813{
1814 #[inline]
1815 fn encode_ref(
1816 &self,
1817 encoder: &mut ___E,
1818 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1819 ) -> Result<(), ::fidl_next::EncodeError> {
1820 ::fidl_next::munge! {
1821 let Self::Encoded {
1822 name,
1823
1824 } = out;
1825 }
1826
1827 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder, name)?;
1828
1829 Ok(())
1830 }
1831}
1832
1833impl ::fidl_next::EncodableOption for CapabilityRef {
1834 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityRef<'static>>;
1835}
1836
1837unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityRef
1838where
1839 ___E: ::fidl_next::Encoder + ?Sized,
1840 CapabilityRef: ::fidl_next::Encode<___E>,
1841{
1842 #[inline]
1843 fn encode_option(
1844 this: Option<Self>,
1845 encoder: &mut ___E,
1846 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1847 ) -> Result<(), ::fidl_next::EncodeError> {
1848 if let Some(inner) = this {
1849 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1850 ::fidl_next::WireBox::encode_present(out);
1851 } else {
1852 ::fidl_next::WireBox::encode_absent(out);
1853 }
1854
1855 Ok(())
1856 }
1857}
1858
1859unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityRef
1860where
1861 ___E: ::fidl_next::Encoder + ?Sized,
1862 CapabilityRef: ::fidl_next::EncodeRef<___E>,
1863{
1864 #[inline]
1865 fn encode_option_ref(
1866 this: Option<&Self>,
1867 encoder: &mut ___E,
1868 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1869 ) -> Result<(), ::fidl_next::EncodeError> {
1870 if let Some(inner) = this {
1871 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1872 ::fidl_next::WireBox::encode_present(out);
1873 } else {
1874 ::fidl_next::WireBox::encode_absent(out);
1875 }
1876
1877 Ok(())
1878 }
1879}
1880
1881impl<'de> ::fidl_next::FromWire<WireCapabilityRef<'de>> for CapabilityRef {
1882 #[inline]
1883 fn from_wire(wire: WireCapabilityRef<'de>) -> Self {
1884 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
1885 }
1886}
1887
1888impl<'de> ::fidl_next::FromWireRef<WireCapabilityRef<'de>> for CapabilityRef {
1889 #[inline]
1890 fn from_wire_ref(wire: &WireCapabilityRef<'de>) -> Self {
1891 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
1892 }
1893}
1894
1895#[derive(Debug)]
1897#[repr(C)]
1898pub struct WireCapabilityRef<'de> {
1899 pub name: ::fidl_next::WireString<'de>,
1900}
1901
1902unsafe impl ::fidl_next::Wire for WireCapabilityRef<'static> {
1903 type Decoded<'de> = WireCapabilityRef<'de>;
1904
1905 #[inline]
1906 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1907}
1908
1909unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityRef<'static>
1910where
1911 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1912 ___D: ::fidl_next::Decoder,
1913{
1914 fn decode(
1915 slot: ::fidl_next::Slot<'_, Self>,
1916 decoder: &mut ___D,
1917 ) -> Result<(), ::fidl_next::DecodeError> {
1918 ::fidl_next::munge! {
1919 let Self {
1920 mut name,
1921
1922 } = slot;
1923 }
1924
1925 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
1926
1927 let name = unsafe { name.deref_unchecked() };
1928
1929 if name.len() > 100 {
1930 return Err(::fidl_next::DecodeError::VectorTooLong {
1931 size: name.len() as u64,
1932 limit: 100,
1933 });
1934 }
1935
1936 Ok(())
1937 }
1938}
1939
1940#[doc = " A reference to the environment\'s debug capabilities.\n"]
1941#[derive(Clone, Debug)]
1942#[repr(C)]
1943pub struct DebugRef {}
1944
1945impl ::fidl_next::Encodable for DebugRef {
1946 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireDebugRef> =
1947 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1948
1949 type Encoded = WireDebugRef;
1950}
1951
1952unsafe impl<___E> ::fidl_next::Encode<___E> for DebugRef
1953where
1954 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1955{
1956 #[inline]
1957 fn encode(
1958 self,
1959 encoder: &mut ___E,
1960 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1961 ) -> Result<(), ::fidl_next::EncodeError> {
1962 ::fidl_next::munge! {
1963 let Self::Encoded {
1964
1965 } = out;
1966 }
1967
1968 Ok(())
1969 }
1970}
1971
1972unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DebugRef
1973where
1974 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1975{
1976 #[inline]
1977 fn encode_ref(
1978 &self,
1979 encoder: &mut ___E,
1980 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1981 ) -> Result<(), ::fidl_next::EncodeError> {
1982 ::fidl_next::munge! {
1983 let Self::Encoded {
1984
1985 } = out;
1986 }
1987
1988 Ok(())
1989 }
1990}
1991
1992impl ::fidl_next::EncodableOption for DebugRef {
1993 type EncodedOption = ::fidl_next::WireBox<'static, WireDebugRef>;
1994}
1995
1996unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DebugRef
1997where
1998 ___E: ::fidl_next::Encoder + ?Sized,
1999 DebugRef: ::fidl_next::Encode<___E>,
2000{
2001 #[inline]
2002 fn encode_option(
2003 this: Option<Self>,
2004 encoder: &mut ___E,
2005 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2006 ) -> Result<(), ::fidl_next::EncodeError> {
2007 if let Some(inner) = this {
2008 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2009 ::fidl_next::WireBox::encode_present(out);
2010 } else {
2011 ::fidl_next::WireBox::encode_absent(out);
2012 }
2013
2014 Ok(())
2015 }
2016}
2017
2018unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DebugRef
2019where
2020 ___E: ::fidl_next::Encoder + ?Sized,
2021 DebugRef: ::fidl_next::EncodeRef<___E>,
2022{
2023 #[inline]
2024 fn encode_option_ref(
2025 this: Option<&Self>,
2026 encoder: &mut ___E,
2027 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2028 ) -> Result<(), ::fidl_next::EncodeError> {
2029 if let Some(inner) = this {
2030 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2031 ::fidl_next::WireBox::encode_present(out);
2032 } else {
2033 ::fidl_next::WireBox::encode_absent(out);
2034 }
2035
2036 Ok(())
2037 }
2038}
2039
2040impl ::fidl_next::FromWire<WireDebugRef> for DebugRef {
2041 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDebugRef, Self> =
2042 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
2043
2044 #[inline]
2045 fn from_wire(wire: WireDebugRef) -> Self {
2046 Self {}
2047 }
2048}
2049
2050impl ::fidl_next::FromWireRef<WireDebugRef> for DebugRef {
2051 #[inline]
2052 fn from_wire_ref(wire: &WireDebugRef) -> Self {
2053 Self {}
2054 }
2055}
2056
2057#[derive(Clone, Debug)]
2059#[repr(C)]
2060pub struct WireDebugRef {}
2061
2062unsafe impl ::fidl_next::Wire for WireDebugRef {
2063 type Decoded<'de> = WireDebugRef;
2064
2065 #[inline]
2066 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2067}
2068
2069unsafe impl<___D> ::fidl_next::Decode<___D> for WireDebugRef
2070where
2071 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2072{
2073 fn decode(
2074 slot: ::fidl_next::Slot<'_, Self>,
2075 decoder: &mut ___D,
2076 ) -> Result<(), ::fidl_next::DecodeError> {
2077 ::fidl_next::munge! {
2078 let Self {
2079
2080 } = slot;
2081 }
2082
2083 Ok(())
2084 }
2085}
2086
2087#[doc = " A reference to an intentionally missing offer source.\n"]
2088#[derive(Clone, Debug)]
2089#[repr(C)]
2090pub struct VoidRef {}
2091
2092impl ::fidl_next::Encodable for VoidRef {
2093 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireVoidRef> =
2094 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
2095
2096 type Encoded = WireVoidRef;
2097}
2098
2099unsafe impl<___E> ::fidl_next::Encode<___E> for VoidRef
2100where
2101 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2102{
2103 #[inline]
2104 fn encode(
2105 self,
2106 encoder: &mut ___E,
2107 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2108 ) -> Result<(), ::fidl_next::EncodeError> {
2109 ::fidl_next::munge! {
2110 let Self::Encoded {
2111
2112 } = out;
2113 }
2114
2115 Ok(())
2116 }
2117}
2118
2119unsafe impl<___E> ::fidl_next::EncodeRef<___E> for VoidRef
2120where
2121 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2122{
2123 #[inline]
2124 fn encode_ref(
2125 &self,
2126 encoder: &mut ___E,
2127 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2128 ) -> Result<(), ::fidl_next::EncodeError> {
2129 ::fidl_next::munge! {
2130 let Self::Encoded {
2131
2132 } = out;
2133 }
2134
2135 Ok(())
2136 }
2137}
2138
2139impl ::fidl_next::EncodableOption for VoidRef {
2140 type EncodedOption = ::fidl_next::WireBox<'static, WireVoidRef>;
2141}
2142
2143unsafe impl<___E> ::fidl_next::EncodeOption<___E> for VoidRef
2144where
2145 ___E: ::fidl_next::Encoder + ?Sized,
2146 VoidRef: ::fidl_next::Encode<___E>,
2147{
2148 #[inline]
2149 fn encode_option(
2150 this: Option<Self>,
2151 encoder: &mut ___E,
2152 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2153 ) -> Result<(), ::fidl_next::EncodeError> {
2154 if let Some(inner) = this {
2155 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2156 ::fidl_next::WireBox::encode_present(out);
2157 } else {
2158 ::fidl_next::WireBox::encode_absent(out);
2159 }
2160
2161 Ok(())
2162 }
2163}
2164
2165unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for VoidRef
2166where
2167 ___E: ::fidl_next::Encoder + ?Sized,
2168 VoidRef: ::fidl_next::EncodeRef<___E>,
2169{
2170 #[inline]
2171 fn encode_option_ref(
2172 this: Option<&Self>,
2173 encoder: &mut ___E,
2174 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2175 ) -> Result<(), ::fidl_next::EncodeError> {
2176 if let Some(inner) = this {
2177 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2178 ::fidl_next::WireBox::encode_present(out);
2179 } else {
2180 ::fidl_next::WireBox::encode_absent(out);
2181 }
2182
2183 Ok(())
2184 }
2185}
2186
2187impl ::fidl_next::FromWire<WireVoidRef> for VoidRef {
2188 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireVoidRef, Self> =
2189 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
2190
2191 #[inline]
2192 fn from_wire(wire: WireVoidRef) -> Self {
2193 Self {}
2194 }
2195}
2196
2197impl ::fidl_next::FromWireRef<WireVoidRef> for VoidRef {
2198 #[inline]
2199 fn from_wire_ref(wire: &WireVoidRef) -> Self {
2200 Self {}
2201 }
2202}
2203
2204#[derive(Clone, Debug)]
2206#[repr(C)]
2207pub struct WireVoidRef {}
2208
2209unsafe impl ::fidl_next::Wire for WireVoidRef {
2210 type Decoded<'de> = WireVoidRef;
2211
2212 #[inline]
2213 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
2214}
2215
2216unsafe impl<___D> ::fidl_next::Decode<___D> for WireVoidRef
2217where
2218 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2219{
2220 fn decode(
2221 slot: ::fidl_next::Slot<'_, Self>,
2222 decoder: &mut ___D,
2223 ) -> Result<(), ::fidl_next::DecodeError> {
2224 ::fidl_next::munge! {
2225 let Self {
2226
2227 } = slot;
2228 }
2229
2230 Ok(())
2231 }
2232}
2233
2234#[doc = " Declares which identifier to use to key a component\'s isolated storage\n directory.\n"]
2235#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2236#[repr(u32)]
2237pub enum StorageId {
2238 StaticInstanceId = 1,
2239 StaticInstanceIdOrMoniker = 2,
2240}
2241
2242impl ::fidl_next::Encodable for StorageId {
2243 type Encoded = WireStorageId;
2244}
2245impl ::std::convert::TryFrom<u32> for StorageId {
2246 type Error = ::fidl_next::UnknownStrictEnumMemberError;
2247 fn try_from(value: u32) -> Result<Self, Self::Error> {
2248 match value {
2249 1 => Ok(Self::StaticInstanceId),
2250 2 => Ok(Self::StaticInstanceIdOrMoniker),
2251
2252 _ => Err(Self::Error::new(value.into())),
2253 }
2254 }
2255}
2256
2257unsafe impl<___E> ::fidl_next::Encode<___E> for StorageId
2258where
2259 ___E: ?Sized,
2260{
2261 #[inline]
2262 fn encode(
2263 self,
2264 encoder: &mut ___E,
2265 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2266 ) -> Result<(), ::fidl_next::EncodeError> {
2267 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
2268 }
2269}
2270
2271unsafe impl<___E> ::fidl_next::EncodeRef<___E> for StorageId
2272where
2273 ___E: ?Sized,
2274{
2275 #[inline]
2276 fn encode_ref(
2277 &self,
2278 encoder: &mut ___E,
2279 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2280 ) -> Result<(), ::fidl_next::EncodeError> {
2281 ::fidl_next::munge!(let WireStorageId { value } = out);
2282 let _ = value.write(::fidl_next::WireU32::from(match *self {
2283 Self::StaticInstanceId => 1,
2284
2285 Self::StaticInstanceIdOrMoniker => 2,
2286 }));
2287
2288 Ok(())
2289 }
2290}
2291
2292impl ::core::convert::From<WireStorageId> for StorageId {
2293 fn from(wire: WireStorageId) -> Self {
2294 match u32::from(wire.value) {
2295 1 => Self::StaticInstanceId,
2296
2297 2 => Self::StaticInstanceIdOrMoniker,
2298
2299 _ => unsafe { ::core::hint::unreachable_unchecked() },
2300 }
2301 }
2302}
2303
2304impl ::fidl_next::FromWire<WireStorageId> for StorageId {
2305 #[inline]
2306 fn from_wire(wire: WireStorageId) -> Self {
2307 Self::from(wire)
2308 }
2309}
2310
2311impl ::fidl_next::FromWireRef<WireStorageId> for StorageId {
2312 #[inline]
2313 fn from_wire_ref(wire: &WireStorageId) -> Self {
2314 Self::from(*wire)
2315 }
2316}
2317
2318#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2320#[repr(transparent)]
2321pub struct WireStorageId {
2322 value: ::fidl_next::WireU32,
2323}
2324
2325unsafe impl ::fidl_next::Wire for WireStorageId {
2326 type Decoded<'de> = Self;
2327
2328 #[inline]
2329 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2330 }
2332}
2333
2334impl WireStorageId {
2335 pub const STATIC_INSTANCE_ID: WireStorageId = WireStorageId { value: ::fidl_next::WireU32(1) };
2336
2337 pub const STATIC_INSTANCE_ID_OR_MONIKER: WireStorageId =
2338 WireStorageId { value: ::fidl_next::WireU32(2) };
2339}
2340
2341unsafe impl<___D> ::fidl_next::Decode<___D> for WireStorageId
2342where
2343 ___D: ?Sized,
2344{
2345 fn decode(
2346 slot: ::fidl_next::Slot<'_, Self>,
2347 _: &mut ___D,
2348 ) -> Result<(), ::fidl_next::DecodeError> {
2349 ::fidl_next::munge!(let Self { value } = slot);
2350
2351 match u32::from(*value) {
2352 1 | 2 => (),
2353 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
2354 }
2355
2356 Ok(())
2357 }
2358}
2359
2360impl ::core::convert::From<StorageId> for WireStorageId {
2361 fn from(natural: StorageId) -> Self {
2362 match natural {
2363 StorageId::StaticInstanceId => WireStorageId::STATIC_INSTANCE_ID,
2364
2365 StorageId::StaticInstanceIdOrMoniker => WireStorageId::STATIC_INSTANCE_ID_OR_MONIKER,
2366 }
2367 }
2368}
2369
2370#[doc = " Declares a runner capability backed by a service.\n"]
2371#[derive(Clone, Debug, Default)]
2372pub struct Runner {
2373 pub name: Option<String>,
2374
2375 pub source_path: Option<String>,
2376}
2377
2378impl Runner {
2379 fn __max_ordinal(&self) -> usize {
2380 if self.source_path.is_some() {
2381 return 2;
2382 }
2383
2384 if self.name.is_some() {
2385 return 1;
2386 }
2387
2388 0
2389 }
2390}
2391
2392impl ::fidl_next::Encodable for Runner {
2393 type Encoded = WireRunner<'static>;
2394}
2395
2396unsafe impl<___E> ::fidl_next::Encode<___E> for Runner
2397where
2398 ___E: ::fidl_next::Encoder + ?Sized,
2399{
2400 #[inline]
2401 fn encode(
2402 mut self,
2403 encoder: &mut ___E,
2404 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2405 ) -> Result<(), ::fidl_next::EncodeError> {
2406 ::fidl_next::munge!(let WireRunner { table } = out);
2407
2408 let max_ord = self.__max_ordinal();
2409
2410 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2411 ::fidl_next::Wire::zero_padding(&mut out);
2412
2413 let mut preallocated =
2414 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2415
2416 for i in 1..=max_ord {
2417 match i {
2418 2 => {
2419 if let Some(source_path) = self.source_path.take() {
2420 ::fidl_next::WireEnvelope::encode_value(
2421 source_path,
2422 preallocated.encoder,
2423 &mut out,
2424 )?;
2425 } else {
2426 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2427 }
2428 }
2429
2430 1 => {
2431 if let Some(name) = self.name.take() {
2432 ::fidl_next::WireEnvelope::encode_value(
2433 name,
2434 preallocated.encoder,
2435 &mut out,
2436 )?;
2437 } else {
2438 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2439 }
2440 }
2441
2442 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2443 }
2444 unsafe {
2445 preallocated.write_next(out.assume_init_ref());
2446 }
2447 }
2448
2449 ::fidl_next::WireTable::encode_len(table, max_ord);
2450
2451 Ok(())
2452 }
2453}
2454
2455unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Runner
2456where
2457 ___E: ::fidl_next::Encoder + ?Sized,
2458{
2459 #[inline]
2460 fn encode_ref(
2461 &self,
2462 encoder: &mut ___E,
2463 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2464 ) -> Result<(), ::fidl_next::EncodeError> {
2465 ::fidl_next::munge!(let WireRunner { table } = out);
2466
2467 let max_ord = self.__max_ordinal();
2468
2469 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2470 ::fidl_next::Wire::zero_padding(&mut out);
2471
2472 let mut preallocated =
2473 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2474
2475 for i in 1..=max_ord {
2476 match i {
2477 2 => {
2478 if let Some(source_path) = &self.source_path {
2479 ::fidl_next::WireEnvelope::encode_value(
2480 source_path,
2481 preallocated.encoder,
2482 &mut out,
2483 )?;
2484 } else {
2485 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2486 }
2487 }
2488
2489 1 => {
2490 if let Some(name) = &self.name {
2491 ::fidl_next::WireEnvelope::encode_value(
2492 name,
2493 preallocated.encoder,
2494 &mut out,
2495 )?;
2496 } else {
2497 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2498 }
2499 }
2500
2501 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2502 }
2503 unsafe {
2504 preallocated.write_next(out.assume_init_ref());
2505 }
2506 }
2507
2508 ::fidl_next::WireTable::encode_len(table, max_ord);
2509
2510 Ok(())
2511 }
2512}
2513
2514impl<'de> ::fidl_next::FromWire<WireRunner<'de>> for Runner {
2515 #[inline]
2516 fn from_wire(wire: WireRunner<'de>) -> Self {
2517 let wire = ::core::mem::ManuallyDrop::new(wire);
2518
2519 let name = wire.table.get(1);
2520
2521 let source_path = wire.table.get(2);
2522
2523 Self {
2524 name: name.map(|envelope| {
2525 ::fidl_next::FromWire::from_wire(unsafe {
2526 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
2527 })
2528 }),
2529
2530 source_path: source_path.map(|envelope| {
2531 ::fidl_next::FromWire::from_wire(unsafe {
2532 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
2533 })
2534 }),
2535 }
2536 }
2537}
2538
2539impl<'de> ::fidl_next::FromWireRef<WireRunner<'de>> for Runner {
2540 #[inline]
2541 fn from_wire_ref(wire: &WireRunner<'de>) -> Self {
2542 Self {
2543 name: wire.table.get(1).map(|envelope| {
2544 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2545 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
2546 })
2547 }),
2548
2549 source_path: wire.table.get(2).map(|envelope| {
2550 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2551 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
2552 })
2553 }),
2554 }
2555 }
2556}
2557
2558#[repr(C)]
2560pub struct WireRunner<'de> {
2561 table: ::fidl_next::WireTable<'de>,
2562}
2563
2564impl<'de> Drop for WireRunner<'de> {
2565 fn drop(&mut self) {
2566 let _ = self
2567 .table
2568 .get(1)
2569 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
2570
2571 let _ = self
2572 .table
2573 .get(2)
2574 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
2575 }
2576}
2577
2578unsafe impl ::fidl_next::Wire for WireRunner<'static> {
2579 type Decoded<'de> = WireRunner<'de>;
2580
2581 #[inline]
2582 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2583 ::fidl_next::munge!(let Self { table } = out);
2584 ::fidl_next::WireTable::zero_padding(table);
2585 }
2586}
2587
2588unsafe impl<___D> ::fidl_next::Decode<___D> for WireRunner<'static>
2589where
2590 ___D: ::fidl_next::Decoder + ?Sized,
2591{
2592 fn decode(
2593 slot: ::fidl_next::Slot<'_, Self>,
2594 decoder: &mut ___D,
2595 ) -> Result<(), ::fidl_next::DecodeError> {
2596 ::fidl_next::munge!(let Self { table } = slot);
2597
2598 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2599 match ordinal {
2600 0 => unsafe { ::core::hint::unreachable_unchecked() },
2601
2602 1 => {
2603 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
2604 slot.as_mut(),
2605 decoder,
2606 )?;
2607
2608 let name = unsafe {
2609 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
2610 };
2611
2612 if name.len() > 100 {
2613 return Err(::fidl_next::DecodeError::VectorTooLong {
2614 size: name.len() as u64,
2615 limit: 100,
2616 });
2617 }
2618
2619 Ok(())
2620 }
2621
2622 2 => {
2623 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
2624 slot.as_mut(),
2625 decoder,
2626 )?;
2627
2628 let source_path = unsafe {
2629 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
2630 };
2631
2632 if source_path.len() > 1024 {
2633 return Err(::fidl_next::DecodeError::VectorTooLong {
2634 size: source_path.len() as u64,
2635 limit: 1024,
2636 });
2637 }
2638
2639 Ok(())
2640 }
2641
2642 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2643 }
2644 })
2645 }
2646}
2647
2648impl<'de> WireRunner<'de> {
2649 pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
2650 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2651 }
2652
2653 pub fn source_path(&self) -> Option<&::fidl_next::WireString<'de>> {
2654 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2655 }
2656}
2657
2658impl<'de> ::core::fmt::Debug for WireRunner<'de> {
2659 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2660 f.debug_struct("Runner")
2661 .field("name", &self.name())
2662 .field("source_path", &self.source_path())
2663 .finish()
2664 }
2665}
2666
2667#[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"]
2668#[derive(Clone, Debug, Default)]
2669pub struct Resolver {
2670 pub name: Option<String>,
2671
2672 pub source_path: Option<String>,
2673}
2674
2675impl Resolver {
2676 fn __max_ordinal(&self) -> usize {
2677 if self.source_path.is_some() {
2678 return 2;
2679 }
2680
2681 if self.name.is_some() {
2682 return 1;
2683 }
2684
2685 0
2686 }
2687}
2688
2689impl ::fidl_next::Encodable for Resolver {
2690 type Encoded = WireResolver<'static>;
2691}
2692
2693unsafe impl<___E> ::fidl_next::Encode<___E> for Resolver
2694where
2695 ___E: ::fidl_next::Encoder + ?Sized,
2696{
2697 #[inline]
2698 fn encode(
2699 mut self,
2700 encoder: &mut ___E,
2701 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2702 ) -> Result<(), ::fidl_next::EncodeError> {
2703 ::fidl_next::munge!(let WireResolver { table } = out);
2704
2705 let max_ord = self.__max_ordinal();
2706
2707 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2708 ::fidl_next::Wire::zero_padding(&mut out);
2709
2710 let mut preallocated =
2711 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2712
2713 for i in 1..=max_ord {
2714 match i {
2715 2 => {
2716 if let Some(source_path) = self.source_path.take() {
2717 ::fidl_next::WireEnvelope::encode_value(
2718 source_path,
2719 preallocated.encoder,
2720 &mut out,
2721 )?;
2722 } else {
2723 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2724 }
2725 }
2726
2727 1 => {
2728 if let Some(name) = self.name.take() {
2729 ::fidl_next::WireEnvelope::encode_value(
2730 name,
2731 preallocated.encoder,
2732 &mut out,
2733 )?;
2734 } else {
2735 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2736 }
2737 }
2738
2739 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2740 }
2741 unsafe {
2742 preallocated.write_next(out.assume_init_ref());
2743 }
2744 }
2745
2746 ::fidl_next::WireTable::encode_len(table, max_ord);
2747
2748 Ok(())
2749 }
2750}
2751
2752unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Resolver
2753where
2754 ___E: ::fidl_next::Encoder + ?Sized,
2755{
2756 #[inline]
2757 fn encode_ref(
2758 &self,
2759 encoder: &mut ___E,
2760 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2761 ) -> Result<(), ::fidl_next::EncodeError> {
2762 ::fidl_next::munge!(let WireResolver { table } = out);
2763
2764 let max_ord = self.__max_ordinal();
2765
2766 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2767 ::fidl_next::Wire::zero_padding(&mut out);
2768
2769 let mut preallocated =
2770 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2771
2772 for i in 1..=max_ord {
2773 match i {
2774 2 => {
2775 if let Some(source_path) = &self.source_path {
2776 ::fidl_next::WireEnvelope::encode_value(
2777 source_path,
2778 preallocated.encoder,
2779 &mut out,
2780 )?;
2781 } else {
2782 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2783 }
2784 }
2785
2786 1 => {
2787 if let Some(name) = &self.name {
2788 ::fidl_next::WireEnvelope::encode_value(
2789 name,
2790 preallocated.encoder,
2791 &mut out,
2792 )?;
2793 } else {
2794 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2795 }
2796 }
2797
2798 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2799 }
2800 unsafe {
2801 preallocated.write_next(out.assume_init_ref());
2802 }
2803 }
2804
2805 ::fidl_next::WireTable::encode_len(table, max_ord);
2806
2807 Ok(())
2808 }
2809}
2810
2811impl<'de> ::fidl_next::FromWire<WireResolver<'de>> for Resolver {
2812 #[inline]
2813 fn from_wire(wire: WireResolver<'de>) -> Self {
2814 let wire = ::core::mem::ManuallyDrop::new(wire);
2815
2816 let name = wire.table.get(1);
2817
2818 let source_path = wire.table.get(2);
2819
2820 Self {
2821 name: name.map(|envelope| {
2822 ::fidl_next::FromWire::from_wire(unsafe {
2823 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
2824 })
2825 }),
2826
2827 source_path: source_path.map(|envelope| {
2828 ::fidl_next::FromWire::from_wire(unsafe {
2829 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
2830 })
2831 }),
2832 }
2833 }
2834}
2835
2836impl<'de> ::fidl_next::FromWireRef<WireResolver<'de>> for Resolver {
2837 #[inline]
2838 fn from_wire_ref(wire: &WireResolver<'de>) -> Self {
2839 Self {
2840 name: wire.table.get(1).map(|envelope| {
2841 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2842 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
2843 })
2844 }),
2845
2846 source_path: wire.table.get(2).map(|envelope| {
2847 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2848 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
2849 })
2850 }),
2851 }
2852 }
2853}
2854
2855#[repr(C)]
2857pub struct WireResolver<'de> {
2858 table: ::fidl_next::WireTable<'de>,
2859}
2860
2861impl<'de> Drop for WireResolver<'de> {
2862 fn drop(&mut self) {
2863 let _ = self
2864 .table
2865 .get(1)
2866 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
2867
2868 let _ = self
2869 .table
2870 .get(2)
2871 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
2872 }
2873}
2874
2875unsafe impl ::fidl_next::Wire for WireResolver<'static> {
2876 type Decoded<'de> = WireResolver<'de>;
2877
2878 #[inline]
2879 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2880 ::fidl_next::munge!(let Self { table } = out);
2881 ::fidl_next::WireTable::zero_padding(table);
2882 }
2883}
2884
2885unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolver<'static>
2886where
2887 ___D: ::fidl_next::Decoder + ?Sized,
2888{
2889 fn decode(
2890 slot: ::fidl_next::Slot<'_, Self>,
2891 decoder: &mut ___D,
2892 ) -> Result<(), ::fidl_next::DecodeError> {
2893 ::fidl_next::munge!(let Self { table } = slot);
2894
2895 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2896 match ordinal {
2897 0 => unsafe { ::core::hint::unreachable_unchecked() },
2898
2899 1 => {
2900 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
2901 slot.as_mut(),
2902 decoder,
2903 )?;
2904
2905 let name = unsafe {
2906 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
2907 };
2908
2909 if name.len() > 100 {
2910 return Err(::fidl_next::DecodeError::VectorTooLong {
2911 size: name.len() as u64,
2912 limit: 100,
2913 });
2914 }
2915
2916 Ok(())
2917 }
2918
2919 2 => {
2920 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
2921 slot.as_mut(),
2922 decoder,
2923 )?;
2924
2925 let source_path = unsafe {
2926 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
2927 };
2928
2929 if source_path.len() > 1024 {
2930 return Err(::fidl_next::DecodeError::VectorTooLong {
2931 size: source_path.len() as u64,
2932 limit: 1024,
2933 });
2934 }
2935
2936 Ok(())
2937 }
2938
2939 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2940 }
2941 })
2942 }
2943}
2944
2945impl<'de> WireResolver<'de> {
2946 pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
2947 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2948 }
2949
2950 pub fn source_path(&self) -> Option<&::fidl_next::WireString<'de>> {
2951 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2952 }
2953}
2954
2955impl<'de> ::core::fmt::Debug for WireResolver<'de> {
2956 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2957 f.debug_struct("Resolver")
2958 .field("name", &self.name())
2959 .field("source_path", &self.source_path())
2960 .finish()
2961 }
2962}
2963
2964#[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"]
2965#[derive(Clone, Debug, Default)]
2966pub struct EventStream {
2967 pub name: Option<String>,
2968}
2969
2970impl EventStream {
2971 fn __max_ordinal(&self) -> usize {
2972 if self.name.is_some() {
2973 return 1;
2974 }
2975
2976 0
2977 }
2978}
2979
2980impl ::fidl_next::Encodable for EventStream {
2981 type Encoded = WireEventStream<'static>;
2982}
2983
2984unsafe impl<___E> ::fidl_next::Encode<___E> for EventStream
2985where
2986 ___E: ::fidl_next::Encoder + ?Sized,
2987{
2988 #[inline]
2989 fn encode(
2990 mut self,
2991 encoder: &mut ___E,
2992 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2993 ) -> Result<(), ::fidl_next::EncodeError> {
2994 ::fidl_next::munge!(let WireEventStream { table } = out);
2995
2996 let max_ord = self.__max_ordinal();
2997
2998 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2999 ::fidl_next::Wire::zero_padding(&mut out);
3000
3001 let mut preallocated =
3002 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3003
3004 for i in 1..=max_ord {
3005 match i {
3006 1 => {
3007 if let Some(name) = self.name.take() {
3008 ::fidl_next::WireEnvelope::encode_value(
3009 name,
3010 preallocated.encoder,
3011 &mut out,
3012 )?;
3013 } else {
3014 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3015 }
3016 }
3017
3018 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3019 }
3020 unsafe {
3021 preallocated.write_next(out.assume_init_ref());
3022 }
3023 }
3024
3025 ::fidl_next::WireTable::encode_len(table, max_ord);
3026
3027 Ok(())
3028 }
3029}
3030
3031unsafe impl<___E> ::fidl_next::EncodeRef<___E> for EventStream
3032where
3033 ___E: ::fidl_next::Encoder + ?Sized,
3034{
3035 #[inline]
3036 fn encode_ref(
3037 &self,
3038 encoder: &mut ___E,
3039 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3040 ) -> Result<(), ::fidl_next::EncodeError> {
3041 ::fidl_next::munge!(let WireEventStream { table } = out);
3042
3043 let max_ord = self.__max_ordinal();
3044
3045 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3046 ::fidl_next::Wire::zero_padding(&mut out);
3047
3048 let mut preallocated =
3049 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3050
3051 for i in 1..=max_ord {
3052 match i {
3053 1 => {
3054 if let Some(name) = &self.name {
3055 ::fidl_next::WireEnvelope::encode_value(
3056 name,
3057 preallocated.encoder,
3058 &mut out,
3059 )?;
3060 } else {
3061 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3062 }
3063 }
3064
3065 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3066 }
3067 unsafe {
3068 preallocated.write_next(out.assume_init_ref());
3069 }
3070 }
3071
3072 ::fidl_next::WireTable::encode_len(table, max_ord);
3073
3074 Ok(())
3075 }
3076}
3077
3078impl<'de> ::fidl_next::FromWire<WireEventStream<'de>> for EventStream {
3079 #[inline]
3080 fn from_wire(wire: WireEventStream<'de>) -> Self {
3081 let wire = ::core::mem::ManuallyDrop::new(wire);
3082
3083 let name = wire.table.get(1);
3084
3085 Self {
3086 name: name.map(|envelope| {
3087 ::fidl_next::FromWire::from_wire(unsafe {
3088 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
3089 })
3090 }),
3091 }
3092 }
3093}
3094
3095impl<'de> ::fidl_next::FromWireRef<WireEventStream<'de>> for EventStream {
3096 #[inline]
3097 fn from_wire_ref(wire: &WireEventStream<'de>) -> Self {
3098 Self {
3099 name: wire.table.get(1).map(|envelope| {
3100 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3101 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
3102 })
3103 }),
3104 }
3105 }
3106}
3107
3108#[repr(C)]
3110pub struct WireEventStream<'de> {
3111 table: ::fidl_next::WireTable<'de>,
3112}
3113
3114impl<'de> Drop for WireEventStream<'de> {
3115 fn drop(&mut self) {
3116 let _ = self
3117 .table
3118 .get(1)
3119 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
3120 }
3121}
3122
3123unsafe impl ::fidl_next::Wire for WireEventStream<'static> {
3124 type Decoded<'de> = WireEventStream<'de>;
3125
3126 #[inline]
3127 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3128 ::fidl_next::munge!(let Self { table } = out);
3129 ::fidl_next::WireTable::zero_padding(table);
3130 }
3131}
3132
3133unsafe impl<___D> ::fidl_next::Decode<___D> for WireEventStream<'static>
3134where
3135 ___D: ::fidl_next::Decoder + ?Sized,
3136{
3137 fn decode(
3138 slot: ::fidl_next::Slot<'_, Self>,
3139 decoder: &mut ___D,
3140 ) -> Result<(), ::fidl_next::DecodeError> {
3141 ::fidl_next::munge!(let Self { table } = slot);
3142
3143 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3144 match ordinal {
3145 0 => unsafe { ::core::hint::unreachable_unchecked() },
3146
3147 1 => {
3148 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
3149 slot.as_mut(),
3150 decoder,
3151 )?;
3152
3153 let name = unsafe {
3154 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
3155 };
3156
3157 if name.len() > 100 {
3158 return Err(::fidl_next::DecodeError::VectorTooLong {
3159 size: name.len() as u64,
3160 limit: 100,
3161 });
3162 }
3163
3164 Ok(())
3165 }
3166
3167 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3168 }
3169 })
3170 }
3171}
3172
3173impl<'de> WireEventStream<'de> {
3174 pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
3175 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3176 }
3177}
3178
3179impl<'de> ::core::fmt::Debug for WireEventStream<'de> {
3180 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3181 f.debug_struct("EventStream").field("name", &self.name()).finish()
3182 }
3183}
3184
3185#[doc = " A single configuration value.\n"]
3186#[derive(Clone, Debug)]
3187pub enum ConfigSingleValue {
3188 Bool(bool),
3189
3190 Uint8(u8),
3191
3192 Uint16(u16),
3193
3194 Uint32(u32),
3195
3196 Uint64(u64),
3197
3198 Int8(i8),
3199
3200 Int16(i16),
3201
3202 Int32(i32),
3203
3204 Int64(i64),
3205
3206 String(String),
3207
3208 UnknownOrdinal_(u64),
3209}
3210
3211impl ::fidl_next::Encodable for ConfigSingleValue {
3212 type Encoded = WireConfigSingleValue<'static>;
3213}
3214
3215unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigSingleValue
3216where
3217 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3218 ___E: ::fidl_next::Encoder,
3219{
3220 #[inline]
3221 fn encode(
3222 self,
3223 encoder: &mut ___E,
3224 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3225 ) -> Result<(), ::fidl_next::EncodeError> {
3226 ::fidl_next::munge!(let WireConfigSingleValue { raw, _phantom: _ } = out);
3227
3228 match self {
3229 Self::Bool(value) => {
3230 ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw)?
3231 }
3232
3233 Self::Uint8(value) => {
3234 ::fidl_next::RawWireUnion::encode_as::<___E, u8>(value, 2, encoder, raw)?
3235 }
3236
3237 Self::Uint16(value) => {
3238 ::fidl_next::RawWireUnion::encode_as::<___E, u16>(value, 3, encoder, raw)?
3239 }
3240
3241 Self::Uint32(value) => {
3242 ::fidl_next::RawWireUnion::encode_as::<___E, u32>(value, 4, encoder, raw)?
3243 }
3244
3245 Self::Uint64(value) => {
3246 ::fidl_next::RawWireUnion::encode_as::<___E, u64>(value, 5, encoder, raw)?
3247 }
3248
3249 Self::Int8(value) => {
3250 ::fidl_next::RawWireUnion::encode_as::<___E, i8>(value, 6, encoder, raw)?
3251 }
3252
3253 Self::Int16(value) => {
3254 ::fidl_next::RawWireUnion::encode_as::<___E, i16>(value, 7, encoder, raw)?
3255 }
3256
3257 Self::Int32(value) => {
3258 ::fidl_next::RawWireUnion::encode_as::<___E, i32>(value, 8, encoder, raw)?
3259 }
3260
3261 Self::Int64(value) => {
3262 ::fidl_next::RawWireUnion::encode_as::<___E, i64>(value, 9, encoder, raw)?
3263 }
3264
3265 Self::String(value) => {
3266 ::fidl_next::RawWireUnion::encode_as::<___E, String>(value, 10, encoder, raw)?
3267 }
3268
3269 Self::UnknownOrdinal_(ordinal) => {
3270 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
3271 }
3272 }
3273
3274 Ok(())
3275 }
3276}
3277
3278unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigSingleValue
3279where
3280 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3281 ___E: ::fidl_next::Encoder,
3282{
3283 #[inline]
3284 fn encode_ref(
3285 &self,
3286 encoder: &mut ___E,
3287 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3288 ) -> Result<(), ::fidl_next::EncodeError> {
3289 ::fidl_next::munge!(let WireConfigSingleValue { raw, _phantom: _ } = out);
3290
3291 match self {
3292 Self::Bool(value) => {
3293 ::fidl_next::RawWireUnion::encode_as::<___E, &bool>(value, 1, encoder, raw)?
3294 }
3295
3296 Self::Uint8(value) => {
3297 ::fidl_next::RawWireUnion::encode_as::<___E, &u8>(value, 2, encoder, raw)?
3298 }
3299
3300 Self::Uint16(value) => {
3301 ::fidl_next::RawWireUnion::encode_as::<___E, &u16>(value, 3, encoder, raw)?
3302 }
3303
3304 Self::Uint32(value) => {
3305 ::fidl_next::RawWireUnion::encode_as::<___E, &u32>(value, 4, encoder, raw)?
3306 }
3307
3308 Self::Uint64(value) => {
3309 ::fidl_next::RawWireUnion::encode_as::<___E, &u64>(value, 5, encoder, raw)?
3310 }
3311
3312 Self::Int8(value) => {
3313 ::fidl_next::RawWireUnion::encode_as::<___E, &i8>(value, 6, encoder, raw)?
3314 }
3315
3316 Self::Int16(value) => {
3317 ::fidl_next::RawWireUnion::encode_as::<___E, &i16>(value, 7, encoder, raw)?
3318 }
3319
3320 Self::Int32(value) => {
3321 ::fidl_next::RawWireUnion::encode_as::<___E, &i32>(value, 8, encoder, raw)?
3322 }
3323
3324 Self::Int64(value) => {
3325 ::fidl_next::RawWireUnion::encode_as::<___E, &i64>(value, 9, encoder, raw)?
3326 }
3327
3328 Self::String(value) => {
3329 ::fidl_next::RawWireUnion::encode_as::<___E, &String>(value, 10, encoder, raw)?
3330 }
3331
3332 Self::UnknownOrdinal_(ordinal) => {
3333 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
3334 }
3335 }
3336
3337 Ok(())
3338 }
3339}
3340
3341impl ::fidl_next::EncodableOption for ConfigSingleValue {
3342 type EncodedOption = WireOptionalConfigSingleValue<'static>;
3343}
3344
3345unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ConfigSingleValue
3346where
3347 ___E: ?Sized,
3348 ConfigSingleValue: ::fidl_next::Encode<___E>,
3349{
3350 #[inline]
3351 fn encode_option(
3352 this: Option<Self>,
3353 encoder: &mut ___E,
3354 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3355 ) -> Result<(), ::fidl_next::EncodeError> {
3356 ::fidl_next::munge!(let WireOptionalConfigSingleValue { raw, _phantom: _ } = &mut *out);
3357
3358 if let Some(inner) = this {
3359 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
3360 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
3361 } else {
3362 ::fidl_next::RawWireUnion::encode_absent(raw);
3363 }
3364
3365 Ok(())
3366 }
3367}
3368
3369unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ConfigSingleValue
3370where
3371 ___E: ?Sized,
3372 ConfigSingleValue: ::fidl_next::EncodeRef<___E>,
3373{
3374 #[inline]
3375 fn encode_option_ref(
3376 this: Option<&Self>,
3377 encoder: &mut ___E,
3378 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3379 ) -> Result<(), ::fidl_next::EncodeError> {
3380 ::fidl_next::munge!(let WireOptionalConfigSingleValue { raw, _phantom: _ } = &mut *out);
3381
3382 if let Some(inner) = this {
3383 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
3384 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
3385 } else {
3386 ::fidl_next::RawWireUnion::encode_absent(raw);
3387 }
3388
3389 Ok(())
3390 }
3391}
3392
3393impl<'de> ::fidl_next::FromWire<WireConfigSingleValue<'de>> for ConfigSingleValue {
3394 #[inline]
3395 fn from_wire(wire: WireConfigSingleValue<'de>) -> Self {
3396 let wire = ::core::mem::ManuallyDrop::new(wire);
3397 match wire.raw.ordinal() {
3398 1 => Self::Bool(::fidl_next::FromWire::from_wire(unsafe {
3399 wire.raw.get().read_unchecked::<bool>()
3400 })),
3401
3402 2 => Self::Uint8(::fidl_next::FromWire::from_wire(unsafe {
3403 wire.raw.get().read_unchecked::<u8>()
3404 })),
3405
3406 3 => Self::Uint16(::fidl_next::FromWire::from_wire(unsafe {
3407 wire.raw.get().read_unchecked::<::fidl_next::WireU16>()
3408 })),
3409
3410 4 => Self::Uint32(::fidl_next::FromWire::from_wire(unsafe {
3411 wire.raw.get().read_unchecked::<::fidl_next::WireU32>()
3412 })),
3413
3414 5 => Self::Uint64(::fidl_next::FromWire::from_wire(unsafe {
3415 wire.raw.get().read_unchecked::<::fidl_next::WireU64>()
3416 })),
3417
3418 6 => Self::Int8(::fidl_next::FromWire::from_wire(unsafe {
3419 wire.raw.get().read_unchecked::<i8>()
3420 })),
3421
3422 7 => Self::Int16(::fidl_next::FromWire::from_wire(unsafe {
3423 wire.raw.get().read_unchecked::<::fidl_next::WireI16>()
3424 })),
3425
3426 8 => Self::Int32(::fidl_next::FromWire::from_wire(unsafe {
3427 wire.raw.get().read_unchecked::<::fidl_next::WireI32>()
3428 })),
3429
3430 9 => Self::Int64(::fidl_next::FromWire::from_wire(unsafe {
3431 wire.raw.get().read_unchecked::<::fidl_next::WireI64>()
3432 })),
3433
3434 10 => Self::String(::fidl_next::FromWire::from_wire(unsafe {
3435 wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
3436 })),
3437
3438 _ => unsafe { ::core::hint::unreachable_unchecked() },
3439 }
3440 }
3441}
3442
3443impl<'de> ::fidl_next::FromWireRef<WireConfigSingleValue<'de>> for ConfigSingleValue {
3444 #[inline]
3445 fn from_wire_ref(wire: &WireConfigSingleValue<'de>) -> Self {
3446 match wire.raw.ordinal() {
3447 1 => Self::Bool(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3448 wire.raw.get().deref_unchecked::<bool>()
3449 })),
3450
3451 2 => Self::Uint8(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3452 wire.raw.get().deref_unchecked::<u8>()
3453 })),
3454
3455 3 => Self::Uint16(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3456 wire.raw.get().deref_unchecked::<::fidl_next::WireU16>()
3457 })),
3458
3459 4 => Self::Uint32(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3460 wire.raw.get().deref_unchecked::<::fidl_next::WireU32>()
3461 })),
3462
3463 5 => Self::Uint64(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3464 wire.raw.get().deref_unchecked::<::fidl_next::WireU64>()
3465 })),
3466
3467 6 => Self::Int8(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3468 wire.raw.get().deref_unchecked::<i8>()
3469 })),
3470
3471 7 => Self::Int16(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3472 wire.raw.get().deref_unchecked::<::fidl_next::WireI16>()
3473 })),
3474
3475 8 => Self::Int32(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3476 wire.raw.get().deref_unchecked::<::fidl_next::WireI32>()
3477 })),
3478
3479 9 => Self::Int64(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3480 wire.raw.get().deref_unchecked::<::fidl_next::WireI64>()
3481 })),
3482
3483 10 => Self::String(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3484 wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
3485 })),
3486
3487 _ => unsafe { ::core::hint::unreachable_unchecked() },
3488 }
3489 }
3490}
3491
3492impl<'de> ::fidl_next::FromWireOption<WireOptionalConfigSingleValue<'de>>
3493 for Box<ConfigSingleValue>
3494{
3495 #[inline]
3496 fn from_wire_option(wire: WireOptionalConfigSingleValue<'de>) -> Option<Self> {
3497 if let Some(inner) = wire.into_option() {
3498 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
3499 } else {
3500 None
3501 }
3502 }
3503}
3504
3505impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalConfigSingleValue<'de>>
3506 for Box<ConfigSingleValue>
3507{
3508 #[inline]
3509 fn from_wire_option_ref(wire: &WireOptionalConfigSingleValue<'de>) -> Option<Self> {
3510 if let Some(inner) = wire.as_ref() {
3511 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
3512 } else {
3513 None
3514 }
3515 }
3516}
3517
3518#[repr(transparent)]
3520pub struct WireConfigSingleValue<'de> {
3521 raw: ::fidl_next::RawWireUnion,
3522 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
3523}
3524
3525impl<'de> Drop for WireConfigSingleValue<'de> {
3526 fn drop(&mut self) {
3527 match self.raw.ordinal() {
3528 1 => {
3529 let _ = unsafe { self.raw.get().read_unchecked::<bool>() };
3530 }
3531
3532 2 => {
3533 let _ = unsafe { self.raw.get().read_unchecked::<u8>() };
3534 }
3535
3536 3 => {
3537 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU16>() };
3538 }
3539
3540 4 => {
3541 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU32>() };
3542 }
3543
3544 5 => {
3545 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU64>() };
3546 }
3547
3548 6 => {
3549 let _ = unsafe { self.raw.get().read_unchecked::<i8>() };
3550 }
3551
3552 7 => {
3553 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireI16>() };
3554 }
3555
3556 8 => {
3557 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireI32>() };
3558 }
3559
3560 9 => {
3561 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireI64>() };
3562 }
3563
3564 10 => {
3565 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
3566 }
3567
3568 _ => (),
3569 }
3570 }
3571}
3572
3573unsafe impl ::fidl_next::Wire for WireConfigSingleValue<'static> {
3574 type Decoded<'de> = WireConfigSingleValue<'de>;
3575
3576 #[inline]
3577 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3578 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
3579 ::fidl_next::RawWireUnion::zero_padding(raw);
3580 }
3581}
3582
3583pub mod config_single_value {
3584 pub enum Ref<'de> {
3585 Bool(&'de bool),
3586
3587 Uint8(&'de u8),
3588
3589 Uint16(&'de ::fidl_next::WireU16),
3590
3591 Uint32(&'de ::fidl_next::WireU32),
3592
3593 Uint64(&'de ::fidl_next::WireU64),
3594
3595 Int8(&'de i8),
3596
3597 Int16(&'de ::fidl_next::WireI16),
3598
3599 Int32(&'de ::fidl_next::WireI32),
3600
3601 Int64(&'de ::fidl_next::WireI64),
3602
3603 String(&'de ::fidl_next::WireString<'de>),
3604
3605 UnknownOrdinal_(u64),
3606 }
3607}
3608
3609impl<'de> WireConfigSingleValue<'de> {
3610 pub fn as_ref(&self) -> crate::config_single_value::Ref<'_> {
3611 match self.raw.ordinal() {
3612 1 => crate::config_single_value::Ref::Bool(unsafe {
3613 self.raw.get().deref_unchecked::<bool>()
3614 }),
3615
3616 2 => crate::config_single_value::Ref::Uint8(unsafe {
3617 self.raw.get().deref_unchecked::<u8>()
3618 }),
3619
3620 3 => crate::config_single_value::Ref::Uint16(unsafe {
3621 self.raw.get().deref_unchecked::<::fidl_next::WireU16>()
3622 }),
3623
3624 4 => crate::config_single_value::Ref::Uint32(unsafe {
3625 self.raw.get().deref_unchecked::<::fidl_next::WireU32>()
3626 }),
3627
3628 5 => crate::config_single_value::Ref::Uint64(unsafe {
3629 self.raw.get().deref_unchecked::<::fidl_next::WireU64>()
3630 }),
3631
3632 6 => crate::config_single_value::Ref::Int8(unsafe {
3633 self.raw.get().deref_unchecked::<i8>()
3634 }),
3635
3636 7 => crate::config_single_value::Ref::Int16(unsafe {
3637 self.raw.get().deref_unchecked::<::fidl_next::WireI16>()
3638 }),
3639
3640 8 => crate::config_single_value::Ref::Int32(unsafe {
3641 self.raw.get().deref_unchecked::<::fidl_next::WireI32>()
3642 }),
3643
3644 9 => crate::config_single_value::Ref::Int64(unsafe {
3645 self.raw.get().deref_unchecked::<::fidl_next::WireI64>()
3646 }),
3647
3648 10 => crate::config_single_value::Ref::String(unsafe {
3649 self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
3650 }),
3651
3652 unknown => crate::config_single_value::Ref::UnknownOrdinal_(unknown),
3653 }
3654 }
3655}
3656
3657unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigSingleValue<'static>
3658where
3659 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3660 ___D: ::fidl_next::Decoder,
3661{
3662 fn decode(
3663 mut slot: ::fidl_next::Slot<'_, Self>,
3664 decoder: &mut ___D,
3665 ) -> Result<(), ::fidl_next::DecodeError> {
3666 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
3667 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
3668 1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder)?,
3669
3670 2 => ::fidl_next::RawWireUnion::decode_as::<___D, u8>(raw, decoder)?,
3671
3672 3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU16>(raw, decoder)?,
3673
3674 4 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
3675
3676 5 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU64>(raw, decoder)?,
3677
3678 6 => ::fidl_next::RawWireUnion::decode_as::<___D, i8>(raw, decoder)?,
3679
3680 7 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI16>(raw, decoder)?,
3681
3682 8 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI32>(raw, decoder)?,
3683
3684 9 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI64>(raw, decoder)?,
3685
3686 10 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
3687 raw, decoder,
3688 )?,
3689
3690 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
3691 }
3692
3693 Ok(())
3694 }
3695}
3696
3697impl<'de> ::core::fmt::Debug for WireConfigSingleValue<'de> {
3698 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3699 match self.raw.ordinal() {
3700 1 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) },
3701 2 => unsafe { self.raw.get().deref_unchecked::<u8>().fmt(f) },
3702 3 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU16>().fmt(f) },
3703 4 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU32>().fmt(f) },
3704 5 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU64>().fmt(f) },
3705 6 => unsafe { self.raw.get().deref_unchecked::<i8>().fmt(f) },
3706 7 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI16>().fmt(f) },
3707 8 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI32>().fmt(f) },
3708 9 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI64>().fmt(f) },
3709 10 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f) },
3710 _ => unsafe { ::core::hint::unreachable_unchecked() },
3711 }
3712 }
3713}
3714
3715#[repr(transparent)]
3716pub struct WireOptionalConfigSingleValue<'de> {
3717 raw: ::fidl_next::RawWireUnion,
3718 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
3719}
3720
3721unsafe impl ::fidl_next::Wire for WireOptionalConfigSingleValue<'static> {
3722 type Decoded<'de> = WireOptionalConfigSingleValue<'de>;
3723
3724 #[inline]
3725 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3726 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
3727 ::fidl_next::RawWireUnion::zero_padding(raw);
3728 }
3729}
3730
3731impl<'de> WireOptionalConfigSingleValue<'de> {
3732 pub fn is_some(&self) -> bool {
3733 self.raw.is_some()
3734 }
3735
3736 pub fn is_none(&self) -> bool {
3737 self.raw.is_none()
3738 }
3739
3740 pub fn as_ref(&self) -> Option<&WireConfigSingleValue<'de>> {
3741 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
3742 }
3743
3744 pub fn into_option(self) -> Option<WireConfigSingleValue<'de>> {
3745 if self.is_some() {
3746 Some(WireConfigSingleValue { raw: self.raw, _phantom: ::core::marker::PhantomData })
3747 } else {
3748 None
3749 }
3750 }
3751}
3752
3753unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConfigSingleValue<'static>
3754where
3755 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3756 ___D: ::fidl_next::Decoder,
3757{
3758 fn decode(
3759 mut slot: ::fidl_next::Slot<'_, Self>,
3760 decoder: &mut ___D,
3761 ) -> Result<(), ::fidl_next::DecodeError> {
3762 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
3763 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
3764 1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder)?,
3765
3766 2 => ::fidl_next::RawWireUnion::decode_as::<___D, u8>(raw, decoder)?,
3767
3768 3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU16>(raw, decoder)?,
3769
3770 4 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
3771
3772 5 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU64>(raw, decoder)?,
3773
3774 6 => ::fidl_next::RawWireUnion::decode_as::<___D, i8>(raw, decoder)?,
3775
3776 7 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI16>(raw, decoder)?,
3777
3778 8 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI32>(raw, decoder)?,
3779
3780 9 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI64>(raw, decoder)?,
3781
3782 10 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
3783 raw, decoder,
3784 )?,
3785
3786 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
3787 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
3788 }
3789
3790 Ok(())
3791 }
3792}
3793
3794impl<'de> ::core::fmt::Debug for WireOptionalConfigSingleValue<'de> {
3795 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3796 self.as_ref().fmt(f)
3797 }
3798}
3799
3800#[doc = " A vector configuration value.\n"]
3801#[derive(Clone, Debug)]
3802pub enum ConfigVectorValue {
3803 BoolVector(Vec<bool>),
3804
3805 Uint8Vector(Vec<u8>),
3806
3807 Uint16Vector(Vec<u16>),
3808
3809 Uint32Vector(Vec<u32>),
3810
3811 Uint64Vector(Vec<u64>),
3812
3813 Int8Vector(Vec<i8>),
3814
3815 Int16Vector(Vec<i16>),
3816
3817 Int32Vector(Vec<i32>),
3818
3819 Int64Vector(Vec<i64>),
3820
3821 StringVector(Vec<String>),
3822
3823 UnknownOrdinal_(u64),
3824}
3825
3826impl ::fidl_next::Encodable for ConfigVectorValue {
3827 type Encoded = WireConfigVectorValue<'static>;
3828}
3829
3830unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigVectorValue
3831where
3832 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3833 ___E: ::fidl_next::Encoder,
3834{
3835 #[inline]
3836 fn encode(
3837 self,
3838 encoder: &mut ___E,
3839 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3840 ) -> Result<(), ::fidl_next::EncodeError> {
3841 ::fidl_next::munge!(let WireConfigVectorValue { raw, _phantom: _ } = out);
3842
3843 match self {
3844 Self::BoolVector(value) => {
3845 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<bool>>(value, 1, encoder, raw)?
3846 }
3847
3848 Self::Uint8Vector(value) => {
3849 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u8>>(value, 2, encoder, raw)?
3850 }
3851
3852 Self::Uint16Vector(value) => {
3853 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u16>>(value, 3, encoder, raw)?
3854 }
3855
3856 Self::Uint32Vector(value) => {
3857 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u32>>(value, 4, encoder, raw)?
3858 }
3859
3860 Self::Uint64Vector(value) => {
3861 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u64>>(value, 5, encoder, raw)?
3862 }
3863
3864 Self::Int8Vector(value) => {
3865 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<i8>>(value, 6, encoder, raw)?
3866 }
3867
3868 Self::Int16Vector(value) => {
3869 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<i16>>(value, 7, encoder, raw)?
3870 }
3871
3872 Self::Int32Vector(value) => {
3873 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<i32>>(value, 8, encoder, raw)?
3874 }
3875
3876 Self::Int64Vector(value) => {
3877 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<i64>>(value, 9, encoder, raw)?
3878 }
3879
3880 Self::StringVector(value) => {
3881 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<String>>(value, 10, encoder, raw)?
3882 }
3883
3884 Self::UnknownOrdinal_(ordinal) => {
3885 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
3886 }
3887 }
3888
3889 Ok(())
3890 }
3891}
3892
3893unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigVectorValue
3894where
3895 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3896 ___E: ::fidl_next::Encoder,
3897{
3898 #[inline]
3899 fn encode_ref(
3900 &self,
3901 encoder: &mut ___E,
3902 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3903 ) -> Result<(), ::fidl_next::EncodeError> {
3904 ::fidl_next::munge!(let WireConfigVectorValue { raw, _phantom: _ } = out);
3905
3906 match self {
3907 Self::BoolVector(value) => {
3908 ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<bool>>(value, 1, encoder, raw)?
3909 }
3910
3911 Self::Uint8Vector(value) => {
3912 ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<u8>>(value, 2, encoder, raw)?
3913 }
3914
3915 Self::Uint16Vector(value) => {
3916 ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<u16>>(value, 3, encoder, raw)?
3917 }
3918
3919 Self::Uint32Vector(value) => {
3920 ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<u32>>(value, 4, encoder, raw)?
3921 }
3922
3923 Self::Uint64Vector(value) => {
3924 ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<u64>>(value, 5, encoder, raw)?
3925 }
3926
3927 Self::Int8Vector(value) => {
3928 ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<i8>>(value, 6, encoder, raw)?
3929 }
3930
3931 Self::Int16Vector(value) => {
3932 ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<i16>>(value, 7, encoder, raw)?
3933 }
3934
3935 Self::Int32Vector(value) => {
3936 ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<i32>>(value, 8, encoder, raw)?
3937 }
3938
3939 Self::Int64Vector(value) => {
3940 ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<i64>>(value, 9, encoder, raw)?
3941 }
3942
3943 Self::StringVector(value) => {
3944 ::fidl_next::RawWireUnion::encode_as::<___E, &Vec<String>>(value, 10, encoder, raw)?
3945 }
3946
3947 Self::UnknownOrdinal_(ordinal) => {
3948 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
3949 }
3950 }
3951
3952 Ok(())
3953 }
3954}
3955
3956impl ::fidl_next::EncodableOption for ConfigVectorValue {
3957 type EncodedOption = WireOptionalConfigVectorValue<'static>;
3958}
3959
3960unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ConfigVectorValue
3961where
3962 ___E: ?Sized,
3963 ConfigVectorValue: ::fidl_next::Encode<___E>,
3964{
3965 #[inline]
3966 fn encode_option(
3967 this: Option<Self>,
3968 encoder: &mut ___E,
3969 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3970 ) -> Result<(), ::fidl_next::EncodeError> {
3971 ::fidl_next::munge!(let WireOptionalConfigVectorValue { raw, _phantom: _ } = &mut *out);
3972
3973 if let Some(inner) = this {
3974 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
3975 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
3976 } else {
3977 ::fidl_next::RawWireUnion::encode_absent(raw);
3978 }
3979
3980 Ok(())
3981 }
3982}
3983
3984unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ConfigVectorValue
3985where
3986 ___E: ?Sized,
3987 ConfigVectorValue: ::fidl_next::EncodeRef<___E>,
3988{
3989 #[inline]
3990 fn encode_option_ref(
3991 this: Option<&Self>,
3992 encoder: &mut ___E,
3993 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3994 ) -> Result<(), ::fidl_next::EncodeError> {
3995 ::fidl_next::munge!(let WireOptionalConfigVectorValue { raw, _phantom: _ } = &mut *out);
3996
3997 if let Some(inner) = this {
3998 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
3999 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
4000 } else {
4001 ::fidl_next::RawWireUnion::encode_absent(raw);
4002 }
4003
4004 Ok(())
4005 }
4006}
4007
4008impl<'de> ::fidl_next::FromWire<WireConfigVectorValue<'de>> for ConfigVectorValue {
4009 #[inline]
4010 fn from_wire(wire: WireConfigVectorValue<'de>) -> Self {
4011 let wire = ::core::mem::ManuallyDrop::new(wire);
4012 match wire.raw.ordinal() {
4013 1 => Self::BoolVector(::fidl_next::FromWire::from_wire(unsafe {
4014 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, bool>>()
4015 })),
4016
4017 2 => Self::Uint8Vector(::fidl_next::FromWire::from_wire(unsafe {
4018 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>()
4019 })),
4020
4021 3 => Self::Uint16Vector(::fidl_next::FromWire::from_wire(unsafe {
4022 wire.raw
4023 .get()
4024 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU16>>()
4025 })),
4026
4027 4 => Self::Uint32Vector(::fidl_next::FromWire::from_wire(unsafe {
4028 wire.raw
4029 .get()
4030 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU32>>()
4031 })),
4032
4033 5 => Self::Uint64Vector(::fidl_next::FromWire::from_wire(unsafe {
4034 wire.raw
4035 .get()
4036 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU64>>()
4037 })),
4038
4039 6 => Self::Int8Vector(::fidl_next::FromWire::from_wire(unsafe {
4040 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, i8>>()
4041 })),
4042
4043 7 => Self::Int16Vector(::fidl_next::FromWire::from_wire(unsafe {
4044 wire.raw
4045 .get()
4046 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI16>>()
4047 })),
4048
4049 8 => Self::Int32Vector(::fidl_next::FromWire::from_wire(unsafe {
4050 wire.raw
4051 .get()
4052 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI32>>()
4053 })),
4054
4055 9 => Self::Int64Vector(::fidl_next::FromWire::from_wire(unsafe {
4056 wire.raw
4057 .get()
4058 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI64>>()
4059 })),
4060
4061 10 => {
4062 Self::StringVector(::fidl_next::FromWire::from_wire(unsafe {
4063 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
4064 }))
4065 }
4066
4067 _ => unsafe { ::core::hint::unreachable_unchecked() },
4068 }
4069 }
4070}
4071
4072impl<'de> ::fidl_next::FromWireRef<WireConfigVectorValue<'de>> for ConfigVectorValue {
4073 #[inline]
4074 fn from_wire_ref(wire: &WireConfigVectorValue<'de>) -> Self {
4075 match wire.raw.ordinal() {
4076 1 => Self::BoolVector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4077 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, bool>>()
4078 })),
4079
4080 2 => Self::Uint8Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4081 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
4082 })),
4083
4084 3 => Self::Uint16Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4085 wire.raw
4086 .get()
4087 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU16>>()
4088 })),
4089
4090 4 => Self::Uint32Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4091 wire.raw
4092 .get()
4093 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU32>>()
4094 })),
4095
4096 5 => Self::Uint64Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4097 wire.raw
4098 .get()
4099 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU64>>()
4100 })),
4101
4102 6 => Self::Int8Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4103 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, i8>>()
4104 })),
4105
4106 7 => Self::Int16Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4107 wire.raw
4108 .get()
4109 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI16>>()
4110 })),
4111
4112 8 => Self::Int32Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4113 wire.raw
4114 .get()
4115 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI32>>()
4116 })),
4117
4118 9 => Self::Int64Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4119 wire.raw
4120 .get()
4121 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI64>>()
4122 })),
4123
4124 10 => {
4125 Self::StringVector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4126 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
4127 }))
4128 }
4129
4130 _ => unsafe { ::core::hint::unreachable_unchecked() },
4131 }
4132 }
4133}
4134
4135impl<'de> ::fidl_next::FromWireOption<WireOptionalConfigVectorValue<'de>>
4136 for Box<ConfigVectorValue>
4137{
4138 #[inline]
4139 fn from_wire_option(wire: WireOptionalConfigVectorValue<'de>) -> Option<Self> {
4140 if let Some(inner) = wire.into_option() {
4141 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
4142 } else {
4143 None
4144 }
4145 }
4146}
4147
4148impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalConfigVectorValue<'de>>
4149 for Box<ConfigVectorValue>
4150{
4151 #[inline]
4152 fn from_wire_option_ref(wire: &WireOptionalConfigVectorValue<'de>) -> Option<Self> {
4153 if let Some(inner) = wire.as_ref() {
4154 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
4155 } else {
4156 None
4157 }
4158 }
4159}
4160
4161#[repr(transparent)]
4163pub struct WireConfigVectorValue<'de> {
4164 raw: ::fidl_next::RawWireUnion,
4165 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
4166}
4167
4168impl<'de> Drop for WireConfigVectorValue<'de> {
4169 fn drop(&mut self) {
4170 match self.raw.ordinal() {
4171 1 => {
4172 let _ = unsafe {
4173 self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, bool>>()
4174 };
4175 }
4176
4177 2 => {
4178 let _ =
4179 unsafe { self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>() };
4180 }
4181
4182 3 => {
4183 let _ = unsafe {
4184 self.raw
4185 .get()
4186 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU16>>()
4187 };
4188 }
4189
4190 4 => {
4191 let _ = unsafe {
4192 self.raw
4193 .get()
4194 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU32>>()
4195 };
4196 }
4197
4198 5 => {
4199 let _ = unsafe {
4200 self.raw
4201 .get()
4202 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU64>>()
4203 };
4204 }
4205
4206 6 => {
4207 let _ =
4208 unsafe { self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, i8>>() };
4209 }
4210
4211 7 => {
4212 let _ = unsafe {
4213 self.raw
4214 .get()
4215 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI16>>()
4216 };
4217 }
4218
4219 8 => {
4220 let _ = unsafe {
4221 self.raw
4222 .get()
4223 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI32>>()
4224 };
4225 }
4226
4227 9 => {
4228 let _ = unsafe {
4229 self.raw
4230 .get()
4231 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI64>>()
4232 };
4233 }
4234
4235 10 => {
4236 let _ = unsafe {
4237 self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
4238 };
4239 }
4240
4241 _ => (),
4242 }
4243 }
4244}
4245
4246unsafe impl ::fidl_next::Wire for WireConfigVectorValue<'static> {
4247 type Decoded<'de> = WireConfigVectorValue<'de>;
4248
4249 #[inline]
4250 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4251 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
4252 ::fidl_next::RawWireUnion::zero_padding(raw);
4253 }
4254}
4255
4256pub mod config_vector_value {
4257 pub enum Ref<'de> {
4258 BoolVector(&'de ::fidl_next::WireVector<'de, bool>),
4259
4260 Uint8Vector(&'de ::fidl_next::WireVector<'de, u8>),
4261
4262 Uint16Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireU16>),
4263
4264 Uint32Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireU32>),
4265
4266 Uint64Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireU64>),
4267
4268 Int8Vector(&'de ::fidl_next::WireVector<'de, i8>),
4269
4270 Int16Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireI16>),
4271
4272 Int32Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireI32>),
4273
4274 Int64Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireI64>),
4275
4276 StringVector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>),
4277
4278 UnknownOrdinal_(u64),
4279 }
4280}
4281
4282impl<'de> WireConfigVectorValue<'de> {
4283 pub fn as_ref(&self) -> crate::config_vector_value::Ref<'_> {
4284 match self.raw.ordinal() {
4285 1 => crate::config_vector_value::Ref::BoolVector(unsafe {
4286 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, bool>>()
4287 }),
4288
4289 2 => crate::config_vector_value::Ref::Uint8Vector(unsafe {
4290 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
4291 }),
4292
4293 3 => crate::config_vector_value::Ref::Uint16Vector(unsafe {
4294 self.raw
4295 .get()
4296 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU16>>()
4297 }),
4298
4299 4 => crate::config_vector_value::Ref::Uint32Vector(unsafe {
4300 self.raw
4301 .get()
4302 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU32>>()
4303 }),
4304
4305 5 => crate::config_vector_value::Ref::Uint64Vector(unsafe {
4306 self.raw
4307 .get()
4308 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU64>>()
4309 }),
4310
4311 6 => crate::config_vector_value::Ref::Int8Vector(unsafe {
4312 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, i8>>()
4313 }),
4314
4315 7 => crate::config_vector_value::Ref::Int16Vector(unsafe {
4316 self.raw
4317 .get()
4318 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI16>>()
4319 }),
4320
4321 8 => crate::config_vector_value::Ref::Int32Vector(unsafe {
4322 self.raw
4323 .get()
4324 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI32>>()
4325 }),
4326
4327 9 => crate::config_vector_value::Ref::Int64Vector(unsafe {
4328 self.raw
4329 .get()
4330 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI64>>()
4331 }),
4332
4333 10 => {
4334 crate::config_vector_value::Ref::StringVector(unsafe {
4335 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireString<'_>>>()
4336 })
4337 }
4338
4339 unknown => crate::config_vector_value::Ref::UnknownOrdinal_(unknown),
4340 }
4341 }
4342}
4343
4344unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigVectorValue<'static>
4345where
4346 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4347 ___D: ::fidl_next::Decoder,
4348{
4349 fn decode(
4350 mut slot: ::fidl_next::Slot<'_, Self>,
4351 decoder: &mut ___D,
4352 ) -> Result<(), ::fidl_next::DecodeError> {
4353 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
4354 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
4355 1 => ::fidl_next::RawWireUnion::decode_as::<
4356 ___D,
4357 ::fidl_next::WireVector<'static, bool>,
4358 >(raw, decoder)?,
4359
4360 2 => {
4361 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
4362 raw, decoder,
4363 )?
4364 }
4365
4366 3 => ::fidl_next::RawWireUnion::decode_as::<
4367 ___D,
4368 ::fidl_next::WireVector<'static, ::fidl_next::WireU16>,
4369 >(raw, decoder)?,
4370
4371 4 => ::fidl_next::RawWireUnion::decode_as::<
4372 ___D,
4373 ::fidl_next::WireVector<'static, ::fidl_next::WireU32>,
4374 >(raw, decoder)?,
4375
4376 5 => ::fidl_next::RawWireUnion::decode_as::<
4377 ___D,
4378 ::fidl_next::WireVector<'static, ::fidl_next::WireU64>,
4379 >(raw, decoder)?,
4380
4381 6 => {
4382 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, i8>>(
4383 raw, decoder,
4384 )?
4385 }
4386
4387 7 => ::fidl_next::RawWireUnion::decode_as::<
4388 ___D,
4389 ::fidl_next::WireVector<'static, ::fidl_next::WireI16>,
4390 >(raw, decoder)?,
4391
4392 8 => ::fidl_next::RawWireUnion::decode_as::<
4393 ___D,
4394 ::fidl_next::WireVector<'static, ::fidl_next::WireI32>,
4395 >(raw, decoder)?,
4396
4397 9 => ::fidl_next::RawWireUnion::decode_as::<
4398 ___D,
4399 ::fidl_next::WireVector<'static, ::fidl_next::WireI64>,
4400 >(raw, decoder)?,
4401
4402 10 => ::fidl_next::RawWireUnion::decode_as::<
4403 ___D,
4404 ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
4405 >(raw, decoder)?,
4406
4407 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
4408 }
4409
4410 Ok(())
4411 }
4412}
4413
4414impl<'de> ::core::fmt::Debug for WireConfigVectorValue<'de> {
4415 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4416 match self.raw.ordinal() {
4417 1 => unsafe {
4418 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, bool>>().fmt(f)
4419 },
4420 2 => unsafe {
4421 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>().fmt(f)
4422 },
4423 3 => unsafe {
4424 self.raw
4425 .get()
4426 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU16>>()
4427 .fmt(f)
4428 },
4429 4 => unsafe {
4430 self.raw
4431 .get()
4432 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU32>>()
4433 .fmt(f)
4434 },
4435 5 => unsafe {
4436 self.raw
4437 .get()
4438 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU64>>()
4439 .fmt(f)
4440 },
4441 6 => unsafe {
4442 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, i8>>().fmt(f)
4443 },
4444 7 => unsafe {
4445 self.raw
4446 .get()
4447 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI16>>()
4448 .fmt(f)
4449 },
4450 8 => unsafe {
4451 self.raw
4452 .get()
4453 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI32>>()
4454 .fmt(f)
4455 },
4456 9 => unsafe {
4457 self.raw
4458 .get()
4459 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI64>>()
4460 .fmt(f)
4461 },
4462 10 => unsafe {
4463 self.raw
4464 .get()
4465 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireString<'_>>>()
4466 .fmt(f)
4467 },
4468 _ => unsafe { ::core::hint::unreachable_unchecked() },
4469 }
4470 }
4471}
4472
4473#[repr(transparent)]
4474pub struct WireOptionalConfigVectorValue<'de> {
4475 raw: ::fidl_next::RawWireUnion,
4476 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
4477}
4478
4479unsafe impl ::fidl_next::Wire for WireOptionalConfigVectorValue<'static> {
4480 type Decoded<'de> = WireOptionalConfigVectorValue<'de>;
4481
4482 #[inline]
4483 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4484 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
4485 ::fidl_next::RawWireUnion::zero_padding(raw);
4486 }
4487}
4488
4489impl<'de> WireOptionalConfigVectorValue<'de> {
4490 pub fn is_some(&self) -> bool {
4491 self.raw.is_some()
4492 }
4493
4494 pub fn is_none(&self) -> bool {
4495 self.raw.is_none()
4496 }
4497
4498 pub fn as_ref(&self) -> Option<&WireConfigVectorValue<'de>> {
4499 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
4500 }
4501
4502 pub fn into_option(self) -> Option<WireConfigVectorValue<'de>> {
4503 if self.is_some() {
4504 Some(WireConfigVectorValue { raw: self.raw, _phantom: ::core::marker::PhantomData })
4505 } else {
4506 None
4507 }
4508 }
4509}
4510
4511unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConfigVectorValue<'static>
4512where
4513 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4514 ___D: ::fidl_next::Decoder,
4515{
4516 fn decode(
4517 mut slot: ::fidl_next::Slot<'_, Self>,
4518 decoder: &mut ___D,
4519 ) -> Result<(), ::fidl_next::DecodeError> {
4520 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
4521 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
4522 1 => ::fidl_next::RawWireUnion::decode_as::<
4523 ___D,
4524 ::fidl_next::WireVector<'static, bool>,
4525 >(raw, decoder)?,
4526
4527 2 => {
4528 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
4529 raw, decoder,
4530 )?
4531 }
4532
4533 3 => ::fidl_next::RawWireUnion::decode_as::<
4534 ___D,
4535 ::fidl_next::WireVector<'static, ::fidl_next::WireU16>,
4536 >(raw, decoder)?,
4537
4538 4 => ::fidl_next::RawWireUnion::decode_as::<
4539 ___D,
4540 ::fidl_next::WireVector<'static, ::fidl_next::WireU32>,
4541 >(raw, decoder)?,
4542
4543 5 => ::fidl_next::RawWireUnion::decode_as::<
4544 ___D,
4545 ::fidl_next::WireVector<'static, ::fidl_next::WireU64>,
4546 >(raw, decoder)?,
4547
4548 6 => {
4549 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, i8>>(
4550 raw, decoder,
4551 )?
4552 }
4553
4554 7 => ::fidl_next::RawWireUnion::decode_as::<
4555 ___D,
4556 ::fidl_next::WireVector<'static, ::fidl_next::WireI16>,
4557 >(raw, decoder)?,
4558
4559 8 => ::fidl_next::RawWireUnion::decode_as::<
4560 ___D,
4561 ::fidl_next::WireVector<'static, ::fidl_next::WireI32>,
4562 >(raw, decoder)?,
4563
4564 9 => ::fidl_next::RawWireUnion::decode_as::<
4565 ___D,
4566 ::fidl_next::WireVector<'static, ::fidl_next::WireI64>,
4567 >(raw, decoder)?,
4568
4569 10 => ::fidl_next::RawWireUnion::decode_as::<
4570 ___D,
4571 ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
4572 >(raw, decoder)?,
4573
4574 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
4575 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
4576 }
4577
4578 Ok(())
4579 }
4580}
4581
4582impl<'de> ::core::fmt::Debug for WireOptionalConfigVectorValue<'de> {
4583 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4584 self.as_ref().fmt(f)
4585 }
4586}
4587
4588#[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"]
4589#[derive(Clone, Debug)]
4590pub enum ConfigValue {
4591 Single(crate::ConfigSingleValue),
4592
4593 Vector(crate::ConfigVectorValue),
4594
4595 UnknownOrdinal_(u64),
4596}
4597
4598impl ::fidl_next::Encodable for ConfigValue {
4599 type Encoded = WireConfigValue<'static>;
4600}
4601
4602unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigValue
4603where
4604 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4605 ___E: ::fidl_next::Encoder,
4606{
4607 #[inline]
4608 fn encode(
4609 self,
4610 encoder: &mut ___E,
4611 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4612 ) -> Result<(), ::fidl_next::EncodeError> {
4613 ::fidl_next::munge!(let WireConfigValue { raw, _phantom: _ } = out);
4614
4615 match self {
4616 Self::Single(value) => ::fidl_next::RawWireUnion::encode_as::<
4617 ___E,
4618 crate::ConfigSingleValue,
4619 >(value, 1, encoder, raw)?,
4620
4621 Self::Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4622 ___E,
4623 crate::ConfigVectorValue,
4624 >(value, 2, encoder, raw)?,
4625
4626 Self::UnknownOrdinal_(ordinal) => {
4627 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
4628 }
4629 }
4630
4631 Ok(())
4632 }
4633}
4634
4635unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigValue
4636where
4637 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4638 ___E: ::fidl_next::Encoder,
4639{
4640 #[inline]
4641 fn encode_ref(
4642 &self,
4643 encoder: &mut ___E,
4644 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4645 ) -> Result<(), ::fidl_next::EncodeError> {
4646 ::fidl_next::munge!(let WireConfigValue { raw, _phantom: _ } = out);
4647
4648 match self {
4649 Self::Single(value) => ::fidl_next::RawWireUnion::encode_as::<
4650 ___E,
4651 &crate::ConfigSingleValue,
4652 >(value, 1, encoder, raw)?,
4653
4654 Self::Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4655 ___E,
4656 &crate::ConfigVectorValue,
4657 >(value, 2, encoder, raw)?,
4658
4659 Self::UnknownOrdinal_(ordinal) => {
4660 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
4661 }
4662 }
4663
4664 Ok(())
4665 }
4666}
4667
4668impl ::fidl_next::EncodableOption for ConfigValue {
4669 type EncodedOption = WireOptionalConfigValue<'static>;
4670}
4671
4672unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ConfigValue
4673where
4674 ___E: ?Sized,
4675 ConfigValue: ::fidl_next::Encode<___E>,
4676{
4677 #[inline]
4678 fn encode_option(
4679 this: Option<Self>,
4680 encoder: &mut ___E,
4681 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4682 ) -> Result<(), ::fidl_next::EncodeError> {
4683 ::fidl_next::munge!(let WireOptionalConfigValue { raw, _phantom: _ } = &mut *out);
4684
4685 if let Some(inner) = this {
4686 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4687 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
4688 } else {
4689 ::fidl_next::RawWireUnion::encode_absent(raw);
4690 }
4691
4692 Ok(())
4693 }
4694}
4695
4696unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ConfigValue
4697where
4698 ___E: ?Sized,
4699 ConfigValue: ::fidl_next::EncodeRef<___E>,
4700{
4701 #[inline]
4702 fn encode_option_ref(
4703 this: Option<&Self>,
4704 encoder: &mut ___E,
4705 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4706 ) -> Result<(), ::fidl_next::EncodeError> {
4707 ::fidl_next::munge!(let WireOptionalConfigValue { raw, _phantom: _ } = &mut *out);
4708
4709 if let Some(inner) = this {
4710 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4711 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
4712 } else {
4713 ::fidl_next::RawWireUnion::encode_absent(raw);
4714 }
4715
4716 Ok(())
4717 }
4718}
4719
4720impl<'de> ::fidl_next::FromWire<WireConfigValue<'de>> for ConfigValue {
4721 #[inline]
4722 fn from_wire(wire: WireConfigValue<'de>) -> Self {
4723 let wire = ::core::mem::ManuallyDrop::new(wire);
4724 match wire.raw.ordinal() {
4725 1 => Self::Single(::fidl_next::FromWire::from_wire(unsafe {
4726 wire.raw.get().read_unchecked::<crate::WireConfigSingleValue<'de>>()
4727 })),
4728
4729 2 => Self::Vector(::fidl_next::FromWire::from_wire(unsafe {
4730 wire.raw.get().read_unchecked::<crate::WireConfigVectorValue<'de>>()
4731 })),
4732
4733 _ => unsafe { ::core::hint::unreachable_unchecked() },
4734 }
4735 }
4736}
4737
4738impl<'de> ::fidl_next::FromWireRef<WireConfigValue<'de>> for ConfigValue {
4739 #[inline]
4740 fn from_wire_ref(wire: &WireConfigValue<'de>) -> Self {
4741 match wire.raw.ordinal() {
4742 1 => Self::Single(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4743 wire.raw.get().deref_unchecked::<crate::WireConfigSingleValue<'de>>()
4744 })),
4745
4746 2 => Self::Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4747 wire.raw.get().deref_unchecked::<crate::WireConfigVectorValue<'de>>()
4748 })),
4749
4750 _ => unsafe { ::core::hint::unreachable_unchecked() },
4751 }
4752 }
4753}
4754
4755impl<'de> ::fidl_next::FromWireOption<WireOptionalConfigValue<'de>> for Box<ConfigValue> {
4756 #[inline]
4757 fn from_wire_option(wire: WireOptionalConfigValue<'de>) -> Option<Self> {
4758 if let Some(inner) = wire.into_option() {
4759 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
4760 } else {
4761 None
4762 }
4763 }
4764}
4765
4766impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalConfigValue<'de>> for Box<ConfigValue> {
4767 #[inline]
4768 fn from_wire_option_ref(wire: &WireOptionalConfigValue<'de>) -> Option<Self> {
4769 if let Some(inner) = wire.as_ref() {
4770 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
4771 } else {
4772 None
4773 }
4774 }
4775}
4776
4777#[repr(transparent)]
4779pub struct WireConfigValue<'de> {
4780 raw: ::fidl_next::RawWireUnion,
4781 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
4782}
4783
4784impl<'de> Drop for WireConfigValue<'de> {
4785 fn drop(&mut self) {
4786 match self.raw.ordinal() {
4787 1 => {
4788 let _ =
4789 unsafe { self.raw.get().read_unchecked::<crate::WireConfigSingleValue<'de>>() };
4790 }
4791
4792 2 => {
4793 let _ =
4794 unsafe { self.raw.get().read_unchecked::<crate::WireConfigVectorValue<'de>>() };
4795 }
4796
4797 _ => (),
4798 }
4799 }
4800}
4801
4802unsafe impl ::fidl_next::Wire for WireConfigValue<'static> {
4803 type Decoded<'de> = WireConfigValue<'de>;
4804
4805 #[inline]
4806 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4807 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
4808 ::fidl_next::RawWireUnion::zero_padding(raw);
4809 }
4810}
4811
4812pub mod config_value {
4813 pub enum Ref<'de> {
4814 Single(&'de crate::WireConfigSingleValue<'de>),
4815
4816 Vector(&'de crate::WireConfigVectorValue<'de>),
4817
4818 UnknownOrdinal_(u64),
4819 }
4820}
4821
4822impl<'de> WireConfigValue<'de> {
4823 pub fn as_ref(&self) -> crate::config_value::Ref<'_> {
4824 match self.raw.ordinal() {
4825 1 => crate::config_value::Ref::Single(unsafe {
4826 self.raw.get().deref_unchecked::<crate::WireConfigSingleValue<'_>>()
4827 }),
4828
4829 2 => crate::config_value::Ref::Vector(unsafe {
4830 self.raw.get().deref_unchecked::<crate::WireConfigVectorValue<'_>>()
4831 }),
4832
4833 unknown => crate::config_value::Ref::UnknownOrdinal_(unknown),
4834 }
4835 }
4836}
4837
4838unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigValue<'static>
4839where
4840 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4841 ___D: ::fidl_next::Decoder,
4842{
4843 fn decode(
4844 mut slot: ::fidl_next::Slot<'_, Self>,
4845 decoder: &mut ___D,
4846 ) -> Result<(), ::fidl_next::DecodeError> {
4847 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
4848 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
4849 1 => {
4850 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigSingleValue<'static>>(
4851 raw, decoder,
4852 )?
4853 }
4854
4855 2 => {
4856 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigVectorValue<'static>>(
4857 raw, decoder,
4858 )?
4859 }
4860
4861 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
4862 }
4863
4864 Ok(())
4865 }
4866}
4867
4868impl<'de> ::core::fmt::Debug for WireConfigValue<'de> {
4869 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4870 match self.raw.ordinal() {
4871 1 => unsafe {
4872 self.raw.get().deref_unchecked::<crate::WireConfigSingleValue<'_>>().fmt(f)
4873 },
4874 2 => unsafe {
4875 self.raw.get().deref_unchecked::<crate::WireConfigVectorValue<'_>>().fmt(f)
4876 },
4877 _ => unsafe { ::core::hint::unreachable_unchecked() },
4878 }
4879 }
4880}
4881
4882#[repr(transparent)]
4883pub struct WireOptionalConfigValue<'de> {
4884 raw: ::fidl_next::RawWireUnion,
4885 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
4886}
4887
4888unsafe impl ::fidl_next::Wire for WireOptionalConfigValue<'static> {
4889 type Decoded<'de> = WireOptionalConfigValue<'de>;
4890
4891 #[inline]
4892 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4893 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
4894 ::fidl_next::RawWireUnion::zero_padding(raw);
4895 }
4896}
4897
4898impl<'de> WireOptionalConfigValue<'de> {
4899 pub fn is_some(&self) -> bool {
4900 self.raw.is_some()
4901 }
4902
4903 pub fn is_none(&self) -> bool {
4904 self.raw.is_none()
4905 }
4906
4907 pub fn as_ref(&self) -> Option<&WireConfigValue<'de>> {
4908 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
4909 }
4910
4911 pub fn into_option(self) -> Option<WireConfigValue<'de>> {
4912 if self.is_some() {
4913 Some(WireConfigValue { raw: self.raw, _phantom: ::core::marker::PhantomData })
4914 } else {
4915 None
4916 }
4917 }
4918}
4919
4920unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConfigValue<'static>
4921where
4922 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4923 ___D: ::fidl_next::Decoder,
4924{
4925 fn decode(
4926 mut slot: ::fidl_next::Slot<'_, Self>,
4927 decoder: &mut ___D,
4928 ) -> Result<(), ::fidl_next::DecodeError> {
4929 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
4930 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
4931 1 => {
4932 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigSingleValue<'static>>(
4933 raw, decoder,
4934 )?
4935 }
4936
4937 2 => {
4938 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigVectorValue<'static>>(
4939 raw, decoder,
4940 )?
4941 }
4942
4943 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
4944 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
4945 }
4946
4947 Ok(())
4948 }
4949}
4950
4951impl<'de> ::core::fmt::Debug for WireOptionalConfigValue<'de> {
4952 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4953 self.as_ref().fmt(f)
4954 }
4955}
4956
4957#[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"]
4958#[derive(Clone, Debug, Default)]
4959pub struct Configuration {
4960 pub name: Option<String>,
4961
4962 pub value: Option<crate::ConfigValue>,
4963}
4964
4965impl Configuration {
4966 fn __max_ordinal(&self) -> usize {
4967 if self.value.is_some() {
4968 return 2;
4969 }
4970
4971 if self.name.is_some() {
4972 return 1;
4973 }
4974
4975 0
4976 }
4977}
4978
4979impl ::fidl_next::Encodable for Configuration {
4980 type Encoded = WireConfiguration<'static>;
4981}
4982
4983unsafe impl<___E> ::fidl_next::Encode<___E> for Configuration
4984where
4985 ___E: ::fidl_next::Encoder + ?Sized,
4986{
4987 #[inline]
4988 fn encode(
4989 mut self,
4990 encoder: &mut ___E,
4991 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4992 ) -> Result<(), ::fidl_next::EncodeError> {
4993 ::fidl_next::munge!(let WireConfiguration { table } = out);
4994
4995 let max_ord = self.__max_ordinal();
4996
4997 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4998 ::fidl_next::Wire::zero_padding(&mut out);
4999
5000 let mut preallocated =
5001 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5002
5003 for i in 1..=max_ord {
5004 match i {
5005 2 => {
5006 if let Some(value) = self.value.take() {
5007 ::fidl_next::WireEnvelope::encode_value(
5008 value,
5009 preallocated.encoder,
5010 &mut out,
5011 )?;
5012 } else {
5013 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5014 }
5015 }
5016
5017 1 => {
5018 if let Some(name) = self.name.take() {
5019 ::fidl_next::WireEnvelope::encode_value(
5020 name,
5021 preallocated.encoder,
5022 &mut out,
5023 )?;
5024 } else {
5025 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5026 }
5027 }
5028
5029 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5030 }
5031 unsafe {
5032 preallocated.write_next(out.assume_init_ref());
5033 }
5034 }
5035
5036 ::fidl_next::WireTable::encode_len(table, max_ord);
5037
5038 Ok(())
5039 }
5040}
5041
5042unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Configuration
5043where
5044 ___E: ::fidl_next::Encoder + ?Sized,
5045{
5046 #[inline]
5047 fn encode_ref(
5048 &self,
5049 encoder: &mut ___E,
5050 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5051 ) -> Result<(), ::fidl_next::EncodeError> {
5052 ::fidl_next::munge!(let WireConfiguration { table } = out);
5053
5054 let max_ord = self.__max_ordinal();
5055
5056 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5057 ::fidl_next::Wire::zero_padding(&mut out);
5058
5059 let mut preallocated =
5060 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5061
5062 for i in 1..=max_ord {
5063 match i {
5064 2 => {
5065 if let Some(value) = &self.value {
5066 ::fidl_next::WireEnvelope::encode_value(
5067 value,
5068 preallocated.encoder,
5069 &mut out,
5070 )?;
5071 } else {
5072 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5073 }
5074 }
5075
5076 1 => {
5077 if let Some(name) = &self.name {
5078 ::fidl_next::WireEnvelope::encode_value(
5079 name,
5080 preallocated.encoder,
5081 &mut out,
5082 )?;
5083 } else {
5084 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5085 }
5086 }
5087
5088 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5089 }
5090 unsafe {
5091 preallocated.write_next(out.assume_init_ref());
5092 }
5093 }
5094
5095 ::fidl_next::WireTable::encode_len(table, max_ord);
5096
5097 Ok(())
5098 }
5099}
5100
5101impl<'de> ::fidl_next::FromWire<WireConfiguration<'de>> for Configuration {
5102 #[inline]
5103 fn from_wire(wire: WireConfiguration<'de>) -> Self {
5104 let wire = ::core::mem::ManuallyDrop::new(wire);
5105
5106 let name = wire.table.get(1);
5107
5108 let value = wire.table.get(2);
5109
5110 Self {
5111 name: name.map(|envelope| {
5112 ::fidl_next::FromWire::from_wire(unsafe {
5113 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
5114 })
5115 }),
5116
5117 value: value.map(|envelope| {
5118 ::fidl_next::FromWire::from_wire(unsafe {
5119 envelope.read_unchecked::<crate::WireConfigValue<'de>>()
5120 })
5121 }),
5122 }
5123 }
5124}
5125
5126impl<'de> ::fidl_next::FromWireRef<WireConfiguration<'de>> for Configuration {
5127 #[inline]
5128 fn from_wire_ref(wire: &WireConfiguration<'de>) -> Self {
5129 Self {
5130 name: wire.table.get(1).map(|envelope| {
5131 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5132 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
5133 })
5134 }),
5135
5136 value: wire.table.get(2).map(|envelope| {
5137 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5138 envelope.deref_unchecked::<crate::WireConfigValue<'de>>()
5139 })
5140 }),
5141 }
5142 }
5143}
5144
5145#[repr(C)]
5147pub struct WireConfiguration<'de> {
5148 table: ::fidl_next::WireTable<'de>,
5149}
5150
5151impl<'de> Drop for WireConfiguration<'de> {
5152 fn drop(&mut self) {
5153 let _ = self
5154 .table
5155 .get(1)
5156 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
5157
5158 let _ = self
5159 .table
5160 .get(2)
5161 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigValue<'de>>() });
5162 }
5163}
5164
5165unsafe impl ::fidl_next::Wire for WireConfiguration<'static> {
5166 type Decoded<'de> = WireConfiguration<'de>;
5167
5168 #[inline]
5169 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5170 ::fidl_next::munge!(let Self { table } = out);
5171 ::fidl_next::WireTable::zero_padding(table);
5172 }
5173}
5174
5175unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfiguration<'static>
5176where
5177 ___D: ::fidl_next::Decoder + ?Sized,
5178{
5179 fn decode(
5180 slot: ::fidl_next::Slot<'_, Self>,
5181 decoder: &mut ___D,
5182 ) -> Result<(), ::fidl_next::DecodeError> {
5183 ::fidl_next::munge!(let Self { table } = slot);
5184
5185 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5186 match ordinal {
5187 0 => unsafe { ::core::hint::unreachable_unchecked() },
5188
5189 1 => {
5190 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
5191 slot.as_mut(),
5192 decoder,
5193 )?;
5194
5195 let name = unsafe {
5196 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
5197 };
5198
5199 if name.len() > 100 {
5200 return Err(::fidl_next::DecodeError::VectorTooLong {
5201 size: name.len() as u64,
5202 limit: 100,
5203 });
5204 }
5205
5206 Ok(())
5207 }
5208
5209 2 => {
5210 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigValue<'static>>(
5211 slot.as_mut(),
5212 decoder,
5213 )?;
5214
5215 Ok(())
5216 }
5217
5218 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
5219 }
5220 })
5221 }
5222}
5223
5224impl<'de> WireConfiguration<'de> {
5225 pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
5226 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5227 }
5228
5229 pub fn value(&self) -> Option<&crate::WireConfigValue<'de>> {
5230 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5231 }
5232}
5233
5234impl<'de> ::core::fmt::Debug for WireConfiguration<'de> {
5235 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
5236 f.debug_struct("Configuration")
5237 .field("name", &self.name())
5238 .field("value", &self.value())
5239 .finish()
5240 }
5241}
5242
5243#[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"]
5244pub type DictionaryPath = String;
5245
5246pub type WireDictionaryPath<'de> = ::fidl_next::WireString<'de>;
5248
5249#[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"]
5250#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5251#[repr(u32)]
5252pub enum DeliveryType {
5253 Immediate = 0,
5254 OnReadable = 1,
5255 UnknownOrdinal_(u32),
5256}
5257
5258impl ::fidl_next::Encodable for DeliveryType {
5259 type Encoded = WireDeliveryType;
5260}
5261impl ::std::convert::From<u32> for DeliveryType {
5262 fn from(value: u32) -> Self {
5263 match value {
5264 0 => Self::Immediate,
5265 1 => Self::OnReadable,
5266
5267 _ => Self::UnknownOrdinal_(value),
5268 }
5269 }
5270}
5271
5272unsafe impl<___E> ::fidl_next::Encode<___E> for DeliveryType
5273where
5274 ___E: ?Sized,
5275{
5276 #[inline]
5277 fn encode(
5278 self,
5279 encoder: &mut ___E,
5280 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5281 ) -> Result<(), ::fidl_next::EncodeError> {
5282 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
5283 }
5284}
5285
5286unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DeliveryType
5287where
5288 ___E: ?Sized,
5289{
5290 #[inline]
5291 fn encode_ref(
5292 &self,
5293 encoder: &mut ___E,
5294 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5295 ) -> Result<(), ::fidl_next::EncodeError> {
5296 ::fidl_next::munge!(let WireDeliveryType { value } = out);
5297 let _ = value.write(::fidl_next::WireU32::from(match *self {
5298 Self::Immediate => 0,
5299
5300 Self::OnReadable => 1,
5301
5302 Self::UnknownOrdinal_(value) => value,
5303 }));
5304
5305 Ok(())
5306 }
5307}
5308
5309impl ::core::convert::From<WireDeliveryType> for DeliveryType {
5310 fn from(wire: WireDeliveryType) -> Self {
5311 match u32::from(wire.value) {
5312 0 => Self::Immediate,
5313
5314 1 => Self::OnReadable,
5315
5316 value => Self::UnknownOrdinal_(value),
5317 }
5318 }
5319}
5320
5321impl ::fidl_next::FromWire<WireDeliveryType> for DeliveryType {
5322 #[inline]
5323 fn from_wire(wire: WireDeliveryType) -> Self {
5324 Self::from(wire)
5325 }
5326}
5327
5328impl ::fidl_next::FromWireRef<WireDeliveryType> for DeliveryType {
5329 #[inline]
5330 fn from_wire_ref(wire: &WireDeliveryType) -> Self {
5331 Self::from(*wire)
5332 }
5333}
5334
5335#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5337#[repr(transparent)]
5338pub struct WireDeliveryType {
5339 value: ::fidl_next::WireU32,
5340}
5341
5342unsafe impl ::fidl_next::Wire for WireDeliveryType {
5343 type Decoded<'de> = Self;
5344
5345 #[inline]
5346 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5347 }
5349}
5350
5351impl WireDeliveryType {
5352 pub const IMMEDIATE: WireDeliveryType = WireDeliveryType { value: ::fidl_next::WireU32(0) };
5353
5354 pub const ON_READABLE: WireDeliveryType = WireDeliveryType { value: ::fidl_next::WireU32(1) };
5355}
5356
5357unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeliveryType
5358where
5359 ___D: ?Sized,
5360{
5361 fn decode(
5362 slot: ::fidl_next::Slot<'_, Self>,
5363 _: &mut ___D,
5364 ) -> Result<(), ::fidl_next::DecodeError> {
5365 Ok(())
5366 }
5367}
5368
5369impl ::core::convert::From<DeliveryType> for WireDeliveryType {
5370 fn from(natural: DeliveryType) -> Self {
5371 match natural {
5372 DeliveryType::Immediate => WireDeliveryType::IMMEDIATE,
5373
5374 DeliveryType::OnReadable => WireDeliveryType::ON_READABLE,
5375
5376 DeliveryType::UnknownOrdinal_(value) => {
5377 WireDeliveryType { value: ::fidl_next::WireU32::from(value) }
5378 }
5379 }
5380 }
5381}
5382
5383#[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"]
5384#[derive(Clone, Debug, Default)]
5385pub struct Protocol {
5386 pub name: Option<String>,
5387
5388 pub source_path: Option<String>,
5389
5390 pub delivery: Option<crate::DeliveryType>,
5391}
5392
5393impl Protocol {
5394 fn __max_ordinal(&self) -> usize {
5395 if self.delivery.is_some() {
5396 return 3;
5397 }
5398
5399 if self.source_path.is_some() {
5400 return 2;
5401 }
5402
5403 if self.name.is_some() {
5404 return 1;
5405 }
5406
5407 0
5408 }
5409}
5410
5411impl ::fidl_next::Encodable for Protocol {
5412 type Encoded = WireProtocol<'static>;
5413}
5414
5415unsafe impl<___E> ::fidl_next::Encode<___E> for Protocol
5416where
5417 ___E: ::fidl_next::Encoder + ?Sized,
5418{
5419 #[inline]
5420 fn encode(
5421 mut self,
5422 encoder: &mut ___E,
5423 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5424 ) -> Result<(), ::fidl_next::EncodeError> {
5425 ::fidl_next::munge!(let WireProtocol { table } = out);
5426
5427 let max_ord = self.__max_ordinal();
5428
5429 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5430 ::fidl_next::Wire::zero_padding(&mut out);
5431
5432 let mut preallocated =
5433 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5434
5435 for i in 1..=max_ord {
5436 match i {
5437 3 => {
5438 if let Some(delivery) = self.delivery.take() {
5439 ::fidl_next::WireEnvelope::encode_value(
5440 delivery,
5441 preallocated.encoder,
5442 &mut out,
5443 )?;
5444 } else {
5445 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5446 }
5447 }
5448
5449 2 => {
5450 if let Some(source_path) = self.source_path.take() {
5451 ::fidl_next::WireEnvelope::encode_value(
5452 source_path,
5453 preallocated.encoder,
5454 &mut out,
5455 )?;
5456 } else {
5457 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5458 }
5459 }
5460
5461 1 => {
5462 if let Some(name) = self.name.take() {
5463 ::fidl_next::WireEnvelope::encode_value(
5464 name,
5465 preallocated.encoder,
5466 &mut out,
5467 )?;
5468 } else {
5469 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5470 }
5471 }
5472
5473 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5474 }
5475 unsafe {
5476 preallocated.write_next(out.assume_init_ref());
5477 }
5478 }
5479
5480 ::fidl_next::WireTable::encode_len(table, max_ord);
5481
5482 Ok(())
5483 }
5484}
5485
5486unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Protocol
5487where
5488 ___E: ::fidl_next::Encoder + ?Sized,
5489{
5490 #[inline]
5491 fn encode_ref(
5492 &self,
5493 encoder: &mut ___E,
5494 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5495 ) -> Result<(), ::fidl_next::EncodeError> {
5496 ::fidl_next::munge!(let WireProtocol { table } = out);
5497
5498 let max_ord = self.__max_ordinal();
5499
5500 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5501 ::fidl_next::Wire::zero_padding(&mut out);
5502
5503 let mut preallocated =
5504 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5505
5506 for i in 1..=max_ord {
5507 match i {
5508 3 => {
5509 if let Some(delivery) = &self.delivery {
5510 ::fidl_next::WireEnvelope::encode_value(
5511 delivery,
5512 preallocated.encoder,
5513 &mut out,
5514 )?;
5515 } else {
5516 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5517 }
5518 }
5519
5520 2 => {
5521 if let Some(source_path) = &self.source_path {
5522 ::fidl_next::WireEnvelope::encode_value(
5523 source_path,
5524 preallocated.encoder,
5525 &mut out,
5526 )?;
5527 } else {
5528 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5529 }
5530 }
5531
5532 1 => {
5533 if let Some(name) = &self.name {
5534 ::fidl_next::WireEnvelope::encode_value(
5535 name,
5536 preallocated.encoder,
5537 &mut out,
5538 )?;
5539 } else {
5540 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5541 }
5542 }
5543
5544 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5545 }
5546 unsafe {
5547 preallocated.write_next(out.assume_init_ref());
5548 }
5549 }
5550
5551 ::fidl_next::WireTable::encode_len(table, max_ord);
5552
5553 Ok(())
5554 }
5555}
5556
5557impl<'de> ::fidl_next::FromWire<WireProtocol<'de>> for Protocol {
5558 #[inline]
5559 fn from_wire(wire: WireProtocol<'de>) -> Self {
5560 let wire = ::core::mem::ManuallyDrop::new(wire);
5561
5562 let name = wire.table.get(1);
5563
5564 let source_path = wire.table.get(2);
5565
5566 let delivery = wire.table.get(3);
5567
5568 Self {
5569 name: name.map(|envelope| {
5570 ::fidl_next::FromWire::from_wire(unsafe {
5571 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
5572 })
5573 }),
5574
5575 source_path: source_path.map(|envelope| {
5576 ::fidl_next::FromWire::from_wire(unsafe {
5577 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
5578 })
5579 }),
5580
5581 delivery: delivery.map(|envelope| {
5582 ::fidl_next::FromWire::from_wire(unsafe {
5583 envelope.read_unchecked::<crate::WireDeliveryType>()
5584 })
5585 }),
5586 }
5587 }
5588}
5589
5590impl<'de> ::fidl_next::FromWireRef<WireProtocol<'de>> for Protocol {
5591 #[inline]
5592 fn from_wire_ref(wire: &WireProtocol<'de>) -> Self {
5593 Self {
5594 name: wire.table.get(1).map(|envelope| {
5595 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5596 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
5597 })
5598 }),
5599
5600 source_path: wire.table.get(2).map(|envelope| {
5601 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5602 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
5603 })
5604 }),
5605
5606 delivery: wire.table.get(3).map(|envelope| {
5607 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5608 envelope.deref_unchecked::<crate::WireDeliveryType>()
5609 })
5610 }),
5611 }
5612 }
5613}
5614
5615#[repr(C)]
5617pub struct WireProtocol<'de> {
5618 table: ::fidl_next::WireTable<'de>,
5619}
5620
5621impl<'de> Drop for WireProtocol<'de> {
5622 fn drop(&mut self) {
5623 let _ = self
5624 .table
5625 .get(1)
5626 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
5627
5628 let _ = self
5629 .table
5630 .get(2)
5631 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
5632
5633 let _ = self
5634 .table
5635 .get(3)
5636 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDeliveryType>() });
5637 }
5638}
5639
5640unsafe impl ::fidl_next::Wire for WireProtocol<'static> {
5641 type Decoded<'de> = WireProtocol<'de>;
5642
5643 #[inline]
5644 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5645 ::fidl_next::munge!(let Self { table } = out);
5646 ::fidl_next::WireTable::zero_padding(table);
5647 }
5648}
5649
5650unsafe impl<___D> ::fidl_next::Decode<___D> for WireProtocol<'static>
5651where
5652 ___D: ::fidl_next::Decoder + ?Sized,
5653{
5654 fn decode(
5655 slot: ::fidl_next::Slot<'_, Self>,
5656 decoder: &mut ___D,
5657 ) -> Result<(), ::fidl_next::DecodeError> {
5658 ::fidl_next::munge!(let Self { table } = slot);
5659
5660 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5661 match ordinal {
5662 0 => unsafe { ::core::hint::unreachable_unchecked() },
5663
5664 1 => {
5665 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
5666 slot.as_mut(),
5667 decoder,
5668 )?;
5669
5670 let name = unsafe {
5671 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
5672 };
5673
5674 if name.len() > 100 {
5675 return Err(::fidl_next::DecodeError::VectorTooLong {
5676 size: name.len() as u64,
5677 limit: 100,
5678 });
5679 }
5680
5681 Ok(())
5682 }
5683
5684 2 => {
5685 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
5686 slot.as_mut(),
5687 decoder,
5688 )?;
5689
5690 let source_path = unsafe {
5691 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
5692 };
5693
5694 if source_path.len() > 1024 {
5695 return Err(::fidl_next::DecodeError::VectorTooLong {
5696 size: source_path.len() as u64,
5697 limit: 1024,
5698 });
5699 }
5700
5701 Ok(())
5702 }
5703
5704 3 => {
5705 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDeliveryType>(
5706 slot.as_mut(),
5707 decoder,
5708 )?;
5709
5710 Ok(())
5711 }
5712
5713 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
5714 }
5715 })
5716 }
5717}
5718
5719impl<'de> WireProtocol<'de> {
5720 pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
5721 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5722 }
5723
5724 pub fn source_path(&self) -> Option<&::fidl_next::WireString<'de>> {
5725 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5726 }
5727
5728 pub fn delivery(&self) -> Option<&crate::WireDeliveryType> {
5729 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
5730 }
5731}
5732
5733impl<'de> ::core::fmt::Debug for WireProtocol<'de> {
5734 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
5735 f.debug_struct("Protocol")
5736 .field("name", &self.name())
5737 .field("source_path", &self.source_path())
5738 .field("delivery", &self.delivery())
5739 .finish()
5740 }
5741}
5742
5743#[doc = " A reference to the environment.\n"]
5744#[derive(Clone, Debug)]
5745#[repr(C)]
5746pub struct EnvironmentRef {}
5747
5748impl ::fidl_next::Encodable for EnvironmentRef {
5749 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireEnvironmentRef> =
5750 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
5751
5752 type Encoded = WireEnvironmentRef;
5753}
5754
5755unsafe impl<___E> ::fidl_next::Encode<___E> for EnvironmentRef
5756where
5757 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5758{
5759 #[inline]
5760 fn encode(
5761 self,
5762 encoder: &mut ___E,
5763 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5764 ) -> Result<(), ::fidl_next::EncodeError> {
5765 ::fidl_next::munge! {
5766 let Self::Encoded {
5767
5768 } = out;
5769 }
5770
5771 Ok(())
5772 }
5773}
5774
5775unsafe impl<___E> ::fidl_next::EncodeRef<___E> for EnvironmentRef
5776where
5777 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5778{
5779 #[inline]
5780 fn encode_ref(
5781 &self,
5782 encoder: &mut ___E,
5783 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5784 ) -> Result<(), ::fidl_next::EncodeError> {
5785 ::fidl_next::munge! {
5786 let Self::Encoded {
5787
5788 } = out;
5789 }
5790
5791 Ok(())
5792 }
5793}
5794
5795impl ::fidl_next::EncodableOption for EnvironmentRef {
5796 type EncodedOption = ::fidl_next::WireBox<'static, WireEnvironmentRef>;
5797}
5798
5799unsafe impl<___E> ::fidl_next::EncodeOption<___E> for EnvironmentRef
5800where
5801 ___E: ::fidl_next::Encoder + ?Sized,
5802 EnvironmentRef: ::fidl_next::Encode<___E>,
5803{
5804 #[inline]
5805 fn encode_option(
5806 this: Option<Self>,
5807 encoder: &mut ___E,
5808 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5809 ) -> Result<(), ::fidl_next::EncodeError> {
5810 if let Some(inner) = this {
5811 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5812 ::fidl_next::WireBox::encode_present(out);
5813 } else {
5814 ::fidl_next::WireBox::encode_absent(out);
5815 }
5816
5817 Ok(())
5818 }
5819}
5820
5821unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for EnvironmentRef
5822where
5823 ___E: ::fidl_next::Encoder + ?Sized,
5824 EnvironmentRef: ::fidl_next::EncodeRef<___E>,
5825{
5826 #[inline]
5827 fn encode_option_ref(
5828 this: Option<&Self>,
5829 encoder: &mut ___E,
5830 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5831 ) -> Result<(), ::fidl_next::EncodeError> {
5832 if let Some(inner) = this {
5833 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5834 ::fidl_next::WireBox::encode_present(out);
5835 } else {
5836 ::fidl_next::WireBox::encode_absent(out);
5837 }
5838
5839 Ok(())
5840 }
5841}
5842
5843impl ::fidl_next::FromWire<WireEnvironmentRef> for EnvironmentRef {
5844 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireEnvironmentRef, Self> =
5845 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
5846
5847 #[inline]
5848 fn from_wire(wire: WireEnvironmentRef) -> Self {
5849 Self {}
5850 }
5851}
5852
5853impl ::fidl_next::FromWireRef<WireEnvironmentRef> for EnvironmentRef {
5854 #[inline]
5855 fn from_wire_ref(wire: &WireEnvironmentRef) -> Self {
5856 Self {}
5857 }
5858}
5859
5860#[derive(Clone, Debug)]
5862#[repr(C)]
5863pub struct WireEnvironmentRef {}
5864
5865unsafe impl ::fidl_next::Wire for WireEnvironmentRef {
5866 type Decoded<'de> = WireEnvironmentRef;
5867
5868 #[inline]
5869 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5870}
5871
5872unsafe impl<___D> ::fidl_next::Decode<___D> for WireEnvironmentRef
5873where
5874 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5875{
5876 fn decode(
5877 slot: ::fidl_next::Slot<'_, Self>,
5878 decoder: &mut ___D,
5879 ) -> Result<(), ::fidl_next::DecodeError> {
5880 ::fidl_next::munge! {
5881 let Self {
5882
5883 } = slot;
5884 }
5885
5886 Ok(())
5887 }
5888}
5889
5890#[doc = " A reference to a capability source or destination relative to this\n component.\n"]
5891#[derive(Clone, Debug)]
5892pub enum Ref {
5893 Parent(crate::ParentRef),
5894
5895 Self_(crate::SelfRef),
5896
5897 Child(crate::ChildRef),
5898
5899 Collection(crate::CollectionRef),
5900
5901 Framework(crate::FrameworkRef),
5902
5903 Capability(crate::CapabilityRef),
5904
5905 Debug(crate::DebugRef),
5906
5907 VoidType(crate::VoidRef),
5908
5909 Environment(crate::EnvironmentRef),
5910
5911 UnknownOrdinal_(u64),
5912}
5913
5914impl ::fidl_next::Encodable for Ref {
5915 type Encoded = WireRef<'static>;
5916}
5917
5918unsafe impl<___E> ::fidl_next::Encode<___E> for Ref
5919where
5920 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5921 ___E: ::fidl_next::Encoder,
5922{
5923 #[inline]
5924 fn encode(
5925 self,
5926 encoder: &mut ___E,
5927 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5928 ) -> Result<(), ::fidl_next::EncodeError> {
5929 ::fidl_next::munge!(let WireRef { raw, _phantom: _ } = out);
5930
5931 match self {
5932 Self::Parent(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::ParentRef>(
5933 value, 1, encoder, raw,
5934 )?,
5935
5936 Self::Self_(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::SelfRef>(
5937 value, 2, encoder, raw,
5938 )?,
5939
5940 Self::Child(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::ChildRef>(
5941 value, 3, encoder, raw,
5942 )?,
5943
5944 Self::Collection(value) => ::fidl_next::RawWireUnion::encode_as::<
5945 ___E,
5946 crate::CollectionRef,
5947 >(value, 4, encoder, raw)?,
5948
5949 Self::Framework(value) => ::fidl_next::RawWireUnion::encode_as::<
5950 ___E,
5951 crate::FrameworkRef,
5952 >(value, 5, encoder, raw)?,
5953
5954 Self::Capability(value) => ::fidl_next::RawWireUnion::encode_as::<
5955 ___E,
5956 crate::CapabilityRef,
5957 >(value, 6, encoder, raw)?,
5958
5959 Self::Debug(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::DebugRef>(
5960 value, 7, encoder, raw,
5961 )?,
5962
5963 Self::VoidType(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::VoidRef>(
5964 value, 8, encoder, raw,
5965 )?,
5966
5967 Self::Environment(value) => ::fidl_next::RawWireUnion::encode_as::<
5968 ___E,
5969 crate::EnvironmentRef,
5970 >(value, 9, encoder, raw)?,
5971
5972 Self::UnknownOrdinal_(ordinal) => {
5973 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
5974 }
5975 }
5976
5977 Ok(())
5978 }
5979}
5980
5981unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Ref
5982where
5983 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5984 ___E: ::fidl_next::Encoder,
5985{
5986 #[inline]
5987 fn encode_ref(
5988 &self,
5989 encoder: &mut ___E,
5990 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5991 ) -> Result<(), ::fidl_next::EncodeError> {
5992 ::fidl_next::munge!(let WireRef { raw, _phantom: _ } = out);
5993
5994 match self {
5995 Self::Parent(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::ParentRef>(
5996 value, 1, encoder, raw,
5997 )?,
5998
5999 Self::Self_(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::SelfRef>(
6000 value, 2, encoder, raw,
6001 )?,
6002
6003 Self::Child(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::ChildRef>(
6004 value, 3, encoder, raw,
6005 )?,
6006
6007 Self::Collection(value) => ::fidl_next::RawWireUnion::encode_as::<
6008 ___E,
6009 &crate::CollectionRef,
6010 >(value, 4, encoder, raw)?,
6011
6012 Self::Framework(value) => ::fidl_next::RawWireUnion::encode_as::<
6013 ___E,
6014 &crate::FrameworkRef,
6015 >(value, 5, encoder, raw)?,
6016
6017 Self::Capability(value) => ::fidl_next::RawWireUnion::encode_as::<
6018 ___E,
6019 &crate::CapabilityRef,
6020 >(value, 6, encoder, raw)?,
6021
6022 Self::Debug(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::DebugRef>(
6023 value, 7, encoder, raw,
6024 )?,
6025
6026 Self::VoidType(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::VoidRef>(
6027 value, 8, encoder, raw,
6028 )?,
6029
6030 Self::Environment(value) => ::fidl_next::RawWireUnion::encode_as::<
6031 ___E,
6032 &crate::EnvironmentRef,
6033 >(value, 9, encoder, raw)?,
6034
6035 Self::UnknownOrdinal_(ordinal) => {
6036 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
6037 }
6038 }
6039
6040 Ok(())
6041 }
6042}
6043
6044impl ::fidl_next::EncodableOption for Ref {
6045 type EncodedOption = WireOptionalRef<'static>;
6046}
6047
6048unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Ref
6049where
6050 ___E: ?Sized,
6051 Ref: ::fidl_next::Encode<___E>,
6052{
6053 #[inline]
6054 fn encode_option(
6055 this: Option<Self>,
6056 encoder: &mut ___E,
6057 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6058 ) -> Result<(), ::fidl_next::EncodeError> {
6059 ::fidl_next::munge!(let WireOptionalRef { raw, _phantom: _ } = &mut *out);
6060
6061 if let Some(inner) = this {
6062 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
6063 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
6064 } else {
6065 ::fidl_next::RawWireUnion::encode_absent(raw);
6066 }
6067
6068 Ok(())
6069 }
6070}
6071
6072unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Ref
6073where
6074 ___E: ?Sized,
6075 Ref: ::fidl_next::EncodeRef<___E>,
6076{
6077 #[inline]
6078 fn encode_option_ref(
6079 this: Option<&Self>,
6080 encoder: &mut ___E,
6081 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6082 ) -> Result<(), ::fidl_next::EncodeError> {
6083 ::fidl_next::munge!(let WireOptionalRef { raw, _phantom: _ } = &mut *out);
6084
6085 if let Some(inner) = this {
6086 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
6087 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
6088 } else {
6089 ::fidl_next::RawWireUnion::encode_absent(raw);
6090 }
6091
6092 Ok(())
6093 }
6094}
6095
6096impl<'de> ::fidl_next::FromWire<WireRef<'de>> for Ref {
6097 #[inline]
6098 fn from_wire(wire: WireRef<'de>) -> Self {
6099 let wire = ::core::mem::ManuallyDrop::new(wire);
6100 match wire.raw.ordinal() {
6101 1 => Self::Parent(::fidl_next::FromWire::from_wire(unsafe {
6102 wire.raw.get().read_unchecked::<crate::WireParentRef>()
6103 })),
6104
6105 2 => Self::Self_(::fidl_next::FromWire::from_wire(unsafe {
6106 wire.raw.get().read_unchecked::<crate::WireSelfRef>()
6107 })),
6108
6109 3 => Self::Child(::fidl_next::FromWire::from_wire(unsafe {
6110 wire.raw.get().read_unchecked::<crate::WireChildRef<'de>>()
6111 })),
6112
6113 4 => Self::Collection(::fidl_next::FromWire::from_wire(unsafe {
6114 wire.raw.get().read_unchecked::<crate::WireCollectionRef<'de>>()
6115 })),
6116
6117 5 => Self::Framework(::fidl_next::FromWire::from_wire(unsafe {
6118 wire.raw.get().read_unchecked::<crate::WireFrameworkRef>()
6119 })),
6120
6121 6 => Self::Capability(::fidl_next::FromWire::from_wire(unsafe {
6122 wire.raw.get().read_unchecked::<crate::WireCapabilityRef<'de>>()
6123 })),
6124
6125 7 => Self::Debug(::fidl_next::FromWire::from_wire(unsafe {
6126 wire.raw.get().read_unchecked::<crate::WireDebugRef>()
6127 })),
6128
6129 8 => Self::VoidType(::fidl_next::FromWire::from_wire(unsafe {
6130 wire.raw.get().read_unchecked::<crate::WireVoidRef>()
6131 })),
6132
6133 9 => Self::Environment(::fidl_next::FromWire::from_wire(unsafe {
6134 wire.raw.get().read_unchecked::<crate::WireEnvironmentRef>()
6135 })),
6136
6137 _ => unsafe { ::core::hint::unreachable_unchecked() },
6138 }
6139 }
6140}
6141
6142impl<'de> ::fidl_next::FromWireRef<WireRef<'de>> for Ref {
6143 #[inline]
6144 fn from_wire_ref(wire: &WireRef<'de>) -> Self {
6145 match wire.raw.ordinal() {
6146 1 => Self::Parent(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6147 wire.raw.get().deref_unchecked::<crate::WireParentRef>()
6148 })),
6149
6150 2 => Self::Self_(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6151 wire.raw.get().deref_unchecked::<crate::WireSelfRef>()
6152 })),
6153
6154 3 => Self::Child(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6155 wire.raw.get().deref_unchecked::<crate::WireChildRef<'de>>()
6156 })),
6157
6158 4 => Self::Collection(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6159 wire.raw.get().deref_unchecked::<crate::WireCollectionRef<'de>>()
6160 })),
6161
6162 5 => Self::Framework(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6163 wire.raw.get().deref_unchecked::<crate::WireFrameworkRef>()
6164 })),
6165
6166 6 => Self::Capability(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6167 wire.raw.get().deref_unchecked::<crate::WireCapabilityRef<'de>>()
6168 })),
6169
6170 7 => Self::Debug(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6171 wire.raw.get().deref_unchecked::<crate::WireDebugRef>()
6172 })),
6173
6174 8 => Self::VoidType(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6175 wire.raw.get().deref_unchecked::<crate::WireVoidRef>()
6176 })),
6177
6178 9 => Self::Environment(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6179 wire.raw.get().deref_unchecked::<crate::WireEnvironmentRef>()
6180 })),
6181
6182 _ => unsafe { ::core::hint::unreachable_unchecked() },
6183 }
6184 }
6185}
6186
6187impl<'de> ::fidl_next::FromWireOption<WireOptionalRef<'de>> for Box<Ref> {
6188 #[inline]
6189 fn from_wire_option(wire: WireOptionalRef<'de>) -> Option<Self> {
6190 if let Some(inner) = wire.into_option() {
6191 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
6192 } else {
6193 None
6194 }
6195 }
6196}
6197
6198impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalRef<'de>> for Box<Ref> {
6199 #[inline]
6200 fn from_wire_option_ref(wire: &WireOptionalRef<'de>) -> Option<Self> {
6201 if let Some(inner) = wire.as_ref() {
6202 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
6203 } else {
6204 None
6205 }
6206 }
6207}
6208
6209#[repr(transparent)]
6211pub struct WireRef<'de> {
6212 raw: ::fidl_next::RawWireUnion,
6213 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
6214}
6215
6216impl<'de> Drop for WireRef<'de> {
6217 fn drop(&mut self) {
6218 match self.raw.ordinal() {
6219 1 => {
6220 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireParentRef>() };
6221 }
6222
6223 2 => {
6224 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireSelfRef>() };
6225 }
6226
6227 3 => {
6228 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireChildRef<'de>>() };
6229 }
6230
6231 4 => {
6232 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireCollectionRef<'de>>() };
6233 }
6234
6235 5 => {
6236 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireFrameworkRef>() };
6237 }
6238
6239 6 => {
6240 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireCapabilityRef<'de>>() };
6241 }
6242
6243 7 => {
6244 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDebugRef>() };
6245 }
6246
6247 8 => {
6248 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireVoidRef>() };
6249 }
6250
6251 9 => {
6252 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireEnvironmentRef>() };
6253 }
6254
6255 _ => (),
6256 }
6257 }
6258}
6259
6260unsafe impl ::fidl_next::Wire for WireRef<'static> {
6261 type Decoded<'de> = WireRef<'de>;
6262
6263 #[inline]
6264 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6265 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
6266 ::fidl_next::RawWireUnion::zero_padding(raw);
6267 }
6268}
6269
6270pub mod ref_ {
6271 pub enum Ref<'de> {
6272 Parent(&'de crate::WireParentRef),
6273
6274 Self_(&'de crate::WireSelfRef),
6275
6276 Child(&'de crate::WireChildRef<'de>),
6277
6278 Collection(&'de crate::WireCollectionRef<'de>),
6279
6280 Framework(&'de crate::WireFrameworkRef),
6281
6282 Capability(&'de crate::WireCapabilityRef<'de>),
6283
6284 Debug(&'de crate::WireDebugRef),
6285
6286 VoidType(&'de crate::WireVoidRef),
6287
6288 Environment(&'de crate::WireEnvironmentRef),
6289
6290 UnknownOrdinal_(u64),
6291 }
6292}
6293
6294impl<'de> WireRef<'de> {
6295 pub fn as_ref(&self) -> crate::ref_::Ref<'_> {
6296 match self.raw.ordinal() {
6297 1 => crate::ref_::Ref::Parent(unsafe {
6298 self.raw.get().deref_unchecked::<crate::WireParentRef>()
6299 }),
6300
6301 2 => crate::ref_::Ref::Self_(unsafe {
6302 self.raw.get().deref_unchecked::<crate::WireSelfRef>()
6303 }),
6304
6305 3 => crate::ref_::Ref::Child(unsafe {
6306 self.raw.get().deref_unchecked::<crate::WireChildRef<'_>>()
6307 }),
6308
6309 4 => crate::ref_::Ref::Collection(unsafe {
6310 self.raw.get().deref_unchecked::<crate::WireCollectionRef<'_>>()
6311 }),
6312
6313 5 => crate::ref_::Ref::Framework(unsafe {
6314 self.raw.get().deref_unchecked::<crate::WireFrameworkRef>()
6315 }),
6316
6317 6 => crate::ref_::Ref::Capability(unsafe {
6318 self.raw.get().deref_unchecked::<crate::WireCapabilityRef<'_>>()
6319 }),
6320
6321 7 => crate::ref_::Ref::Debug(unsafe {
6322 self.raw.get().deref_unchecked::<crate::WireDebugRef>()
6323 }),
6324
6325 8 => crate::ref_::Ref::VoidType(unsafe {
6326 self.raw.get().deref_unchecked::<crate::WireVoidRef>()
6327 }),
6328
6329 9 => crate::ref_::Ref::Environment(unsafe {
6330 self.raw.get().deref_unchecked::<crate::WireEnvironmentRef>()
6331 }),
6332
6333 unknown => crate::ref_::Ref::UnknownOrdinal_(unknown),
6334 }
6335 }
6336}
6337
6338unsafe impl<___D> ::fidl_next::Decode<___D> for WireRef<'static>
6339where
6340 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6341 ___D: ::fidl_next::Decoder,
6342{
6343 fn decode(
6344 mut slot: ::fidl_next::Slot<'_, Self>,
6345 decoder: &mut ___D,
6346 ) -> Result<(), ::fidl_next::DecodeError> {
6347 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
6348 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
6349 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireParentRef>(raw, decoder)?,
6350
6351 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSelfRef>(raw, decoder)?,
6352
6353 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireChildRef<'static>>(
6354 raw, decoder,
6355 )?,
6356
6357 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireCollectionRef<'static>>(
6358 raw, decoder,
6359 )?,
6360
6361 5 => {
6362 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFrameworkRef>(raw, decoder)?
6363 }
6364
6365 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireCapabilityRef<'static>>(
6366 raw, decoder,
6367 )?,
6368
6369 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDebugRef>(raw, decoder)?,
6370
6371 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireVoidRef>(raw, decoder)?,
6372
6373 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEnvironmentRef>(
6374 raw, decoder,
6375 )?,
6376
6377 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
6378 }
6379
6380 Ok(())
6381 }
6382}
6383
6384impl<'de> ::core::fmt::Debug for WireRef<'de> {
6385 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6386 match self.raw.ordinal() {
6387 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireParentRef>().fmt(f) },
6388 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireSelfRef>().fmt(f) },
6389 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireChildRef<'_>>().fmt(f) },
6390 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireCollectionRef<'_>>().fmt(f) },
6391 5 => unsafe { self.raw.get().deref_unchecked::<crate::WireFrameworkRef>().fmt(f) },
6392 6 => unsafe { self.raw.get().deref_unchecked::<crate::WireCapabilityRef<'_>>().fmt(f) },
6393 7 => unsafe { self.raw.get().deref_unchecked::<crate::WireDebugRef>().fmt(f) },
6394 8 => unsafe { self.raw.get().deref_unchecked::<crate::WireVoidRef>().fmt(f) },
6395 9 => unsafe { self.raw.get().deref_unchecked::<crate::WireEnvironmentRef>().fmt(f) },
6396 _ => unsafe { ::core::hint::unreachable_unchecked() },
6397 }
6398 }
6399}
6400
6401#[repr(transparent)]
6402pub struct WireOptionalRef<'de> {
6403 raw: ::fidl_next::RawWireUnion,
6404 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
6405}
6406
6407unsafe impl ::fidl_next::Wire for WireOptionalRef<'static> {
6408 type Decoded<'de> = WireOptionalRef<'de>;
6409
6410 #[inline]
6411 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6412 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
6413 ::fidl_next::RawWireUnion::zero_padding(raw);
6414 }
6415}
6416
6417impl<'de> WireOptionalRef<'de> {
6418 pub fn is_some(&self) -> bool {
6419 self.raw.is_some()
6420 }
6421
6422 pub fn is_none(&self) -> bool {
6423 self.raw.is_none()
6424 }
6425
6426 pub fn as_ref(&self) -> Option<&WireRef<'de>> {
6427 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
6428 }
6429
6430 pub fn into_option(self) -> Option<WireRef<'de>> {
6431 if self.is_some() {
6432 Some(WireRef { raw: self.raw, _phantom: ::core::marker::PhantomData })
6433 } else {
6434 None
6435 }
6436 }
6437}
6438
6439unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalRef<'static>
6440where
6441 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6442 ___D: ::fidl_next::Decoder,
6443{
6444 fn decode(
6445 mut slot: ::fidl_next::Slot<'_, Self>,
6446 decoder: &mut ___D,
6447 ) -> Result<(), ::fidl_next::DecodeError> {
6448 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
6449 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
6450 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireParentRef>(raw, decoder)?,
6451
6452 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSelfRef>(raw, decoder)?,
6453
6454 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireChildRef<'static>>(
6455 raw, decoder,
6456 )?,
6457
6458 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireCollectionRef<'static>>(
6459 raw, decoder,
6460 )?,
6461
6462 5 => {
6463 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFrameworkRef>(raw, decoder)?
6464 }
6465
6466 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireCapabilityRef<'static>>(
6467 raw, decoder,
6468 )?,
6469
6470 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDebugRef>(raw, decoder)?,
6471
6472 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireVoidRef>(raw, decoder)?,
6473
6474 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEnvironmentRef>(
6475 raw, decoder,
6476 )?,
6477
6478 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
6479 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
6480 }
6481
6482 Ok(())
6483 }
6484}
6485
6486impl<'de> ::core::fmt::Debug for WireOptionalRef<'de> {
6487 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6488 self.as_ref().fmt(f)
6489 }
6490}
6491
6492#[doc = " Declares a storage capability backed by a directory from which data, cache,\n or meta storage can be offered.\n"]
6493#[derive(Clone, Debug, Default)]
6494pub struct Storage {
6495 pub name: Option<String>,
6496
6497 pub source: Option<crate::Ref>,
6498
6499 pub backing_dir: Option<String>,
6500
6501 pub subdir: Option<String>,
6502
6503 pub storage_id: Option<crate::StorageId>,
6504}
6505
6506impl Storage {
6507 fn __max_ordinal(&self) -> usize {
6508 if self.storage_id.is_some() {
6509 return 5;
6510 }
6511
6512 if self.subdir.is_some() {
6513 return 4;
6514 }
6515
6516 if self.backing_dir.is_some() {
6517 return 3;
6518 }
6519
6520 if self.source.is_some() {
6521 return 2;
6522 }
6523
6524 if self.name.is_some() {
6525 return 1;
6526 }
6527
6528 0
6529 }
6530}
6531
6532impl ::fidl_next::Encodable for Storage {
6533 type Encoded = WireStorage<'static>;
6534}
6535
6536unsafe impl<___E> ::fidl_next::Encode<___E> for Storage
6537where
6538 ___E: ::fidl_next::Encoder + ?Sized,
6539{
6540 #[inline]
6541 fn encode(
6542 mut self,
6543 encoder: &mut ___E,
6544 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6545 ) -> Result<(), ::fidl_next::EncodeError> {
6546 ::fidl_next::munge!(let WireStorage { table } = out);
6547
6548 let max_ord = self.__max_ordinal();
6549
6550 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
6551 ::fidl_next::Wire::zero_padding(&mut out);
6552
6553 let mut preallocated =
6554 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
6555
6556 for i in 1..=max_ord {
6557 match i {
6558 5 => {
6559 if let Some(storage_id) = self.storage_id.take() {
6560 ::fidl_next::WireEnvelope::encode_value(
6561 storage_id,
6562 preallocated.encoder,
6563 &mut out,
6564 )?;
6565 } else {
6566 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6567 }
6568 }
6569
6570 4 => {
6571 if let Some(subdir) = self.subdir.take() {
6572 ::fidl_next::WireEnvelope::encode_value(
6573 subdir,
6574 preallocated.encoder,
6575 &mut out,
6576 )?;
6577 } else {
6578 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6579 }
6580 }
6581
6582 3 => {
6583 if let Some(backing_dir) = self.backing_dir.take() {
6584 ::fidl_next::WireEnvelope::encode_value(
6585 backing_dir,
6586 preallocated.encoder,
6587 &mut out,
6588 )?;
6589 } else {
6590 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6591 }
6592 }
6593
6594 2 => {
6595 if let Some(source) = self.source.take() {
6596 ::fidl_next::WireEnvelope::encode_value(
6597 source,
6598 preallocated.encoder,
6599 &mut out,
6600 )?;
6601 } else {
6602 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6603 }
6604 }
6605
6606 1 => {
6607 if let Some(name) = self.name.take() {
6608 ::fidl_next::WireEnvelope::encode_value(
6609 name,
6610 preallocated.encoder,
6611 &mut out,
6612 )?;
6613 } else {
6614 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6615 }
6616 }
6617
6618 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
6619 }
6620 unsafe {
6621 preallocated.write_next(out.assume_init_ref());
6622 }
6623 }
6624
6625 ::fidl_next::WireTable::encode_len(table, max_ord);
6626
6627 Ok(())
6628 }
6629}
6630
6631unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Storage
6632where
6633 ___E: ::fidl_next::Encoder + ?Sized,
6634{
6635 #[inline]
6636 fn encode_ref(
6637 &self,
6638 encoder: &mut ___E,
6639 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6640 ) -> Result<(), ::fidl_next::EncodeError> {
6641 ::fidl_next::munge!(let WireStorage { table } = out);
6642
6643 let max_ord = self.__max_ordinal();
6644
6645 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
6646 ::fidl_next::Wire::zero_padding(&mut out);
6647
6648 let mut preallocated =
6649 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
6650
6651 for i in 1..=max_ord {
6652 match i {
6653 5 => {
6654 if let Some(storage_id) = &self.storage_id {
6655 ::fidl_next::WireEnvelope::encode_value(
6656 storage_id,
6657 preallocated.encoder,
6658 &mut out,
6659 )?;
6660 } else {
6661 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6662 }
6663 }
6664
6665 4 => {
6666 if let Some(subdir) = &self.subdir {
6667 ::fidl_next::WireEnvelope::encode_value(
6668 subdir,
6669 preallocated.encoder,
6670 &mut out,
6671 )?;
6672 } else {
6673 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6674 }
6675 }
6676
6677 3 => {
6678 if let Some(backing_dir) = &self.backing_dir {
6679 ::fidl_next::WireEnvelope::encode_value(
6680 backing_dir,
6681 preallocated.encoder,
6682 &mut out,
6683 )?;
6684 } else {
6685 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6686 }
6687 }
6688
6689 2 => {
6690 if let Some(source) = &self.source {
6691 ::fidl_next::WireEnvelope::encode_value(
6692 source,
6693 preallocated.encoder,
6694 &mut out,
6695 )?;
6696 } else {
6697 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6698 }
6699 }
6700
6701 1 => {
6702 if let Some(name) = &self.name {
6703 ::fidl_next::WireEnvelope::encode_value(
6704 name,
6705 preallocated.encoder,
6706 &mut out,
6707 )?;
6708 } else {
6709 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6710 }
6711 }
6712
6713 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
6714 }
6715 unsafe {
6716 preallocated.write_next(out.assume_init_ref());
6717 }
6718 }
6719
6720 ::fidl_next::WireTable::encode_len(table, max_ord);
6721
6722 Ok(())
6723 }
6724}
6725
6726impl<'de> ::fidl_next::FromWire<WireStorage<'de>> for Storage {
6727 #[inline]
6728 fn from_wire(wire: WireStorage<'de>) -> Self {
6729 let wire = ::core::mem::ManuallyDrop::new(wire);
6730
6731 let name = wire.table.get(1);
6732
6733 let source = wire.table.get(2);
6734
6735 let backing_dir = wire.table.get(3);
6736
6737 let subdir = wire.table.get(4);
6738
6739 let storage_id = wire.table.get(5);
6740
6741 Self {
6742 name: name.map(|envelope| {
6743 ::fidl_next::FromWire::from_wire(unsafe {
6744 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
6745 })
6746 }),
6747
6748 source: source.map(|envelope| {
6749 ::fidl_next::FromWire::from_wire(unsafe {
6750 envelope.read_unchecked::<crate::WireRef<'de>>()
6751 })
6752 }),
6753
6754 backing_dir: backing_dir.map(|envelope| {
6755 ::fidl_next::FromWire::from_wire(unsafe {
6756 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
6757 })
6758 }),
6759
6760 subdir: subdir.map(|envelope| {
6761 ::fidl_next::FromWire::from_wire(unsafe {
6762 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
6763 })
6764 }),
6765
6766 storage_id: storage_id.map(|envelope| {
6767 ::fidl_next::FromWire::from_wire(unsafe {
6768 envelope.read_unchecked::<crate::WireStorageId>()
6769 })
6770 }),
6771 }
6772 }
6773}
6774
6775impl<'de> ::fidl_next::FromWireRef<WireStorage<'de>> for Storage {
6776 #[inline]
6777 fn from_wire_ref(wire: &WireStorage<'de>) -> Self {
6778 Self {
6779 name: wire.table.get(1).map(|envelope| {
6780 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6781 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
6782 })
6783 }),
6784
6785 source: wire.table.get(2).map(|envelope| {
6786 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6787 envelope.deref_unchecked::<crate::WireRef<'de>>()
6788 })
6789 }),
6790
6791 backing_dir: wire.table.get(3).map(|envelope| {
6792 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6793 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
6794 })
6795 }),
6796
6797 subdir: wire.table.get(4).map(|envelope| {
6798 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6799 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
6800 })
6801 }),
6802
6803 storage_id: wire.table.get(5).map(|envelope| {
6804 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6805 envelope.deref_unchecked::<crate::WireStorageId>()
6806 })
6807 }),
6808 }
6809 }
6810}
6811
6812#[repr(C)]
6814pub struct WireStorage<'de> {
6815 table: ::fidl_next::WireTable<'de>,
6816}
6817
6818impl<'de> Drop for WireStorage<'de> {
6819 fn drop(&mut self) {
6820 let _ = self
6821 .table
6822 .get(1)
6823 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
6824
6825 let _ = self
6826 .table
6827 .get(2)
6828 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
6829
6830 let _ = self
6831 .table
6832 .get(3)
6833 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
6834
6835 let _ = self
6836 .table
6837 .get(4)
6838 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
6839
6840 let _ = self
6841 .table
6842 .get(5)
6843 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireStorageId>() });
6844 }
6845}
6846
6847unsafe impl ::fidl_next::Wire for WireStorage<'static> {
6848 type Decoded<'de> = WireStorage<'de>;
6849
6850 #[inline]
6851 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6852 ::fidl_next::munge!(let Self { table } = out);
6853 ::fidl_next::WireTable::zero_padding(table);
6854 }
6855}
6856
6857unsafe impl<___D> ::fidl_next::Decode<___D> for WireStorage<'static>
6858where
6859 ___D: ::fidl_next::Decoder + ?Sized,
6860{
6861 fn decode(
6862 slot: ::fidl_next::Slot<'_, Self>,
6863 decoder: &mut ___D,
6864 ) -> Result<(), ::fidl_next::DecodeError> {
6865 ::fidl_next::munge!(let Self { table } = slot);
6866
6867 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6868 match ordinal {
6869 0 => unsafe { ::core::hint::unreachable_unchecked() },
6870
6871 1 => {
6872 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
6873 slot.as_mut(),
6874 decoder,
6875 )?;
6876
6877 let name = unsafe {
6878 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
6879 };
6880
6881 if name.len() > 100 {
6882 return Err(::fidl_next::DecodeError::VectorTooLong {
6883 size: name.len() as u64,
6884 limit: 100,
6885 });
6886 }
6887
6888 Ok(())
6889 }
6890
6891 2 => {
6892 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
6893 slot.as_mut(),
6894 decoder,
6895 )?;
6896
6897 Ok(())
6898 }
6899
6900 3 => {
6901 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
6902 slot.as_mut(),
6903 decoder,
6904 )?;
6905
6906 let backing_dir = unsafe {
6907 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
6908 };
6909
6910 if backing_dir.len() > 100 {
6911 return Err(::fidl_next::DecodeError::VectorTooLong {
6912 size: backing_dir.len() as u64,
6913 limit: 100,
6914 });
6915 }
6916
6917 Ok(())
6918 }
6919
6920 4 => {
6921 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
6922 slot.as_mut(),
6923 decoder,
6924 )?;
6925
6926 let subdir = unsafe {
6927 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
6928 };
6929
6930 if subdir.len() > 1024 {
6931 return Err(::fidl_next::DecodeError::VectorTooLong {
6932 size: subdir.len() as u64,
6933 limit: 1024,
6934 });
6935 }
6936
6937 Ok(())
6938 }
6939
6940 5 => {
6941 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireStorageId>(
6942 slot.as_mut(),
6943 decoder,
6944 )?;
6945
6946 Ok(())
6947 }
6948
6949 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
6950 }
6951 })
6952 }
6953}
6954
6955impl<'de> WireStorage<'de> {
6956 pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
6957 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6958 }
6959
6960 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
6961 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
6962 }
6963
6964 pub fn backing_dir(&self) -> Option<&::fidl_next::WireString<'de>> {
6965 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
6966 }
6967
6968 pub fn subdir(&self) -> Option<&::fidl_next::WireString<'de>> {
6969 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
6970 }
6971
6972 pub fn storage_id(&self) -> Option<&crate::WireStorageId> {
6973 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
6974 }
6975}
6976
6977impl<'de> ::core::fmt::Debug for WireStorage<'de> {
6978 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
6979 f.debug_struct("Storage")
6980 .field("name", &self.name())
6981 .field("source", &self.source())
6982 .field("backing_dir", &self.backing_dir())
6983 .field("subdir", &self.subdir())
6984 .field("storage_id", &self.storage_id())
6985 .finish()
6986 }
6987}
6988
6989#[doc = " Declares a dictionary capability.\n"]
6990#[derive(Clone, Debug, Default)]
6991pub struct Dictionary {
6992 pub name: Option<String>,
6993
6994 pub source: Option<crate::Ref>,
6995
6996 pub source_dictionary: Option<String>,
6997
6998 pub source_path: Option<String>,
6999}
7000
7001impl Dictionary {
7002 fn __max_ordinal(&self) -> usize {
7003 if self.source_path.is_some() {
7004 return 4;
7005 }
7006
7007 if self.source_dictionary.is_some() {
7008 return 3;
7009 }
7010
7011 if self.source.is_some() {
7012 return 2;
7013 }
7014
7015 if self.name.is_some() {
7016 return 1;
7017 }
7018
7019 0
7020 }
7021}
7022
7023impl ::fidl_next::Encodable for Dictionary {
7024 type Encoded = WireDictionary<'static>;
7025}
7026
7027unsafe impl<___E> ::fidl_next::Encode<___E> for Dictionary
7028where
7029 ___E: ::fidl_next::Encoder + ?Sized,
7030{
7031 #[inline]
7032 fn encode(
7033 mut self,
7034 encoder: &mut ___E,
7035 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7036 ) -> Result<(), ::fidl_next::EncodeError> {
7037 ::fidl_next::munge!(let WireDictionary { table } = out);
7038
7039 let max_ord = self.__max_ordinal();
7040
7041 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7042 ::fidl_next::Wire::zero_padding(&mut out);
7043
7044 let mut preallocated =
7045 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7046
7047 for i in 1..=max_ord {
7048 match i {
7049 4 => {
7050 if let Some(source_path) = self.source_path.take() {
7051 ::fidl_next::WireEnvelope::encode_value(
7052 source_path,
7053 preallocated.encoder,
7054 &mut out,
7055 )?;
7056 } else {
7057 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7058 }
7059 }
7060
7061 3 => {
7062 if let Some(source_dictionary) = self.source_dictionary.take() {
7063 ::fidl_next::WireEnvelope::encode_value(
7064 source_dictionary,
7065 preallocated.encoder,
7066 &mut out,
7067 )?;
7068 } else {
7069 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7070 }
7071 }
7072
7073 2 => {
7074 if let Some(source) = self.source.take() {
7075 ::fidl_next::WireEnvelope::encode_value(
7076 source,
7077 preallocated.encoder,
7078 &mut out,
7079 )?;
7080 } else {
7081 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7082 }
7083 }
7084
7085 1 => {
7086 if let Some(name) = self.name.take() {
7087 ::fidl_next::WireEnvelope::encode_value(
7088 name,
7089 preallocated.encoder,
7090 &mut out,
7091 )?;
7092 } else {
7093 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7094 }
7095 }
7096
7097 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7098 }
7099 unsafe {
7100 preallocated.write_next(out.assume_init_ref());
7101 }
7102 }
7103
7104 ::fidl_next::WireTable::encode_len(table, max_ord);
7105
7106 Ok(())
7107 }
7108}
7109
7110unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Dictionary
7111where
7112 ___E: ::fidl_next::Encoder + ?Sized,
7113{
7114 #[inline]
7115 fn encode_ref(
7116 &self,
7117 encoder: &mut ___E,
7118 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7119 ) -> Result<(), ::fidl_next::EncodeError> {
7120 ::fidl_next::munge!(let WireDictionary { table } = out);
7121
7122 let max_ord = self.__max_ordinal();
7123
7124 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7125 ::fidl_next::Wire::zero_padding(&mut out);
7126
7127 let mut preallocated =
7128 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7129
7130 for i in 1..=max_ord {
7131 match i {
7132 4 => {
7133 if let Some(source_path) = &self.source_path {
7134 ::fidl_next::WireEnvelope::encode_value(
7135 source_path,
7136 preallocated.encoder,
7137 &mut out,
7138 )?;
7139 } else {
7140 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7141 }
7142 }
7143
7144 3 => {
7145 if let Some(source_dictionary) = &self.source_dictionary {
7146 ::fidl_next::WireEnvelope::encode_value(
7147 source_dictionary,
7148 preallocated.encoder,
7149 &mut out,
7150 )?;
7151 } else {
7152 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7153 }
7154 }
7155
7156 2 => {
7157 if let Some(source) = &self.source {
7158 ::fidl_next::WireEnvelope::encode_value(
7159 source,
7160 preallocated.encoder,
7161 &mut out,
7162 )?;
7163 } else {
7164 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7165 }
7166 }
7167
7168 1 => {
7169 if let Some(name) = &self.name {
7170 ::fidl_next::WireEnvelope::encode_value(
7171 name,
7172 preallocated.encoder,
7173 &mut out,
7174 )?;
7175 } else {
7176 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7177 }
7178 }
7179
7180 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7181 }
7182 unsafe {
7183 preallocated.write_next(out.assume_init_ref());
7184 }
7185 }
7186
7187 ::fidl_next::WireTable::encode_len(table, max_ord);
7188
7189 Ok(())
7190 }
7191}
7192
7193impl<'de> ::fidl_next::FromWire<WireDictionary<'de>> for Dictionary {
7194 #[inline]
7195 fn from_wire(wire: WireDictionary<'de>) -> Self {
7196 let wire = ::core::mem::ManuallyDrop::new(wire);
7197
7198 let name = wire.table.get(1);
7199
7200 let source = wire.table.get(2);
7201
7202 let source_dictionary = wire.table.get(3);
7203
7204 let source_path = wire.table.get(4);
7205
7206 Self {
7207 name: name.map(|envelope| {
7208 ::fidl_next::FromWire::from_wire(unsafe {
7209 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7210 })
7211 }),
7212
7213 source: source.map(|envelope| {
7214 ::fidl_next::FromWire::from_wire(unsafe {
7215 envelope.read_unchecked::<crate::WireRef<'de>>()
7216 })
7217 }),
7218
7219 source_dictionary: source_dictionary.map(|envelope| {
7220 ::fidl_next::FromWire::from_wire(unsafe {
7221 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7222 })
7223 }),
7224
7225 source_path: source_path.map(|envelope| {
7226 ::fidl_next::FromWire::from_wire(unsafe {
7227 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7228 })
7229 }),
7230 }
7231 }
7232}
7233
7234impl<'de> ::fidl_next::FromWireRef<WireDictionary<'de>> for Dictionary {
7235 #[inline]
7236 fn from_wire_ref(wire: &WireDictionary<'de>) -> Self {
7237 Self {
7238 name: wire.table.get(1).map(|envelope| {
7239 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7240 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7241 })
7242 }),
7243
7244 source: wire.table.get(2).map(|envelope| {
7245 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7246 envelope.deref_unchecked::<crate::WireRef<'de>>()
7247 })
7248 }),
7249
7250 source_dictionary: wire.table.get(3).map(|envelope| {
7251 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7252 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7253 })
7254 }),
7255
7256 source_path: wire.table.get(4).map(|envelope| {
7257 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7258 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7259 })
7260 }),
7261 }
7262 }
7263}
7264
7265#[repr(C)]
7267pub struct WireDictionary<'de> {
7268 table: ::fidl_next::WireTable<'de>,
7269}
7270
7271impl<'de> Drop for WireDictionary<'de> {
7272 fn drop(&mut self) {
7273 let _ = self
7274 .table
7275 .get(1)
7276 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
7277
7278 let _ = self
7279 .table
7280 .get(2)
7281 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
7282
7283 let _ = self
7284 .table
7285 .get(3)
7286 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
7287
7288 let _ = self
7289 .table
7290 .get(4)
7291 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
7292 }
7293}
7294
7295unsafe impl ::fidl_next::Wire for WireDictionary<'static> {
7296 type Decoded<'de> = WireDictionary<'de>;
7297
7298 #[inline]
7299 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7300 ::fidl_next::munge!(let Self { table } = out);
7301 ::fidl_next::WireTable::zero_padding(table);
7302 }
7303}
7304
7305unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionary<'static>
7306where
7307 ___D: ::fidl_next::Decoder + ?Sized,
7308{
7309 fn decode(
7310 slot: ::fidl_next::Slot<'_, Self>,
7311 decoder: &mut ___D,
7312 ) -> Result<(), ::fidl_next::DecodeError> {
7313 ::fidl_next::munge!(let Self { table } = slot);
7314
7315 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
7316 match ordinal {
7317 0 => unsafe { ::core::hint::unreachable_unchecked() },
7318
7319 1 => {
7320 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
7321 slot.as_mut(),
7322 decoder,
7323 )?;
7324
7325 let name = unsafe {
7326 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
7327 };
7328
7329 if name.len() > 100 {
7330 return Err(::fidl_next::DecodeError::VectorTooLong {
7331 size: name.len() as u64,
7332 limit: 100,
7333 });
7334 }
7335
7336 Ok(())
7337 }
7338
7339 2 => {
7340 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
7341 slot.as_mut(),
7342 decoder,
7343 )?;
7344
7345 Ok(())
7346 }
7347
7348 3 => {
7349 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
7350 slot.as_mut(),
7351 decoder,
7352 )?;
7353
7354 let source_dictionary = unsafe {
7355 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
7356 };
7357
7358 if source_dictionary.len() > 1024 {
7359 return Err(::fidl_next::DecodeError::VectorTooLong {
7360 size: source_dictionary.len() as u64,
7361 limit: 1024,
7362 });
7363 }
7364
7365 Ok(())
7366 }
7367
7368 4 => {
7369 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
7370 slot.as_mut(),
7371 decoder,
7372 )?;
7373
7374 let source_path = unsafe {
7375 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
7376 };
7377
7378 if source_path.len() > 1024 {
7379 return Err(::fidl_next::DecodeError::VectorTooLong {
7380 size: source_path.len() as u64,
7381 limit: 1024,
7382 });
7383 }
7384
7385 Ok(())
7386 }
7387
7388 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
7389 }
7390 })
7391 }
7392}
7393
7394impl<'de> WireDictionary<'de> {
7395 pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
7396 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
7397 }
7398
7399 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
7400 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
7401 }
7402
7403 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
7404 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
7405 }
7406
7407 pub fn source_path(&self) -> Option<&::fidl_next::WireString<'de>> {
7408 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
7409 }
7410}
7411
7412impl<'de> ::core::fmt::Debug for WireDictionary<'de> {
7413 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
7414 f.debug_struct("Dictionary")
7415 .field("name", &self.name())
7416 .field("source", &self.source())
7417 .field("source_dictionary", &self.source_dictionary())
7418 .field("source_path", &self.source_path())
7419 .finish()
7420 }
7421}
7422
7423#[doc = " Declares a capability defined by this component.\n"]
7424#[derive(Clone, Debug)]
7425pub enum Capability {
7426 Service(crate::Service),
7427
7428 Protocol(crate::Protocol),
7429
7430 Directory(crate::Directory),
7431
7432 Storage(crate::Storage),
7433
7434 Runner(crate::Runner),
7435
7436 Resolver(crate::Resolver),
7437
7438 EventStream(crate::EventStream),
7439
7440 Dictionary(crate::Dictionary),
7441
7442 Config(crate::Configuration),
7443
7444 UnknownOrdinal_(u64),
7445}
7446
7447impl ::fidl_next::Encodable for Capability {
7448 type Encoded = WireCapability<'static>;
7449}
7450
7451unsafe impl<___E> ::fidl_next::Encode<___E> for Capability
7452where
7453 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7454 ___E: ::fidl_next::Encoder,
7455{
7456 #[inline]
7457 fn encode(
7458 self,
7459 encoder: &mut ___E,
7460 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7461 ) -> Result<(), ::fidl_next::EncodeError> {
7462 ::fidl_next::munge!(let WireCapability { raw, _phantom: _ } = out);
7463
7464 match self {
7465 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Service>(
7466 value, 1, encoder, raw,
7467 )?,
7468
7469 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Protocol>(
7470 value, 2, encoder, raw,
7471 )?,
7472
7473 Self::Directory(value) => {
7474 ::fidl_next::RawWireUnion::encode_as::<___E, crate::Directory>(
7475 value, 3, encoder, raw,
7476 )?
7477 }
7478
7479 Self::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Storage>(
7480 value, 4, encoder, raw,
7481 )?,
7482
7483 Self::Runner(value) => {
7484 ::fidl_next::RawWireUnion::encode_as::<___E, crate::Runner>(value, 5, encoder, raw)?
7485 }
7486
7487 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Resolver>(
7488 value, 6, encoder, raw,
7489 )?,
7490
7491 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
7492 ___E,
7493 crate::EventStream,
7494 >(value, 8, encoder, raw)?,
7495
7496 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
7497 ___E,
7498 crate::Dictionary,
7499 >(value, 9, encoder, raw)?,
7500
7501 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
7502 ___E,
7503 crate::Configuration,
7504 >(value, 10, encoder, raw)?,
7505
7506 Self::UnknownOrdinal_(ordinal) => {
7507 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
7508 }
7509 }
7510
7511 Ok(())
7512 }
7513}
7514
7515unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Capability
7516where
7517 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7518 ___E: ::fidl_next::Encoder,
7519{
7520 #[inline]
7521 fn encode_ref(
7522 &self,
7523 encoder: &mut ___E,
7524 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7525 ) -> Result<(), ::fidl_next::EncodeError> {
7526 ::fidl_next::munge!(let WireCapability { raw, _phantom: _ } = out);
7527
7528 match self {
7529 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::Service>(
7530 value, 1, encoder, raw,
7531 )?,
7532
7533 Self::Protocol(value) => {
7534 ::fidl_next::RawWireUnion::encode_as::<___E, &crate::Protocol>(
7535 value, 2, encoder, raw,
7536 )?
7537 }
7538
7539 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
7540 ___E,
7541 &crate::Directory,
7542 >(value, 3, encoder, raw)?,
7543
7544 Self::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::Storage>(
7545 value, 4, encoder, raw,
7546 )?,
7547
7548 Self::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::Runner>(
7549 value, 5, encoder, raw,
7550 )?,
7551
7552 Self::Resolver(value) => {
7553 ::fidl_next::RawWireUnion::encode_as::<___E, &crate::Resolver>(
7554 value, 6, encoder, raw,
7555 )?
7556 }
7557
7558 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
7559 ___E,
7560 &crate::EventStream,
7561 >(value, 8, encoder, raw)?,
7562
7563 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
7564 ___E,
7565 &crate::Dictionary,
7566 >(value, 9, encoder, raw)?,
7567
7568 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
7569 ___E,
7570 &crate::Configuration,
7571 >(value, 10, encoder, raw)?,
7572
7573 Self::UnknownOrdinal_(ordinal) => {
7574 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
7575 }
7576 }
7577
7578 Ok(())
7579 }
7580}
7581
7582impl ::fidl_next::EncodableOption for Capability {
7583 type EncodedOption = WireOptionalCapability<'static>;
7584}
7585
7586unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Capability
7587where
7588 ___E: ?Sized,
7589 Capability: ::fidl_next::Encode<___E>,
7590{
7591 #[inline]
7592 fn encode_option(
7593 this: Option<Self>,
7594 encoder: &mut ___E,
7595 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7596 ) -> Result<(), ::fidl_next::EncodeError> {
7597 ::fidl_next::munge!(let WireOptionalCapability { raw, _phantom: _ } = &mut *out);
7598
7599 if let Some(inner) = this {
7600 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7601 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
7602 } else {
7603 ::fidl_next::RawWireUnion::encode_absent(raw);
7604 }
7605
7606 Ok(())
7607 }
7608}
7609
7610unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Capability
7611where
7612 ___E: ?Sized,
7613 Capability: ::fidl_next::EncodeRef<___E>,
7614{
7615 #[inline]
7616 fn encode_option_ref(
7617 this: Option<&Self>,
7618 encoder: &mut ___E,
7619 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7620 ) -> Result<(), ::fidl_next::EncodeError> {
7621 ::fidl_next::munge!(let WireOptionalCapability { raw, _phantom: _ } = &mut *out);
7622
7623 if let Some(inner) = this {
7624 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7625 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
7626 } else {
7627 ::fidl_next::RawWireUnion::encode_absent(raw);
7628 }
7629
7630 Ok(())
7631 }
7632}
7633
7634impl<'de> ::fidl_next::FromWire<WireCapability<'de>> for Capability {
7635 #[inline]
7636 fn from_wire(wire: WireCapability<'de>) -> Self {
7637 let wire = ::core::mem::ManuallyDrop::new(wire);
7638 match wire.raw.ordinal() {
7639 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
7640 wire.raw.get().read_unchecked::<crate::WireService<'de>>()
7641 })),
7642
7643 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
7644 wire.raw.get().read_unchecked::<crate::WireProtocol<'de>>()
7645 })),
7646
7647 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
7648 wire.raw.get().read_unchecked::<crate::WireDirectory<'de>>()
7649 })),
7650
7651 4 => Self::Storage(::fidl_next::FromWire::from_wire(unsafe {
7652 wire.raw.get().read_unchecked::<crate::WireStorage<'de>>()
7653 })),
7654
7655 5 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
7656 wire.raw.get().read_unchecked::<crate::WireRunner<'de>>()
7657 })),
7658
7659 6 => Self::Resolver(::fidl_next::FromWire::from_wire(unsafe {
7660 wire.raw.get().read_unchecked::<crate::WireResolver<'de>>()
7661 })),
7662
7663 8 => Self::EventStream(::fidl_next::FromWire::from_wire(unsafe {
7664 wire.raw.get().read_unchecked::<crate::WireEventStream<'de>>()
7665 })),
7666
7667 9 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
7668 wire.raw.get().read_unchecked::<crate::WireDictionary<'de>>()
7669 })),
7670
7671 10 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
7672 wire.raw.get().read_unchecked::<crate::WireConfiguration<'de>>()
7673 })),
7674
7675 _ => unsafe { ::core::hint::unreachable_unchecked() },
7676 }
7677 }
7678}
7679
7680impl<'de> ::fidl_next::FromWireRef<WireCapability<'de>> for Capability {
7681 #[inline]
7682 fn from_wire_ref(wire: &WireCapability<'de>) -> Self {
7683 match wire.raw.ordinal() {
7684 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7685 wire.raw.get().deref_unchecked::<crate::WireService<'de>>()
7686 })),
7687
7688 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7689 wire.raw.get().deref_unchecked::<crate::WireProtocol<'de>>()
7690 })),
7691
7692 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7693 wire.raw.get().deref_unchecked::<crate::WireDirectory<'de>>()
7694 })),
7695
7696 4 => Self::Storage(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7697 wire.raw.get().deref_unchecked::<crate::WireStorage<'de>>()
7698 })),
7699
7700 5 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7701 wire.raw.get().deref_unchecked::<crate::WireRunner<'de>>()
7702 })),
7703
7704 6 => Self::Resolver(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7705 wire.raw.get().deref_unchecked::<crate::WireResolver<'de>>()
7706 })),
7707
7708 8 => Self::EventStream(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7709 wire.raw.get().deref_unchecked::<crate::WireEventStream<'de>>()
7710 })),
7711
7712 9 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7713 wire.raw.get().deref_unchecked::<crate::WireDictionary<'de>>()
7714 })),
7715
7716 10 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7717 wire.raw.get().deref_unchecked::<crate::WireConfiguration<'de>>()
7718 })),
7719
7720 _ => unsafe { ::core::hint::unreachable_unchecked() },
7721 }
7722 }
7723}
7724
7725impl<'de> ::fidl_next::FromWireOption<WireOptionalCapability<'de>> for Box<Capability> {
7726 #[inline]
7727 fn from_wire_option(wire: WireOptionalCapability<'de>) -> Option<Self> {
7728 if let Some(inner) = wire.into_option() {
7729 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
7730 } else {
7731 None
7732 }
7733 }
7734}
7735
7736impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalCapability<'de>> for Box<Capability> {
7737 #[inline]
7738 fn from_wire_option_ref(wire: &WireOptionalCapability<'de>) -> Option<Self> {
7739 if let Some(inner) = wire.as_ref() {
7740 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
7741 } else {
7742 None
7743 }
7744 }
7745}
7746
7747#[repr(transparent)]
7749pub struct WireCapability<'de> {
7750 raw: ::fidl_next::RawWireUnion,
7751 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
7752}
7753
7754impl<'de> Drop for WireCapability<'de> {
7755 fn drop(&mut self) {
7756 match self.raw.ordinal() {
7757 1 => {
7758 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireService<'de>>() };
7759 }
7760
7761 2 => {
7762 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireProtocol<'de>>() };
7763 }
7764
7765 3 => {
7766 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirectory<'de>>() };
7767 }
7768
7769 4 => {
7770 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireStorage<'de>>() };
7771 }
7772
7773 5 => {
7774 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireRunner<'de>>() };
7775 }
7776
7777 6 => {
7778 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireResolver<'de>>() };
7779 }
7780
7781 8 => {
7782 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireEventStream<'de>>() };
7783 }
7784
7785 9 => {
7786 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDictionary<'de>>() };
7787 }
7788
7789 10 => {
7790 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireConfiguration<'de>>() };
7791 }
7792
7793 _ => (),
7794 }
7795 }
7796}
7797
7798unsafe impl ::fidl_next::Wire for WireCapability<'static> {
7799 type Decoded<'de> = WireCapability<'de>;
7800
7801 #[inline]
7802 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7803 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7804 ::fidl_next::RawWireUnion::zero_padding(raw);
7805 }
7806}
7807
7808pub mod capability {
7809 pub enum Ref<'de> {
7810 Service(&'de crate::WireService<'de>),
7811
7812 Protocol(&'de crate::WireProtocol<'de>),
7813
7814 Directory(&'de crate::WireDirectory<'de>),
7815
7816 Storage(&'de crate::WireStorage<'de>),
7817
7818 Runner(&'de crate::WireRunner<'de>),
7819
7820 Resolver(&'de crate::WireResolver<'de>),
7821
7822 EventStream(&'de crate::WireEventStream<'de>),
7823
7824 Dictionary(&'de crate::WireDictionary<'de>),
7825
7826 Config(&'de crate::WireConfiguration<'de>),
7827
7828 UnknownOrdinal_(u64),
7829 }
7830}
7831
7832impl<'de> WireCapability<'de> {
7833 pub fn as_ref(&self) -> crate::capability::Ref<'_> {
7834 match self.raw.ordinal() {
7835 1 => crate::capability::Ref::Service(unsafe {
7836 self.raw.get().deref_unchecked::<crate::WireService<'_>>()
7837 }),
7838
7839 2 => crate::capability::Ref::Protocol(unsafe {
7840 self.raw.get().deref_unchecked::<crate::WireProtocol<'_>>()
7841 }),
7842
7843 3 => crate::capability::Ref::Directory(unsafe {
7844 self.raw.get().deref_unchecked::<crate::WireDirectory<'_>>()
7845 }),
7846
7847 4 => crate::capability::Ref::Storage(unsafe {
7848 self.raw.get().deref_unchecked::<crate::WireStorage<'_>>()
7849 }),
7850
7851 5 => crate::capability::Ref::Runner(unsafe {
7852 self.raw.get().deref_unchecked::<crate::WireRunner<'_>>()
7853 }),
7854
7855 6 => crate::capability::Ref::Resolver(unsafe {
7856 self.raw.get().deref_unchecked::<crate::WireResolver<'_>>()
7857 }),
7858
7859 8 => crate::capability::Ref::EventStream(unsafe {
7860 self.raw.get().deref_unchecked::<crate::WireEventStream<'_>>()
7861 }),
7862
7863 9 => crate::capability::Ref::Dictionary(unsafe {
7864 self.raw.get().deref_unchecked::<crate::WireDictionary<'_>>()
7865 }),
7866
7867 10 => crate::capability::Ref::Config(unsafe {
7868 self.raw.get().deref_unchecked::<crate::WireConfiguration<'_>>()
7869 }),
7870
7871 unknown => crate::capability::Ref::UnknownOrdinal_(unknown),
7872 }
7873 }
7874}
7875
7876unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapability<'static>
7877where
7878 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7879 ___D: ::fidl_next::Decoder,
7880{
7881 fn decode(
7882 mut slot: ::fidl_next::Slot<'_, Self>,
7883 decoder: &mut ___D,
7884 ) -> Result<(), ::fidl_next::DecodeError> {
7885 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7886 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7887 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireService<'static>>(
7888 raw, decoder,
7889 )?,
7890
7891 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireProtocol<'static>>(
7892 raw, decoder,
7893 )?,
7894
7895 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectory<'static>>(
7896 raw, decoder,
7897 )?,
7898
7899 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireStorage<'static>>(
7900 raw, decoder,
7901 )?,
7902
7903 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireRunner<'static>>(
7904 raw, decoder,
7905 )?,
7906
7907 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireResolver<'static>>(
7908 raw, decoder,
7909 )?,
7910
7911 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEventStream<'static>>(
7912 raw, decoder,
7913 )?,
7914
7915 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDictionary<'static>>(
7916 raw, decoder,
7917 )?,
7918
7919 10 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfiguration<'static>>(
7920 raw, decoder,
7921 )?,
7922
7923 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
7924 }
7925
7926 Ok(())
7927 }
7928}
7929
7930impl<'de> ::core::fmt::Debug for WireCapability<'de> {
7931 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7932 match self.raw.ordinal() {
7933 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireService<'_>>().fmt(f) },
7934 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireProtocol<'_>>().fmt(f) },
7935 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirectory<'_>>().fmt(f) },
7936 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireStorage<'_>>().fmt(f) },
7937 5 => unsafe { self.raw.get().deref_unchecked::<crate::WireRunner<'_>>().fmt(f) },
7938 6 => unsafe { self.raw.get().deref_unchecked::<crate::WireResolver<'_>>().fmt(f) },
7939 8 => unsafe { self.raw.get().deref_unchecked::<crate::WireEventStream<'_>>().fmt(f) },
7940 9 => unsafe { self.raw.get().deref_unchecked::<crate::WireDictionary<'_>>().fmt(f) },
7941 10 => unsafe {
7942 self.raw.get().deref_unchecked::<crate::WireConfiguration<'_>>().fmt(f)
7943 },
7944 _ => unsafe { ::core::hint::unreachable_unchecked() },
7945 }
7946 }
7947}
7948
7949#[repr(transparent)]
7950pub struct WireOptionalCapability<'de> {
7951 raw: ::fidl_next::RawWireUnion,
7952 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
7953}
7954
7955unsafe impl ::fidl_next::Wire for WireOptionalCapability<'static> {
7956 type Decoded<'de> = WireOptionalCapability<'de>;
7957
7958 #[inline]
7959 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7960 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
7961 ::fidl_next::RawWireUnion::zero_padding(raw);
7962 }
7963}
7964
7965impl<'de> WireOptionalCapability<'de> {
7966 pub fn is_some(&self) -> bool {
7967 self.raw.is_some()
7968 }
7969
7970 pub fn is_none(&self) -> bool {
7971 self.raw.is_none()
7972 }
7973
7974 pub fn as_ref(&self) -> Option<&WireCapability<'de>> {
7975 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
7976 }
7977
7978 pub fn into_option(self) -> Option<WireCapability<'de>> {
7979 if self.is_some() {
7980 Some(WireCapability { raw: self.raw, _phantom: ::core::marker::PhantomData })
7981 } else {
7982 None
7983 }
7984 }
7985}
7986
7987unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalCapability<'static>
7988where
7989 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7990 ___D: ::fidl_next::Decoder,
7991{
7992 fn decode(
7993 mut slot: ::fidl_next::Slot<'_, Self>,
7994 decoder: &mut ___D,
7995 ) -> Result<(), ::fidl_next::DecodeError> {
7996 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
7997 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7998 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireService<'static>>(
7999 raw, decoder,
8000 )?,
8001
8002 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireProtocol<'static>>(
8003 raw, decoder,
8004 )?,
8005
8006 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectory<'static>>(
8007 raw, decoder,
8008 )?,
8009
8010 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireStorage<'static>>(
8011 raw, decoder,
8012 )?,
8013
8014 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireRunner<'static>>(
8015 raw, decoder,
8016 )?,
8017
8018 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireResolver<'static>>(
8019 raw, decoder,
8020 )?,
8021
8022 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEventStream<'static>>(
8023 raw, decoder,
8024 )?,
8025
8026 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDictionary<'static>>(
8027 raw, decoder,
8028 )?,
8029
8030 10 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfiguration<'static>>(
8031 raw, decoder,
8032 )?,
8033
8034 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
8035 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
8036 }
8037
8038 Ok(())
8039 }
8040}
8041
8042impl<'de> ::core::fmt::Debug for WireOptionalCapability<'de> {
8043 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8044 self.as_ref().fmt(f)
8045 }
8046}
8047
8048#[doc = " Describes under what conditions the component may be started.\n"]
8049#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8050#[repr(u32)]
8051pub enum StartupMode {
8052 Lazy = 0,
8053 Eager = 1,
8054}
8055
8056impl ::fidl_next::Encodable for StartupMode {
8057 type Encoded = WireStartupMode;
8058}
8059impl ::std::convert::TryFrom<u32> for StartupMode {
8060 type Error = ::fidl_next::UnknownStrictEnumMemberError;
8061 fn try_from(value: u32) -> Result<Self, Self::Error> {
8062 match value {
8063 0 => Ok(Self::Lazy),
8064 1 => Ok(Self::Eager),
8065
8066 _ => Err(Self::Error::new(value.into())),
8067 }
8068 }
8069}
8070
8071unsafe impl<___E> ::fidl_next::Encode<___E> for StartupMode
8072where
8073 ___E: ?Sized,
8074{
8075 #[inline]
8076 fn encode(
8077 self,
8078 encoder: &mut ___E,
8079 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8080 ) -> Result<(), ::fidl_next::EncodeError> {
8081 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
8082 }
8083}
8084
8085unsafe impl<___E> ::fidl_next::EncodeRef<___E> for StartupMode
8086where
8087 ___E: ?Sized,
8088{
8089 #[inline]
8090 fn encode_ref(
8091 &self,
8092 encoder: &mut ___E,
8093 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8094 ) -> Result<(), ::fidl_next::EncodeError> {
8095 ::fidl_next::munge!(let WireStartupMode { value } = out);
8096 let _ = value.write(::fidl_next::WireU32::from(match *self {
8097 Self::Lazy => 0,
8098
8099 Self::Eager => 1,
8100 }));
8101
8102 Ok(())
8103 }
8104}
8105
8106impl ::core::convert::From<WireStartupMode> for StartupMode {
8107 fn from(wire: WireStartupMode) -> Self {
8108 match u32::from(wire.value) {
8109 0 => Self::Lazy,
8110
8111 1 => Self::Eager,
8112
8113 _ => unsafe { ::core::hint::unreachable_unchecked() },
8114 }
8115 }
8116}
8117
8118impl ::fidl_next::FromWire<WireStartupMode> for StartupMode {
8119 #[inline]
8120 fn from_wire(wire: WireStartupMode) -> Self {
8121 Self::from(wire)
8122 }
8123}
8124
8125impl ::fidl_next::FromWireRef<WireStartupMode> for StartupMode {
8126 #[inline]
8127 fn from_wire_ref(wire: &WireStartupMode) -> Self {
8128 Self::from(*wire)
8129 }
8130}
8131
8132#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8134#[repr(transparent)]
8135pub struct WireStartupMode {
8136 value: ::fidl_next::WireU32,
8137}
8138
8139unsafe impl ::fidl_next::Wire for WireStartupMode {
8140 type Decoded<'de> = Self;
8141
8142 #[inline]
8143 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
8144 }
8146}
8147
8148impl WireStartupMode {
8149 pub const LAZY: WireStartupMode = WireStartupMode { value: ::fidl_next::WireU32(0) };
8150
8151 pub const EAGER: WireStartupMode = WireStartupMode { value: ::fidl_next::WireU32(1) };
8152}
8153
8154unsafe impl<___D> ::fidl_next::Decode<___D> for WireStartupMode
8155where
8156 ___D: ?Sized,
8157{
8158 fn decode(
8159 slot: ::fidl_next::Slot<'_, Self>,
8160 _: &mut ___D,
8161 ) -> Result<(), ::fidl_next::DecodeError> {
8162 ::fidl_next::munge!(let Self { value } = slot);
8163
8164 match u32::from(*value) {
8165 0 | 1 => (),
8166 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
8167 }
8168
8169 Ok(())
8170 }
8171}
8172
8173impl ::core::convert::From<StartupMode> for WireStartupMode {
8174 fn from(natural: StartupMode) -> Self {
8175 match natural {
8176 StartupMode::Lazy => WireStartupMode::LAZY,
8177
8178 StartupMode::Eager => WireStartupMode::EAGER,
8179 }
8180 }
8181}
8182
8183#[doc = " Describes the action to take if this component instance terminates\n unexpectedly.\n"]
8184#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8185#[repr(u32)]
8186pub enum OnTerminate {
8187 None = 0,
8188 Reboot = 1,
8189}
8190
8191impl ::fidl_next::Encodable for OnTerminate {
8192 type Encoded = WireOnTerminate;
8193}
8194impl ::std::convert::TryFrom<u32> for OnTerminate {
8195 type Error = ::fidl_next::UnknownStrictEnumMemberError;
8196 fn try_from(value: u32) -> Result<Self, Self::Error> {
8197 match value {
8198 0 => Ok(Self::None),
8199 1 => Ok(Self::Reboot),
8200
8201 _ => Err(Self::Error::new(value.into())),
8202 }
8203 }
8204}
8205
8206unsafe impl<___E> ::fidl_next::Encode<___E> for OnTerminate
8207where
8208 ___E: ?Sized,
8209{
8210 #[inline]
8211 fn encode(
8212 self,
8213 encoder: &mut ___E,
8214 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8215 ) -> Result<(), ::fidl_next::EncodeError> {
8216 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
8217 }
8218}
8219
8220unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OnTerminate
8221where
8222 ___E: ?Sized,
8223{
8224 #[inline]
8225 fn encode_ref(
8226 &self,
8227 encoder: &mut ___E,
8228 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8229 ) -> Result<(), ::fidl_next::EncodeError> {
8230 ::fidl_next::munge!(let WireOnTerminate { value } = out);
8231 let _ = value.write(::fidl_next::WireU32::from(match *self {
8232 Self::None => 0,
8233
8234 Self::Reboot => 1,
8235 }));
8236
8237 Ok(())
8238 }
8239}
8240
8241impl ::core::convert::From<WireOnTerminate> for OnTerminate {
8242 fn from(wire: WireOnTerminate) -> Self {
8243 match u32::from(wire.value) {
8244 0 => Self::None,
8245
8246 1 => Self::Reboot,
8247
8248 _ => unsafe { ::core::hint::unreachable_unchecked() },
8249 }
8250 }
8251}
8252
8253impl ::fidl_next::FromWire<WireOnTerminate> for OnTerminate {
8254 #[inline]
8255 fn from_wire(wire: WireOnTerminate) -> Self {
8256 Self::from(wire)
8257 }
8258}
8259
8260impl ::fidl_next::FromWireRef<WireOnTerminate> for OnTerminate {
8261 #[inline]
8262 fn from_wire_ref(wire: &WireOnTerminate) -> Self {
8263 Self::from(*wire)
8264 }
8265}
8266
8267#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8269#[repr(transparent)]
8270pub struct WireOnTerminate {
8271 value: ::fidl_next::WireU32,
8272}
8273
8274unsafe impl ::fidl_next::Wire for WireOnTerminate {
8275 type Decoded<'de> = Self;
8276
8277 #[inline]
8278 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
8279 }
8281}
8282
8283impl WireOnTerminate {
8284 pub const NONE: WireOnTerminate = WireOnTerminate { value: ::fidl_next::WireU32(0) };
8285
8286 pub const REBOOT: WireOnTerminate = WireOnTerminate { value: ::fidl_next::WireU32(1) };
8287}
8288
8289unsafe impl<___D> ::fidl_next::Decode<___D> for WireOnTerminate
8290where
8291 ___D: ?Sized,
8292{
8293 fn decode(
8294 slot: ::fidl_next::Slot<'_, Self>,
8295 _: &mut ___D,
8296 ) -> Result<(), ::fidl_next::DecodeError> {
8297 ::fidl_next::munge!(let Self { value } = slot);
8298
8299 match u32::from(*value) {
8300 0 | 1 => (),
8301 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
8302 }
8303
8304 Ok(())
8305 }
8306}
8307
8308impl ::core::convert::From<OnTerminate> for WireOnTerminate {
8309 fn from(natural: OnTerminate) -> Self {
8310 match natural {
8311 OnTerminate::None => WireOnTerminate::NONE,
8312
8313 OnTerminate::Reboot => WireOnTerminate::REBOOT,
8314 }
8315 }
8316}
8317
8318#[doc = " The string identifier for a config field.\n"]
8319pub type ConfigKey = String;
8320
8321pub type WireConfigKey<'de> = ::fidl_next::WireString<'de>;
8323
8324#[doc = " A directive to override the value of a particular configuration field in the child.\n"]
8325#[derive(Clone, Debug, Default)]
8326pub struct ConfigOverride {
8327 pub key: Option<String>,
8328
8329 pub value: Option<crate::ConfigValue>,
8330}
8331
8332impl ConfigOverride {
8333 fn __max_ordinal(&self) -> usize {
8334 if self.value.is_some() {
8335 return 2;
8336 }
8337
8338 if self.key.is_some() {
8339 return 1;
8340 }
8341
8342 0
8343 }
8344}
8345
8346impl ::fidl_next::Encodable for ConfigOverride {
8347 type Encoded = WireConfigOverride<'static>;
8348}
8349
8350unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigOverride
8351where
8352 ___E: ::fidl_next::Encoder + ?Sized,
8353{
8354 #[inline]
8355 fn encode(
8356 mut self,
8357 encoder: &mut ___E,
8358 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8359 ) -> Result<(), ::fidl_next::EncodeError> {
8360 ::fidl_next::munge!(let WireConfigOverride { table } = out);
8361
8362 let max_ord = self.__max_ordinal();
8363
8364 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8365 ::fidl_next::Wire::zero_padding(&mut out);
8366
8367 let mut preallocated =
8368 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8369
8370 for i in 1..=max_ord {
8371 match i {
8372 2 => {
8373 if let Some(value) = self.value.take() {
8374 ::fidl_next::WireEnvelope::encode_value(
8375 value,
8376 preallocated.encoder,
8377 &mut out,
8378 )?;
8379 } else {
8380 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8381 }
8382 }
8383
8384 1 => {
8385 if let Some(key) = self.key.take() {
8386 ::fidl_next::WireEnvelope::encode_value(
8387 key,
8388 preallocated.encoder,
8389 &mut out,
8390 )?;
8391 } else {
8392 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8393 }
8394 }
8395
8396 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8397 }
8398 unsafe {
8399 preallocated.write_next(out.assume_init_ref());
8400 }
8401 }
8402
8403 ::fidl_next::WireTable::encode_len(table, max_ord);
8404
8405 Ok(())
8406 }
8407}
8408
8409unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigOverride
8410where
8411 ___E: ::fidl_next::Encoder + ?Sized,
8412{
8413 #[inline]
8414 fn encode_ref(
8415 &self,
8416 encoder: &mut ___E,
8417 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8418 ) -> Result<(), ::fidl_next::EncodeError> {
8419 ::fidl_next::munge!(let WireConfigOverride { table } = out);
8420
8421 let max_ord = self.__max_ordinal();
8422
8423 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8424 ::fidl_next::Wire::zero_padding(&mut out);
8425
8426 let mut preallocated =
8427 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8428
8429 for i in 1..=max_ord {
8430 match i {
8431 2 => {
8432 if let Some(value) = &self.value {
8433 ::fidl_next::WireEnvelope::encode_value(
8434 value,
8435 preallocated.encoder,
8436 &mut out,
8437 )?;
8438 } else {
8439 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8440 }
8441 }
8442
8443 1 => {
8444 if let Some(key) = &self.key {
8445 ::fidl_next::WireEnvelope::encode_value(
8446 key,
8447 preallocated.encoder,
8448 &mut out,
8449 )?;
8450 } else {
8451 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8452 }
8453 }
8454
8455 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8456 }
8457 unsafe {
8458 preallocated.write_next(out.assume_init_ref());
8459 }
8460 }
8461
8462 ::fidl_next::WireTable::encode_len(table, max_ord);
8463
8464 Ok(())
8465 }
8466}
8467
8468impl<'de> ::fidl_next::FromWire<WireConfigOverride<'de>> for ConfigOverride {
8469 #[inline]
8470 fn from_wire(wire: WireConfigOverride<'de>) -> Self {
8471 let wire = ::core::mem::ManuallyDrop::new(wire);
8472
8473 let key = wire.table.get(1);
8474
8475 let value = wire.table.get(2);
8476
8477 Self {
8478 key: key.map(|envelope| {
8479 ::fidl_next::FromWire::from_wire(unsafe {
8480 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
8481 })
8482 }),
8483
8484 value: value.map(|envelope| {
8485 ::fidl_next::FromWire::from_wire(unsafe {
8486 envelope.read_unchecked::<crate::WireConfigValue<'de>>()
8487 })
8488 }),
8489 }
8490 }
8491}
8492
8493impl<'de> ::fidl_next::FromWireRef<WireConfigOverride<'de>> for ConfigOverride {
8494 #[inline]
8495 fn from_wire_ref(wire: &WireConfigOverride<'de>) -> Self {
8496 Self {
8497 key: wire.table.get(1).map(|envelope| {
8498 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8499 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
8500 })
8501 }),
8502
8503 value: wire.table.get(2).map(|envelope| {
8504 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8505 envelope.deref_unchecked::<crate::WireConfigValue<'de>>()
8506 })
8507 }),
8508 }
8509 }
8510}
8511
8512#[repr(C)]
8514pub struct WireConfigOverride<'de> {
8515 table: ::fidl_next::WireTable<'de>,
8516}
8517
8518impl<'de> Drop for WireConfigOverride<'de> {
8519 fn drop(&mut self) {
8520 let _ = self
8521 .table
8522 .get(1)
8523 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
8524
8525 let _ = self
8526 .table
8527 .get(2)
8528 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigValue<'de>>() });
8529 }
8530}
8531
8532unsafe impl ::fidl_next::Wire for WireConfigOverride<'static> {
8533 type Decoded<'de> = WireConfigOverride<'de>;
8534
8535 #[inline]
8536 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8537 ::fidl_next::munge!(let Self { table } = out);
8538 ::fidl_next::WireTable::zero_padding(table);
8539 }
8540}
8541
8542unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigOverride<'static>
8543where
8544 ___D: ::fidl_next::Decoder + ?Sized,
8545{
8546 fn decode(
8547 slot: ::fidl_next::Slot<'_, Self>,
8548 decoder: &mut ___D,
8549 ) -> Result<(), ::fidl_next::DecodeError> {
8550 ::fidl_next::munge!(let Self { table } = slot);
8551
8552 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8553 match ordinal {
8554 0 => unsafe { ::core::hint::unreachable_unchecked() },
8555
8556 1 => {
8557 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
8558 slot.as_mut(),
8559 decoder,
8560 )?;
8561
8562 let key = unsafe {
8563 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
8564 };
8565
8566 if key.len() > 64 {
8567 return Err(::fidl_next::DecodeError::VectorTooLong {
8568 size: key.len() as u64,
8569 limit: 64,
8570 });
8571 }
8572
8573 Ok(())
8574 }
8575
8576 2 => {
8577 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigValue<'static>>(
8578 slot.as_mut(),
8579 decoder,
8580 )?;
8581
8582 Ok(())
8583 }
8584
8585 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
8586 }
8587 })
8588 }
8589}
8590
8591impl<'de> WireConfigOverride<'de> {
8592 pub fn key(&self) -> Option<&::fidl_next::WireString<'de>> {
8593 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8594 }
8595
8596 pub fn value(&self) -> Option<&crate::WireConfigValue<'de>> {
8597 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
8598 }
8599}
8600
8601impl<'de> ::core::fmt::Debug for WireConfigOverride<'de> {
8602 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
8603 f.debug_struct("ConfigOverride")
8604 .field("key", &self.key())
8605 .field("value", &self.value())
8606 .finish()
8607 }
8608}
8609
8610#[doc = " Statically declares a child component instance.\n"]
8611#[derive(Clone, Debug, Default)]
8612pub struct Child {
8613 pub name: Option<String>,
8614
8615 pub url: Option<String>,
8616
8617 pub startup: Option<crate::StartupMode>,
8618
8619 pub environment: Option<String>,
8620
8621 pub on_terminate: Option<crate::OnTerminate>,
8622
8623 pub config_overrides: Option<Vec<crate::ConfigOverride>>,
8624}
8625
8626impl Child {
8627 fn __max_ordinal(&self) -> usize {
8628 if self.config_overrides.is_some() {
8629 return 6;
8630 }
8631
8632 if self.on_terminate.is_some() {
8633 return 5;
8634 }
8635
8636 if self.environment.is_some() {
8637 return 4;
8638 }
8639
8640 if self.startup.is_some() {
8641 return 3;
8642 }
8643
8644 if self.url.is_some() {
8645 return 2;
8646 }
8647
8648 if self.name.is_some() {
8649 return 1;
8650 }
8651
8652 0
8653 }
8654}
8655
8656impl ::fidl_next::Encodable for Child {
8657 type Encoded = WireChild<'static>;
8658}
8659
8660unsafe impl<___E> ::fidl_next::Encode<___E> for Child
8661where
8662 ___E: ::fidl_next::Encoder + ?Sized,
8663{
8664 #[inline]
8665 fn encode(
8666 mut self,
8667 encoder: &mut ___E,
8668 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8669 ) -> Result<(), ::fidl_next::EncodeError> {
8670 ::fidl_next::munge!(let WireChild { table } = out);
8671
8672 let max_ord = self.__max_ordinal();
8673
8674 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8675 ::fidl_next::Wire::zero_padding(&mut out);
8676
8677 let mut preallocated =
8678 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8679
8680 for i in 1..=max_ord {
8681 match i {
8682 6 => {
8683 if let Some(config_overrides) = self.config_overrides.take() {
8684 ::fidl_next::WireEnvelope::encode_value(
8685 config_overrides,
8686 preallocated.encoder,
8687 &mut out,
8688 )?;
8689 } else {
8690 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8691 }
8692 }
8693
8694 5 => {
8695 if let Some(on_terminate) = self.on_terminate.take() {
8696 ::fidl_next::WireEnvelope::encode_value(
8697 on_terminate,
8698 preallocated.encoder,
8699 &mut out,
8700 )?;
8701 } else {
8702 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8703 }
8704 }
8705
8706 4 => {
8707 if let Some(environment) = self.environment.take() {
8708 ::fidl_next::WireEnvelope::encode_value(
8709 environment,
8710 preallocated.encoder,
8711 &mut out,
8712 )?;
8713 } else {
8714 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8715 }
8716 }
8717
8718 3 => {
8719 if let Some(startup) = self.startup.take() {
8720 ::fidl_next::WireEnvelope::encode_value(
8721 startup,
8722 preallocated.encoder,
8723 &mut out,
8724 )?;
8725 } else {
8726 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8727 }
8728 }
8729
8730 2 => {
8731 if let Some(url) = self.url.take() {
8732 ::fidl_next::WireEnvelope::encode_value(
8733 url,
8734 preallocated.encoder,
8735 &mut out,
8736 )?;
8737 } else {
8738 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8739 }
8740 }
8741
8742 1 => {
8743 if let Some(name) = self.name.take() {
8744 ::fidl_next::WireEnvelope::encode_value(
8745 name,
8746 preallocated.encoder,
8747 &mut out,
8748 )?;
8749 } else {
8750 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8751 }
8752 }
8753
8754 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8755 }
8756 unsafe {
8757 preallocated.write_next(out.assume_init_ref());
8758 }
8759 }
8760
8761 ::fidl_next::WireTable::encode_len(table, max_ord);
8762
8763 Ok(())
8764 }
8765}
8766
8767unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Child
8768where
8769 ___E: ::fidl_next::Encoder + ?Sized,
8770{
8771 #[inline]
8772 fn encode_ref(
8773 &self,
8774 encoder: &mut ___E,
8775 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8776 ) -> Result<(), ::fidl_next::EncodeError> {
8777 ::fidl_next::munge!(let WireChild { table } = out);
8778
8779 let max_ord = self.__max_ordinal();
8780
8781 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8782 ::fidl_next::Wire::zero_padding(&mut out);
8783
8784 let mut preallocated =
8785 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8786
8787 for i in 1..=max_ord {
8788 match i {
8789 6 => {
8790 if let Some(config_overrides) = &self.config_overrides {
8791 ::fidl_next::WireEnvelope::encode_value(
8792 config_overrides,
8793 preallocated.encoder,
8794 &mut out,
8795 )?;
8796 } else {
8797 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8798 }
8799 }
8800
8801 5 => {
8802 if let Some(on_terminate) = &self.on_terminate {
8803 ::fidl_next::WireEnvelope::encode_value(
8804 on_terminate,
8805 preallocated.encoder,
8806 &mut out,
8807 )?;
8808 } else {
8809 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8810 }
8811 }
8812
8813 4 => {
8814 if let Some(environment) = &self.environment {
8815 ::fidl_next::WireEnvelope::encode_value(
8816 environment,
8817 preallocated.encoder,
8818 &mut out,
8819 )?;
8820 } else {
8821 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8822 }
8823 }
8824
8825 3 => {
8826 if let Some(startup) = &self.startup {
8827 ::fidl_next::WireEnvelope::encode_value(
8828 startup,
8829 preallocated.encoder,
8830 &mut out,
8831 )?;
8832 } else {
8833 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8834 }
8835 }
8836
8837 2 => {
8838 if let Some(url) = &self.url {
8839 ::fidl_next::WireEnvelope::encode_value(
8840 url,
8841 preallocated.encoder,
8842 &mut out,
8843 )?;
8844 } else {
8845 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8846 }
8847 }
8848
8849 1 => {
8850 if let Some(name) = &self.name {
8851 ::fidl_next::WireEnvelope::encode_value(
8852 name,
8853 preallocated.encoder,
8854 &mut out,
8855 )?;
8856 } else {
8857 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8858 }
8859 }
8860
8861 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8862 }
8863 unsafe {
8864 preallocated.write_next(out.assume_init_ref());
8865 }
8866 }
8867
8868 ::fidl_next::WireTable::encode_len(table, max_ord);
8869
8870 Ok(())
8871 }
8872}
8873
8874impl<'de> ::fidl_next::FromWire<WireChild<'de>> for Child {
8875 #[inline]
8876 fn from_wire(wire: WireChild<'de>) -> Self {
8877 let wire = ::core::mem::ManuallyDrop::new(wire);
8878
8879 let name = wire.table.get(1);
8880
8881 let url = wire.table.get(2);
8882
8883 let startup = wire.table.get(3);
8884
8885 let environment = wire.table.get(4);
8886
8887 let on_terminate = wire.table.get(5);
8888
8889 let config_overrides = wire.table.get(6);
8890
8891 Self {
8892
8893
8894 name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
8895 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
8896 )),
8897
8898
8899 url: url.map(|envelope| ::fidl_next::FromWire::from_wire(
8900 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
8901 )),
8902
8903
8904 startup: startup.map(|envelope| ::fidl_next::FromWire::from_wire(
8905 unsafe { envelope.read_unchecked::<crate::WireStartupMode>() }
8906 )),
8907
8908
8909 environment: environment.map(|envelope| ::fidl_next::FromWire::from_wire(
8910 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
8911 )),
8912
8913
8914 on_terminate: on_terminate.map(|envelope| ::fidl_next::FromWire::from_wire(
8915 unsafe { envelope.read_unchecked::<crate::WireOnTerminate>() }
8916 )),
8917
8918
8919 config_overrides: config_overrides.map(|envelope| ::fidl_next::FromWire::from_wire(
8920 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigOverride<'de>>>() }
8921 )),
8922
8923 }
8924 }
8925}
8926
8927impl<'de> ::fidl_next::FromWireRef<WireChild<'de>> for Child {
8928 #[inline]
8929 fn from_wire_ref(wire: &WireChild<'de>) -> Self {
8930 Self {
8931
8932
8933 name: wire.table.get(1)
8934 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
8935 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
8936 )),
8937
8938
8939 url: wire.table.get(2)
8940 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
8941 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
8942 )),
8943
8944
8945 startup: wire.table.get(3)
8946 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
8947 unsafe { envelope.deref_unchecked::<crate::WireStartupMode>() }
8948 )),
8949
8950
8951 environment: wire.table.get(4)
8952 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
8953 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
8954 )),
8955
8956
8957 on_terminate: wire.table.get(5)
8958 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
8959 unsafe { envelope.deref_unchecked::<crate::WireOnTerminate>() }
8960 )),
8961
8962
8963 config_overrides: wire.table.get(6)
8964 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
8965 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigOverride<'de>>>() }
8966 )),
8967
8968 }
8969 }
8970}
8971
8972#[repr(C)]
8974pub struct WireChild<'de> {
8975 table: ::fidl_next::WireTable<'de>,
8976}
8977
8978impl<'de> Drop for WireChild<'de> {
8979 fn drop(&mut self) {
8980 let _ = self
8981 .table
8982 .get(1)
8983 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
8984
8985 let _ = self
8986 .table
8987 .get(2)
8988 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
8989
8990 let _ = self
8991 .table
8992 .get(3)
8993 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireStartupMode>() });
8994
8995 let _ = self
8996 .table
8997 .get(4)
8998 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
8999
9000 let _ = self
9001 .table
9002 .get(5)
9003 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireOnTerminate>() });
9004
9005 let _ = self.table.get(6).map(|envelope| unsafe {
9006 envelope
9007 .read_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigOverride<'de>>>()
9008 });
9009 }
9010}
9011
9012unsafe impl ::fidl_next::Wire for WireChild<'static> {
9013 type Decoded<'de> = WireChild<'de>;
9014
9015 #[inline]
9016 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9017 ::fidl_next::munge!(let Self { table } = out);
9018 ::fidl_next::WireTable::zero_padding(table);
9019 }
9020}
9021
9022unsafe impl<___D> ::fidl_next::Decode<___D> for WireChild<'static>
9023where
9024 ___D: ::fidl_next::Decoder + ?Sized,
9025{
9026 fn decode(
9027 slot: ::fidl_next::Slot<'_, Self>,
9028 decoder: &mut ___D,
9029 ) -> Result<(), ::fidl_next::DecodeError> {
9030 ::fidl_next::munge!(let Self { table } = slot);
9031
9032 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9033 match ordinal {
9034 0 => unsafe { ::core::hint::unreachable_unchecked() },
9035
9036 1 => {
9037 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
9038 slot.as_mut(),
9039 decoder,
9040 )?;
9041
9042 let name = unsafe {
9043 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
9044 };
9045
9046 if name.len() > 1024 {
9047 return Err(::fidl_next::DecodeError::VectorTooLong {
9048 size: name.len() as u64,
9049 limit: 1024,
9050 });
9051 }
9052
9053 Ok(())
9054 }
9055
9056 2 => {
9057 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
9058 slot.as_mut(),
9059 decoder,
9060 )?;
9061
9062 let url = unsafe {
9063 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
9064 };
9065
9066 if url.len() > 4096 {
9067 return Err(::fidl_next::DecodeError::VectorTooLong {
9068 size: url.len() as u64,
9069 limit: 4096,
9070 });
9071 }
9072
9073 Ok(())
9074 }
9075
9076 3 => {
9077 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireStartupMode>(
9078 slot.as_mut(),
9079 decoder,
9080 )?;
9081
9082 Ok(())
9083 }
9084
9085 4 => {
9086 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
9087 slot.as_mut(),
9088 decoder,
9089 )?;
9090
9091 let environment = unsafe {
9092 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
9093 };
9094
9095 if environment.len() > 100 {
9096 return Err(::fidl_next::DecodeError::VectorTooLong {
9097 size: environment.len() as u64,
9098 limit: 100,
9099 });
9100 }
9101
9102 Ok(())
9103 }
9104
9105 5 => {
9106 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireOnTerminate>(
9107 slot.as_mut(),
9108 decoder,
9109 )?;
9110
9111 Ok(())
9112 }
9113
9114 6 => {
9115 ::fidl_next::WireEnvelope::decode_as::<
9116 ___D,
9117 ::fidl_next::WireVector<'static, crate::WireConfigOverride<'static>>,
9118 >(slot.as_mut(), decoder)?;
9119
9120 Ok(())
9121 }
9122
9123 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9124 }
9125 })
9126 }
9127}
9128
9129impl<'de> WireChild<'de> {
9130 pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
9131 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9132 }
9133
9134 pub fn url(&self) -> Option<&::fidl_next::WireString<'de>> {
9135 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9136 }
9137
9138 pub fn startup(&self) -> Option<&crate::WireStartupMode> {
9139 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
9140 }
9141
9142 pub fn environment(&self) -> Option<&::fidl_next::WireString<'de>> {
9143 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
9144 }
9145
9146 pub fn on_terminate(&self) -> Option<&crate::WireOnTerminate> {
9147 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
9148 }
9149
9150 pub fn config_overrides(
9151 &self,
9152 ) -> Option<&::fidl_next::WireVector<'de, crate::WireConfigOverride<'de>>> {
9153 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
9154 }
9155}
9156
9157impl<'de> ::core::fmt::Debug for WireChild<'de> {
9158 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
9159 f.debug_struct("Child")
9160 .field("name", &self.name())
9161 .field("url", &self.url())
9162 .field("startup", &self.startup())
9163 .field("environment", &self.environment())
9164 .field("on_terminate", &self.on_terminate())
9165 .field("config_overrides", &self.config_overrides())
9166 .finish()
9167 }
9168}
9169
9170#[doc = " The durability of component instances created in a collection.\n"]
9171#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9172#[repr(u32)]
9173pub enum Durability {
9174 Transient = 2,
9175 SingleRun = 3,
9176}
9177
9178impl ::fidl_next::Encodable for Durability {
9179 type Encoded = WireDurability;
9180}
9181impl ::std::convert::TryFrom<u32> for Durability {
9182 type Error = ::fidl_next::UnknownStrictEnumMemberError;
9183 fn try_from(value: u32) -> Result<Self, Self::Error> {
9184 match value {
9185 2 => Ok(Self::Transient),
9186 3 => Ok(Self::SingleRun),
9187
9188 _ => Err(Self::Error::new(value.into())),
9189 }
9190 }
9191}
9192
9193unsafe impl<___E> ::fidl_next::Encode<___E> for Durability
9194where
9195 ___E: ?Sized,
9196{
9197 #[inline]
9198 fn encode(
9199 self,
9200 encoder: &mut ___E,
9201 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9202 ) -> Result<(), ::fidl_next::EncodeError> {
9203 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
9204 }
9205}
9206
9207unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Durability
9208where
9209 ___E: ?Sized,
9210{
9211 #[inline]
9212 fn encode_ref(
9213 &self,
9214 encoder: &mut ___E,
9215 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9216 ) -> Result<(), ::fidl_next::EncodeError> {
9217 ::fidl_next::munge!(let WireDurability { value } = out);
9218 let _ = value.write(::fidl_next::WireU32::from(match *self {
9219 Self::Transient => 2,
9220
9221 Self::SingleRun => 3,
9222 }));
9223
9224 Ok(())
9225 }
9226}
9227
9228impl ::core::convert::From<WireDurability> for Durability {
9229 fn from(wire: WireDurability) -> Self {
9230 match u32::from(wire.value) {
9231 2 => Self::Transient,
9232
9233 3 => Self::SingleRun,
9234
9235 _ => unsafe { ::core::hint::unreachable_unchecked() },
9236 }
9237 }
9238}
9239
9240impl ::fidl_next::FromWire<WireDurability> for Durability {
9241 #[inline]
9242 fn from_wire(wire: WireDurability) -> Self {
9243 Self::from(wire)
9244 }
9245}
9246
9247impl ::fidl_next::FromWireRef<WireDurability> for Durability {
9248 #[inline]
9249 fn from_wire_ref(wire: &WireDurability) -> Self {
9250 Self::from(*wire)
9251 }
9252}
9253
9254#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9256#[repr(transparent)]
9257pub struct WireDurability {
9258 value: ::fidl_next::WireU32,
9259}
9260
9261unsafe impl ::fidl_next::Wire for WireDurability {
9262 type Decoded<'de> = Self;
9263
9264 #[inline]
9265 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
9266 }
9268}
9269
9270impl WireDurability {
9271 pub const TRANSIENT: WireDurability = WireDurability { value: ::fidl_next::WireU32(2) };
9272
9273 pub const SINGLE_RUN: WireDurability = WireDurability { value: ::fidl_next::WireU32(3) };
9274}
9275
9276unsafe impl<___D> ::fidl_next::Decode<___D> for WireDurability
9277where
9278 ___D: ?Sized,
9279{
9280 fn decode(
9281 slot: ::fidl_next::Slot<'_, Self>,
9282 _: &mut ___D,
9283 ) -> Result<(), ::fidl_next::DecodeError> {
9284 ::fidl_next::munge!(let Self { value } = slot);
9285
9286 match u32::from(*value) {
9287 2 | 3 => (),
9288 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
9289 }
9290
9291 Ok(())
9292 }
9293}
9294
9295impl ::core::convert::From<Durability> for WireDurability {
9296 fn from(natural: Durability) -> Self {
9297 match natural {
9298 Durability::Transient => WireDurability::TRANSIENT,
9299
9300 Durability::SingleRun => WireDurability::SINGLE_RUN,
9301 }
9302 }
9303}
9304
9305#[doc = " Statically declares a component instance collection.\n"]
9306#[derive(Clone, Debug, Default)]
9307pub struct Collection {
9308 pub name: Option<String>,
9309
9310 pub durability: Option<crate::Durability>,
9311
9312 pub environment: Option<String>,
9313
9314 pub allowed_offers: Option<crate::AllowedOffers>,
9315
9316 pub allow_long_names: Option<bool>,
9317
9318 pub persistent_storage: Option<bool>,
9319}
9320
9321impl Collection {
9322 fn __max_ordinal(&self) -> usize {
9323 if self.persistent_storage.is_some() {
9324 return 6;
9325 }
9326
9327 if self.allow_long_names.is_some() {
9328 return 5;
9329 }
9330
9331 if self.allowed_offers.is_some() {
9332 return 4;
9333 }
9334
9335 if self.environment.is_some() {
9336 return 3;
9337 }
9338
9339 if self.durability.is_some() {
9340 return 2;
9341 }
9342
9343 if self.name.is_some() {
9344 return 1;
9345 }
9346
9347 0
9348 }
9349}
9350
9351impl ::fidl_next::Encodable for Collection {
9352 type Encoded = WireCollection<'static>;
9353}
9354
9355unsafe impl<___E> ::fidl_next::Encode<___E> for Collection
9356where
9357 ___E: ::fidl_next::Encoder + ?Sized,
9358{
9359 #[inline]
9360 fn encode(
9361 mut self,
9362 encoder: &mut ___E,
9363 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9364 ) -> Result<(), ::fidl_next::EncodeError> {
9365 ::fidl_next::munge!(let WireCollection { table } = out);
9366
9367 let max_ord = self.__max_ordinal();
9368
9369 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9370 ::fidl_next::Wire::zero_padding(&mut out);
9371
9372 let mut preallocated =
9373 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9374
9375 for i in 1..=max_ord {
9376 match i {
9377 6 => {
9378 if let Some(persistent_storage) = self.persistent_storage.take() {
9379 ::fidl_next::WireEnvelope::encode_value(
9380 persistent_storage,
9381 preallocated.encoder,
9382 &mut out,
9383 )?;
9384 } else {
9385 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9386 }
9387 }
9388
9389 5 => {
9390 if let Some(allow_long_names) = self.allow_long_names.take() {
9391 ::fidl_next::WireEnvelope::encode_value(
9392 allow_long_names,
9393 preallocated.encoder,
9394 &mut out,
9395 )?;
9396 } else {
9397 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9398 }
9399 }
9400
9401 4 => {
9402 if let Some(allowed_offers) = self.allowed_offers.take() {
9403 ::fidl_next::WireEnvelope::encode_value(
9404 allowed_offers,
9405 preallocated.encoder,
9406 &mut out,
9407 )?;
9408 } else {
9409 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9410 }
9411 }
9412
9413 3 => {
9414 if let Some(environment) = self.environment.take() {
9415 ::fidl_next::WireEnvelope::encode_value(
9416 environment,
9417 preallocated.encoder,
9418 &mut out,
9419 )?;
9420 } else {
9421 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9422 }
9423 }
9424
9425 2 => {
9426 if let Some(durability) = self.durability.take() {
9427 ::fidl_next::WireEnvelope::encode_value(
9428 durability,
9429 preallocated.encoder,
9430 &mut out,
9431 )?;
9432 } else {
9433 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9434 }
9435 }
9436
9437 1 => {
9438 if let Some(name) = self.name.take() {
9439 ::fidl_next::WireEnvelope::encode_value(
9440 name,
9441 preallocated.encoder,
9442 &mut out,
9443 )?;
9444 } else {
9445 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9446 }
9447 }
9448
9449 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9450 }
9451 unsafe {
9452 preallocated.write_next(out.assume_init_ref());
9453 }
9454 }
9455
9456 ::fidl_next::WireTable::encode_len(table, max_ord);
9457
9458 Ok(())
9459 }
9460}
9461
9462unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Collection
9463where
9464 ___E: ::fidl_next::Encoder + ?Sized,
9465{
9466 #[inline]
9467 fn encode_ref(
9468 &self,
9469 encoder: &mut ___E,
9470 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9471 ) -> Result<(), ::fidl_next::EncodeError> {
9472 ::fidl_next::munge!(let WireCollection { table } = out);
9473
9474 let max_ord = self.__max_ordinal();
9475
9476 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9477 ::fidl_next::Wire::zero_padding(&mut out);
9478
9479 let mut preallocated =
9480 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9481
9482 for i in 1..=max_ord {
9483 match i {
9484 6 => {
9485 if let Some(persistent_storage) = &self.persistent_storage {
9486 ::fidl_next::WireEnvelope::encode_value(
9487 persistent_storage,
9488 preallocated.encoder,
9489 &mut out,
9490 )?;
9491 } else {
9492 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9493 }
9494 }
9495
9496 5 => {
9497 if let Some(allow_long_names) = &self.allow_long_names {
9498 ::fidl_next::WireEnvelope::encode_value(
9499 allow_long_names,
9500 preallocated.encoder,
9501 &mut out,
9502 )?;
9503 } else {
9504 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9505 }
9506 }
9507
9508 4 => {
9509 if let Some(allowed_offers) = &self.allowed_offers {
9510 ::fidl_next::WireEnvelope::encode_value(
9511 allowed_offers,
9512 preallocated.encoder,
9513 &mut out,
9514 )?;
9515 } else {
9516 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9517 }
9518 }
9519
9520 3 => {
9521 if let Some(environment) = &self.environment {
9522 ::fidl_next::WireEnvelope::encode_value(
9523 environment,
9524 preallocated.encoder,
9525 &mut out,
9526 )?;
9527 } else {
9528 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9529 }
9530 }
9531
9532 2 => {
9533 if let Some(durability) = &self.durability {
9534 ::fidl_next::WireEnvelope::encode_value(
9535 durability,
9536 preallocated.encoder,
9537 &mut out,
9538 )?;
9539 } else {
9540 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9541 }
9542 }
9543
9544 1 => {
9545 if let Some(name) = &self.name {
9546 ::fidl_next::WireEnvelope::encode_value(
9547 name,
9548 preallocated.encoder,
9549 &mut out,
9550 )?;
9551 } else {
9552 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9553 }
9554 }
9555
9556 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9557 }
9558 unsafe {
9559 preallocated.write_next(out.assume_init_ref());
9560 }
9561 }
9562
9563 ::fidl_next::WireTable::encode_len(table, max_ord);
9564
9565 Ok(())
9566 }
9567}
9568
9569impl<'de> ::fidl_next::FromWire<WireCollection<'de>> for Collection {
9570 #[inline]
9571 fn from_wire(wire: WireCollection<'de>) -> Self {
9572 let wire = ::core::mem::ManuallyDrop::new(wire);
9573
9574 let name = wire.table.get(1);
9575
9576 let durability = wire.table.get(2);
9577
9578 let environment = wire.table.get(3);
9579
9580 let allowed_offers = wire.table.get(4);
9581
9582 let allow_long_names = wire.table.get(5);
9583
9584 let persistent_storage = wire.table.get(6);
9585
9586 Self {
9587 name: name.map(|envelope| {
9588 ::fidl_next::FromWire::from_wire(unsafe {
9589 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
9590 })
9591 }),
9592
9593 durability: durability.map(|envelope| {
9594 ::fidl_next::FromWire::from_wire(unsafe {
9595 envelope.read_unchecked::<crate::WireDurability>()
9596 })
9597 }),
9598
9599 environment: environment.map(|envelope| {
9600 ::fidl_next::FromWire::from_wire(unsafe {
9601 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
9602 })
9603 }),
9604
9605 allowed_offers: allowed_offers.map(|envelope| {
9606 ::fidl_next::FromWire::from_wire(unsafe {
9607 envelope.read_unchecked::<crate::WireAllowedOffers>()
9608 })
9609 }),
9610
9611 allow_long_names: allow_long_names.map(|envelope| {
9612 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
9613 }),
9614
9615 persistent_storage: persistent_storage.map(|envelope| {
9616 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
9617 }),
9618 }
9619 }
9620}
9621
9622impl<'de> ::fidl_next::FromWireRef<WireCollection<'de>> for Collection {
9623 #[inline]
9624 fn from_wire_ref(wire: &WireCollection<'de>) -> Self {
9625 Self {
9626 name: wire.table.get(1).map(|envelope| {
9627 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9628 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
9629 })
9630 }),
9631
9632 durability: wire.table.get(2).map(|envelope| {
9633 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9634 envelope.deref_unchecked::<crate::WireDurability>()
9635 })
9636 }),
9637
9638 environment: wire.table.get(3).map(|envelope| {
9639 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9640 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
9641 })
9642 }),
9643
9644 allowed_offers: wire.table.get(4).map(|envelope| {
9645 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9646 envelope.deref_unchecked::<crate::WireAllowedOffers>()
9647 })
9648 }),
9649
9650 allow_long_names: wire.table.get(5).map(|envelope| {
9651 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9652 envelope.deref_unchecked::<bool>()
9653 })
9654 }),
9655
9656 persistent_storage: wire.table.get(6).map(|envelope| {
9657 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9658 envelope.deref_unchecked::<bool>()
9659 })
9660 }),
9661 }
9662 }
9663}
9664
9665#[repr(C)]
9667pub struct WireCollection<'de> {
9668 table: ::fidl_next::WireTable<'de>,
9669}
9670
9671impl<'de> Drop for WireCollection<'de> {
9672 fn drop(&mut self) {
9673 let _ = self
9674 .table
9675 .get(1)
9676 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
9677
9678 let _ = self
9679 .table
9680 .get(2)
9681 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDurability>() });
9682
9683 let _ = self
9684 .table
9685 .get(3)
9686 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
9687
9688 let _ = self
9689 .table
9690 .get(4)
9691 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAllowedOffers>() });
9692
9693 let _ = self.table.get(5).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9694
9695 let _ = self.table.get(6).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
9696 }
9697}
9698
9699unsafe impl ::fidl_next::Wire for WireCollection<'static> {
9700 type Decoded<'de> = WireCollection<'de>;
9701
9702 #[inline]
9703 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9704 ::fidl_next::munge!(let Self { table } = out);
9705 ::fidl_next::WireTable::zero_padding(table);
9706 }
9707}
9708
9709unsafe impl<___D> ::fidl_next::Decode<___D> for WireCollection<'static>
9710where
9711 ___D: ::fidl_next::Decoder + ?Sized,
9712{
9713 fn decode(
9714 slot: ::fidl_next::Slot<'_, Self>,
9715 decoder: &mut ___D,
9716 ) -> Result<(), ::fidl_next::DecodeError> {
9717 ::fidl_next::munge!(let Self { table } = slot);
9718
9719 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9720 match ordinal {
9721 0 => unsafe { ::core::hint::unreachable_unchecked() },
9722
9723 1 => {
9724 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
9725 slot.as_mut(),
9726 decoder,
9727 )?;
9728
9729 let name = unsafe {
9730 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
9731 };
9732
9733 if name.len() > 100 {
9734 return Err(::fidl_next::DecodeError::VectorTooLong {
9735 size: name.len() as u64,
9736 limit: 100,
9737 });
9738 }
9739
9740 Ok(())
9741 }
9742
9743 2 => {
9744 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDurability>(
9745 slot.as_mut(),
9746 decoder,
9747 )?;
9748
9749 Ok(())
9750 }
9751
9752 3 => {
9753 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
9754 slot.as_mut(),
9755 decoder,
9756 )?;
9757
9758 let environment = unsafe {
9759 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
9760 };
9761
9762 if environment.len() > 100 {
9763 return Err(::fidl_next::DecodeError::VectorTooLong {
9764 size: environment.len() as u64,
9765 limit: 100,
9766 });
9767 }
9768
9769 Ok(())
9770 }
9771
9772 4 => {
9773 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAllowedOffers>(
9774 slot.as_mut(),
9775 decoder,
9776 )?;
9777
9778 Ok(())
9779 }
9780
9781 5 => {
9782 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
9783
9784 Ok(())
9785 }
9786
9787 6 => {
9788 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
9789
9790 Ok(())
9791 }
9792
9793 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9794 }
9795 })
9796 }
9797}
9798
9799impl<'de> WireCollection<'de> {
9800 pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
9801 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9802 }
9803
9804 pub fn durability(&self) -> Option<&crate::WireDurability> {
9805 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9806 }
9807
9808 pub fn environment(&self) -> Option<&::fidl_next::WireString<'de>> {
9809 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
9810 }
9811
9812 pub fn allowed_offers(&self) -> Option<&crate::WireAllowedOffers> {
9813 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
9814 }
9815
9816 pub fn allow_long_names(&self) -> Option<&bool> {
9817 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
9818 }
9819
9820 pub fn persistent_storage(&self) -> Option<&bool> {
9821 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
9822 }
9823}
9824
9825impl<'de> ::core::fmt::Debug for WireCollection<'de> {
9826 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
9827 f.debug_struct("Collection")
9828 .field("name", &self.name())
9829 .field("durability", &self.durability())
9830 .field("environment", &self.environment())
9831 .field("allowed_offers", &self.allowed_offers())
9832 .field("allow_long_names", &self.allow_long_names())
9833 .field("persistent_storage", &self.persistent_storage())
9834 .finish()
9835 }
9836}
9837
9838#[doc = " Describes the type of dependency implied by the capability.\n"]
9839#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9840#[repr(u32)]
9841pub enum DependencyType {
9842 Strong = 1,
9843 Weak = 2,
9844}
9845
9846impl ::fidl_next::Encodable for DependencyType {
9847 type Encoded = WireDependencyType;
9848}
9849impl ::std::convert::TryFrom<u32> for DependencyType {
9850 type Error = ::fidl_next::UnknownStrictEnumMemberError;
9851 fn try_from(value: u32) -> Result<Self, Self::Error> {
9852 match value {
9853 1 => Ok(Self::Strong),
9854 2 => Ok(Self::Weak),
9855
9856 _ => Err(Self::Error::new(value.into())),
9857 }
9858 }
9859}
9860
9861unsafe impl<___E> ::fidl_next::Encode<___E> for DependencyType
9862where
9863 ___E: ?Sized,
9864{
9865 #[inline]
9866 fn encode(
9867 self,
9868 encoder: &mut ___E,
9869 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9870 ) -> Result<(), ::fidl_next::EncodeError> {
9871 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
9872 }
9873}
9874
9875unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DependencyType
9876where
9877 ___E: ?Sized,
9878{
9879 #[inline]
9880 fn encode_ref(
9881 &self,
9882 encoder: &mut ___E,
9883 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9884 ) -> Result<(), ::fidl_next::EncodeError> {
9885 ::fidl_next::munge!(let WireDependencyType { value } = out);
9886 let _ = value.write(::fidl_next::WireU32::from(match *self {
9887 Self::Strong => 1,
9888
9889 Self::Weak => 2,
9890 }));
9891
9892 Ok(())
9893 }
9894}
9895
9896impl ::core::convert::From<WireDependencyType> for DependencyType {
9897 fn from(wire: WireDependencyType) -> Self {
9898 match u32::from(wire.value) {
9899 1 => Self::Strong,
9900
9901 2 => Self::Weak,
9902
9903 _ => unsafe { ::core::hint::unreachable_unchecked() },
9904 }
9905 }
9906}
9907
9908impl ::fidl_next::FromWire<WireDependencyType> for DependencyType {
9909 #[inline]
9910 fn from_wire(wire: WireDependencyType) -> Self {
9911 Self::from(wire)
9912 }
9913}
9914
9915impl ::fidl_next::FromWireRef<WireDependencyType> for DependencyType {
9916 #[inline]
9917 fn from_wire_ref(wire: &WireDependencyType) -> Self {
9918 Self::from(*wire)
9919 }
9920}
9921
9922#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9924#[repr(transparent)]
9925pub struct WireDependencyType {
9926 value: ::fidl_next::WireU32,
9927}
9928
9929unsafe impl ::fidl_next::Wire for WireDependencyType {
9930 type Decoded<'de> = Self;
9931
9932 #[inline]
9933 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
9934 }
9936}
9937
9938impl WireDependencyType {
9939 pub const STRONG: WireDependencyType = WireDependencyType { value: ::fidl_next::WireU32(1) };
9940
9941 pub const WEAK: WireDependencyType = WireDependencyType { value: ::fidl_next::WireU32(2) };
9942}
9943
9944unsafe impl<___D> ::fidl_next::Decode<___D> for WireDependencyType
9945where
9946 ___D: ?Sized,
9947{
9948 fn decode(
9949 slot: ::fidl_next::Slot<'_, Self>,
9950 _: &mut ___D,
9951 ) -> Result<(), ::fidl_next::DecodeError> {
9952 ::fidl_next::munge!(let Self { value } = slot);
9953
9954 match u32::from(*value) {
9955 1 | 2 => (),
9956 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
9957 }
9958
9959 Ok(())
9960 }
9961}
9962
9963impl ::core::convert::From<DependencyType> for WireDependencyType {
9964 fn from(natural: DependencyType) -> Self {
9965 match natural {
9966 DependencyType::Strong => WireDependencyType::STRONG,
9967
9968 DependencyType::Weak => WireDependencyType::WEAK,
9969 }
9970 }
9971}
9972
9973#[doc = " Type used to create a mapping between 2 names. Used to rename service or component instances\n in FIDL declarations.\n"]
9974#[derive(Clone, Debug)]
9975pub struct NameMapping {
9976 pub source_name: String,
9977
9978 pub target_name: String,
9979}
9980
9981impl ::fidl_next::Encodable for NameMapping {
9982 type Encoded = WireNameMapping<'static>;
9983}
9984
9985unsafe impl<___E> ::fidl_next::Encode<___E> for NameMapping
9986where
9987 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
9988 ___E: ::fidl_next::Encoder,
9989{
9990 #[inline]
9991 fn encode(
9992 self,
9993 encoder: &mut ___E,
9994 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9995 ) -> Result<(), ::fidl_next::EncodeError> {
9996 ::fidl_next::munge! {
9997 let Self::Encoded {
9998 source_name,
9999 target_name,
10000
10001 } = out;
10002 }
10003
10004 ::fidl_next::Encode::encode(self.source_name, encoder, source_name)?;
10005
10006 ::fidl_next::Encode::encode(self.target_name, encoder, target_name)?;
10007
10008 Ok(())
10009 }
10010}
10011
10012unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NameMapping
10013where
10014 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10015 ___E: ::fidl_next::Encoder,
10016{
10017 #[inline]
10018 fn encode_ref(
10019 &self,
10020 encoder: &mut ___E,
10021 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10022 ) -> Result<(), ::fidl_next::EncodeError> {
10023 ::fidl_next::munge! {
10024 let Self::Encoded {
10025 source_name,
10026 target_name,
10027
10028 } = out;
10029 }
10030
10031 ::fidl_next::EncodeRef::encode_ref(&self.source_name, encoder, source_name)?;
10032
10033 ::fidl_next::EncodeRef::encode_ref(&self.target_name, encoder, target_name)?;
10034
10035 Ok(())
10036 }
10037}
10038
10039impl ::fidl_next::EncodableOption for NameMapping {
10040 type EncodedOption = ::fidl_next::WireBox<'static, WireNameMapping<'static>>;
10041}
10042
10043unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NameMapping
10044where
10045 ___E: ::fidl_next::Encoder + ?Sized,
10046 NameMapping: ::fidl_next::Encode<___E>,
10047{
10048 #[inline]
10049 fn encode_option(
10050 this: Option<Self>,
10051 encoder: &mut ___E,
10052 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10053 ) -> Result<(), ::fidl_next::EncodeError> {
10054 if let Some(inner) = this {
10055 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10056 ::fidl_next::WireBox::encode_present(out);
10057 } else {
10058 ::fidl_next::WireBox::encode_absent(out);
10059 }
10060
10061 Ok(())
10062 }
10063}
10064
10065unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NameMapping
10066where
10067 ___E: ::fidl_next::Encoder + ?Sized,
10068 NameMapping: ::fidl_next::EncodeRef<___E>,
10069{
10070 #[inline]
10071 fn encode_option_ref(
10072 this: Option<&Self>,
10073 encoder: &mut ___E,
10074 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10075 ) -> Result<(), ::fidl_next::EncodeError> {
10076 if let Some(inner) = this {
10077 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10078 ::fidl_next::WireBox::encode_present(out);
10079 } else {
10080 ::fidl_next::WireBox::encode_absent(out);
10081 }
10082
10083 Ok(())
10084 }
10085}
10086
10087impl<'de> ::fidl_next::FromWire<WireNameMapping<'de>> for NameMapping {
10088 #[inline]
10089 fn from_wire(wire: WireNameMapping<'de>) -> Self {
10090 Self {
10091 source_name: ::fidl_next::FromWire::from_wire(wire.source_name),
10092
10093 target_name: ::fidl_next::FromWire::from_wire(wire.target_name),
10094 }
10095 }
10096}
10097
10098impl<'de> ::fidl_next::FromWireRef<WireNameMapping<'de>> for NameMapping {
10099 #[inline]
10100 fn from_wire_ref(wire: &WireNameMapping<'de>) -> Self {
10101 Self {
10102 source_name: ::fidl_next::FromWireRef::from_wire_ref(&wire.source_name),
10103
10104 target_name: ::fidl_next::FromWireRef::from_wire_ref(&wire.target_name),
10105 }
10106 }
10107}
10108
10109#[derive(Debug)]
10111#[repr(C)]
10112pub struct WireNameMapping<'de> {
10113 pub source_name: ::fidl_next::WireString<'de>,
10114
10115 pub target_name: ::fidl_next::WireString<'de>,
10116}
10117
10118unsafe impl ::fidl_next::Wire for WireNameMapping<'static> {
10119 type Decoded<'de> = WireNameMapping<'de>;
10120
10121 #[inline]
10122 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
10123}
10124
10125unsafe impl<___D> ::fidl_next::Decode<___D> for WireNameMapping<'static>
10126where
10127 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10128 ___D: ::fidl_next::Decoder,
10129{
10130 fn decode(
10131 slot: ::fidl_next::Slot<'_, Self>,
10132 decoder: &mut ___D,
10133 ) -> Result<(), ::fidl_next::DecodeError> {
10134 ::fidl_next::munge! {
10135 let Self {
10136 mut source_name,
10137 mut target_name,
10138
10139 } = slot;
10140 }
10141
10142 ::fidl_next::Decode::decode(source_name.as_mut(), decoder)?;
10143
10144 let source_name = unsafe { source_name.deref_unchecked() };
10145
10146 if source_name.len() > 100 {
10147 return Err(::fidl_next::DecodeError::VectorTooLong {
10148 size: source_name.len() as u64,
10149 limit: 100,
10150 });
10151 }
10152
10153 ::fidl_next::Decode::decode(target_name.as_mut(), decoder)?;
10154
10155 let target_name = unsafe { target_name.deref_unchecked() };
10156
10157 if target_name.len() > 100 {
10158 return Err(::fidl_next::DecodeError::VectorTooLong {
10159 size: target_name.len() as u64,
10160 limit: 100,
10161 });
10162 }
10163
10164 Ok(())
10165 }
10166}
10167
10168#[doc = " Specifies how a declared environment\'s initial set of properties are assigned.\n"]
10169#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10170#[repr(u32)]
10171pub enum EnvironmentExtends {
10172 None = 0,
10173 Realm = 1,
10174}
10175
10176impl ::fidl_next::Encodable for EnvironmentExtends {
10177 type Encoded = WireEnvironmentExtends;
10178}
10179impl ::std::convert::TryFrom<u32> for EnvironmentExtends {
10180 type Error = ::fidl_next::UnknownStrictEnumMemberError;
10181 fn try_from(value: u32) -> Result<Self, Self::Error> {
10182 match value {
10183 0 => Ok(Self::None),
10184 1 => Ok(Self::Realm),
10185
10186 _ => Err(Self::Error::new(value.into())),
10187 }
10188 }
10189}
10190
10191unsafe impl<___E> ::fidl_next::Encode<___E> for EnvironmentExtends
10192where
10193 ___E: ?Sized,
10194{
10195 #[inline]
10196 fn encode(
10197 self,
10198 encoder: &mut ___E,
10199 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10200 ) -> Result<(), ::fidl_next::EncodeError> {
10201 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
10202 }
10203}
10204
10205unsafe impl<___E> ::fidl_next::EncodeRef<___E> for EnvironmentExtends
10206where
10207 ___E: ?Sized,
10208{
10209 #[inline]
10210 fn encode_ref(
10211 &self,
10212 encoder: &mut ___E,
10213 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10214 ) -> Result<(), ::fidl_next::EncodeError> {
10215 ::fidl_next::munge!(let WireEnvironmentExtends { value } = out);
10216 let _ = value.write(::fidl_next::WireU32::from(match *self {
10217 Self::None => 0,
10218
10219 Self::Realm => 1,
10220 }));
10221
10222 Ok(())
10223 }
10224}
10225
10226impl ::core::convert::From<WireEnvironmentExtends> for EnvironmentExtends {
10227 fn from(wire: WireEnvironmentExtends) -> Self {
10228 match u32::from(wire.value) {
10229 0 => Self::None,
10230
10231 1 => Self::Realm,
10232
10233 _ => unsafe { ::core::hint::unreachable_unchecked() },
10234 }
10235 }
10236}
10237
10238impl ::fidl_next::FromWire<WireEnvironmentExtends> for EnvironmentExtends {
10239 #[inline]
10240 fn from_wire(wire: WireEnvironmentExtends) -> Self {
10241 Self::from(wire)
10242 }
10243}
10244
10245impl ::fidl_next::FromWireRef<WireEnvironmentExtends> for EnvironmentExtends {
10246 #[inline]
10247 fn from_wire_ref(wire: &WireEnvironmentExtends) -> Self {
10248 Self::from(*wire)
10249 }
10250}
10251
10252#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10254#[repr(transparent)]
10255pub struct WireEnvironmentExtends {
10256 value: ::fidl_next::WireU32,
10257}
10258
10259unsafe impl ::fidl_next::Wire for WireEnvironmentExtends {
10260 type Decoded<'de> = Self;
10261
10262 #[inline]
10263 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
10264 }
10266}
10267
10268impl WireEnvironmentExtends {
10269 pub const NONE: WireEnvironmentExtends =
10270 WireEnvironmentExtends { value: ::fidl_next::WireU32(0) };
10271
10272 pub const REALM: WireEnvironmentExtends =
10273 WireEnvironmentExtends { value: ::fidl_next::WireU32(1) };
10274}
10275
10276unsafe impl<___D> ::fidl_next::Decode<___D> for WireEnvironmentExtends
10277where
10278 ___D: ?Sized,
10279{
10280 fn decode(
10281 slot: ::fidl_next::Slot<'_, Self>,
10282 _: &mut ___D,
10283 ) -> Result<(), ::fidl_next::DecodeError> {
10284 ::fidl_next::munge!(let Self { value } = slot);
10285
10286 match u32::from(*value) {
10287 0 | 1 => (),
10288 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
10289 }
10290
10291 Ok(())
10292 }
10293}
10294
10295impl ::core::convert::From<EnvironmentExtends> for WireEnvironmentExtends {
10296 fn from(natural: EnvironmentExtends) -> Self {
10297 match natural {
10298 EnvironmentExtends::None => WireEnvironmentExtends::NONE,
10299
10300 EnvironmentExtends::Realm => WireEnvironmentExtends::REALM,
10301 }
10302 }
10303}
10304
10305pub const MAX_URL_SCHEME_LENGTH: u32 = 100;
10306
10307pub type UrlScheme = String;
10308
10309pub type WireUrlScheme<'de> = ::fidl_next::WireString<'de>;
10311
10312#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10313#[repr(u32)]
10314pub enum ConfigTypeLayout {
10315 Bool = 1,
10316 Uint8 = 2,
10317 Uint16 = 3,
10318 Uint32 = 4,
10319 Uint64 = 5,
10320 Int8 = 6,
10321 Int16 = 7,
10322 Int32 = 8,
10323 Int64 = 9,
10324 String = 10,
10325 Vector = 11,
10326 UnknownOrdinal_(u32),
10327}
10328
10329impl ::fidl_next::Encodable for ConfigTypeLayout {
10330 type Encoded = WireConfigTypeLayout;
10331}
10332impl ::std::convert::From<u32> for ConfigTypeLayout {
10333 fn from(value: u32) -> Self {
10334 match value {
10335 1 => Self::Bool,
10336 2 => Self::Uint8,
10337 3 => Self::Uint16,
10338 4 => Self::Uint32,
10339 5 => Self::Uint64,
10340 6 => Self::Int8,
10341 7 => Self::Int16,
10342 8 => Self::Int32,
10343 9 => Self::Int64,
10344 10 => Self::String,
10345 11 => Self::Vector,
10346
10347 _ => Self::UnknownOrdinal_(value),
10348 }
10349 }
10350}
10351
10352unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigTypeLayout
10353where
10354 ___E: ?Sized,
10355{
10356 #[inline]
10357 fn encode(
10358 self,
10359 encoder: &mut ___E,
10360 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10361 ) -> Result<(), ::fidl_next::EncodeError> {
10362 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
10363 }
10364}
10365
10366unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigTypeLayout
10367where
10368 ___E: ?Sized,
10369{
10370 #[inline]
10371 fn encode_ref(
10372 &self,
10373 encoder: &mut ___E,
10374 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10375 ) -> Result<(), ::fidl_next::EncodeError> {
10376 ::fidl_next::munge!(let WireConfigTypeLayout { value } = out);
10377 let _ = value.write(::fidl_next::WireU32::from(match *self {
10378 Self::Bool => 1,
10379
10380 Self::Uint8 => 2,
10381
10382 Self::Uint16 => 3,
10383
10384 Self::Uint32 => 4,
10385
10386 Self::Uint64 => 5,
10387
10388 Self::Int8 => 6,
10389
10390 Self::Int16 => 7,
10391
10392 Self::Int32 => 8,
10393
10394 Self::Int64 => 9,
10395
10396 Self::String => 10,
10397
10398 Self::Vector => 11,
10399
10400 Self::UnknownOrdinal_(value) => value,
10401 }));
10402
10403 Ok(())
10404 }
10405}
10406
10407impl ::core::convert::From<WireConfigTypeLayout> for ConfigTypeLayout {
10408 fn from(wire: WireConfigTypeLayout) -> Self {
10409 match u32::from(wire.value) {
10410 1 => Self::Bool,
10411
10412 2 => Self::Uint8,
10413
10414 3 => Self::Uint16,
10415
10416 4 => Self::Uint32,
10417
10418 5 => Self::Uint64,
10419
10420 6 => Self::Int8,
10421
10422 7 => Self::Int16,
10423
10424 8 => Self::Int32,
10425
10426 9 => Self::Int64,
10427
10428 10 => Self::String,
10429
10430 11 => Self::Vector,
10431
10432 value => Self::UnknownOrdinal_(value),
10433 }
10434 }
10435}
10436
10437impl ::fidl_next::FromWire<WireConfigTypeLayout> for ConfigTypeLayout {
10438 #[inline]
10439 fn from_wire(wire: WireConfigTypeLayout) -> Self {
10440 Self::from(wire)
10441 }
10442}
10443
10444impl ::fidl_next::FromWireRef<WireConfigTypeLayout> for ConfigTypeLayout {
10445 #[inline]
10446 fn from_wire_ref(wire: &WireConfigTypeLayout) -> Self {
10447 Self::from(*wire)
10448 }
10449}
10450
10451#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10453#[repr(transparent)]
10454pub struct WireConfigTypeLayout {
10455 value: ::fidl_next::WireU32,
10456}
10457
10458unsafe impl ::fidl_next::Wire for WireConfigTypeLayout {
10459 type Decoded<'de> = Self;
10460
10461 #[inline]
10462 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
10463 }
10465}
10466
10467impl WireConfigTypeLayout {
10468 pub const BOOL: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(1) };
10469
10470 pub const UINT8: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(2) };
10471
10472 pub const UINT16: WireConfigTypeLayout =
10473 WireConfigTypeLayout { value: ::fidl_next::WireU32(3) };
10474
10475 pub const UINT32: WireConfigTypeLayout =
10476 WireConfigTypeLayout { value: ::fidl_next::WireU32(4) };
10477
10478 pub const UINT64: WireConfigTypeLayout =
10479 WireConfigTypeLayout { value: ::fidl_next::WireU32(5) };
10480
10481 pub const INT8: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(6) };
10482
10483 pub const INT16: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(7) };
10484
10485 pub const INT32: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(8) };
10486
10487 pub const INT64: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(9) };
10488
10489 pub const STRING: WireConfigTypeLayout =
10490 WireConfigTypeLayout { value: ::fidl_next::WireU32(10) };
10491
10492 pub const VECTOR: WireConfigTypeLayout =
10493 WireConfigTypeLayout { value: ::fidl_next::WireU32(11) };
10494}
10495
10496unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigTypeLayout
10497where
10498 ___D: ?Sized,
10499{
10500 fn decode(
10501 slot: ::fidl_next::Slot<'_, Self>,
10502 _: &mut ___D,
10503 ) -> Result<(), ::fidl_next::DecodeError> {
10504 Ok(())
10505 }
10506}
10507
10508impl ::core::convert::From<ConfigTypeLayout> for WireConfigTypeLayout {
10509 fn from(natural: ConfigTypeLayout) -> Self {
10510 match natural {
10511 ConfigTypeLayout::Bool => WireConfigTypeLayout::BOOL,
10512
10513 ConfigTypeLayout::Uint8 => WireConfigTypeLayout::UINT8,
10514
10515 ConfigTypeLayout::Uint16 => WireConfigTypeLayout::UINT16,
10516
10517 ConfigTypeLayout::Uint32 => WireConfigTypeLayout::UINT32,
10518
10519 ConfigTypeLayout::Uint64 => WireConfigTypeLayout::UINT64,
10520
10521 ConfigTypeLayout::Int8 => WireConfigTypeLayout::INT8,
10522
10523 ConfigTypeLayout::Int16 => WireConfigTypeLayout::INT16,
10524
10525 ConfigTypeLayout::Int32 => WireConfigTypeLayout::INT32,
10526
10527 ConfigTypeLayout::Int64 => WireConfigTypeLayout::INT64,
10528
10529 ConfigTypeLayout::String => WireConfigTypeLayout::STRING,
10530
10531 ConfigTypeLayout::Vector => WireConfigTypeLayout::VECTOR,
10532
10533 ConfigTypeLayout::UnknownOrdinal_(value) => {
10534 WireConfigTypeLayout { value: ::fidl_next::WireU32::from(value) }
10535 }
10536 }
10537 }
10538}
10539
10540#[derive(Clone, Debug)]
10541pub enum LayoutConstraint {
10542 MaxSize(u32),
10543
10544 UnknownOrdinal_(u64),
10545}
10546
10547impl ::fidl_next::Encodable for LayoutConstraint {
10548 type Encoded = WireLayoutConstraint;
10549}
10550
10551unsafe impl<___E> ::fidl_next::Encode<___E> for LayoutConstraint
10552where
10553 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10554{
10555 #[inline]
10556 fn encode(
10557 self,
10558 encoder: &mut ___E,
10559 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10560 ) -> Result<(), ::fidl_next::EncodeError> {
10561 ::fidl_next::munge!(let WireLayoutConstraint { raw, _phantom: _ } = out);
10562
10563 match self {
10564 Self::MaxSize(value) => {
10565 ::fidl_next::RawWireUnion::encode_as_static::<___E, u32>(value, 1, encoder, raw)?
10566 }
10567
10568 Self::UnknownOrdinal_(ordinal) => {
10569 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
10570 }
10571 }
10572
10573 Ok(())
10574 }
10575}
10576
10577unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LayoutConstraint
10578where
10579 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10580{
10581 #[inline]
10582 fn encode_ref(
10583 &self,
10584 encoder: &mut ___E,
10585 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10586 ) -> Result<(), ::fidl_next::EncodeError> {
10587 ::fidl_next::munge!(let WireLayoutConstraint { raw, _phantom: _ } = out);
10588
10589 match self {
10590 Self::MaxSize(value) => {
10591 ::fidl_next::RawWireUnion::encode_as_static::<___E, &u32>(value, 1, encoder, raw)?
10592 }
10593
10594 Self::UnknownOrdinal_(ordinal) => {
10595 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
10596 }
10597 }
10598
10599 Ok(())
10600 }
10601}
10602
10603impl ::fidl_next::EncodableOption for LayoutConstraint {
10604 type EncodedOption = WireOptionalLayoutConstraint;
10605}
10606
10607unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LayoutConstraint
10608where
10609 ___E: ?Sized,
10610 LayoutConstraint: ::fidl_next::Encode<___E>,
10611{
10612 #[inline]
10613 fn encode_option(
10614 this: Option<Self>,
10615 encoder: &mut ___E,
10616 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10617 ) -> Result<(), ::fidl_next::EncodeError> {
10618 ::fidl_next::munge!(let WireOptionalLayoutConstraint { raw, _phantom: _ } = &mut *out);
10619
10620 if let Some(inner) = this {
10621 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
10622 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
10623 } else {
10624 ::fidl_next::RawWireUnion::encode_absent(raw);
10625 }
10626
10627 Ok(())
10628 }
10629}
10630
10631unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for LayoutConstraint
10632where
10633 ___E: ?Sized,
10634 LayoutConstraint: ::fidl_next::EncodeRef<___E>,
10635{
10636 #[inline]
10637 fn encode_option_ref(
10638 this: Option<&Self>,
10639 encoder: &mut ___E,
10640 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10641 ) -> Result<(), ::fidl_next::EncodeError> {
10642 ::fidl_next::munge!(let WireOptionalLayoutConstraint { raw, _phantom: _ } = &mut *out);
10643
10644 if let Some(inner) = this {
10645 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
10646 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
10647 } else {
10648 ::fidl_next::RawWireUnion::encode_absent(raw);
10649 }
10650
10651 Ok(())
10652 }
10653}
10654
10655impl ::fidl_next::FromWire<WireLayoutConstraint> for LayoutConstraint {
10656 #[inline]
10657 fn from_wire(wire: WireLayoutConstraint) -> Self {
10658 let wire = ::core::mem::ManuallyDrop::new(wire);
10659 match wire.raw.ordinal() {
10660 1 => Self::MaxSize(::fidl_next::FromWire::from_wire(unsafe {
10661 wire.raw.get().read_unchecked::<::fidl_next::WireU32>()
10662 })),
10663
10664 _ => unsafe { ::core::hint::unreachable_unchecked() },
10665 }
10666 }
10667}
10668
10669impl ::fidl_next::FromWireRef<WireLayoutConstraint> for LayoutConstraint {
10670 #[inline]
10671 fn from_wire_ref(wire: &WireLayoutConstraint) -> Self {
10672 match wire.raw.ordinal() {
10673 1 => Self::MaxSize(::fidl_next::FromWireRef::from_wire_ref(unsafe {
10674 wire.raw.get().deref_unchecked::<::fidl_next::WireU32>()
10675 })),
10676
10677 _ => unsafe { ::core::hint::unreachable_unchecked() },
10678 }
10679 }
10680}
10681
10682impl ::fidl_next::FromWireOption<WireOptionalLayoutConstraint> for Box<LayoutConstraint> {
10683 #[inline]
10684 fn from_wire_option(wire: WireOptionalLayoutConstraint) -> Option<Self> {
10685 if let Some(inner) = wire.into_option() {
10686 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
10687 } else {
10688 None
10689 }
10690 }
10691}
10692
10693impl ::fidl_next::FromWireOptionRef<WireOptionalLayoutConstraint> for Box<LayoutConstraint> {
10694 #[inline]
10695 fn from_wire_option_ref(wire: &WireOptionalLayoutConstraint) -> Option<Self> {
10696 if let Some(inner) = wire.as_ref() {
10697 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
10698 } else {
10699 None
10700 }
10701 }
10702}
10703
10704#[repr(transparent)]
10706pub struct WireLayoutConstraint {
10707 raw: ::fidl_next::RawWireUnion,
10708 _phantom: ::core::marker::PhantomData<()>,
10709}
10710
10711impl Drop for WireLayoutConstraint {
10712 fn drop(&mut self) {
10713 match self.raw.ordinal() {
10714 1 => {
10715 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU32>() };
10716 }
10717
10718 _ => (),
10719 }
10720 }
10721}
10722
10723unsafe impl ::fidl_next::Wire for WireLayoutConstraint {
10724 type Decoded<'de> = WireLayoutConstraint;
10725
10726 #[inline]
10727 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10728 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
10729 ::fidl_next::RawWireUnion::zero_padding(raw);
10730 }
10731}
10732
10733pub mod layout_constraint {
10734 pub enum Ref<'de> {
10735 MaxSize(&'de ::fidl_next::WireU32),
10736
10737 UnknownOrdinal_(u64),
10738 }
10739}
10740
10741impl WireLayoutConstraint {
10742 pub fn as_ref(&self) -> crate::layout_constraint::Ref<'_> {
10743 match self.raw.ordinal() {
10744 1 => crate::layout_constraint::Ref::MaxSize(unsafe {
10745 self.raw.get().deref_unchecked::<::fidl_next::WireU32>()
10746 }),
10747
10748 unknown => crate::layout_constraint::Ref::UnknownOrdinal_(unknown),
10749 }
10750 }
10751}
10752
10753impl Clone for WireLayoutConstraint {
10754 fn clone(&self) -> Self {
10755 match self.raw.ordinal() {
10756 1 => Self {
10757 raw: unsafe { self.raw.clone_inline_unchecked::<::fidl_next::WireU32>() },
10758 _phantom: ::core::marker::PhantomData,
10759 },
10760
10761 _ => Self {
10762 raw: unsafe { self.raw.clone_inline_unchecked::<()>() },
10763 _phantom: ::core::marker::PhantomData,
10764 },
10765 }
10766 }
10767}
10768
10769unsafe impl<___D> ::fidl_next::Decode<___D> for WireLayoutConstraint
10770where
10771 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10772{
10773 fn decode(
10774 mut slot: ::fidl_next::Slot<'_, Self>,
10775 decoder: &mut ___D,
10776 ) -> Result<(), ::fidl_next::DecodeError> {
10777 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
10778 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
10779 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, ::fidl_next::WireU32>(
10780 raw, decoder,
10781 )?,
10782
10783 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
10784 }
10785
10786 Ok(())
10787 }
10788}
10789
10790impl ::core::fmt::Debug for WireLayoutConstraint {
10791 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
10792 match self.raw.ordinal() {
10793 1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU32>().fmt(f) },
10794 _ => unsafe { ::core::hint::unreachable_unchecked() },
10795 }
10796 }
10797}
10798
10799#[repr(transparent)]
10800pub struct WireOptionalLayoutConstraint {
10801 raw: ::fidl_next::RawWireUnion,
10802 _phantom: ::core::marker::PhantomData<()>,
10803}
10804
10805unsafe impl ::fidl_next::Wire for WireOptionalLayoutConstraint {
10806 type Decoded<'de> = WireOptionalLayoutConstraint;
10807
10808 #[inline]
10809 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10810 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
10811 ::fidl_next::RawWireUnion::zero_padding(raw);
10812 }
10813}
10814
10815impl WireOptionalLayoutConstraint {
10816 pub fn is_some(&self) -> bool {
10817 self.raw.is_some()
10818 }
10819
10820 pub fn is_none(&self) -> bool {
10821 self.raw.is_none()
10822 }
10823
10824 pub fn as_ref(&self) -> Option<&WireLayoutConstraint> {
10825 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
10826 }
10827
10828 pub fn into_option(self) -> Option<WireLayoutConstraint> {
10829 if self.is_some() {
10830 Some(WireLayoutConstraint { raw: self.raw, _phantom: ::core::marker::PhantomData })
10831 } else {
10832 None
10833 }
10834 }
10835}
10836
10837impl Clone for WireOptionalLayoutConstraint {
10838 fn clone(&self) -> Self {
10839 if self.is_none() {
10840 return WireOptionalLayoutConstraint {
10841 raw: ::fidl_next::RawWireUnion::absent(),
10842 _phantom: ::core::marker::PhantomData,
10843 };
10844 }
10845
10846 match self.raw.ordinal() {
10847 1 => Self {
10848 raw: unsafe { self.raw.clone_inline_unchecked::<::fidl_next::WireU32>() },
10849 _phantom: ::core::marker::PhantomData,
10850 },
10851
10852 _ => Self {
10853 raw: unsafe { self.raw.clone_inline_unchecked::<()>() },
10854 _phantom: ::core::marker::PhantomData,
10855 },
10856 }
10857 }
10858}
10859
10860unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalLayoutConstraint
10861where
10862 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10863{
10864 fn decode(
10865 mut slot: ::fidl_next::Slot<'_, Self>,
10866 decoder: &mut ___D,
10867 ) -> Result<(), ::fidl_next::DecodeError> {
10868 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
10869 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
10870 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, ::fidl_next::WireU32>(
10871 raw, decoder,
10872 )?,
10873
10874 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
10875 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
10876 }
10877
10878 Ok(())
10879 }
10880}
10881
10882impl ::core::fmt::Debug for WireOptionalLayoutConstraint {
10883 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
10884 self.as_ref().fmt(f)
10885 }
10886}
10887
10888#[derive(Clone, Debug)]
10889pub struct ConfigType {
10890 pub layout: crate::ConfigTypeLayout,
10891
10892 pub parameters: Option<Vec<crate::LayoutParameter>>,
10893
10894 pub constraints: Vec<crate::LayoutConstraint>,
10895}
10896
10897impl ::fidl_next::Encodable for ConfigType {
10898 type Encoded = WireConfigType<'static>;
10899}
10900
10901unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigType
10902where
10903 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10904 ___E: ::fidl_next::Encoder,
10905{
10906 #[inline]
10907 fn encode(
10908 self,
10909 encoder: &mut ___E,
10910 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10911 ) -> Result<(), ::fidl_next::EncodeError> {
10912 ::fidl_next::munge! {
10913 let Self::Encoded {
10914 layout,
10915 parameters,
10916 constraints,
10917
10918 } = out;
10919 }
10920
10921 ::fidl_next::Encode::encode(self.layout, encoder, layout)?;
10922
10923 ::fidl_next::Encode::encode(self.parameters, encoder, parameters)?;
10924
10925 ::fidl_next::Encode::encode(self.constraints, encoder, constraints)?;
10926
10927 Ok(())
10928 }
10929}
10930
10931unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigType
10932where
10933 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10934 ___E: ::fidl_next::Encoder,
10935{
10936 #[inline]
10937 fn encode_ref(
10938 &self,
10939 encoder: &mut ___E,
10940 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10941 ) -> Result<(), ::fidl_next::EncodeError> {
10942 ::fidl_next::munge! {
10943 let Self::Encoded {
10944 layout,
10945 parameters,
10946 constraints,
10947
10948 } = out;
10949 }
10950
10951 ::fidl_next::EncodeRef::encode_ref(&self.layout, encoder, layout)?;
10952
10953 ::fidl_next::EncodeRef::encode_ref(&self.parameters, encoder, parameters)?;
10954
10955 ::fidl_next::EncodeRef::encode_ref(&self.constraints, encoder, constraints)?;
10956
10957 Ok(())
10958 }
10959}
10960
10961impl ::fidl_next::EncodableOption for ConfigType {
10962 type EncodedOption = ::fidl_next::WireBox<'static, WireConfigType<'static>>;
10963}
10964
10965unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ConfigType
10966where
10967 ___E: ::fidl_next::Encoder + ?Sized,
10968 ConfigType: ::fidl_next::Encode<___E>,
10969{
10970 #[inline]
10971 fn encode_option(
10972 this: Option<Self>,
10973 encoder: &mut ___E,
10974 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10975 ) -> Result<(), ::fidl_next::EncodeError> {
10976 if let Some(inner) = this {
10977 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10978 ::fidl_next::WireBox::encode_present(out);
10979 } else {
10980 ::fidl_next::WireBox::encode_absent(out);
10981 }
10982
10983 Ok(())
10984 }
10985}
10986
10987unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ConfigType
10988where
10989 ___E: ::fidl_next::Encoder + ?Sized,
10990 ConfigType: ::fidl_next::EncodeRef<___E>,
10991{
10992 #[inline]
10993 fn encode_option_ref(
10994 this: Option<&Self>,
10995 encoder: &mut ___E,
10996 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10997 ) -> Result<(), ::fidl_next::EncodeError> {
10998 if let Some(inner) = this {
10999 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
11000 ::fidl_next::WireBox::encode_present(out);
11001 } else {
11002 ::fidl_next::WireBox::encode_absent(out);
11003 }
11004
11005 Ok(())
11006 }
11007}
11008
11009impl<'de> ::fidl_next::FromWire<WireConfigType<'de>> for ConfigType {
11010 #[inline]
11011 fn from_wire(wire: WireConfigType<'de>) -> Self {
11012 Self {
11013 layout: ::fidl_next::FromWire::from_wire(wire.layout),
11014
11015 parameters: ::fidl_next::FromWire::from_wire(wire.parameters),
11016
11017 constraints: ::fidl_next::FromWire::from_wire(wire.constraints),
11018 }
11019 }
11020}
11021
11022impl<'de> ::fidl_next::FromWireRef<WireConfigType<'de>> for ConfigType {
11023 #[inline]
11024 fn from_wire_ref(wire: &WireConfigType<'de>) -> Self {
11025 Self {
11026 layout: ::fidl_next::FromWireRef::from_wire_ref(&wire.layout),
11027
11028 parameters: ::fidl_next::FromWireRef::from_wire_ref(&wire.parameters),
11029
11030 constraints: ::fidl_next::FromWireRef::from_wire_ref(&wire.constraints),
11031 }
11032 }
11033}
11034
11035#[derive(Debug)]
11037#[repr(C)]
11038pub struct WireConfigType<'de> {
11039 pub layout: crate::WireConfigTypeLayout,
11040
11041 pub parameters: ::fidl_next::WireOptionalVector<'de, crate::WireLayoutParameter<'de>>,
11042
11043 pub constraints: ::fidl_next::WireVector<'de, crate::WireLayoutConstraint>,
11044}
11045
11046unsafe impl ::fidl_next::Wire for WireConfigType<'static> {
11047 type Decoded<'de> = WireConfigType<'de>;
11048
11049 #[inline]
11050 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11051 unsafe {
11052 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
11053 }
11054 }
11055}
11056
11057unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigType<'static>
11058where
11059 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11060 ___D: ::fidl_next::Decoder,
11061{
11062 fn decode(
11063 slot: ::fidl_next::Slot<'_, Self>,
11064 decoder: &mut ___D,
11065 ) -> Result<(), ::fidl_next::DecodeError> {
11066 ::fidl_next::munge! {
11067 let Self {
11068 mut layout,
11069 mut parameters,
11070 mut constraints,
11071
11072 } = slot;
11073 }
11074
11075 ::fidl_next::Decode::decode(layout.as_mut(), decoder)?;
11076
11077 ::fidl_next::Decode::decode(parameters.as_mut(), decoder)?;
11078
11079 ::fidl_next::Decode::decode(constraints.as_mut(), decoder)?;
11080
11081 Ok(())
11082 }
11083}
11084
11085#[doc = " The checksum produced for a configuration interface.\n Two configuration interfaces are the same if their checksums are the same.\n"]
11086#[derive(Clone, Debug)]
11087pub enum ConfigChecksum {
11088 Sha256([u8; 32]),
11089
11090 UnknownOrdinal_(u64),
11091}
11092
11093impl ::fidl_next::Encodable for ConfigChecksum {
11094 type Encoded = WireConfigChecksum<'static>;
11095}
11096
11097unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigChecksum
11098where
11099 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11100 ___E: ::fidl_next::Encoder,
11101{
11102 #[inline]
11103 fn encode(
11104 self,
11105 encoder: &mut ___E,
11106 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11107 ) -> Result<(), ::fidl_next::EncodeError> {
11108 ::fidl_next::munge!(let WireConfigChecksum { raw, _phantom: _ } = out);
11109
11110 match self {
11111 Self::Sha256(value) => {
11112 ::fidl_next::RawWireUnion::encode_as::<___E, [u8; 32]>(value, 1, encoder, raw)?
11113 }
11114
11115 Self::UnknownOrdinal_(ordinal) => {
11116 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
11117 }
11118 }
11119
11120 Ok(())
11121 }
11122}
11123
11124unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigChecksum
11125where
11126 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11127 ___E: ::fidl_next::Encoder,
11128{
11129 #[inline]
11130 fn encode_ref(
11131 &self,
11132 encoder: &mut ___E,
11133 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11134 ) -> Result<(), ::fidl_next::EncodeError> {
11135 ::fidl_next::munge!(let WireConfigChecksum { raw, _phantom: _ } = out);
11136
11137 match self {
11138 Self::Sha256(value) => {
11139 ::fidl_next::RawWireUnion::encode_as::<___E, &[u8; 32]>(value, 1, encoder, raw)?
11140 }
11141
11142 Self::UnknownOrdinal_(ordinal) => {
11143 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
11144 }
11145 }
11146
11147 Ok(())
11148 }
11149}
11150
11151impl ::fidl_next::EncodableOption for ConfigChecksum {
11152 type EncodedOption = WireOptionalConfigChecksum<'static>;
11153}
11154
11155unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ConfigChecksum
11156where
11157 ___E: ?Sized,
11158 ConfigChecksum: ::fidl_next::Encode<___E>,
11159{
11160 #[inline]
11161 fn encode_option(
11162 this: Option<Self>,
11163 encoder: &mut ___E,
11164 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11165 ) -> Result<(), ::fidl_next::EncodeError> {
11166 ::fidl_next::munge!(let WireOptionalConfigChecksum { raw, _phantom: _ } = &mut *out);
11167
11168 if let Some(inner) = this {
11169 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
11170 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
11171 } else {
11172 ::fidl_next::RawWireUnion::encode_absent(raw);
11173 }
11174
11175 Ok(())
11176 }
11177}
11178
11179unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ConfigChecksum
11180where
11181 ___E: ?Sized,
11182 ConfigChecksum: ::fidl_next::EncodeRef<___E>,
11183{
11184 #[inline]
11185 fn encode_option_ref(
11186 this: Option<&Self>,
11187 encoder: &mut ___E,
11188 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11189 ) -> Result<(), ::fidl_next::EncodeError> {
11190 ::fidl_next::munge!(let WireOptionalConfigChecksum { raw, _phantom: _ } = &mut *out);
11191
11192 if let Some(inner) = this {
11193 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
11194 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
11195 } else {
11196 ::fidl_next::RawWireUnion::encode_absent(raw);
11197 }
11198
11199 Ok(())
11200 }
11201}
11202
11203impl<'de> ::fidl_next::FromWire<WireConfigChecksum<'de>> for ConfigChecksum {
11204 #[inline]
11205 fn from_wire(wire: WireConfigChecksum<'de>) -> Self {
11206 let wire = ::core::mem::ManuallyDrop::new(wire);
11207 match wire.raw.ordinal() {
11208 1 => Self::Sha256(::fidl_next::FromWire::from_wire(unsafe {
11209 wire.raw.get().read_unchecked::<[u8; 32]>()
11210 })),
11211
11212 _ => unsafe { ::core::hint::unreachable_unchecked() },
11213 }
11214 }
11215}
11216
11217impl<'de> ::fidl_next::FromWireRef<WireConfigChecksum<'de>> for ConfigChecksum {
11218 #[inline]
11219 fn from_wire_ref(wire: &WireConfigChecksum<'de>) -> Self {
11220 match wire.raw.ordinal() {
11221 1 => Self::Sha256(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11222 wire.raw.get().deref_unchecked::<[u8; 32]>()
11223 })),
11224
11225 _ => unsafe { ::core::hint::unreachable_unchecked() },
11226 }
11227 }
11228}
11229
11230impl<'de> ::fidl_next::FromWireOption<WireOptionalConfigChecksum<'de>> for Box<ConfigChecksum> {
11231 #[inline]
11232 fn from_wire_option(wire: WireOptionalConfigChecksum<'de>) -> Option<Self> {
11233 if let Some(inner) = wire.into_option() {
11234 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
11235 } else {
11236 None
11237 }
11238 }
11239}
11240
11241impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalConfigChecksum<'de>> for Box<ConfigChecksum> {
11242 #[inline]
11243 fn from_wire_option_ref(wire: &WireOptionalConfigChecksum<'de>) -> Option<Self> {
11244 if let Some(inner) = wire.as_ref() {
11245 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
11246 } else {
11247 None
11248 }
11249 }
11250}
11251
11252#[repr(transparent)]
11254pub struct WireConfigChecksum<'de> {
11255 raw: ::fidl_next::RawWireUnion,
11256 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
11257}
11258
11259impl<'de> Drop for WireConfigChecksum<'de> {
11260 fn drop(&mut self) {
11261 match self.raw.ordinal() {
11262 1 => {
11263 let _ = unsafe { self.raw.get().read_unchecked::<[u8; 32]>() };
11264 }
11265
11266 _ => (),
11267 }
11268 }
11269}
11270
11271unsafe impl ::fidl_next::Wire for WireConfigChecksum<'static> {
11272 type Decoded<'de> = WireConfigChecksum<'de>;
11273
11274 #[inline]
11275 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11276 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
11277 ::fidl_next::RawWireUnion::zero_padding(raw);
11278 }
11279}
11280
11281pub mod config_checksum {
11282 pub enum Ref<'de> {
11283 Sha256(&'de [u8; 32]),
11284
11285 UnknownOrdinal_(u64),
11286 }
11287}
11288
11289impl<'de> WireConfigChecksum<'de> {
11290 pub fn as_ref(&self) -> crate::config_checksum::Ref<'_> {
11291 match self.raw.ordinal() {
11292 1 => crate::config_checksum::Ref::Sha256(unsafe {
11293 self.raw.get().deref_unchecked::<[u8; 32]>()
11294 }),
11295
11296 unknown => crate::config_checksum::Ref::UnknownOrdinal_(unknown),
11297 }
11298 }
11299}
11300
11301unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigChecksum<'static>
11302where
11303 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11304 ___D: ::fidl_next::Decoder,
11305{
11306 fn decode(
11307 mut slot: ::fidl_next::Slot<'_, Self>,
11308 decoder: &mut ___D,
11309 ) -> Result<(), ::fidl_next::DecodeError> {
11310 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
11311 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
11312 1 => ::fidl_next::RawWireUnion::decode_as::<___D, [u8; 32]>(raw, decoder)?,
11313
11314 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
11315 }
11316
11317 Ok(())
11318 }
11319}
11320
11321impl<'de> ::core::fmt::Debug for WireConfigChecksum<'de> {
11322 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11323 match self.raw.ordinal() {
11324 1 => unsafe { self.raw.get().deref_unchecked::<[u8; 32]>().fmt(f) },
11325 _ => unsafe { ::core::hint::unreachable_unchecked() },
11326 }
11327 }
11328}
11329
11330#[repr(transparent)]
11331pub struct WireOptionalConfigChecksum<'de> {
11332 raw: ::fidl_next::RawWireUnion,
11333 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
11334}
11335
11336unsafe impl ::fidl_next::Wire for WireOptionalConfigChecksum<'static> {
11337 type Decoded<'de> = WireOptionalConfigChecksum<'de>;
11338
11339 #[inline]
11340 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11341 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
11342 ::fidl_next::RawWireUnion::zero_padding(raw);
11343 }
11344}
11345
11346impl<'de> WireOptionalConfigChecksum<'de> {
11347 pub fn is_some(&self) -> bool {
11348 self.raw.is_some()
11349 }
11350
11351 pub fn is_none(&self) -> bool {
11352 self.raw.is_none()
11353 }
11354
11355 pub fn as_ref(&self) -> Option<&WireConfigChecksum<'de>> {
11356 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
11357 }
11358
11359 pub fn into_option(self) -> Option<WireConfigChecksum<'de>> {
11360 if self.is_some() {
11361 Some(WireConfigChecksum { raw: self.raw, _phantom: ::core::marker::PhantomData })
11362 } else {
11363 None
11364 }
11365 }
11366}
11367
11368unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConfigChecksum<'static>
11369where
11370 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11371 ___D: ::fidl_next::Decoder,
11372{
11373 fn decode(
11374 mut slot: ::fidl_next::Slot<'_, Self>,
11375 decoder: &mut ___D,
11376 ) -> Result<(), ::fidl_next::DecodeError> {
11377 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
11378 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
11379 1 => ::fidl_next::RawWireUnion::decode_as::<___D, [u8; 32]>(raw, decoder)?,
11380
11381 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
11382 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
11383 }
11384
11385 Ok(())
11386 }
11387}
11388
11389impl<'de> ::core::fmt::Debug for WireOptionalConfigChecksum<'de> {
11390 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11391 self.as_ref().fmt(f)
11392 }
11393}
11394
11395#[doc = " Declares storage used by a component, which was offered to it.\n"]
11396#[derive(Clone, Debug, Default)]
11397pub struct UseStorage {
11398 pub source_name: Option<String>,
11399
11400 pub target_path: Option<String>,
11401
11402 pub availability: Option<crate::Availability>,
11403}
11404
11405impl UseStorage {
11406 fn __max_ordinal(&self) -> usize {
11407 if self.availability.is_some() {
11408 return 3;
11409 }
11410
11411 if self.target_path.is_some() {
11412 return 2;
11413 }
11414
11415 if self.source_name.is_some() {
11416 return 1;
11417 }
11418
11419 0
11420 }
11421}
11422
11423impl ::fidl_next::Encodable for UseStorage {
11424 type Encoded = WireUseStorage<'static>;
11425}
11426
11427unsafe impl<___E> ::fidl_next::Encode<___E> for UseStorage
11428where
11429 ___E: ::fidl_next::Encoder + ?Sized,
11430{
11431 #[inline]
11432 fn encode(
11433 mut self,
11434 encoder: &mut ___E,
11435 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11436 ) -> Result<(), ::fidl_next::EncodeError> {
11437 ::fidl_next::munge!(let WireUseStorage { table } = out);
11438
11439 let max_ord = self.__max_ordinal();
11440
11441 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11442 ::fidl_next::Wire::zero_padding(&mut out);
11443
11444 let mut preallocated =
11445 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11446
11447 for i in 1..=max_ord {
11448 match i {
11449 3 => {
11450 if let Some(availability) = self.availability.take() {
11451 ::fidl_next::WireEnvelope::encode_value(
11452 availability,
11453 preallocated.encoder,
11454 &mut out,
11455 )?;
11456 } else {
11457 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11458 }
11459 }
11460
11461 2 => {
11462 if let Some(target_path) = self.target_path.take() {
11463 ::fidl_next::WireEnvelope::encode_value(
11464 target_path,
11465 preallocated.encoder,
11466 &mut out,
11467 )?;
11468 } else {
11469 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11470 }
11471 }
11472
11473 1 => {
11474 if let Some(source_name) = self.source_name.take() {
11475 ::fidl_next::WireEnvelope::encode_value(
11476 source_name,
11477 preallocated.encoder,
11478 &mut out,
11479 )?;
11480 } else {
11481 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11482 }
11483 }
11484
11485 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11486 }
11487 unsafe {
11488 preallocated.write_next(out.assume_init_ref());
11489 }
11490 }
11491
11492 ::fidl_next::WireTable::encode_len(table, max_ord);
11493
11494 Ok(())
11495 }
11496}
11497
11498unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UseStorage
11499where
11500 ___E: ::fidl_next::Encoder + ?Sized,
11501{
11502 #[inline]
11503 fn encode_ref(
11504 &self,
11505 encoder: &mut ___E,
11506 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11507 ) -> Result<(), ::fidl_next::EncodeError> {
11508 ::fidl_next::munge!(let WireUseStorage { table } = out);
11509
11510 let max_ord = self.__max_ordinal();
11511
11512 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11513 ::fidl_next::Wire::zero_padding(&mut out);
11514
11515 let mut preallocated =
11516 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11517
11518 for i in 1..=max_ord {
11519 match i {
11520 3 => {
11521 if let Some(availability) = &self.availability {
11522 ::fidl_next::WireEnvelope::encode_value(
11523 availability,
11524 preallocated.encoder,
11525 &mut out,
11526 )?;
11527 } else {
11528 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11529 }
11530 }
11531
11532 2 => {
11533 if let Some(target_path) = &self.target_path {
11534 ::fidl_next::WireEnvelope::encode_value(
11535 target_path,
11536 preallocated.encoder,
11537 &mut out,
11538 )?;
11539 } else {
11540 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11541 }
11542 }
11543
11544 1 => {
11545 if let Some(source_name) = &self.source_name {
11546 ::fidl_next::WireEnvelope::encode_value(
11547 source_name,
11548 preallocated.encoder,
11549 &mut out,
11550 )?;
11551 } else {
11552 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11553 }
11554 }
11555
11556 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11557 }
11558 unsafe {
11559 preallocated.write_next(out.assume_init_ref());
11560 }
11561 }
11562
11563 ::fidl_next::WireTable::encode_len(table, max_ord);
11564
11565 Ok(())
11566 }
11567}
11568
11569impl<'de> ::fidl_next::FromWire<WireUseStorage<'de>> for UseStorage {
11570 #[inline]
11571 fn from_wire(wire: WireUseStorage<'de>) -> Self {
11572 let wire = ::core::mem::ManuallyDrop::new(wire);
11573
11574 let source_name = wire.table.get(1);
11575
11576 let target_path = wire.table.get(2);
11577
11578 let availability = wire.table.get(3);
11579
11580 Self {
11581 source_name: source_name.map(|envelope| {
11582 ::fidl_next::FromWire::from_wire(unsafe {
11583 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
11584 })
11585 }),
11586
11587 target_path: target_path.map(|envelope| {
11588 ::fidl_next::FromWire::from_wire(unsafe {
11589 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
11590 })
11591 }),
11592
11593 availability: availability.map(|envelope| {
11594 ::fidl_next::FromWire::from_wire(unsafe {
11595 envelope.read_unchecked::<crate::WireAvailability>()
11596 })
11597 }),
11598 }
11599 }
11600}
11601
11602impl<'de> ::fidl_next::FromWireRef<WireUseStorage<'de>> for UseStorage {
11603 #[inline]
11604 fn from_wire_ref(wire: &WireUseStorage<'de>) -> Self {
11605 Self {
11606 source_name: wire.table.get(1).map(|envelope| {
11607 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11608 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
11609 })
11610 }),
11611
11612 target_path: wire.table.get(2).map(|envelope| {
11613 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11614 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
11615 })
11616 }),
11617
11618 availability: wire.table.get(3).map(|envelope| {
11619 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11620 envelope.deref_unchecked::<crate::WireAvailability>()
11621 })
11622 }),
11623 }
11624 }
11625}
11626
11627#[repr(C)]
11629pub struct WireUseStorage<'de> {
11630 table: ::fidl_next::WireTable<'de>,
11631}
11632
11633impl<'de> Drop for WireUseStorage<'de> {
11634 fn drop(&mut self) {
11635 let _ = self
11636 .table
11637 .get(1)
11638 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
11639
11640 let _ = self
11641 .table
11642 .get(2)
11643 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
11644
11645 let _ = self
11646 .table
11647 .get(3)
11648 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
11649 }
11650}
11651
11652unsafe impl ::fidl_next::Wire for WireUseStorage<'static> {
11653 type Decoded<'de> = WireUseStorage<'de>;
11654
11655 #[inline]
11656 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11657 ::fidl_next::munge!(let Self { table } = out);
11658 ::fidl_next::WireTable::zero_padding(table);
11659 }
11660}
11661
11662unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseStorage<'static>
11663where
11664 ___D: ::fidl_next::Decoder + ?Sized,
11665{
11666 fn decode(
11667 slot: ::fidl_next::Slot<'_, Self>,
11668 decoder: &mut ___D,
11669 ) -> Result<(), ::fidl_next::DecodeError> {
11670 ::fidl_next::munge!(let Self { table } = slot);
11671
11672 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11673 match ordinal {
11674 0 => unsafe { ::core::hint::unreachable_unchecked() },
11675
11676 1 => {
11677 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
11678 slot.as_mut(),
11679 decoder,
11680 )?;
11681
11682 let source_name = unsafe {
11683 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
11684 };
11685
11686 if source_name.len() > 100 {
11687 return Err(::fidl_next::DecodeError::VectorTooLong {
11688 size: source_name.len() as u64,
11689 limit: 100,
11690 });
11691 }
11692
11693 Ok(())
11694 }
11695
11696 2 => {
11697 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
11698 slot.as_mut(),
11699 decoder,
11700 )?;
11701
11702 let target_path = unsafe {
11703 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
11704 };
11705
11706 if target_path.len() > 1024 {
11707 return Err(::fidl_next::DecodeError::VectorTooLong {
11708 size: target_path.len() as u64,
11709 limit: 1024,
11710 });
11711 }
11712
11713 Ok(())
11714 }
11715
11716 3 => {
11717 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
11718 slot.as_mut(),
11719 decoder,
11720 )?;
11721
11722 Ok(())
11723 }
11724
11725 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
11726 }
11727 })
11728 }
11729}
11730
11731impl<'de> WireUseStorage<'de> {
11732 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
11733 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11734 }
11735
11736 pub fn target_path(&self) -> Option<&::fidl_next::WireString<'de>> {
11737 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11738 }
11739
11740 pub fn availability(&self) -> Option<&crate::WireAvailability> {
11741 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
11742 }
11743}
11744
11745impl<'de> ::core::fmt::Debug for WireUseStorage<'de> {
11746 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
11747 f.debug_struct("UseStorage")
11748 .field("source_name", &self.source_name())
11749 .field("target_path", &self.target_path())
11750 .field("availability", &self.availability())
11751 .finish()
11752 }
11753}
11754
11755::fidl_next::bitflags! {
11756 #[doc = " Allowed sources for runtime overrides of a config field\'s value.\n"]#[derive(
11757 Clone,
11758 Copy,
11759 Debug,
11760 PartialEq,
11761 Eq,
11762 Hash,
11763 )]
11764 pub struct ConfigMutability: u32 {
11765 #[doc = " Allow parent components to provide overrides for the configuration field.\n"]const PARENT = 1;
11766 const _ = !0;
11767 }
11768}
11769
11770impl ::fidl_next::Encodable for ConfigMutability {
11771 type Encoded = WireConfigMutability;
11772}
11773
11774unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigMutability
11775where
11776 ___E: ?Sized,
11777{
11778 #[inline]
11779 fn encode(
11780 self,
11781 encoder: &mut ___E,
11782 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11783 ) -> Result<(), ::fidl_next::EncodeError> {
11784 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
11785 }
11786}
11787
11788unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigMutability
11789where
11790 ___E: ?Sized,
11791{
11792 #[inline]
11793 fn encode_ref(
11794 &self,
11795 _: &mut ___E,
11796 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11797 ) -> Result<(), ::fidl_next::EncodeError> {
11798 ::fidl_next::munge!(let WireConfigMutability { value } = out);
11799 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
11800 Ok(())
11801 }
11802}
11803
11804impl ::core::convert::From<WireConfigMutability> for ConfigMutability {
11805 fn from(wire: WireConfigMutability) -> Self {
11806 Self::from_bits_retain(u32::from(wire.value))
11807 }
11808}
11809
11810impl ::fidl_next::FromWire<WireConfigMutability> for ConfigMutability {
11811 #[inline]
11812 fn from_wire(wire: WireConfigMutability) -> Self {
11813 Self::from(wire)
11814 }
11815}
11816
11817impl ::fidl_next::FromWireRef<WireConfigMutability> for ConfigMutability {
11818 #[inline]
11819 fn from_wire_ref(wire: &WireConfigMutability) -> Self {
11820 Self::from(*wire)
11821 }
11822}
11823
11824#[derive(Clone, Copy, Debug)]
11826#[repr(transparent)]
11827pub struct WireConfigMutability {
11828 value: ::fidl_next::WireU32,
11829}
11830
11831unsafe impl ::fidl_next::Wire for WireConfigMutability {
11832 type Decoded<'de> = Self;
11833
11834 #[inline]
11835 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
11836 }
11838}
11839
11840unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigMutability
11841where
11842 ___D: ?Sized,
11843{
11844 fn decode(
11845 slot: ::fidl_next::Slot<'_, Self>,
11846 _: &mut ___D,
11847 ) -> Result<(), ::fidl_next::DecodeError> {
11848 Ok(())
11849 }
11850}
11851
11852impl ::core::convert::From<ConfigMutability> for WireConfigMutability {
11853 fn from(natural: ConfigMutability) -> Self {
11854 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
11855 }
11856}
11857
11858#[doc = " Declares a single config field (key + type)\n"]
11859#[derive(Clone, Debug, Default)]
11860pub struct ConfigField {
11861 pub key: Option<String>,
11862
11863 pub type_: Option<crate::ConfigType>,
11864
11865 pub mutability: Option<crate::ConfigMutability>,
11866}
11867
11868impl ConfigField {
11869 fn __max_ordinal(&self) -> usize {
11870 if self.mutability.is_some() {
11871 return 3;
11872 }
11873
11874 if self.type_.is_some() {
11875 return 2;
11876 }
11877
11878 if self.key.is_some() {
11879 return 1;
11880 }
11881
11882 0
11883 }
11884}
11885
11886impl ::fidl_next::Encodable for ConfigField {
11887 type Encoded = WireConfigField<'static>;
11888}
11889
11890unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigField
11891where
11892 ___E: ::fidl_next::Encoder + ?Sized,
11893{
11894 #[inline]
11895 fn encode(
11896 mut self,
11897 encoder: &mut ___E,
11898 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11899 ) -> Result<(), ::fidl_next::EncodeError> {
11900 ::fidl_next::munge!(let WireConfigField { table } = out);
11901
11902 let max_ord = self.__max_ordinal();
11903
11904 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11905 ::fidl_next::Wire::zero_padding(&mut out);
11906
11907 let mut preallocated =
11908 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11909
11910 for i in 1..=max_ord {
11911 match i {
11912 3 => {
11913 if let Some(mutability) = self.mutability.take() {
11914 ::fidl_next::WireEnvelope::encode_value(
11915 mutability,
11916 preallocated.encoder,
11917 &mut out,
11918 )?;
11919 } else {
11920 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11921 }
11922 }
11923
11924 2 => {
11925 if let Some(type_) = self.type_.take() {
11926 ::fidl_next::WireEnvelope::encode_value(
11927 type_,
11928 preallocated.encoder,
11929 &mut out,
11930 )?;
11931 } else {
11932 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11933 }
11934 }
11935
11936 1 => {
11937 if let Some(key) = self.key.take() {
11938 ::fidl_next::WireEnvelope::encode_value(
11939 key,
11940 preallocated.encoder,
11941 &mut out,
11942 )?;
11943 } else {
11944 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11945 }
11946 }
11947
11948 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11949 }
11950 unsafe {
11951 preallocated.write_next(out.assume_init_ref());
11952 }
11953 }
11954
11955 ::fidl_next::WireTable::encode_len(table, max_ord);
11956
11957 Ok(())
11958 }
11959}
11960
11961unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigField
11962where
11963 ___E: ::fidl_next::Encoder + ?Sized,
11964{
11965 #[inline]
11966 fn encode_ref(
11967 &self,
11968 encoder: &mut ___E,
11969 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11970 ) -> Result<(), ::fidl_next::EncodeError> {
11971 ::fidl_next::munge!(let WireConfigField { table } = out);
11972
11973 let max_ord = self.__max_ordinal();
11974
11975 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11976 ::fidl_next::Wire::zero_padding(&mut out);
11977
11978 let mut preallocated =
11979 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11980
11981 for i in 1..=max_ord {
11982 match i {
11983 3 => {
11984 if let Some(mutability) = &self.mutability {
11985 ::fidl_next::WireEnvelope::encode_value(
11986 mutability,
11987 preallocated.encoder,
11988 &mut out,
11989 )?;
11990 } else {
11991 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11992 }
11993 }
11994
11995 2 => {
11996 if let Some(type_) = &self.type_ {
11997 ::fidl_next::WireEnvelope::encode_value(
11998 type_,
11999 preallocated.encoder,
12000 &mut out,
12001 )?;
12002 } else {
12003 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12004 }
12005 }
12006
12007 1 => {
12008 if let Some(key) = &self.key {
12009 ::fidl_next::WireEnvelope::encode_value(
12010 key,
12011 preallocated.encoder,
12012 &mut out,
12013 )?;
12014 } else {
12015 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12016 }
12017 }
12018
12019 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12020 }
12021 unsafe {
12022 preallocated.write_next(out.assume_init_ref());
12023 }
12024 }
12025
12026 ::fidl_next::WireTable::encode_len(table, max_ord);
12027
12028 Ok(())
12029 }
12030}
12031
12032impl<'de> ::fidl_next::FromWire<WireConfigField<'de>> for ConfigField {
12033 #[inline]
12034 fn from_wire(wire: WireConfigField<'de>) -> Self {
12035 let wire = ::core::mem::ManuallyDrop::new(wire);
12036
12037 let key = wire.table.get(1);
12038
12039 let type_ = wire.table.get(2);
12040
12041 let mutability = wire.table.get(3);
12042
12043 Self {
12044 key: key.map(|envelope| {
12045 ::fidl_next::FromWire::from_wire(unsafe {
12046 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12047 })
12048 }),
12049
12050 type_: type_.map(|envelope| {
12051 ::fidl_next::FromWire::from_wire(unsafe {
12052 envelope.read_unchecked::<crate::WireConfigType<'de>>()
12053 })
12054 }),
12055
12056 mutability: mutability.map(|envelope| {
12057 ::fidl_next::FromWire::from_wire(unsafe {
12058 envelope.read_unchecked::<crate::WireConfigMutability>()
12059 })
12060 }),
12061 }
12062 }
12063}
12064
12065impl<'de> ::fidl_next::FromWireRef<WireConfigField<'de>> for ConfigField {
12066 #[inline]
12067 fn from_wire_ref(wire: &WireConfigField<'de>) -> Self {
12068 Self {
12069 key: wire.table.get(1).map(|envelope| {
12070 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12071 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12072 })
12073 }),
12074
12075 type_: wire.table.get(2).map(|envelope| {
12076 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12077 envelope.deref_unchecked::<crate::WireConfigType<'de>>()
12078 })
12079 }),
12080
12081 mutability: wire.table.get(3).map(|envelope| {
12082 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12083 envelope.deref_unchecked::<crate::WireConfigMutability>()
12084 })
12085 }),
12086 }
12087 }
12088}
12089
12090#[repr(C)]
12092pub struct WireConfigField<'de> {
12093 table: ::fidl_next::WireTable<'de>,
12094}
12095
12096impl<'de> Drop for WireConfigField<'de> {
12097 fn drop(&mut self) {
12098 let _ = self
12099 .table
12100 .get(1)
12101 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
12102
12103 let _ = self
12104 .table
12105 .get(2)
12106 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigType<'de>>() });
12107
12108 let _ = self
12109 .table
12110 .get(3)
12111 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigMutability>() });
12112 }
12113}
12114
12115unsafe impl ::fidl_next::Wire for WireConfigField<'static> {
12116 type Decoded<'de> = WireConfigField<'de>;
12117
12118 #[inline]
12119 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12120 ::fidl_next::munge!(let Self { table } = out);
12121 ::fidl_next::WireTable::zero_padding(table);
12122 }
12123}
12124
12125unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigField<'static>
12126where
12127 ___D: ::fidl_next::Decoder + ?Sized,
12128{
12129 fn decode(
12130 slot: ::fidl_next::Slot<'_, Self>,
12131 decoder: &mut ___D,
12132 ) -> Result<(), ::fidl_next::DecodeError> {
12133 ::fidl_next::munge!(let Self { table } = slot);
12134
12135 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12136 match ordinal {
12137 0 => unsafe { ::core::hint::unreachable_unchecked() },
12138
12139 1 => {
12140 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
12141 slot.as_mut(),
12142 decoder,
12143 )?;
12144
12145 let key = unsafe {
12146 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
12147 };
12148
12149 if key.len() > 64 {
12150 return Err(::fidl_next::DecodeError::VectorTooLong {
12151 size: key.len() as u64,
12152 limit: 64,
12153 });
12154 }
12155
12156 Ok(())
12157 }
12158
12159 2 => {
12160 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigType<'static>>(
12161 slot.as_mut(),
12162 decoder,
12163 )?;
12164
12165 Ok(())
12166 }
12167
12168 3 => {
12169 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigMutability>(
12170 slot.as_mut(),
12171 decoder,
12172 )?;
12173
12174 Ok(())
12175 }
12176
12177 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
12178 }
12179 })
12180 }
12181}
12182
12183impl<'de> WireConfigField<'de> {
12184 pub fn key(&self) -> Option<&::fidl_next::WireString<'de>> {
12185 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12186 }
12187
12188 pub fn type_(&self) -> Option<&crate::WireConfigType<'de>> {
12189 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12190 }
12191
12192 pub fn mutability(&self) -> Option<&crate::WireConfigMutability> {
12193 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
12194 }
12195}
12196
12197impl<'de> ::core::fmt::Debug for WireConfigField<'de> {
12198 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
12199 f.debug_struct("ConfigField")
12200 .field("key", &self.key())
12201 .field("type_", &self.type_())
12202 .field("mutability", &self.mutability())
12203 .finish()
12204 }
12205}
12206
12207#[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"]
12208#[derive(Clone, Debug, Default)]
12209pub struct Program {
12210 pub runner: Option<String>,
12211
12212 pub info: Option<::fidl_next_fuchsia_data::Dictionary>,
12213}
12214
12215impl Program {
12216 fn __max_ordinal(&self) -> usize {
12217 if self.info.is_some() {
12218 return 2;
12219 }
12220
12221 if self.runner.is_some() {
12222 return 1;
12223 }
12224
12225 0
12226 }
12227}
12228
12229impl ::fidl_next::Encodable for Program {
12230 type Encoded = WireProgram<'static>;
12231}
12232
12233unsafe impl<___E> ::fidl_next::Encode<___E> for Program
12234where
12235 ___E: ::fidl_next::Encoder + ?Sized,
12236{
12237 #[inline]
12238 fn encode(
12239 mut self,
12240 encoder: &mut ___E,
12241 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12242 ) -> Result<(), ::fidl_next::EncodeError> {
12243 ::fidl_next::munge!(let WireProgram { table } = out);
12244
12245 let max_ord = self.__max_ordinal();
12246
12247 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12248 ::fidl_next::Wire::zero_padding(&mut out);
12249
12250 let mut preallocated =
12251 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12252
12253 for i in 1..=max_ord {
12254 match i {
12255 2 => {
12256 if let Some(info) = self.info.take() {
12257 ::fidl_next::WireEnvelope::encode_value(
12258 info,
12259 preallocated.encoder,
12260 &mut out,
12261 )?;
12262 } else {
12263 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12264 }
12265 }
12266
12267 1 => {
12268 if let Some(runner) = self.runner.take() {
12269 ::fidl_next::WireEnvelope::encode_value(
12270 runner,
12271 preallocated.encoder,
12272 &mut out,
12273 )?;
12274 } else {
12275 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12276 }
12277 }
12278
12279 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12280 }
12281 unsafe {
12282 preallocated.write_next(out.assume_init_ref());
12283 }
12284 }
12285
12286 ::fidl_next::WireTable::encode_len(table, max_ord);
12287
12288 Ok(())
12289 }
12290}
12291
12292unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Program
12293where
12294 ___E: ::fidl_next::Encoder + ?Sized,
12295{
12296 #[inline]
12297 fn encode_ref(
12298 &self,
12299 encoder: &mut ___E,
12300 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12301 ) -> Result<(), ::fidl_next::EncodeError> {
12302 ::fidl_next::munge!(let WireProgram { table } = out);
12303
12304 let max_ord = self.__max_ordinal();
12305
12306 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12307 ::fidl_next::Wire::zero_padding(&mut out);
12308
12309 let mut preallocated =
12310 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12311
12312 for i in 1..=max_ord {
12313 match i {
12314 2 => {
12315 if let Some(info) = &self.info {
12316 ::fidl_next::WireEnvelope::encode_value(
12317 info,
12318 preallocated.encoder,
12319 &mut out,
12320 )?;
12321 } else {
12322 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12323 }
12324 }
12325
12326 1 => {
12327 if let Some(runner) = &self.runner {
12328 ::fidl_next::WireEnvelope::encode_value(
12329 runner,
12330 preallocated.encoder,
12331 &mut out,
12332 )?;
12333 } else {
12334 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12335 }
12336 }
12337
12338 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12339 }
12340 unsafe {
12341 preallocated.write_next(out.assume_init_ref());
12342 }
12343 }
12344
12345 ::fidl_next::WireTable::encode_len(table, max_ord);
12346
12347 Ok(())
12348 }
12349}
12350
12351impl<'de> ::fidl_next::FromWire<WireProgram<'de>> for Program {
12352 #[inline]
12353 fn from_wire(wire: WireProgram<'de>) -> Self {
12354 let wire = ::core::mem::ManuallyDrop::new(wire);
12355
12356 let runner = wire.table.get(1);
12357
12358 let info = wire.table.get(2);
12359
12360 Self {
12361 runner: runner.map(|envelope| {
12362 ::fidl_next::FromWire::from_wire(unsafe {
12363 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12364 })
12365 }),
12366
12367 info: info.map(|envelope| {
12368 ::fidl_next::FromWire::from_wire(unsafe {
12369 envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
12370 })
12371 }),
12372 }
12373 }
12374}
12375
12376impl<'de> ::fidl_next::FromWireRef<WireProgram<'de>> for Program {
12377 #[inline]
12378 fn from_wire_ref(wire: &WireProgram<'de>) -> Self {
12379 Self {
12380 runner: wire.table.get(1).map(|envelope| {
12381 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12382 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12383 })
12384 }),
12385
12386 info: wire.table.get(2).map(|envelope| {
12387 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12388 envelope.deref_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
12389 })
12390 }),
12391 }
12392 }
12393}
12394
12395#[repr(C)]
12397pub struct WireProgram<'de> {
12398 table: ::fidl_next::WireTable<'de>,
12399}
12400
12401impl<'de> Drop for WireProgram<'de> {
12402 fn drop(&mut self) {
12403 let _ = self
12404 .table
12405 .get(1)
12406 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
12407
12408 let _ = self.table.get(2).map(|envelope| unsafe {
12409 envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
12410 });
12411 }
12412}
12413
12414unsafe impl ::fidl_next::Wire for WireProgram<'static> {
12415 type Decoded<'de> = WireProgram<'de>;
12416
12417 #[inline]
12418 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12419 ::fidl_next::munge!(let Self { table } = out);
12420 ::fidl_next::WireTable::zero_padding(table);
12421 }
12422}
12423
12424unsafe impl<___D> ::fidl_next::Decode<___D> for WireProgram<'static>
12425where
12426 ___D: ::fidl_next::Decoder + ?Sized,
12427{
12428 fn decode(
12429 slot: ::fidl_next::Slot<'_, Self>,
12430 decoder: &mut ___D,
12431 ) -> Result<(), ::fidl_next::DecodeError> {
12432 ::fidl_next::munge!(let Self { table } = slot);
12433
12434 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12435 match ordinal {
12436 0 => unsafe { ::core::hint::unreachable_unchecked() },
12437
12438 1 => {
12439 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
12440 slot.as_mut(),
12441 decoder,
12442 )?;
12443
12444 let runner = unsafe {
12445 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
12446 };
12447
12448 if runner.len() > 100 {
12449 return Err(::fidl_next::DecodeError::VectorTooLong {
12450 size: runner.len() as u64,
12451 limit: 100,
12452 });
12453 }
12454
12455 Ok(())
12456 }
12457
12458 2 => {
12459 ::fidl_next::WireEnvelope::decode_as::<
12460 ___D,
12461 ::fidl_next_fuchsia_data::WireDictionary<'static>,
12462 >(slot.as_mut(), decoder)?;
12463
12464 Ok(())
12465 }
12466
12467 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
12468 }
12469 })
12470 }
12471}
12472
12473impl<'de> WireProgram<'de> {
12474 pub fn runner(&self) -> Option<&::fidl_next::WireString<'de>> {
12475 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12476 }
12477
12478 pub fn info(&self) -> Option<&::fidl_next_fuchsia_data::WireDictionary<'de>> {
12479 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12480 }
12481}
12482
12483impl<'de> ::core::fmt::Debug for WireProgram<'de> {
12484 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
12485 f.debug_struct("Program")
12486 .field("runner", &self.runner())
12487 .field("info", &self.info())
12488 .finish()
12489 }
12490}
12491
12492#[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"]
12493#[derive(Clone, Debug, Default)]
12494pub struct UseService {
12495 pub source: Option<crate::Ref>,
12496
12497 pub source_name: Option<String>,
12498
12499 pub target_path: Option<String>,
12500
12501 pub dependency_type: Option<crate::DependencyType>,
12502
12503 pub availability: Option<crate::Availability>,
12504
12505 pub source_dictionary: Option<String>,
12506}
12507
12508impl UseService {
12509 fn __max_ordinal(&self) -> usize {
12510 if self.source_dictionary.is_some() {
12511 return 6;
12512 }
12513
12514 if self.availability.is_some() {
12515 return 5;
12516 }
12517
12518 if self.dependency_type.is_some() {
12519 return 4;
12520 }
12521
12522 if self.target_path.is_some() {
12523 return 3;
12524 }
12525
12526 if self.source_name.is_some() {
12527 return 2;
12528 }
12529
12530 if self.source.is_some() {
12531 return 1;
12532 }
12533
12534 0
12535 }
12536}
12537
12538impl ::fidl_next::Encodable for UseService {
12539 type Encoded = WireUseService<'static>;
12540}
12541
12542unsafe impl<___E> ::fidl_next::Encode<___E> for UseService
12543where
12544 ___E: ::fidl_next::Encoder + ?Sized,
12545{
12546 #[inline]
12547 fn encode(
12548 mut self,
12549 encoder: &mut ___E,
12550 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12551 ) -> Result<(), ::fidl_next::EncodeError> {
12552 ::fidl_next::munge!(let WireUseService { table } = out);
12553
12554 let max_ord = self.__max_ordinal();
12555
12556 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12557 ::fidl_next::Wire::zero_padding(&mut out);
12558
12559 let mut preallocated =
12560 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12561
12562 for i in 1..=max_ord {
12563 match i {
12564 6 => {
12565 if let Some(source_dictionary) = self.source_dictionary.take() {
12566 ::fidl_next::WireEnvelope::encode_value(
12567 source_dictionary,
12568 preallocated.encoder,
12569 &mut out,
12570 )?;
12571 } else {
12572 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12573 }
12574 }
12575
12576 5 => {
12577 if let Some(availability) = self.availability.take() {
12578 ::fidl_next::WireEnvelope::encode_value(
12579 availability,
12580 preallocated.encoder,
12581 &mut out,
12582 )?;
12583 } else {
12584 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12585 }
12586 }
12587
12588 4 => {
12589 if let Some(dependency_type) = self.dependency_type.take() {
12590 ::fidl_next::WireEnvelope::encode_value(
12591 dependency_type,
12592 preallocated.encoder,
12593 &mut out,
12594 )?;
12595 } else {
12596 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12597 }
12598 }
12599
12600 3 => {
12601 if let Some(target_path) = self.target_path.take() {
12602 ::fidl_next::WireEnvelope::encode_value(
12603 target_path,
12604 preallocated.encoder,
12605 &mut out,
12606 )?;
12607 } else {
12608 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12609 }
12610 }
12611
12612 2 => {
12613 if let Some(source_name) = self.source_name.take() {
12614 ::fidl_next::WireEnvelope::encode_value(
12615 source_name,
12616 preallocated.encoder,
12617 &mut out,
12618 )?;
12619 } else {
12620 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12621 }
12622 }
12623
12624 1 => {
12625 if let Some(source) = self.source.take() {
12626 ::fidl_next::WireEnvelope::encode_value(
12627 source,
12628 preallocated.encoder,
12629 &mut out,
12630 )?;
12631 } else {
12632 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12633 }
12634 }
12635
12636 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12637 }
12638 unsafe {
12639 preallocated.write_next(out.assume_init_ref());
12640 }
12641 }
12642
12643 ::fidl_next::WireTable::encode_len(table, max_ord);
12644
12645 Ok(())
12646 }
12647}
12648
12649unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UseService
12650where
12651 ___E: ::fidl_next::Encoder + ?Sized,
12652{
12653 #[inline]
12654 fn encode_ref(
12655 &self,
12656 encoder: &mut ___E,
12657 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12658 ) -> Result<(), ::fidl_next::EncodeError> {
12659 ::fidl_next::munge!(let WireUseService { table } = out);
12660
12661 let max_ord = self.__max_ordinal();
12662
12663 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12664 ::fidl_next::Wire::zero_padding(&mut out);
12665
12666 let mut preallocated =
12667 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12668
12669 for i in 1..=max_ord {
12670 match i {
12671 6 => {
12672 if let Some(source_dictionary) = &self.source_dictionary {
12673 ::fidl_next::WireEnvelope::encode_value(
12674 source_dictionary,
12675 preallocated.encoder,
12676 &mut out,
12677 )?;
12678 } else {
12679 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12680 }
12681 }
12682
12683 5 => {
12684 if let Some(availability) = &self.availability {
12685 ::fidl_next::WireEnvelope::encode_value(
12686 availability,
12687 preallocated.encoder,
12688 &mut out,
12689 )?;
12690 } else {
12691 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12692 }
12693 }
12694
12695 4 => {
12696 if let Some(dependency_type) = &self.dependency_type {
12697 ::fidl_next::WireEnvelope::encode_value(
12698 dependency_type,
12699 preallocated.encoder,
12700 &mut out,
12701 )?;
12702 } else {
12703 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12704 }
12705 }
12706
12707 3 => {
12708 if let Some(target_path) = &self.target_path {
12709 ::fidl_next::WireEnvelope::encode_value(
12710 target_path,
12711 preallocated.encoder,
12712 &mut out,
12713 )?;
12714 } else {
12715 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12716 }
12717 }
12718
12719 2 => {
12720 if let Some(source_name) = &self.source_name {
12721 ::fidl_next::WireEnvelope::encode_value(
12722 source_name,
12723 preallocated.encoder,
12724 &mut out,
12725 )?;
12726 } else {
12727 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12728 }
12729 }
12730
12731 1 => {
12732 if let Some(source) = &self.source {
12733 ::fidl_next::WireEnvelope::encode_value(
12734 source,
12735 preallocated.encoder,
12736 &mut out,
12737 )?;
12738 } else {
12739 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12740 }
12741 }
12742
12743 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12744 }
12745 unsafe {
12746 preallocated.write_next(out.assume_init_ref());
12747 }
12748 }
12749
12750 ::fidl_next::WireTable::encode_len(table, max_ord);
12751
12752 Ok(())
12753 }
12754}
12755
12756impl<'de> ::fidl_next::FromWire<WireUseService<'de>> for UseService {
12757 #[inline]
12758 fn from_wire(wire: WireUseService<'de>) -> Self {
12759 let wire = ::core::mem::ManuallyDrop::new(wire);
12760
12761 let source = wire.table.get(1);
12762
12763 let source_name = wire.table.get(2);
12764
12765 let target_path = wire.table.get(3);
12766
12767 let dependency_type = wire.table.get(4);
12768
12769 let availability = wire.table.get(5);
12770
12771 let source_dictionary = wire.table.get(6);
12772
12773 Self {
12774 source: source.map(|envelope| {
12775 ::fidl_next::FromWire::from_wire(unsafe {
12776 envelope.read_unchecked::<crate::WireRef<'de>>()
12777 })
12778 }),
12779
12780 source_name: source_name.map(|envelope| {
12781 ::fidl_next::FromWire::from_wire(unsafe {
12782 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12783 })
12784 }),
12785
12786 target_path: target_path.map(|envelope| {
12787 ::fidl_next::FromWire::from_wire(unsafe {
12788 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12789 })
12790 }),
12791
12792 dependency_type: dependency_type.map(|envelope| {
12793 ::fidl_next::FromWire::from_wire(unsafe {
12794 envelope.read_unchecked::<crate::WireDependencyType>()
12795 })
12796 }),
12797
12798 availability: availability.map(|envelope| {
12799 ::fidl_next::FromWire::from_wire(unsafe {
12800 envelope.read_unchecked::<crate::WireAvailability>()
12801 })
12802 }),
12803
12804 source_dictionary: source_dictionary.map(|envelope| {
12805 ::fidl_next::FromWire::from_wire(unsafe {
12806 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12807 })
12808 }),
12809 }
12810 }
12811}
12812
12813impl<'de> ::fidl_next::FromWireRef<WireUseService<'de>> for UseService {
12814 #[inline]
12815 fn from_wire_ref(wire: &WireUseService<'de>) -> Self {
12816 Self {
12817 source: wire.table.get(1).map(|envelope| {
12818 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12819 envelope.deref_unchecked::<crate::WireRef<'de>>()
12820 })
12821 }),
12822
12823 source_name: wire.table.get(2).map(|envelope| {
12824 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12825 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12826 })
12827 }),
12828
12829 target_path: wire.table.get(3).map(|envelope| {
12830 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12831 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12832 })
12833 }),
12834
12835 dependency_type: wire.table.get(4).map(|envelope| {
12836 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12837 envelope.deref_unchecked::<crate::WireDependencyType>()
12838 })
12839 }),
12840
12841 availability: wire.table.get(5).map(|envelope| {
12842 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12843 envelope.deref_unchecked::<crate::WireAvailability>()
12844 })
12845 }),
12846
12847 source_dictionary: wire.table.get(6).map(|envelope| {
12848 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12849 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12850 })
12851 }),
12852 }
12853 }
12854}
12855
12856#[repr(C)]
12858pub struct WireUseService<'de> {
12859 table: ::fidl_next::WireTable<'de>,
12860}
12861
12862impl<'de> Drop for WireUseService<'de> {
12863 fn drop(&mut self) {
12864 let _ = self
12865 .table
12866 .get(1)
12867 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
12868
12869 let _ = self
12870 .table
12871 .get(2)
12872 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
12873
12874 let _ = self
12875 .table
12876 .get(3)
12877 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
12878
12879 let _ = self
12880 .table
12881 .get(4)
12882 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDependencyType>() });
12883
12884 let _ = self
12885 .table
12886 .get(5)
12887 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
12888
12889 let _ = self
12890 .table
12891 .get(6)
12892 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
12893 }
12894}
12895
12896unsafe impl ::fidl_next::Wire for WireUseService<'static> {
12897 type Decoded<'de> = WireUseService<'de>;
12898
12899 #[inline]
12900 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12901 ::fidl_next::munge!(let Self { table } = out);
12902 ::fidl_next::WireTable::zero_padding(table);
12903 }
12904}
12905
12906unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseService<'static>
12907where
12908 ___D: ::fidl_next::Decoder + ?Sized,
12909{
12910 fn decode(
12911 slot: ::fidl_next::Slot<'_, Self>,
12912 decoder: &mut ___D,
12913 ) -> Result<(), ::fidl_next::DecodeError> {
12914 ::fidl_next::munge!(let Self { table } = slot);
12915
12916 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12917 match ordinal {
12918 0 => unsafe { ::core::hint::unreachable_unchecked() },
12919
12920 1 => {
12921 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
12922 slot.as_mut(),
12923 decoder,
12924 )?;
12925
12926 Ok(())
12927 }
12928
12929 2 => {
12930 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
12931 slot.as_mut(),
12932 decoder,
12933 )?;
12934
12935 let source_name = unsafe {
12936 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
12937 };
12938
12939 if source_name.len() > 100 {
12940 return Err(::fidl_next::DecodeError::VectorTooLong {
12941 size: source_name.len() as u64,
12942 limit: 100,
12943 });
12944 }
12945
12946 Ok(())
12947 }
12948
12949 3 => {
12950 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
12951 slot.as_mut(),
12952 decoder,
12953 )?;
12954
12955 let target_path = unsafe {
12956 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
12957 };
12958
12959 if target_path.len() > 1024 {
12960 return Err(::fidl_next::DecodeError::VectorTooLong {
12961 size: target_path.len() as u64,
12962 limit: 1024,
12963 });
12964 }
12965
12966 Ok(())
12967 }
12968
12969 4 => {
12970 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
12971 slot.as_mut(),
12972 decoder,
12973 )?;
12974
12975 Ok(())
12976 }
12977
12978 5 => {
12979 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
12980 slot.as_mut(),
12981 decoder,
12982 )?;
12983
12984 Ok(())
12985 }
12986
12987 6 => {
12988 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
12989 slot.as_mut(),
12990 decoder,
12991 )?;
12992
12993 let source_dictionary = unsafe {
12994 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
12995 };
12996
12997 if source_dictionary.len() > 1024 {
12998 return Err(::fidl_next::DecodeError::VectorTooLong {
12999 size: source_dictionary.len() as u64,
13000 limit: 1024,
13001 });
13002 }
13003
13004 Ok(())
13005 }
13006
13007 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
13008 }
13009 })
13010 }
13011}
13012
13013impl<'de> WireUseService<'de> {
13014 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
13015 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13016 }
13017
13018 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
13019 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
13020 }
13021
13022 pub fn target_path(&self) -> Option<&::fidl_next::WireString<'de>> {
13023 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
13024 }
13025
13026 pub fn dependency_type(&self) -> Option<&crate::WireDependencyType> {
13027 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
13028 }
13029
13030 pub fn availability(&self) -> Option<&crate::WireAvailability> {
13031 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
13032 }
13033
13034 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
13035 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
13036 }
13037}
13038
13039impl<'de> ::core::fmt::Debug for WireUseService<'de> {
13040 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
13041 f.debug_struct("UseService")
13042 .field("source", &self.source())
13043 .field("source_name", &self.source_name())
13044 .field("target_path", &self.target_path())
13045 .field("dependency_type", &self.dependency_type())
13046 .field("availability", &self.availability())
13047 .field("source_dictionary", &self.source_dictionary())
13048 .finish()
13049 }
13050}
13051
13052#[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"]
13053#[derive(Clone, Debug, Default)]
13054pub struct UseProtocol {
13055 pub source: Option<crate::Ref>,
13056
13057 pub source_name: Option<String>,
13058
13059 pub target_path: Option<String>,
13060
13061 pub dependency_type: Option<crate::DependencyType>,
13062
13063 pub availability: Option<crate::Availability>,
13064
13065 pub source_dictionary: Option<String>,
13066}
13067
13068impl UseProtocol {
13069 fn __max_ordinal(&self) -> usize {
13070 if self.source_dictionary.is_some() {
13071 return 6;
13072 }
13073
13074 if self.availability.is_some() {
13075 return 5;
13076 }
13077
13078 if self.dependency_type.is_some() {
13079 return 4;
13080 }
13081
13082 if self.target_path.is_some() {
13083 return 3;
13084 }
13085
13086 if self.source_name.is_some() {
13087 return 2;
13088 }
13089
13090 if self.source.is_some() {
13091 return 1;
13092 }
13093
13094 0
13095 }
13096}
13097
13098impl ::fidl_next::Encodable for UseProtocol {
13099 type Encoded = WireUseProtocol<'static>;
13100}
13101
13102unsafe impl<___E> ::fidl_next::Encode<___E> for UseProtocol
13103where
13104 ___E: ::fidl_next::Encoder + ?Sized,
13105{
13106 #[inline]
13107 fn encode(
13108 mut self,
13109 encoder: &mut ___E,
13110 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13111 ) -> Result<(), ::fidl_next::EncodeError> {
13112 ::fidl_next::munge!(let WireUseProtocol { table } = out);
13113
13114 let max_ord = self.__max_ordinal();
13115
13116 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
13117 ::fidl_next::Wire::zero_padding(&mut out);
13118
13119 let mut preallocated =
13120 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
13121
13122 for i in 1..=max_ord {
13123 match i {
13124 6 => {
13125 if let Some(source_dictionary) = self.source_dictionary.take() {
13126 ::fidl_next::WireEnvelope::encode_value(
13127 source_dictionary,
13128 preallocated.encoder,
13129 &mut out,
13130 )?;
13131 } else {
13132 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13133 }
13134 }
13135
13136 5 => {
13137 if let Some(availability) = self.availability.take() {
13138 ::fidl_next::WireEnvelope::encode_value(
13139 availability,
13140 preallocated.encoder,
13141 &mut out,
13142 )?;
13143 } else {
13144 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13145 }
13146 }
13147
13148 4 => {
13149 if let Some(dependency_type) = self.dependency_type.take() {
13150 ::fidl_next::WireEnvelope::encode_value(
13151 dependency_type,
13152 preallocated.encoder,
13153 &mut out,
13154 )?;
13155 } else {
13156 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13157 }
13158 }
13159
13160 3 => {
13161 if let Some(target_path) = self.target_path.take() {
13162 ::fidl_next::WireEnvelope::encode_value(
13163 target_path,
13164 preallocated.encoder,
13165 &mut out,
13166 )?;
13167 } else {
13168 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13169 }
13170 }
13171
13172 2 => {
13173 if let Some(source_name) = self.source_name.take() {
13174 ::fidl_next::WireEnvelope::encode_value(
13175 source_name,
13176 preallocated.encoder,
13177 &mut out,
13178 )?;
13179 } else {
13180 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13181 }
13182 }
13183
13184 1 => {
13185 if let Some(source) = self.source.take() {
13186 ::fidl_next::WireEnvelope::encode_value(
13187 source,
13188 preallocated.encoder,
13189 &mut out,
13190 )?;
13191 } else {
13192 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13193 }
13194 }
13195
13196 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
13197 }
13198 unsafe {
13199 preallocated.write_next(out.assume_init_ref());
13200 }
13201 }
13202
13203 ::fidl_next::WireTable::encode_len(table, max_ord);
13204
13205 Ok(())
13206 }
13207}
13208
13209unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UseProtocol
13210where
13211 ___E: ::fidl_next::Encoder + ?Sized,
13212{
13213 #[inline]
13214 fn encode_ref(
13215 &self,
13216 encoder: &mut ___E,
13217 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13218 ) -> Result<(), ::fidl_next::EncodeError> {
13219 ::fidl_next::munge!(let WireUseProtocol { table } = out);
13220
13221 let max_ord = self.__max_ordinal();
13222
13223 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
13224 ::fidl_next::Wire::zero_padding(&mut out);
13225
13226 let mut preallocated =
13227 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
13228
13229 for i in 1..=max_ord {
13230 match i {
13231 6 => {
13232 if let Some(source_dictionary) = &self.source_dictionary {
13233 ::fidl_next::WireEnvelope::encode_value(
13234 source_dictionary,
13235 preallocated.encoder,
13236 &mut out,
13237 )?;
13238 } else {
13239 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13240 }
13241 }
13242
13243 5 => {
13244 if let Some(availability) = &self.availability {
13245 ::fidl_next::WireEnvelope::encode_value(
13246 availability,
13247 preallocated.encoder,
13248 &mut out,
13249 )?;
13250 } else {
13251 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13252 }
13253 }
13254
13255 4 => {
13256 if let Some(dependency_type) = &self.dependency_type {
13257 ::fidl_next::WireEnvelope::encode_value(
13258 dependency_type,
13259 preallocated.encoder,
13260 &mut out,
13261 )?;
13262 } else {
13263 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13264 }
13265 }
13266
13267 3 => {
13268 if let Some(target_path) = &self.target_path {
13269 ::fidl_next::WireEnvelope::encode_value(
13270 target_path,
13271 preallocated.encoder,
13272 &mut out,
13273 )?;
13274 } else {
13275 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13276 }
13277 }
13278
13279 2 => {
13280 if let Some(source_name) = &self.source_name {
13281 ::fidl_next::WireEnvelope::encode_value(
13282 source_name,
13283 preallocated.encoder,
13284 &mut out,
13285 )?;
13286 } else {
13287 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13288 }
13289 }
13290
13291 1 => {
13292 if let Some(source) = &self.source {
13293 ::fidl_next::WireEnvelope::encode_value(
13294 source,
13295 preallocated.encoder,
13296 &mut out,
13297 )?;
13298 } else {
13299 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13300 }
13301 }
13302
13303 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
13304 }
13305 unsafe {
13306 preallocated.write_next(out.assume_init_ref());
13307 }
13308 }
13309
13310 ::fidl_next::WireTable::encode_len(table, max_ord);
13311
13312 Ok(())
13313 }
13314}
13315
13316impl<'de> ::fidl_next::FromWire<WireUseProtocol<'de>> for UseProtocol {
13317 #[inline]
13318 fn from_wire(wire: WireUseProtocol<'de>) -> Self {
13319 let wire = ::core::mem::ManuallyDrop::new(wire);
13320
13321 let source = wire.table.get(1);
13322
13323 let source_name = wire.table.get(2);
13324
13325 let target_path = wire.table.get(3);
13326
13327 let dependency_type = wire.table.get(4);
13328
13329 let availability = wire.table.get(5);
13330
13331 let source_dictionary = wire.table.get(6);
13332
13333 Self {
13334 source: source.map(|envelope| {
13335 ::fidl_next::FromWire::from_wire(unsafe {
13336 envelope.read_unchecked::<crate::WireRef<'de>>()
13337 })
13338 }),
13339
13340 source_name: source_name.map(|envelope| {
13341 ::fidl_next::FromWire::from_wire(unsafe {
13342 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13343 })
13344 }),
13345
13346 target_path: target_path.map(|envelope| {
13347 ::fidl_next::FromWire::from_wire(unsafe {
13348 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13349 })
13350 }),
13351
13352 dependency_type: dependency_type.map(|envelope| {
13353 ::fidl_next::FromWire::from_wire(unsafe {
13354 envelope.read_unchecked::<crate::WireDependencyType>()
13355 })
13356 }),
13357
13358 availability: availability.map(|envelope| {
13359 ::fidl_next::FromWire::from_wire(unsafe {
13360 envelope.read_unchecked::<crate::WireAvailability>()
13361 })
13362 }),
13363
13364 source_dictionary: source_dictionary.map(|envelope| {
13365 ::fidl_next::FromWire::from_wire(unsafe {
13366 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13367 })
13368 }),
13369 }
13370 }
13371}
13372
13373impl<'de> ::fidl_next::FromWireRef<WireUseProtocol<'de>> for UseProtocol {
13374 #[inline]
13375 fn from_wire_ref(wire: &WireUseProtocol<'de>) -> Self {
13376 Self {
13377 source: wire.table.get(1).map(|envelope| {
13378 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13379 envelope.deref_unchecked::<crate::WireRef<'de>>()
13380 })
13381 }),
13382
13383 source_name: wire.table.get(2).map(|envelope| {
13384 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13385 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13386 })
13387 }),
13388
13389 target_path: wire.table.get(3).map(|envelope| {
13390 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13391 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13392 })
13393 }),
13394
13395 dependency_type: wire.table.get(4).map(|envelope| {
13396 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13397 envelope.deref_unchecked::<crate::WireDependencyType>()
13398 })
13399 }),
13400
13401 availability: wire.table.get(5).map(|envelope| {
13402 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13403 envelope.deref_unchecked::<crate::WireAvailability>()
13404 })
13405 }),
13406
13407 source_dictionary: wire.table.get(6).map(|envelope| {
13408 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13409 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13410 })
13411 }),
13412 }
13413 }
13414}
13415
13416#[repr(C)]
13418pub struct WireUseProtocol<'de> {
13419 table: ::fidl_next::WireTable<'de>,
13420}
13421
13422impl<'de> Drop for WireUseProtocol<'de> {
13423 fn drop(&mut self) {
13424 let _ = self
13425 .table
13426 .get(1)
13427 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
13428
13429 let _ = self
13430 .table
13431 .get(2)
13432 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
13433
13434 let _ = self
13435 .table
13436 .get(3)
13437 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
13438
13439 let _ = self
13440 .table
13441 .get(4)
13442 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDependencyType>() });
13443
13444 let _ = self
13445 .table
13446 .get(5)
13447 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
13448
13449 let _ = self
13450 .table
13451 .get(6)
13452 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
13453 }
13454}
13455
13456unsafe impl ::fidl_next::Wire for WireUseProtocol<'static> {
13457 type Decoded<'de> = WireUseProtocol<'de>;
13458
13459 #[inline]
13460 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13461 ::fidl_next::munge!(let Self { table } = out);
13462 ::fidl_next::WireTable::zero_padding(table);
13463 }
13464}
13465
13466unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseProtocol<'static>
13467where
13468 ___D: ::fidl_next::Decoder + ?Sized,
13469{
13470 fn decode(
13471 slot: ::fidl_next::Slot<'_, Self>,
13472 decoder: &mut ___D,
13473 ) -> Result<(), ::fidl_next::DecodeError> {
13474 ::fidl_next::munge!(let Self { table } = slot);
13475
13476 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13477 match ordinal {
13478 0 => unsafe { ::core::hint::unreachable_unchecked() },
13479
13480 1 => {
13481 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
13482 slot.as_mut(),
13483 decoder,
13484 )?;
13485
13486 Ok(())
13487 }
13488
13489 2 => {
13490 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
13491 slot.as_mut(),
13492 decoder,
13493 )?;
13494
13495 let source_name = unsafe {
13496 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
13497 };
13498
13499 if source_name.len() > 100 {
13500 return Err(::fidl_next::DecodeError::VectorTooLong {
13501 size: source_name.len() as u64,
13502 limit: 100,
13503 });
13504 }
13505
13506 Ok(())
13507 }
13508
13509 3 => {
13510 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
13511 slot.as_mut(),
13512 decoder,
13513 )?;
13514
13515 let target_path = unsafe {
13516 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
13517 };
13518
13519 if target_path.len() > 1024 {
13520 return Err(::fidl_next::DecodeError::VectorTooLong {
13521 size: target_path.len() as u64,
13522 limit: 1024,
13523 });
13524 }
13525
13526 Ok(())
13527 }
13528
13529 4 => {
13530 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
13531 slot.as_mut(),
13532 decoder,
13533 )?;
13534
13535 Ok(())
13536 }
13537
13538 5 => {
13539 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
13540 slot.as_mut(),
13541 decoder,
13542 )?;
13543
13544 Ok(())
13545 }
13546
13547 6 => {
13548 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
13549 slot.as_mut(),
13550 decoder,
13551 )?;
13552
13553 let source_dictionary = unsafe {
13554 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
13555 };
13556
13557 if source_dictionary.len() > 1024 {
13558 return Err(::fidl_next::DecodeError::VectorTooLong {
13559 size: source_dictionary.len() as u64,
13560 limit: 1024,
13561 });
13562 }
13563
13564 Ok(())
13565 }
13566
13567 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
13568 }
13569 })
13570 }
13571}
13572
13573impl<'de> WireUseProtocol<'de> {
13574 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
13575 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13576 }
13577
13578 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
13579 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
13580 }
13581
13582 pub fn target_path(&self) -> Option<&::fidl_next::WireString<'de>> {
13583 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
13584 }
13585
13586 pub fn dependency_type(&self) -> Option<&crate::WireDependencyType> {
13587 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
13588 }
13589
13590 pub fn availability(&self) -> Option<&crate::WireAvailability> {
13591 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
13592 }
13593
13594 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
13595 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
13596 }
13597}
13598
13599impl<'de> ::core::fmt::Debug for WireUseProtocol<'de> {
13600 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
13601 f.debug_struct("UseProtocol")
13602 .field("source", &self.source())
13603 .field("source_name", &self.source_name())
13604 .field("target_path", &self.target_path())
13605 .field("dependency_type", &self.dependency_type())
13606 .field("availability", &self.availability())
13607 .field("source_dictionary", &self.source_dictionary())
13608 .finish()
13609 }
13610}
13611
13612#[doc = " Declares a directory used by a component, which was offered to it.\n"]
13613#[derive(Clone, Debug, Default)]
13614pub struct UseDirectory {
13615 pub source: Option<crate::Ref>,
13616
13617 pub source_name: Option<String>,
13618
13619 pub target_path: Option<String>,
13620
13621 pub rights: Option<::fidl_next_fuchsia_io::Operations>,
13622
13623 pub subdir: Option<String>,
13624
13625 pub dependency_type: Option<crate::DependencyType>,
13626
13627 pub availability: Option<crate::Availability>,
13628
13629 pub source_dictionary: Option<String>,
13630}
13631
13632impl UseDirectory {
13633 fn __max_ordinal(&self) -> usize {
13634 if self.source_dictionary.is_some() {
13635 return 8;
13636 }
13637
13638 if self.availability.is_some() {
13639 return 7;
13640 }
13641
13642 if self.dependency_type.is_some() {
13643 return 6;
13644 }
13645
13646 if self.subdir.is_some() {
13647 return 5;
13648 }
13649
13650 if self.rights.is_some() {
13651 return 4;
13652 }
13653
13654 if self.target_path.is_some() {
13655 return 3;
13656 }
13657
13658 if self.source_name.is_some() {
13659 return 2;
13660 }
13661
13662 if self.source.is_some() {
13663 return 1;
13664 }
13665
13666 0
13667 }
13668}
13669
13670impl ::fidl_next::Encodable for UseDirectory {
13671 type Encoded = WireUseDirectory<'static>;
13672}
13673
13674unsafe impl<___E> ::fidl_next::Encode<___E> for UseDirectory
13675where
13676 ___E: ::fidl_next::Encoder + ?Sized,
13677{
13678 #[inline]
13679 fn encode(
13680 mut self,
13681 encoder: &mut ___E,
13682 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13683 ) -> Result<(), ::fidl_next::EncodeError> {
13684 ::fidl_next::munge!(let WireUseDirectory { table } = out);
13685
13686 let max_ord = self.__max_ordinal();
13687
13688 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
13689 ::fidl_next::Wire::zero_padding(&mut out);
13690
13691 let mut preallocated =
13692 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
13693
13694 for i in 1..=max_ord {
13695 match i {
13696 8 => {
13697 if let Some(source_dictionary) = self.source_dictionary.take() {
13698 ::fidl_next::WireEnvelope::encode_value(
13699 source_dictionary,
13700 preallocated.encoder,
13701 &mut out,
13702 )?;
13703 } else {
13704 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13705 }
13706 }
13707
13708 7 => {
13709 if let Some(availability) = self.availability.take() {
13710 ::fidl_next::WireEnvelope::encode_value(
13711 availability,
13712 preallocated.encoder,
13713 &mut out,
13714 )?;
13715 } else {
13716 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13717 }
13718 }
13719
13720 6 => {
13721 if let Some(dependency_type) = self.dependency_type.take() {
13722 ::fidl_next::WireEnvelope::encode_value(
13723 dependency_type,
13724 preallocated.encoder,
13725 &mut out,
13726 )?;
13727 } else {
13728 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13729 }
13730 }
13731
13732 5 => {
13733 if let Some(subdir) = self.subdir.take() {
13734 ::fidl_next::WireEnvelope::encode_value(
13735 subdir,
13736 preallocated.encoder,
13737 &mut out,
13738 )?;
13739 } else {
13740 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13741 }
13742 }
13743
13744 4 => {
13745 if let Some(rights) = self.rights.take() {
13746 ::fidl_next::WireEnvelope::encode_value(
13747 rights,
13748 preallocated.encoder,
13749 &mut out,
13750 )?;
13751 } else {
13752 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13753 }
13754 }
13755
13756 3 => {
13757 if let Some(target_path) = self.target_path.take() {
13758 ::fidl_next::WireEnvelope::encode_value(
13759 target_path,
13760 preallocated.encoder,
13761 &mut out,
13762 )?;
13763 } else {
13764 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13765 }
13766 }
13767
13768 2 => {
13769 if let Some(source_name) = self.source_name.take() {
13770 ::fidl_next::WireEnvelope::encode_value(
13771 source_name,
13772 preallocated.encoder,
13773 &mut out,
13774 )?;
13775 } else {
13776 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13777 }
13778 }
13779
13780 1 => {
13781 if let Some(source) = self.source.take() {
13782 ::fidl_next::WireEnvelope::encode_value(
13783 source,
13784 preallocated.encoder,
13785 &mut out,
13786 )?;
13787 } else {
13788 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13789 }
13790 }
13791
13792 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
13793 }
13794 unsafe {
13795 preallocated.write_next(out.assume_init_ref());
13796 }
13797 }
13798
13799 ::fidl_next::WireTable::encode_len(table, max_ord);
13800
13801 Ok(())
13802 }
13803}
13804
13805unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UseDirectory
13806where
13807 ___E: ::fidl_next::Encoder + ?Sized,
13808{
13809 #[inline]
13810 fn encode_ref(
13811 &self,
13812 encoder: &mut ___E,
13813 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13814 ) -> Result<(), ::fidl_next::EncodeError> {
13815 ::fidl_next::munge!(let WireUseDirectory { table } = out);
13816
13817 let max_ord = self.__max_ordinal();
13818
13819 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
13820 ::fidl_next::Wire::zero_padding(&mut out);
13821
13822 let mut preallocated =
13823 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
13824
13825 for i in 1..=max_ord {
13826 match i {
13827 8 => {
13828 if let Some(source_dictionary) = &self.source_dictionary {
13829 ::fidl_next::WireEnvelope::encode_value(
13830 source_dictionary,
13831 preallocated.encoder,
13832 &mut out,
13833 )?;
13834 } else {
13835 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13836 }
13837 }
13838
13839 7 => {
13840 if let Some(availability) = &self.availability {
13841 ::fidl_next::WireEnvelope::encode_value(
13842 availability,
13843 preallocated.encoder,
13844 &mut out,
13845 )?;
13846 } else {
13847 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13848 }
13849 }
13850
13851 6 => {
13852 if let Some(dependency_type) = &self.dependency_type {
13853 ::fidl_next::WireEnvelope::encode_value(
13854 dependency_type,
13855 preallocated.encoder,
13856 &mut out,
13857 )?;
13858 } else {
13859 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13860 }
13861 }
13862
13863 5 => {
13864 if let Some(subdir) = &self.subdir {
13865 ::fidl_next::WireEnvelope::encode_value(
13866 subdir,
13867 preallocated.encoder,
13868 &mut out,
13869 )?;
13870 } else {
13871 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13872 }
13873 }
13874
13875 4 => {
13876 if let Some(rights) = &self.rights {
13877 ::fidl_next::WireEnvelope::encode_value(
13878 rights,
13879 preallocated.encoder,
13880 &mut out,
13881 )?;
13882 } else {
13883 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13884 }
13885 }
13886
13887 3 => {
13888 if let Some(target_path) = &self.target_path {
13889 ::fidl_next::WireEnvelope::encode_value(
13890 target_path,
13891 preallocated.encoder,
13892 &mut out,
13893 )?;
13894 } else {
13895 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13896 }
13897 }
13898
13899 2 => {
13900 if let Some(source_name) = &self.source_name {
13901 ::fidl_next::WireEnvelope::encode_value(
13902 source_name,
13903 preallocated.encoder,
13904 &mut out,
13905 )?;
13906 } else {
13907 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13908 }
13909 }
13910
13911 1 => {
13912 if let Some(source) = &self.source {
13913 ::fidl_next::WireEnvelope::encode_value(
13914 source,
13915 preallocated.encoder,
13916 &mut out,
13917 )?;
13918 } else {
13919 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13920 }
13921 }
13922
13923 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
13924 }
13925 unsafe {
13926 preallocated.write_next(out.assume_init_ref());
13927 }
13928 }
13929
13930 ::fidl_next::WireTable::encode_len(table, max_ord);
13931
13932 Ok(())
13933 }
13934}
13935
13936impl<'de> ::fidl_next::FromWire<WireUseDirectory<'de>> for UseDirectory {
13937 #[inline]
13938 fn from_wire(wire: WireUseDirectory<'de>) -> Self {
13939 let wire = ::core::mem::ManuallyDrop::new(wire);
13940
13941 let source = wire.table.get(1);
13942
13943 let source_name = wire.table.get(2);
13944
13945 let target_path = wire.table.get(3);
13946
13947 let rights = wire.table.get(4);
13948
13949 let subdir = wire.table.get(5);
13950
13951 let dependency_type = wire.table.get(6);
13952
13953 let availability = wire.table.get(7);
13954
13955 let source_dictionary = wire.table.get(8);
13956
13957 Self {
13958 source: source.map(|envelope| {
13959 ::fidl_next::FromWire::from_wire(unsafe {
13960 envelope.read_unchecked::<crate::WireRef<'de>>()
13961 })
13962 }),
13963
13964 source_name: source_name.map(|envelope| {
13965 ::fidl_next::FromWire::from_wire(unsafe {
13966 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13967 })
13968 }),
13969
13970 target_path: target_path.map(|envelope| {
13971 ::fidl_next::FromWire::from_wire(unsafe {
13972 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13973 })
13974 }),
13975
13976 rights: rights.map(|envelope| {
13977 ::fidl_next::FromWire::from_wire(unsafe {
13978 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
13979 })
13980 }),
13981
13982 subdir: subdir.map(|envelope| {
13983 ::fidl_next::FromWire::from_wire(unsafe {
13984 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13985 })
13986 }),
13987
13988 dependency_type: dependency_type.map(|envelope| {
13989 ::fidl_next::FromWire::from_wire(unsafe {
13990 envelope.read_unchecked::<crate::WireDependencyType>()
13991 })
13992 }),
13993
13994 availability: availability.map(|envelope| {
13995 ::fidl_next::FromWire::from_wire(unsafe {
13996 envelope.read_unchecked::<crate::WireAvailability>()
13997 })
13998 }),
13999
14000 source_dictionary: source_dictionary.map(|envelope| {
14001 ::fidl_next::FromWire::from_wire(unsafe {
14002 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
14003 })
14004 }),
14005 }
14006 }
14007}
14008
14009impl<'de> ::fidl_next::FromWireRef<WireUseDirectory<'de>> for UseDirectory {
14010 #[inline]
14011 fn from_wire_ref(wire: &WireUseDirectory<'de>) -> Self {
14012 Self {
14013 source: wire.table.get(1).map(|envelope| {
14014 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14015 envelope.deref_unchecked::<crate::WireRef<'de>>()
14016 })
14017 }),
14018
14019 source_name: wire.table.get(2).map(|envelope| {
14020 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14021 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
14022 })
14023 }),
14024
14025 target_path: wire.table.get(3).map(|envelope| {
14026 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14027 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
14028 })
14029 }),
14030
14031 rights: wire.table.get(4).map(|envelope| {
14032 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14033 envelope.deref_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
14034 })
14035 }),
14036
14037 subdir: wire.table.get(5).map(|envelope| {
14038 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14039 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
14040 })
14041 }),
14042
14043 dependency_type: wire.table.get(6).map(|envelope| {
14044 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14045 envelope.deref_unchecked::<crate::WireDependencyType>()
14046 })
14047 }),
14048
14049 availability: wire.table.get(7).map(|envelope| {
14050 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14051 envelope.deref_unchecked::<crate::WireAvailability>()
14052 })
14053 }),
14054
14055 source_dictionary: wire.table.get(8).map(|envelope| {
14056 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14057 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
14058 })
14059 }),
14060 }
14061 }
14062}
14063
14064#[repr(C)]
14066pub struct WireUseDirectory<'de> {
14067 table: ::fidl_next::WireTable<'de>,
14068}
14069
14070impl<'de> Drop for WireUseDirectory<'de> {
14071 fn drop(&mut self) {
14072 let _ = self
14073 .table
14074 .get(1)
14075 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
14076
14077 let _ = self
14078 .table
14079 .get(2)
14080 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
14081
14082 let _ = self
14083 .table
14084 .get(3)
14085 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
14086
14087 let _ = self.table.get(4).map(|envelope| unsafe {
14088 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
14089 });
14090
14091 let _ = self
14092 .table
14093 .get(5)
14094 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
14095
14096 let _ = self
14097 .table
14098 .get(6)
14099 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDependencyType>() });
14100
14101 let _ = self
14102 .table
14103 .get(7)
14104 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
14105
14106 let _ = self
14107 .table
14108 .get(8)
14109 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
14110 }
14111}
14112
14113unsafe impl ::fidl_next::Wire for WireUseDirectory<'static> {
14114 type Decoded<'de> = WireUseDirectory<'de>;
14115
14116 #[inline]
14117 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14118 ::fidl_next::munge!(let Self { table } = out);
14119 ::fidl_next::WireTable::zero_padding(table);
14120 }
14121}
14122
14123unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseDirectory<'static>
14124where
14125 ___D: ::fidl_next::Decoder + ?Sized,
14126{
14127 fn decode(
14128 slot: ::fidl_next::Slot<'_, Self>,
14129 decoder: &mut ___D,
14130 ) -> Result<(), ::fidl_next::DecodeError> {
14131 ::fidl_next::munge!(let Self { table } = slot);
14132
14133 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
14134 match ordinal {
14135 0 => unsafe { ::core::hint::unreachable_unchecked() },
14136
14137 1 => {
14138 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
14139 slot.as_mut(),
14140 decoder,
14141 )?;
14142
14143 Ok(())
14144 }
14145
14146 2 => {
14147 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
14148 slot.as_mut(),
14149 decoder,
14150 )?;
14151
14152 let source_name = unsafe {
14153 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
14154 };
14155
14156 if source_name.len() > 100 {
14157 return Err(::fidl_next::DecodeError::VectorTooLong {
14158 size: source_name.len() as u64,
14159 limit: 100,
14160 });
14161 }
14162
14163 Ok(())
14164 }
14165
14166 3 => {
14167 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
14168 slot.as_mut(),
14169 decoder,
14170 )?;
14171
14172 let target_path = unsafe {
14173 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
14174 };
14175
14176 if target_path.len() > 1024 {
14177 return Err(::fidl_next::DecodeError::VectorTooLong {
14178 size: target_path.len() as u64,
14179 limit: 1024,
14180 });
14181 }
14182
14183 Ok(())
14184 }
14185
14186 4 => {
14187 ::fidl_next::WireEnvelope::decode_as::<
14188 ___D,
14189 ::fidl_next_fuchsia_io::WireOperations,
14190 >(slot.as_mut(), decoder)?;
14191
14192 Ok(())
14193 }
14194
14195 5 => {
14196 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
14197 slot.as_mut(),
14198 decoder,
14199 )?;
14200
14201 let subdir = unsafe {
14202 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
14203 };
14204
14205 if subdir.len() > 1024 {
14206 return Err(::fidl_next::DecodeError::VectorTooLong {
14207 size: subdir.len() as u64,
14208 limit: 1024,
14209 });
14210 }
14211
14212 Ok(())
14213 }
14214
14215 6 => {
14216 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
14217 slot.as_mut(),
14218 decoder,
14219 )?;
14220
14221 Ok(())
14222 }
14223
14224 7 => {
14225 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
14226 slot.as_mut(),
14227 decoder,
14228 )?;
14229
14230 Ok(())
14231 }
14232
14233 8 => {
14234 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
14235 slot.as_mut(),
14236 decoder,
14237 )?;
14238
14239 let source_dictionary = unsafe {
14240 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
14241 };
14242
14243 if source_dictionary.len() > 1024 {
14244 return Err(::fidl_next::DecodeError::VectorTooLong {
14245 size: source_dictionary.len() as u64,
14246 limit: 1024,
14247 });
14248 }
14249
14250 Ok(())
14251 }
14252
14253 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
14254 }
14255 })
14256 }
14257}
14258
14259impl<'de> WireUseDirectory<'de> {
14260 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
14261 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
14262 }
14263
14264 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
14265 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
14266 }
14267
14268 pub fn target_path(&self) -> Option<&::fidl_next::WireString<'de>> {
14269 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
14270 }
14271
14272 pub fn rights(&self) -> Option<&::fidl_next_fuchsia_io::WireOperations> {
14273 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
14274 }
14275
14276 pub fn subdir(&self) -> Option<&::fidl_next::WireString<'de>> {
14277 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
14278 }
14279
14280 pub fn dependency_type(&self) -> Option<&crate::WireDependencyType> {
14281 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
14282 }
14283
14284 pub fn availability(&self) -> Option<&crate::WireAvailability> {
14285 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
14286 }
14287
14288 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
14289 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
14290 }
14291}
14292
14293impl<'de> ::core::fmt::Debug for WireUseDirectory<'de> {
14294 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
14295 f.debug_struct("UseDirectory")
14296 .field("source", &self.source())
14297 .field("source_name", &self.source_name())
14298 .field("target_path", &self.target_path())
14299 .field("rights", &self.rights())
14300 .field("subdir", &self.subdir())
14301 .field("dependency_type", &self.dependency_type())
14302 .field("availability", &self.availability())
14303 .field("source_dictionary", &self.source_dictionary())
14304 .finish()
14305 }
14306}
14307
14308#[doc = " Declares an EventStream used by a component.\n"]
14309#[derive(Clone, Debug, Default)]
14310pub struct UseEventStream {
14311 pub source_name: Option<String>,
14312
14313 pub source: Option<crate::Ref>,
14314
14315 pub scope: Option<Vec<crate::Ref>>,
14316
14317 pub target_path: Option<String>,
14318
14319 pub availability: Option<crate::Availability>,
14320
14321 pub filter: Option<::fidl_next_fuchsia_data::Dictionary>,
14322}
14323
14324impl UseEventStream {
14325 fn __max_ordinal(&self) -> usize {
14326 if self.filter.is_some() {
14327 return 6;
14328 }
14329
14330 if self.availability.is_some() {
14331 return 5;
14332 }
14333
14334 if self.target_path.is_some() {
14335 return 4;
14336 }
14337
14338 if self.scope.is_some() {
14339 return 3;
14340 }
14341
14342 if self.source.is_some() {
14343 return 2;
14344 }
14345
14346 if self.source_name.is_some() {
14347 return 1;
14348 }
14349
14350 0
14351 }
14352}
14353
14354impl ::fidl_next::Encodable for UseEventStream {
14355 type Encoded = WireUseEventStream<'static>;
14356}
14357
14358unsafe impl<___E> ::fidl_next::Encode<___E> for UseEventStream
14359where
14360 ___E: ::fidl_next::Encoder + ?Sized,
14361{
14362 #[inline]
14363 fn encode(
14364 mut self,
14365 encoder: &mut ___E,
14366 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14367 ) -> Result<(), ::fidl_next::EncodeError> {
14368 ::fidl_next::munge!(let WireUseEventStream { table } = out);
14369
14370 let max_ord = self.__max_ordinal();
14371
14372 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
14373 ::fidl_next::Wire::zero_padding(&mut out);
14374
14375 let mut preallocated =
14376 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
14377
14378 for i in 1..=max_ord {
14379 match i {
14380 6 => {
14381 if let Some(filter) = self.filter.take() {
14382 ::fidl_next::WireEnvelope::encode_value(
14383 filter,
14384 preallocated.encoder,
14385 &mut out,
14386 )?;
14387 } else {
14388 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14389 }
14390 }
14391
14392 5 => {
14393 if let Some(availability) = self.availability.take() {
14394 ::fidl_next::WireEnvelope::encode_value(
14395 availability,
14396 preallocated.encoder,
14397 &mut out,
14398 )?;
14399 } else {
14400 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14401 }
14402 }
14403
14404 4 => {
14405 if let Some(target_path) = self.target_path.take() {
14406 ::fidl_next::WireEnvelope::encode_value(
14407 target_path,
14408 preallocated.encoder,
14409 &mut out,
14410 )?;
14411 } else {
14412 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14413 }
14414 }
14415
14416 3 => {
14417 if let Some(scope) = self.scope.take() {
14418 ::fidl_next::WireEnvelope::encode_value(
14419 scope,
14420 preallocated.encoder,
14421 &mut out,
14422 )?;
14423 } else {
14424 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14425 }
14426 }
14427
14428 2 => {
14429 if let Some(source) = self.source.take() {
14430 ::fidl_next::WireEnvelope::encode_value(
14431 source,
14432 preallocated.encoder,
14433 &mut out,
14434 )?;
14435 } else {
14436 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14437 }
14438 }
14439
14440 1 => {
14441 if let Some(source_name) = self.source_name.take() {
14442 ::fidl_next::WireEnvelope::encode_value(
14443 source_name,
14444 preallocated.encoder,
14445 &mut out,
14446 )?;
14447 } else {
14448 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14449 }
14450 }
14451
14452 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
14453 }
14454 unsafe {
14455 preallocated.write_next(out.assume_init_ref());
14456 }
14457 }
14458
14459 ::fidl_next::WireTable::encode_len(table, max_ord);
14460
14461 Ok(())
14462 }
14463}
14464
14465unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UseEventStream
14466where
14467 ___E: ::fidl_next::Encoder + ?Sized,
14468{
14469 #[inline]
14470 fn encode_ref(
14471 &self,
14472 encoder: &mut ___E,
14473 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14474 ) -> Result<(), ::fidl_next::EncodeError> {
14475 ::fidl_next::munge!(let WireUseEventStream { table } = out);
14476
14477 let max_ord = self.__max_ordinal();
14478
14479 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
14480 ::fidl_next::Wire::zero_padding(&mut out);
14481
14482 let mut preallocated =
14483 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
14484
14485 for i in 1..=max_ord {
14486 match i {
14487 6 => {
14488 if let Some(filter) = &self.filter {
14489 ::fidl_next::WireEnvelope::encode_value(
14490 filter,
14491 preallocated.encoder,
14492 &mut out,
14493 )?;
14494 } else {
14495 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14496 }
14497 }
14498
14499 5 => {
14500 if let Some(availability) = &self.availability {
14501 ::fidl_next::WireEnvelope::encode_value(
14502 availability,
14503 preallocated.encoder,
14504 &mut out,
14505 )?;
14506 } else {
14507 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14508 }
14509 }
14510
14511 4 => {
14512 if let Some(target_path) = &self.target_path {
14513 ::fidl_next::WireEnvelope::encode_value(
14514 target_path,
14515 preallocated.encoder,
14516 &mut out,
14517 )?;
14518 } else {
14519 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14520 }
14521 }
14522
14523 3 => {
14524 if let Some(scope) = &self.scope {
14525 ::fidl_next::WireEnvelope::encode_value(
14526 scope,
14527 preallocated.encoder,
14528 &mut out,
14529 )?;
14530 } else {
14531 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14532 }
14533 }
14534
14535 2 => {
14536 if let Some(source) = &self.source {
14537 ::fidl_next::WireEnvelope::encode_value(
14538 source,
14539 preallocated.encoder,
14540 &mut out,
14541 )?;
14542 } else {
14543 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14544 }
14545 }
14546
14547 1 => {
14548 if let Some(source_name) = &self.source_name {
14549 ::fidl_next::WireEnvelope::encode_value(
14550 source_name,
14551 preallocated.encoder,
14552 &mut out,
14553 )?;
14554 } else {
14555 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14556 }
14557 }
14558
14559 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
14560 }
14561 unsafe {
14562 preallocated.write_next(out.assume_init_ref());
14563 }
14564 }
14565
14566 ::fidl_next::WireTable::encode_len(table, max_ord);
14567
14568 Ok(())
14569 }
14570}
14571
14572impl<'de> ::fidl_next::FromWire<WireUseEventStream<'de>> for UseEventStream {
14573 #[inline]
14574 fn from_wire(wire: WireUseEventStream<'de>) -> Self {
14575 let wire = ::core::mem::ManuallyDrop::new(wire);
14576
14577 let source_name = wire.table.get(1);
14578
14579 let source = wire.table.get(2);
14580
14581 let scope = wire.table.get(3);
14582
14583 let target_path = wire.table.get(4);
14584
14585 let availability = wire.table.get(5);
14586
14587 let filter = wire.table.get(6);
14588
14589 Self {
14590 source_name: source_name.map(|envelope| {
14591 ::fidl_next::FromWire::from_wire(unsafe {
14592 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
14593 })
14594 }),
14595
14596 source: source.map(|envelope| {
14597 ::fidl_next::FromWire::from_wire(unsafe {
14598 envelope.read_unchecked::<crate::WireRef<'de>>()
14599 })
14600 }),
14601
14602 scope: scope.map(|envelope| {
14603 ::fidl_next::FromWire::from_wire(unsafe {
14604 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireRef<'de>>>()
14605 })
14606 }),
14607
14608 target_path: target_path.map(|envelope| {
14609 ::fidl_next::FromWire::from_wire(unsafe {
14610 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
14611 })
14612 }),
14613
14614 availability: availability.map(|envelope| {
14615 ::fidl_next::FromWire::from_wire(unsafe {
14616 envelope.read_unchecked::<crate::WireAvailability>()
14617 })
14618 }),
14619
14620 filter: filter.map(|envelope| {
14621 ::fidl_next::FromWire::from_wire(unsafe {
14622 envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
14623 })
14624 }),
14625 }
14626 }
14627}
14628
14629impl<'de> ::fidl_next::FromWireRef<WireUseEventStream<'de>> for UseEventStream {
14630 #[inline]
14631 fn from_wire_ref(wire: &WireUseEventStream<'de>) -> Self {
14632 Self {
14633 source_name: wire.table.get(1).map(|envelope| {
14634 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14635 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
14636 })
14637 }),
14638
14639 source: wire.table.get(2).map(|envelope| {
14640 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14641 envelope.deref_unchecked::<crate::WireRef<'de>>()
14642 })
14643 }),
14644
14645 scope: wire.table.get(3).map(|envelope| {
14646 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14647 envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireRef<'de>>>()
14648 })
14649 }),
14650
14651 target_path: wire.table.get(4).map(|envelope| {
14652 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14653 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
14654 })
14655 }),
14656
14657 availability: wire.table.get(5).map(|envelope| {
14658 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14659 envelope.deref_unchecked::<crate::WireAvailability>()
14660 })
14661 }),
14662
14663 filter: wire.table.get(6).map(|envelope| {
14664 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14665 envelope.deref_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
14666 })
14667 }),
14668 }
14669 }
14670}
14671
14672#[repr(C)]
14674pub struct WireUseEventStream<'de> {
14675 table: ::fidl_next::WireTable<'de>,
14676}
14677
14678impl<'de> Drop for WireUseEventStream<'de> {
14679 fn drop(&mut self) {
14680 let _ = self
14681 .table
14682 .get(1)
14683 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
14684
14685 let _ = self
14686 .table
14687 .get(2)
14688 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
14689
14690 let _ = self.table.get(3).map(|envelope| unsafe {
14691 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireRef<'de>>>()
14692 });
14693
14694 let _ = self
14695 .table
14696 .get(4)
14697 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
14698
14699 let _ = self
14700 .table
14701 .get(5)
14702 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
14703
14704 let _ = self.table.get(6).map(|envelope| unsafe {
14705 envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
14706 });
14707 }
14708}
14709
14710unsafe impl ::fidl_next::Wire for WireUseEventStream<'static> {
14711 type Decoded<'de> = WireUseEventStream<'de>;
14712
14713 #[inline]
14714 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14715 ::fidl_next::munge!(let Self { table } = out);
14716 ::fidl_next::WireTable::zero_padding(table);
14717 }
14718}
14719
14720unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseEventStream<'static>
14721where
14722 ___D: ::fidl_next::Decoder + ?Sized,
14723{
14724 fn decode(
14725 slot: ::fidl_next::Slot<'_, Self>,
14726 decoder: &mut ___D,
14727 ) -> Result<(), ::fidl_next::DecodeError> {
14728 ::fidl_next::munge!(let Self { table } = slot);
14729
14730 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
14731 match ordinal {
14732 0 => unsafe { ::core::hint::unreachable_unchecked() },
14733
14734 1 => {
14735 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
14736 slot.as_mut(),
14737 decoder,
14738 )?;
14739
14740 let source_name = unsafe {
14741 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
14742 };
14743
14744 if source_name.len() > 100 {
14745 return Err(::fidl_next::DecodeError::VectorTooLong {
14746 size: source_name.len() as u64,
14747 limit: 100,
14748 });
14749 }
14750
14751 Ok(())
14752 }
14753
14754 2 => {
14755 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
14756 slot.as_mut(),
14757 decoder,
14758 )?;
14759
14760 Ok(())
14761 }
14762
14763 3 => {
14764 ::fidl_next::WireEnvelope::decode_as::<
14765 ___D,
14766 ::fidl_next::WireVector<'static, crate::WireRef<'static>>,
14767 >(slot.as_mut(), decoder)?;
14768
14769 Ok(())
14770 }
14771
14772 4 => {
14773 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
14774 slot.as_mut(),
14775 decoder,
14776 )?;
14777
14778 let target_path = unsafe {
14779 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
14780 };
14781
14782 if target_path.len() > 100 {
14783 return Err(::fidl_next::DecodeError::VectorTooLong {
14784 size: target_path.len() as u64,
14785 limit: 100,
14786 });
14787 }
14788
14789 Ok(())
14790 }
14791
14792 5 => {
14793 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
14794 slot.as_mut(),
14795 decoder,
14796 )?;
14797
14798 Ok(())
14799 }
14800
14801 6 => {
14802 ::fidl_next::WireEnvelope::decode_as::<
14803 ___D,
14804 ::fidl_next_fuchsia_data::WireDictionary<'static>,
14805 >(slot.as_mut(), decoder)?;
14806
14807 Ok(())
14808 }
14809
14810 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
14811 }
14812 })
14813 }
14814}
14815
14816impl<'de> WireUseEventStream<'de> {
14817 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
14818 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
14819 }
14820
14821 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
14822 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
14823 }
14824
14825 pub fn scope(&self) -> Option<&::fidl_next::WireVector<'de, crate::WireRef<'de>>> {
14826 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
14827 }
14828
14829 pub fn target_path(&self) -> Option<&::fidl_next::WireString<'de>> {
14830 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
14831 }
14832
14833 pub fn availability(&self) -> Option<&crate::WireAvailability> {
14834 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
14835 }
14836
14837 pub fn filter(&self) -> Option<&::fidl_next_fuchsia_data::WireDictionary<'de>> {
14838 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
14839 }
14840}
14841
14842impl<'de> ::core::fmt::Debug for WireUseEventStream<'de> {
14843 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
14844 f.debug_struct("UseEventStream")
14845 .field("source_name", &self.source_name())
14846 .field("source", &self.source())
14847 .field("scope", &self.scope())
14848 .field("target_path", &self.target_path())
14849 .field("availability", &self.availability())
14850 .field("filter", &self.filter())
14851 .finish()
14852 }
14853}
14854
14855#[doc = " Declares runner used by a component.\n"]
14856#[derive(Clone, Debug, Default)]
14857pub struct UseRunner {
14858 pub source: Option<crate::Ref>,
14859
14860 pub source_name: Option<String>,
14861
14862 pub source_dictionary: Option<String>,
14863}
14864
14865impl UseRunner {
14866 fn __max_ordinal(&self) -> usize {
14867 if self.source_dictionary.is_some() {
14868 return 3;
14869 }
14870
14871 if self.source_name.is_some() {
14872 return 2;
14873 }
14874
14875 if self.source.is_some() {
14876 return 1;
14877 }
14878
14879 0
14880 }
14881}
14882
14883impl ::fidl_next::Encodable for UseRunner {
14884 type Encoded = WireUseRunner<'static>;
14885}
14886
14887unsafe impl<___E> ::fidl_next::Encode<___E> for UseRunner
14888where
14889 ___E: ::fidl_next::Encoder + ?Sized,
14890{
14891 #[inline]
14892 fn encode(
14893 mut self,
14894 encoder: &mut ___E,
14895 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14896 ) -> Result<(), ::fidl_next::EncodeError> {
14897 ::fidl_next::munge!(let WireUseRunner { table } = out);
14898
14899 let max_ord = self.__max_ordinal();
14900
14901 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
14902 ::fidl_next::Wire::zero_padding(&mut out);
14903
14904 let mut preallocated =
14905 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
14906
14907 for i in 1..=max_ord {
14908 match i {
14909 3 => {
14910 if let Some(source_dictionary) = self.source_dictionary.take() {
14911 ::fidl_next::WireEnvelope::encode_value(
14912 source_dictionary,
14913 preallocated.encoder,
14914 &mut out,
14915 )?;
14916 } else {
14917 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14918 }
14919 }
14920
14921 2 => {
14922 if let Some(source_name) = self.source_name.take() {
14923 ::fidl_next::WireEnvelope::encode_value(
14924 source_name,
14925 preallocated.encoder,
14926 &mut out,
14927 )?;
14928 } else {
14929 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14930 }
14931 }
14932
14933 1 => {
14934 if let Some(source) = self.source.take() {
14935 ::fidl_next::WireEnvelope::encode_value(
14936 source,
14937 preallocated.encoder,
14938 &mut out,
14939 )?;
14940 } else {
14941 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14942 }
14943 }
14944
14945 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
14946 }
14947 unsafe {
14948 preallocated.write_next(out.assume_init_ref());
14949 }
14950 }
14951
14952 ::fidl_next::WireTable::encode_len(table, max_ord);
14953
14954 Ok(())
14955 }
14956}
14957
14958unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UseRunner
14959where
14960 ___E: ::fidl_next::Encoder + ?Sized,
14961{
14962 #[inline]
14963 fn encode_ref(
14964 &self,
14965 encoder: &mut ___E,
14966 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14967 ) -> Result<(), ::fidl_next::EncodeError> {
14968 ::fidl_next::munge!(let WireUseRunner { table } = out);
14969
14970 let max_ord = self.__max_ordinal();
14971
14972 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
14973 ::fidl_next::Wire::zero_padding(&mut out);
14974
14975 let mut preallocated =
14976 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
14977
14978 for i in 1..=max_ord {
14979 match i {
14980 3 => {
14981 if let Some(source_dictionary) = &self.source_dictionary {
14982 ::fidl_next::WireEnvelope::encode_value(
14983 source_dictionary,
14984 preallocated.encoder,
14985 &mut out,
14986 )?;
14987 } else {
14988 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14989 }
14990 }
14991
14992 2 => {
14993 if let Some(source_name) = &self.source_name {
14994 ::fidl_next::WireEnvelope::encode_value(
14995 source_name,
14996 preallocated.encoder,
14997 &mut out,
14998 )?;
14999 } else {
15000 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15001 }
15002 }
15003
15004 1 => {
15005 if let Some(source) = &self.source {
15006 ::fidl_next::WireEnvelope::encode_value(
15007 source,
15008 preallocated.encoder,
15009 &mut out,
15010 )?;
15011 } else {
15012 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15013 }
15014 }
15015
15016 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
15017 }
15018 unsafe {
15019 preallocated.write_next(out.assume_init_ref());
15020 }
15021 }
15022
15023 ::fidl_next::WireTable::encode_len(table, max_ord);
15024
15025 Ok(())
15026 }
15027}
15028
15029impl<'de> ::fidl_next::FromWire<WireUseRunner<'de>> for UseRunner {
15030 #[inline]
15031 fn from_wire(wire: WireUseRunner<'de>) -> Self {
15032 let wire = ::core::mem::ManuallyDrop::new(wire);
15033
15034 let source = wire.table.get(1);
15035
15036 let source_name = wire.table.get(2);
15037
15038 let source_dictionary = wire.table.get(3);
15039
15040 Self {
15041 source: source.map(|envelope| {
15042 ::fidl_next::FromWire::from_wire(unsafe {
15043 envelope.read_unchecked::<crate::WireRef<'de>>()
15044 })
15045 }),
15046
15047 source_name: source_name.map(|envelope| {
15048 ::fidl_next::FromWire::from_wire(unsafe {
15049 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15050 })
15051 }),
15052
15053 source_dictionary: source_dictionary.map(|envelope| {
15054 ::fidl_next::FromWire::from_wire(unsafe {
15055 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15056 })
15057 }),
15058 }
15059 }
15060}
15061
15062impl<'de> ::fidl_next::FromWireRef<WireUseRunner<'de>> for UseRunner {
15063 #[inline]
15064 fn from_wire_ref(wire: &WireUseRunner<'de>) -> Self {
15065 Self {
15066 source: wire.table.get(1).map(|envelope| {
15067 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15068 envelope.deref_unchecked::<crate::WireRef<'de>>()
15069 })
15070 }),
15071
15072 source_name: wire.table.get(2).map(|envelope| {
15073 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15074 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15075 })
15076 }),
15077
15078 source_dictionary: wire.table.get(3).map(|envelope| {
15079 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15080 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15081 })
15082 }),
15083 }
15084 }
15085}
15086
15087#[repr(C)]
15089pub struct WireUseRunner<'de> {
15090 table: ::fidl_next::WireTable<'de>,
15091}
15092
15093impl<'de> Drop for WireUseRunner<'de> {
15094 fn drop(&mut self) {
15095 let _ = self
15096 .table
15097 .get(1)
15098 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
15099
15100 let _ = self
15101 .table
15102 .get(2)
15103 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
15104
15105 let _ = self
15106 .table
15107 .get(3)
15108 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
15109 }
15110}
15111
15112unsafe impl ::fidl_next::Wire for WireUseRunner<'static> {
15113 type Decoded<'de> = WireUseRunner<'de>;
15114
15115 #[inline]
15116 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
15117 ::fidl_next::munge!(let Self { table } = out);
15118 ::fidl_next::WireTable::zero_padding(table);
15119 }
15120}
15121
15122unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseRunner<'static>
15123where
15124 ___D: ::fidl_next::Decoder + ?Sized,
15125{
15126 fn decode(
15127 slot: ::fidl_next::Slot<'_, Self>,
15128 decoder: &mut ___D,
15129 ) -> Result<(), ::fidl_next::DecodeError> {
15130 ::fidl_next::munge!(let Self { table } = slot);
15131
15132 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
15133 match ordinal {
15134 0 => unsafe { ::core::hint::unreachable_unchecked() },
15135
15136 1 => {
15137 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
15138 slot.as_mut(),
15139 decoder,
15140 )?;
15141
15142 Ok(())
15143 }
15144
15145 2 => {
15146 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
15147 slot.as_mut(),
15148 decoder,
15149 )?;
15150
15151 let source_name = unsafe {
15152 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
15153 };
15154
15155 if source_name.len() > 100 {
15156 return Err(::fidl_next::DecodeError::VectorTooLong {
15157 size: source_name.len() as u64,
15158 limit: 100,
15159 });
15160 }
15161
15162 Ok(())
15163 }
15164
15165 3 => {
15166 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
15167 slot.as_mut(),
15168 decoder,
15169 )?;
15170
15171 let source_dictionary = unsafe {
15172 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
15173 };
15174
15175 if source_dictionary.len() > 1024 {
15176 return Err(::fidl_next::DecodeError::VectorTooLong {
15177 size: source_dictionary.len() as u64,
15178 limit: 1024,
15179 });
15180 }
15181
15182 Ok(())
15183 }
15184
15185 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
15186 }
15187 })
15188 }
15189}
15190
15191impl<'de> WireUseRunner<'de> {
15192 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
15193 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
15194 }
15195
15196 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
15197 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
15198 }
15199
15200 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
15201 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
15202 }
15203}
15204
15205impl<'de> ::core::fmt::Debug for WireUseRunner<'de> {
15206 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
15207 f.debug_struct("UseRunner")
15208 .field("source", &self.source())
15209 .field("source_name", &self.source_name())
15210 .field("source_dictionary", &self.source_dictionary())
15211 .finish()
15212 }
15213}
15214
15215#[derive(Clone, Debug, Default)]
15216pub struct UseConfiguration {
15217 pub source: Option<crate::Ref>,
15218
15219 pub source_name: Option<String>,
15220
15221 pub target_name: Option<String>,
15222
15223 pub availability: Option<crate::Availability>,
15224
15225 pub type_: Option<crate::ConfigType>,
15226
15227 pub default: Option<crate::ConfigValue>,
15228
15229 pub source_dictionary: Option<String>,
15230}
15231
15232impl UseConfiguration {
15233 fn __max_ordinal(&self) -> usize {
15234 if self.source_dictionary.is_some() {
15235 return 7;
15236 }
15237
15238 if self.default.is_some() {
15239 return 6;
15240 }
15241
15242 if self.type_.is_some() {
15243 return 5;
15244 }
15245
15246 if self.availability.is_some() {
15247 return 4;
15248 }
15249
15250 if self.target_name.is_some() {
15251 return 3;
15252 }
15253
15254 if self.source_name.is_some() {
15255 return 2;
15256 }
15257
15258 if self.source.is_some() {
15259 return 1;
15260 }
15261
15262 0
15263 }
15264}
15265
15266impl ::fidl_next::Encodable for UseConfiguration {
15267 type Encoded = WireUseConfiguration<'static>;
15268}
15269
15270unsafe impl<___E> ::fidl_next::Encode<___E> for UseConfiguration
15271where
15272 ___E: ::fidl_next::Encoder + ?Sized,
15273{
15274 #[inline]
15275 fn encode(
15276 mut self,
15277 encoder: &mut ___E,
15278 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15279 ) -> Result<(), ::fidl_next::EncodeError> {
15280 ::fidl_next::munge!(let WireUseConfiguration { table } = out);
15281
15282 let max_ord = self.__max_ordinal();
15283
15284 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
15285 ::fidl_next::Wire::zero_padding(&mut out);
15286
15287 let mut preallocated =
15288 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
15289
15290 for i in 1..=max_ord {
15291 match i {
15292 7 => {
15293 if let Some(source_dictionary) = self.source_dictionary.take() {
15294 ::fidl_next::WireEnvelope::encode_value(
15295 source_dictionary,
15296 preallocated.encoder,
15297 &mut out,
15298 )?;
15299 } else {
15300 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15301 }
15302 }
15303
15304 6 => {
15305 if let Some(default) = self.default.take() {
15306 ::fidl_next::WireEnvelope::encode_value(
15307 default,
15308 preallocated.encoder,
15309 &mut out,
15310 )?;
15311 } else {
15312 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15313 }
15314 }
15315
15316 5 => {
15317 if let Some(type_) = self.type_.take() {
15318 ::fidl_next::WireEnvelope::encode_value(
15319 type_,
15320 preallocated.encoder,
15321 &mut out,
15322 )?;
15323 } else {
15324 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15325 }
15326 }
15327
15328 4 => {
15329 if let Some(availability) = self.availability.take() {
15330 ::fidl_next::WireEnvelope::encode_value(
15331 availability,
15332 preallocated.encoder,
15333 &mut out,
15334 )?;
15335 } else {
15336 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15337 }
15338 }
15339
15340 3 => {
15341 if let Some(target_name) = self.target_name.take() {
15342 ::fidl_next::WireEnvelope::encode_value(
15343 target_name,
15344 preallocated.encoder,
15345 &mut out,
15346 )?;
15347 } else {
15348 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15349 }
15350 }
15351
15352 2 => {
15353 if let Some(source_name) = self.source_name.take() {
15354 ::fidl_next::WireEnvelope::encode_value(
15355 source_name,
15356 preallocated.encoder,
15357 &mut out,
15358 )?;
15359 } else {
15360 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15361 }
15362 }
15363
15364 1 => {
15365 if let Some(source) = self.source.take() {
15366 ::fidl_next::WireEnvelope::encode_value(
15367 source,
15368 preallocated.encoder,
15369 &mut out,
15370 )?;
15371 } else {
15372 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15373 }
15374 }
15375
15376 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
15377 }
15378 unsafe {
15379 preallocated.write_next(out.assume_init_ref());
15380 }
15381 }
15382
15383 ::fidl_next::WireTable::encode_len(table, max_ord);
15384
15385 Ok(())
15386 }
15387}
15388
15389unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UseConfiguration
15390where
15391 ___E: ::fidl_next::Encoder + ?Sized,
15392{
15393 #[inline]
15394 fn encode_ref(
15395 &self,
15396 encoder: &mut ___E,
15397 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15398 ) -> Result<(), ::fidl_next::EncodeError> {
15399 ::fidl_next::munge!(let WireUseConfiguration { table } = out);
15400
15401 let max_ord = self.__max_ordinal();
15402
15403 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
15404 ::fidl_next::Wire::zero_padding(&mut out);
15405
15406 let mut preallocated =
15407 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
15408
15409 for i in 1..=max_ord {
15410 match i {
15411 7 => {
15412 if let Some(source_dictionary) = &self.source_dictionary {
15413 ::fidl_next::WireEnvelope::encode_value(
15414 source_dictionary,
15415 preallocated.encoder,
15416 &mut out,
15417 )?;
15418 } else {
15419 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15420 }
15421 }
15422
15423 6 => {
15424 if let Some(default) = &self.default {
15425 ::fidl_next::WireEnvelope::encode_value(
15426 default,
15427 preallocated.encoder,
15428 &mut out,
15429 )?;
15430 } else {
15431 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15432 }
15433 }
15434
15435 5 => {
15436 if let Some(type_) = &self.type_ {
15437 ::fidl_next::WireEnvelope::encode_value(
15438 type_,
15439 preallocated.encoder,
15440 &mut out,
15441 )?;
15442 } else {
15443 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15444 }
15445 }
15446
15447 4 => {
15448 if let Some(availability) = &self.availability {
15449 ::fidl_next::WireEnvelope::encode_value(
15450 availability,
15451 preallocated.encoder,
15452 &mut out,
15453 )?;
15454 } else {
15455 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15456 }
15457 }
15458
15459 3 => {
15460 if let Some(target_name) = &self.target_name {
15461 ::fidl_next::WireEnvelope::encode_value(
15462 target_name,
15463 preallocated.encoder,
15464 &mut out,
15465 )?;
15466 } else {
15467 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15468 }
15469 }
15470
15471 2 => {
15472 if let Some(source_name) = &self.source_name {
15473 ::fidl_next::WireEnvelope::encode_value(
15474 source_name,
15475 preallocated.encoder,
15476 &mut out,
15477 )?;
15478 } else {
15479 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15480 }
15481 }
15482
15483 1 => {
15484 if let Some(source) = &self.source {
15485 ::fidl_next::WireEnvelope::encode_value(
15486 source,
15487 preallocated.encoder,
15488 &mut out,
15489 )?;
15490 } else {
15491 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15492 }
15493 }
15494
15495 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
15496 }
15497 unsafe {
15498 preallocated.write_next(out.assume_init_ref());
15499 }
15500 }
15501
15502 ::fidl_next::WireTable::encode_len(table, max_ord);
15503
15504 Ok(())
15505 }
15506}
15507
15508impl<'de> ::fidl_next::FromWire<WireUseConfiguration<'de>> for UseConfiguration {
15509 #[inline]
15510 fn from_wire(wire: WireUseConfiguration<'de>) -> Self {
15511 let wire = ::core::mem::ManuallyDrop::new(wire);
15512
15513 let source = wire.table.get(1);
15514
15515 let source_name = wire.table.get(2);
15516
15517 let target_name = wire.table.get(3);
15518
15519 let availability = wire.table.get(4);
15520
15521 let type_ = wire.table.get(5);
15522
15523 let default = wire.table.get(6);
15524
15525 let source_dictionary = wire.table.get(7);
15526
15527 Self {
15528 source: source.map(|envelope| {
15529 ::fidl_next::FromWire::from_wire(unsafe {
15530 envelope.read_unchecked::<crate::WireRef<'de>>()
15531 })
15532 }),
15533
15534 source_name: source_name.map(|envelope| {
15535 ::fidl_next::FromWire::from_wire(unsafe {
15536 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15537 })
15538 }),
15539
15540 target_name: target_name.map(|envelope| {
15541 ::fidl_next::FromWire::from_wire(unsafe {
15542 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15543 })
15544 }),
15545
15546 availability: availability.map(|envelope| {
15547 ::fidl_next::FromWire::from_wire(unsafe {
15548 envelope.read_unchecked::<crate::WireAvailability>()
15549 })
15550 }),
15551
15552 type_: type_.map(|envelope| {
15553 ::fidl_next::FromWire::from_wire(unsafe {
15554 envelope.read_unchecked::<crate::WireConfigType<'de>>()
15555 })
15556 }),
15557
15558 default: default.map(|envelope| {
15559 ::fidl_next::FromWire::from_wire(unsafe {
15560 envelope.read_unchecked::<crate::WireConfigValue<'de>>()
15561 })
15562 }),
15563
15564 source_dictionary: source_dictionary.map(|envelope| {
15565 ::fidl_next::FromWire::from_wire(unsafe {
15566 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15567 })
15568 }),
15569 }
15570 }
15571}
15572
15573impl<'de> ::fidl_next::FromWireRef<WireUseConfiguration<'de>> for UseConfiguration {
15574 #[inline]
15575 fn from_wire_ref(wire: &WireUseConfiguration<'de>) -> Self {
15576 Self {
15577 source: wire.table.get(1).map(|envelope| {
15578 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15579 envelope.deref_unchecked::<crate::WireRef<'de>>()
15580 })
15581 }),
15582
15583 source_name: wire.table.get(2).map(|envelope| {
15584 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15585 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15586 })
15587 }),
15588
15589 target_name: wire.table.get(3).map(|envelope| {
15590 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15591 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15592 })
15593 }),
15594
15595 availability: wire.table.get(4).map(|envelope| {
15596 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15597 envelope.deref_unchecked::<crate::WireAvailability>()
15598 })
15599 }),
15600
15601 type_: wire.table.get(5).map(|envelope| {
15602 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15603 envelope.deref_unchecked::<crate::WireConfigType<'de>>()
15604 })
15605 }),
15606
15607 default: wire.table.get(6).map(|envelope| {
15608 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15609 envelope.deref_unchecked::<crate::WireConfigValue<'de>>()
15610 })
15611 }),
15612
15613 source_dictionary: wire.table.get(7).map(|envelope| {
15614 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15615 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15616 })
15617 }),
15618 }
15619 }
15620}
15621
15622#[repr(C)]
15624pub struct WireUseConfiguration<'de> {
15625 table: ::fidl_next::WireTable<'de>,
15626}
15627
15628impl<'de> Drop for WireUseConfiguration<'de> {
15629 fn drop(&mut self) {
15630 let _ = self
15631 .table
15632 .get(1)
15633 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
15634
15635 let _ = self
15636 .table
15637 .get(2)
15638 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
15639
15640 let _ = self
15641 .table
15642 .get(3)
15643 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
15644
15645 let _ = self
15646 .table
15647 .get(4)
15648 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
15649
15650 let _ = self
15651 .table
15652 .get(5)
15653 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigType<'de>>() });
15654
15655 let _ = self
15656 .table
15657 .get(6)
15658 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigValue<'de>>() });
15659
15660 let _ = self
15661 .table
15662 .get(7)
15663 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
15664 }
15665}
15666
15667unsafe impl ::fidl_next::Wire for WireUseConfiguration<'static> {
15668 type Decoded<'de> = WireUseConfiguration<'de>;
15669
15670 #[inline]
15671 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
15672 ::fidl_next::munge!(let Self { table } = out);
15673 ::fidl_next::WireTable::zero_padding(table);
15674 }
15675}
15676
15677unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseConfiguration<'static>
15678where
15679 ___D: ::fidl_next::Decoder + ?Sized,
15680{
15681 fn decode(
15682 slot: ::fidl_next::Slot<'_, Self>,
15683 decoder: &mut ___D,
15684 ) -> Result<(), ::fidl_next::DecodeError> {
15685 ::fidl_next::munge!(let Self { table } = slot);
15686
15687 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
15688 match ordinal {
15689 0 => unsafe { ::core::hint::unreachable_unchecked() },
15690
15691 1 => {
15692 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
15693 slot.as_mut(),
15694 decoder,
15695 )?;
15696
15697 Ok(())
15698 }
15699
15700 2 => {
15701 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
15702 slot.as_mut(),
15703 decoder,
15704 )?;
15705
15706 let source_name = unsafe {
15707 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
15708 };
15709
15710 if source_name.len() > 100 {
15711 return Err(::fidl_next::DecodeError::VectorTooLong {
15712 size: source_name.len() as u64,
15713 limit: 100,
15714 });
15715 }
15716
15717 Ok(())
15718 }
15719
15720 3 => {
15721 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
15722 slot.as_mut(),
15723 decoder,
15724 )?;
15725
15726 let target_name = unsafe {
15727 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
15728 };
15729
15730 if target_name.len() > 100 {
15731 return Err(::fidl_next::DecodeError::VectorTooLong {
15732 size: target_name.len() as u64,
15733 limit: 100,
15734 });
15735 }
15736
15737 Ok(())
15738 }
15739
15740 4 => {
15741 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
15742 slot.as_mut(),
15743 decoder,
15744 )?;
15745
15746 Ok(())
15747 }
15748
15749 5 => {
15750 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigType<'static>>(
15751 slot.as_mut(),
15752 decoder,
15753 )?;
15754
15755 Ok(())
15756 }
15757
15758 6 => {
15759 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigValue<'static>>(
15760 slot.as_mut(),
15761 decoder,
15762 )?;
15763
15764 Ok(())
15765 }
15766
15767 7 => {
15768 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
15769 slot.as_mut(),
15770 decoder,
15771 )?;
15772
15773 let source_dictionary = unsafe {
15774 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
15775 };
15776
15777 if source_dictionary.len() > 1024 {
15778 return Err(::fidl_next::DecodeError::VectorTooLong {
15779 size: source_dictionary.len() as u64,
15780 limit: 1024,
15781 });
15782 }
15783
15784 Ok(())
15785 }
15786
15787 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
15788 }
15789 })
15790 }
15791}
15792
15793impl<'de> WireUseConfiguration<'de> {
15794 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
15795 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
15796 }
15797
15798 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
15799 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
15800 }
15801
15802 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
15803 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
15804 }
15805
15806 pub fn availability(&self) -> Option<&crate::WireAvailability> {
15807 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
15808 }
15809
15810 pub fn type_(&self) -> Option<&crate::WireConfigType<'de>> {
15811 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
15812 }
15813
15814 pub fn default(&self) -> Option<&crate::WireConfigValue<'de>> {
15815 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
15816 }
15817
15818 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
15819 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
15820 }
15821}
15822
15823impl<'de> ::core::fmt::Debug for WireUseConfiguration<'de> {
15824 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
15825 f.debug_struct("UseConfiguration")
15826 .field("source", &self.source())
15827 .field("source_name", &self.source_name())
15828 .field("target_name", &self.target_name())
15829 .field("availability", &self.availability())
15830 .field("type_", &self.type_())
15831 .field("default", &self.default())
15832 .field("source_dictionary", &self.source_dictionary())
15833 .finish()
15834 }
15835}
15836
15837#[doc = " Declares a capability used by a component, which was offered to it.\n"]
15838#[derive(Clone, Debug)]
15839pub enum Use {
15840 Service(crate::UseService),
15841
15842 Protocol(crate::UseProtocol),
15843
15844 Directory(crate::UseDirectory),
15845
15846 Storage(crate::UseStorage),
15847
15848 EventStream(crate::UseEventStream),
15849
15850 Runner(crate::UseRunner),
15851
15852 Config(crate::UseConfiguration),
15853
15854 UnknownOrdinal_(u64),
15855}
15856
15857impl ::fidl_next::Encodable for Use {
15858 type Encoded = WireUse<'static>;
15859}
15860
15861unsafe impl<___E> ::fidl_next::Encode<___E> for Use
15862where
15863 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15864 ___E: ::fidl_next::Encoder,
15865{
15866 #[inline]
15867 fn encode(
15868 self,
15869 encoder: &mut ___E,
15870 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15871 ) -> Result<(), ::fidl_next::EncodeError> {
15872 ::fidl_next::munge!(let WireUse { raw, _phantom: _ } = out);
15873
15874 match self {
15875 Self::Service(value) => {
15876 ::fidl_next::RawWireUnion::encode_as::<___E, crate::UseService>(
15877 value, 1, encoder, raw,
15878 )?
15879 }
15880
15881 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
15882 ___E,
15883 crate::UseProtocol,
15884 >(value, 2, encoder, raw)?,
15885
15886 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
15887 ___E,
15888 crate::UseDirectory,
15889 >(value, 3, encoder, raw)?,
15890
15891 Self::Storage(value) => {
15892 ::fidl_next::RawWireUnion::encode_as::<___E, crate::UseStorage>(
15893 value, 4, encoder, raw,
15894 )?
15895 }
15896
15897 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
15898 ___E,
15899 crate::UseEventStream,
15900 >(value, 7, encoder, raw)?,
15901
15902 Self::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::UseRunner>(
15903 value, 8, encoder, raw,
15904 )?,
15905
15906 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
15907 ___E,
15908 crate::UseConfiguration,
15909 >(value, 9, encoder, raw)?,
15910
15911 Self::UnknownOrdinal_(ordinal) => {
15912 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
15913 }
15914 }
15915
15916 Ok(())
15917 }
15918}
15919
15920unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Use
15921where
15922 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
15923 ___E: ::fidl_next::Encoder,
15924{
15925 #[inline]
15926 fn encode_ref(
15927 &self,
15928 encoder: &mut ___E,
15929 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15930 ) -> Result<(), ::fidl_next::EncodeError> {
15931 ::fidl_next::munge!(let WireUse { raw, _phantom: _ } = out);
15932
15933 match self {
15934 Self::Service(value) => {
15935 ::fidl_next::RawWireUnion::encode_as::<___E, &crate::UseService>(
15936 value, 1, encoder, raw,
15937 )?
15938 }
15939
15940 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
15941 ___E,
15942 &crate::UseProtocol,
15943 >(value, 2, encoder, raw)?,
15944
15945 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
15946 ___E,
15947 &crate::UseDirectory,
15948 >(value, 3, encoder, raw)?,
15949
15950 Self::Storage(value) => {
15951 ::fidl_next::RawWireUnion::encode_as::<___E, &crate::UseStorage>(
15952 value, 4, encoder, raw,
15953 )?
15954 }
15955
15956 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
15957 ___E,
15958 &crate::UseEventStream,
15959 >(value, 7, encoder, raw)?,
15960
15961 Self::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::UseRunner>(
15962 value, 8, encoder, raw,
15963 )?,
15964
15965 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
15966 ___E,
15967 &crate::UseConfiguration,
15968 >(value, 9, encoder, raw)?,
15969
15970 Self::UnknownOrdinal_(ordinal) => {
15971 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
15972 }
15973 }
15974
15975 Ok(())
15976 }
15977}
15978
15979impl ::fidl_next::EncodableOption for Use {
15980 type EncodedOption = WireOptionalUse<'static>;
15981}
15982
15983unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Use
15984where
15985 ___E: ?Sized,
15986 Use: ::fidl_next::Encode<___E>,
15987{
15988 #[inline]
15989 fn encode_option(
15990 this: Option<Self>,
15991 encoder: &mut ___E,
15992 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
15993 ) -> Result<(), ::fidl_next::EncodeError> {
15994 ::fidl_next::munge!(let WireOptionalUse { raw, _phantom: _ } = &mut *out);
15995
15996 if let Some(inner) = this {
15997 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
15998 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
15999 } else {
16000 ::fidl_next::RawWireUnion::encode_absent(raw);
16001 }
16002
16003 Ok(())
16004 }
16005}
16006
16007unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Use
16008where
16009 ___E: ?Sized,
16010 Use: ::fidl_next::EncodeRef<___E>,
16011{
16012 #[inline]
16013 fn encode_option_ref(
16014 this: Option<&Self>,
16015 encoder: &mut ___E,
16016 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
16017 ) -> Result<(), ::fidl_next::EncodeError> {
16018 ::fidl_next::munge!(let WireOptionalUse { raw, _phantom: _ } = &mut *out);
16019
16020 if let Some(inner) = this {
16021 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
16022 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
16023 } else {
16024 ::fidl_next::RawWireUnion::encode_absent(raw);
16025 }
16026
16027 Ok(())
16028 }
16029}
16030
16031impl<'de> ::fidl_next::FromWire<WireUse<'de>> for Use {
16032 #[inline]
16033 fn from_wire(wire: WireUse<'de>) -> Self {
16034 let wire = ::core::mem::ManuallyDrop::new(wire);
16035 match wire.raw.ordinal() {
16036 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
16037 wire.raw.get().read_unchecked::<crate::WireUseService<'de>>()
16038 })),
16039
16040 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
16041 wire.raw.get().read_unchecked::<crate::WireUseProtocol<'de>>()
16042 })),
16043
16044 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
16045 wire.raw.get().read_unchecked::<crate::WireUseDirectory<'de>>()
16046 })),
16047
16048 4 => Self::Storage(::fidl_next::FromWire::from_wire(unsafe {
16049 wire.raw.get().read_unchecked::<crate::WireUseStorage<'de>>()
16050 })),
16051
16052 7 => Self::EventStream(::fidl_next::FromWire::from_wire(unsafe {
16053 wire.raw.get().read_unchecked::<crate::WireUseEventStream<'de>>()
16054 })),
16055
16056 8 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
16057 wire.raw.get().read_unchecked::<crate::WireUseRunner<'de>>()
16058 })),
16059
16060 9 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
16061 wire.raw.get().read_unchecked::<crate::WireUseConfiguration<'de>>()
16062 })),
16063
16064 _ => unsafe { ::core::hint::unreachable_unchecked() },
16065 }
16066 }
16067}
16068
16069impl<'de> ::fidl_next::FromWireRef<WireUse<'de>> for Use {
16070 #[inline]
16071 fn from_wire_ref(wire: &WireUse<'de>) -> Self {
16072 match wire.raw.ordinal() {
16073 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
16074 wire.raw.get().deref_unchecked::<crate::WireUseService<'de>>()
16075 })),
16076
16077 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
16078 wire.raw.get().deref_unchecked::<crate::WireUseProtocol<'de>>()
16079 })),
16080
16081 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
16082 wire.raw.get().deref_unchecked::<crate::WireUseDirectory<'de>>()
16083 })),
16084
16085 4 => Self::Storage(::fidl_next::FromWireRef::from_wire_ref(unsafe {
16086 wire.raw.get().deref_unchecked::<crate::WireUseStorage<'de>>()
16087 })),
16088
16089 7 => Self::EventStream(::fidl_next::FromWireRef::from_wire_ref(unsafe {
16090 wire.raw.get().deref_unchecked::<crate::WireUseEventStream<'de>>()
16091 })),
16092
16093 8 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
16094 wire.raw.get().deref_unchecked::<crate::WireUseRunner<'de>>()
16095 })),
16096
16097 9 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
16098 wire.raw.get().deref_unchecked::<crate::WireUseConfiguration<'de>>()
16099 })),
16100
16101 _ => unsafe { ::core::hint::unreachable_unchecked() },
16102 }
16103 }
16104}
16105
16106impl<'de> ::fidl_next::FromWireOption<WireOptionalUse<'de>> for Box<Use> {
16107 #[inline]
16108 fn from_wire_option(wire: WireOptionalUse<'de>) -> Option<Self> {
16109 if let Some(inner) = wire.into_option() {
16110 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
16111 } else {
16112 None
16113 }
16114 }
16115}
16116
16117impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalUse<'de>> for Box<Use> {
16118 #[inline]
16119 fn from_wire_option_ref(wire: &WireOptionalUse<'de>) -> Option<Self> {
16120 if let Some(inner) = wire.as_ref() {
16121 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
16122 } else {
16123 None
16124 }
16125 }
16126}
16127
16128#[repr(transparent)]
16130pub struct WireUse<'de> {
16131 raw: ::fidl_next::RawWireUnion,
16132 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
16133}
16134
16135impl<'de> Drop for WireUse<'de> {
16136 fn drop(&mut self) {
16137 match self.raw.ordinal() {
16138 1 => {
16139 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUseService<'de>>() };
16140 }
16141
16142 2 => {
16143 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUseProtocol<'de>>() };
16144 }
16145
16146 3 => {
16147 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUseDirectory<'de>>() };
16148 }
16149
16150 4 => {
16151 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUseStorage<'de>>() };
16152 }
16153
16154 7 => {
16155 let _ =
16156 unsafe { self.raw.get().read_unchecked::<crate::WireUseEventStream<'de>>() };
16157 }
16158
16159 8 => {
16160 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUseRunner<'de>>() };
16161 }
16162
16163 9 => {
16164 let _ =
16165 unsafe { self.raw.get().read_unchecked::<crate::WireUseConfiguration<'de>>() };
16166 }
16167
16168 _ => (),
16169 }
16170 }
16171}
16172
16173unsafe impl ::fidl_next::Wire for WireUse<'static> {
16174 type Decoded<'de> = WireUse<'de>;
16175
16176 #[inline]
16177 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
16178 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
16179 ::fidl_next::RawWireUnion::zero_padding(raw);
16180 }
16181}
16182
16183pub mod use_ {
16184 pub enum Ref<'de> {
16185 Service(&'de crate::WireUseService<'de>),
16186
16187 Protocol(&'de crate::WireUseProtocol<'de>),
16188
16189 Directory(&'de crate::WireUseDirectory<'de>),
16190
16191 Storage(&'de crate::WireUseStorage<'de>),
16192
16193 EventStream(&'de crate::WireUseEventStream<'de>),
16194
16195 Runner(&'de crate::WireUseRunner<'de>),
16196
16197 Config(&'de crate::WireUseConfiguration<'de>),
16198
16199 UnknownOrdinal_(u64),
16200 }
16201}
16202
16203impl<'de> WireUse<'de> {
16204 pub fn as_ref(&self) -> crate::use_::Ref<'_> {
16205 match self.raw.ordinal() {
16206 1 => crate::use_::Ref::Service(unsafe {
16207 self.raw.get().deref_unchecked::<crate::WireUseService<'_>>()
16208 }),
16209
16210 2 => crate::use_::Ref::Protocol(unsafe {
16211 self.raw.get().deref_unchecked::<crate::WireUseProtocol<'_>>()
16212 }),
16213
16214 3 => crate::use_::Ref::Directory(unsafe {
16215 self.raw.get().deref_unchecked::<crate::WireUseDirectory<'_>>()
16216 }),
16217
16218 4 => crate::use_::Ref::Storage(unsafe {
16219 self.raw.get().deref_unchecked::<crate::WireUseStorage<'_>>()
16220 }),
16221
16222 7 => crate::use_::Ref::EventStream(unsafe {
16223 self.raw.get().deref_unchecked::<crate::WireUseEventStream<'_>>()
16224 }),
16225
16226 8 => crate::use_::Ref::Runner(unsafe {
16227 self.raw.get().deref_unchecked::<crate::WireUseRunner<'_>>()
16228 }),
16229
16230 9 => crate::use_::Ref::Config(unsafe {
16231 self.raw.get().deref_unchecked::<crate::WireUseConfiguration<'_>>()
16232 }),
16233
16234 unknown => crate::use_::Ref::UnknownOrdinal_(unknown),
16235 }
16236 }
16237}
16238
16239unsafe impl<___D> ::fidl_next::Decode<___D> for WireUse<'static>
16240where
16241 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
16242 ___D: ::fidl_next::Decoder,
16243{
16244 fn decode(
16245 mut slot: ::fidl_next::Slot<'_, Self>,
16246 decoder: &mut ___D,
16247 ) -> Result<(), ::fidl_next::DecodeError> {
16248 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
16249 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
16250 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseService<'static>>(
16251 raw, decoder,
16252 )?,
16253
16254 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseProtocol<'static>>(
16255 raw, decoder,
16256 )?,
16257
16258 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseDirectory<'static>>(
16259 raw, decoder,
16260 )?,
16261
16262 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseStorage<'static>>(
16263 raw, decoder,
16264 )?,
16265
16266 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseEventStream<'static>>(
16267 raw, decoder,
16268 )?,
16269
16270 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseRunner<'static>>(
16271 raw, decoder,
16272 )?,
16273
16274 9 => {
16275 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseConfiguration<'static>>(
16276 raw, decoder,
16277 )?
16278 }
16279
16280 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
16281 }
16282
16283 Ok(())
16284 }
16285}
16286
16287impl<'de> ::core::fmt::Debug for WireUse<'de> {
16288 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
16289 match self.raw.ordinal() {
16290 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseService<'_>>().fmt(f) },
16291 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseProtocol<'_>>().fmt(f) },
16292 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseDirectory<'_>>().fmt(f) },
16293 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseStorage<'_>>().fmt(f) },
16294 7 => unsafe {
16295 self.raw.get().deref_unchecked::<crate::WireUseEventStream<'_>>().fmt(f)
16296 },
16297 8 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseRunner<'_>>().fmt(f) },
16298 9 => unsafe {
16299 self.raw.get().deref_unchecked::<crate::WireUseConfiguration<'_>>().fmt(f)
16300 },
16301 _ => unsafe { ::core::hint::unreachable_unchecked() },
16302 }
16303 }
16304}
16305
16306#[repr(transparent)]
16307pub struct WireOptionalUse<'de> {
16308 raw: ::fidl_next::RawWireUnion,
16309 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
16310}
16311
16312unsafe impl ::fidl_next::Wire for WireOptionalUse<'static> {
16313 type Decoded<'de> = WireOptionalUse<'de>;
16314
16315 #[inline]
16316 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
16317 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
16318 ::fidl_next::RawWireUnion::zero_padding(raw);
16319 }
16320}
16321
16322impl<'de> WireOptionalUse<'de> {
16323 pub fn is_some(&self) -> bool {
16324 self.raw.is_some()
16325 }
16326
16327 pub fn is_none(&self) -> bool {
16328 self.raw.is_none()
16329 }
16330
16331 pub fn as_ref(&self) -> Option<&WireUse<'de>> {
16332 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
16333 }
16334
16335 pub fn into_option(self) -> Option<WireUse<'de>> {
16336 if self.is_some() {
16337 Some(WireUse { raw: self.raw, _phantom: ::core::marker::PhantomData })
16338 } else {
16339 None
16340 }
16341 }
16342}
16343
16344unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalUse<'static>
16345where
16346 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
16347 ___D: ::fidl_next::Decoder,
16348{
16349 fn decode(
16350 mut slot: ::fidl_next::Slot<'_, Self>,
16351 decoder: &mut ___D,
16352 ) -> Result<(), ::fidl_next::DecodeError> {
16353 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
16354 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
16355 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseService<'static>>(
16356 raw, decoder,
16357 )?,
16358
16359 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseProtocol<'static>>(
16360 raw, decoder,
16361 )?,
16362
16363 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseDirectory<'static>>(
16364 raw, decoder,
16365 )?,
16366
16367 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseStorage<'static>>(
16368 raw, decoder,
16369 )?,
16370
16371 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseEventStream<'static>>(
16372 raw, decoder,
16373 )?,
16374
16375 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseRunner<'static>>(
16376 raw, decoder,
16377 )?,
16378
16379 9 => {
16380 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseConfiguration<'static>>(
16381 raw, decoder,
16382 )?
16383 }
16384
16385 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
16386 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
16387 }
16388
16389 Ok(())
16390 }
16391}
16392
16393impl<'de> ::core::fmt::Debug for WireOptionalUse<'de> {
16394 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
16395 self.as_ref().fmt(f)
16396 }
16397}
16398
16399#[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"]
16400#[derive(Clone, Debug, Default)]
16401pub struct ExposeService {
16402 pub source: Option<crate::Ref>,
16403
16404 pub source_name: Option<String>,
16405
16406 pub target: Option<crate::Ref>,
16407
16408 pub target_name: Option<String>,
16409
16410 pub availability: Option<crate::Availability>,
16411
16412 pub source_dictionary: Option<String>,
16413}
16414
16415impl ExposeService {
16416 fn __max_ordinal(&self) -> usize {
16417 if self.source_dictionary.is_some() {
16418 return 6;
16419 }
16420
16421 if self.availability.is_some() {
16422 return 5;
16423 }
16424
16425 if self.target_name.is_some() {
16426 return 4;
16427 }
16428
16429 if self.target.is_some() {
16430 return 3;
16431 }
16432
16433 if self.source_name.is_some() {
16434 return 2;
16435 }
16436
16437 if self.source.is_some() {
16438 return 1;
16439 }
16440
16441 0
16442 }
16443}
16444
16445impl ::fidl_next::Encodable for ExposeService {
16446 type Encoded = WireExposeService<'static>;
16447}
16448
16449unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeService
16450where
16451 ___E: ::fidl_next::Encoder + ?Sized,
16452{
16453 #[inline]
16454 fn encode(
16455 mut self,
16456 encoder: &mut ___E,
16457 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16458 ) -> Result<(), ::fidl_next::EncodeError> {
16459 ::fidl_next::munge!(let WireExposeService { table } = out);
16460
16461 let max_ord = self.__max_ordinal();
16462
16463 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
16464 ::fidl_next::Wire::zero_padding(&mut out);
16465
16466 let mut preallocated =
16467 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
16468
16469 for i in 1..=max_ord {
16470 match i {
16471 6 => {
16472 if let Some(source_dictionary) = self.source_dictionary.take() {
16473 ::fidl_next::WireEnvelope::encode_value(
16474 source_dictionary,
16475 preallocated.encoder,
16476 &mut out,
16477 )?;
16478 } else {
16479 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16480 }
16481 }
16482
16483 5 => {
16484 if let Some(availability) = self.availability.take() {
16485 ::fidl_next::WireEnvelope::encode_value(
16486 availability,
16487 preallocated.encoder,
16488 &mut out,
16489 )?;
16490 } else {
16491 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16492 }
16493 }
16494
16495 4 => {
16496 if let Some(target_name) = self.target_name.take() {
16497 ::fidl_next::WireEnvelope::encode_value(
16498 target_name,
16499 preallocated.encoder,
16500 &mut out,
16501 )?;
16502 } else {
16503 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16504 }
16505 }
16506
16507 3 => {
16508 if let Some(target) = self.target.take() {
16509 ::fidl_next::WireEnvelope::encode_value(
16510 target,
16511 preallocated.encoder,
16512 &mut out,
16513 )?;
16514 } else {
16515 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16516 }
16517 }
16518
16519 2 => {
16520 if let Some(source_name) = self.source_name.take() {
16521 ::fidl_next::WireEnvelope::encode_value(
16522 source_name,
16523 preallocated.encoder,
16524 &mut out,
16525 )?;
16526 } else {
16527 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16528 }
16529 }
16530
16531 1 => {
16532 if let Some(source) = self.source.take() {
16533 ::fidl_next::WireEnvelope::encode_value(
16534 source,
16535 preallocated.encoder,
16536 &mut out,
16537 )?;
16538 } else {
16539 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16540 }
16541 }
16542
16543 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
16544 }
16545 unsafe {
16546 preallocated.write_next(out.assume_init_ref());
16547 }
16548 }
16549
16550 ::fidl_next::WireTable::encode_len(table, max_ord);
16551
16552 Ok(())
16553 }
16554}
16555
16556unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExposeService
16557where
16558 ___E: ::fidl_next::Encoder + ?Sized,
16559{
16560 #[inline]
16561 fn encode_ref(
16562 &self,
16563 encoder: &mut ___E,
16564 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16565 ) -> Result<(), ::fidl_next::EncodeError> {
16566 ::fidl_next::munge!(let WireExposeService { table } = out);
16567
16568 let max_ord = self.__max_ordinal();
16569
16570 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
16571 ::fidl_next::Wire::zero_padding(&mut out);
16572
16573 let mut preallocated =
16574 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
16575
16576 for i in 1..=max_ord {
16577 match i {
16578 6 => {
16579 if let Some(source_dictionary) = &self.source_dictionary {
16580 ::fidl_next::WireEnvelope::encode_value(
16581 source_dictionary,
16582 preallocated.encoder,
16583 &mut out,
16584 )?;
16585 } else {
16586 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16587 }
16588 }
16589
16590 5 => {
16591 if let Some(availability) = &self.availability {
16592 ::fidl_next::WireEnvelope::encode_value(
16593 availability,
16594 preallocated.encoder,
16595 &mut out,
16596 )?;
16597 } else {
16598 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16599 }
16600 }
16601
16602 4 => {
16603 if let Some(target_name) = &self.target_name {
16604 ::fidl_next::WireEnvelope::encode_value(
16605 target_name,
16606 preallocated.encoder,
16607 &mut out,
16608 )?;
16609 } else {
16610 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16611 }
16612 }
16613
16614 3 => {
16615 if let Some(target) = &self.target {
16616 ::fidl_next::WireEnvelope::encode_value(
16617 target,
16618 preallocated.encoder,
16619 &mut out,
16620 )?;
16621 } else {
16622 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16623 }
16624 }
16625
16626 2 => {
16627 if let Some(source_name) = &self.source_name {
16628 ::fidl_next::WireEnvelope::encode_value(
16629 source_name,
16630 preallocated.encoder,
16631 &mut out,
16632 )?;
16633 } else {
16634 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16635 }
16636 }
16637
16638 1 => {
16639 if let Some(source) = &self.source {
16640 ::fidl_next::WireEnvelope::encode_value(
16641 source,
16642 preallocated.encoder,
16643 &mut out,
16644 )?;
16645 } else {
16646 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16647 }
16648 }
16649
16650 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
16651 }
16652 unsafe {
16653 preallocated.write_next(out.assume_init_ref());
16654 }
16655 }
16656
16657 ::fidl_next::WireTable::encode_len(table, max_ord);
16658
16659 Ok(())
16660 }
16661}
16662
16663impl<'de> ::fidl_next::FromWire<WireExposeService<'de>> for ExposeService {
16664 #[inline]
16665 fn from_wire(wire: WireExposeService<'de>) -> Self {
16666 let wire = ::core::mem::ManuallyDrop::new(wire);
16667
16668 let source = wire.table.get(1);
16669
16670 let source_name = wire.table.get(2);
16671
16672 let target = wire.table.get(3);
16673
16674 let target_name = wire.table.get(4);
16675
16676 let availability = wire.table.get(5);
16677
16678 let source_dictionary = wire.table.get(6);
16679
16680 Self {
16681 source: source.map(|envelope| {
16682 ::fidl_next::FromWire::from_wire(unsafe {
16683 envelope.read_unchecked::<crate::WireRef<'de>>()
16684 })
16685 }),
16686
16687 source_name: source_name.map(|envelope| {
16688 ::fidl_next::FromWire::from_wire(unsafe {
16689 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16690 })
16691 }),
16692
16693 target: target.map(|envelope| {
16694 ::fidl_next::FromWire::from_wire(unsafe {
16695 envelope.read_unchecked::<crate::WireRef<'de>>()
16696 })
16697 }),
16698
16699 target_name: target_name.map(|envelope| {
16700 ::fidl_next::FromWire::from_wire(unsafe {
16701 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16702 })
16703 }),
16704
16705 availability: availability.map(|envelope| {
16706 ::fidl_next::FromWire::from_wire(unsafe {
16707 envelope.read_unchecked::<crate::WireAvailability>()
16708 })
16709 }),
16710
16711 source_dictionary: source_dictionary.map(|envelope| {
16712 ::fidl_next::FromWire::from_wire(unsafe {
16713 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16714 })
16715 }),
16716 }
16717 }
16718}
16719
16720impl<'de> ::fidl_next::FromWireRef<WireExposeService<'de>> for ExposeService {
16721 #[inline]
16722 fn from_wire_ref(wire: &WireExposeService<'de>) -> Self {
16723 Self {
16724 source: wire.table.get(1).map(|envelope| {
16725 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16726 envelope.deref_unchecked::<crate::WireRef<'de>>()
16727 })
16728 }),
16729
16730 source_name: wire.table.get(2).map(|envelope| {
16731 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16732 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16733 })
16734 }),
16735
16736 target: wire.table.get(3).map(|envelope| {
16737 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16738 envelope.deref_unchecked::<crate::WireRef<'de>>()
16739 })
16740 }),
16741
16742 target_name: wire.table.get(4).map(|envelope| {
16743 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16744 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16745 })
16746 }),
16747
16748 availability: wire.table.get(5).map(|envelope| {
16749 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16750 envelope.deref_unchecked::<crate::WireAvailability>()
16751 })
16752 }),
16753
16754 source_dictionary: wire.table.get(6).map(|envelope| {
16755 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16756 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16757 })
16758 }),
16759 }
16760 }
16761}
16762
16763#[repr(C)]
16765pub struct WireExposeService<'de> {
16766 table: ::fidl_next::WireTable<'de>,
16767}
16768
16769impl<'de> Drop for WireExposeService<'de> {
16770 fn drop(&mut self) {
16771 let _ = self
16772 .table
16773 .get(1)
16774 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
16775
16776 let _ = self
16777 .table
16778 .get(2)
16779 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
16780
16781 let _ = self
16782 .table
16783 .get(3)
16784 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
16785
16786 let _ = self
16787 .table
16788 .get(4)
16789 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
16790
16791 let _ = self
16792 .table
16793 .get(5)
16794 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
16795
16796 let _ = self
16797 .table
16798 .get(6)
16799 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
16800 }
16801}
16802
16803unsafe impl ::fidl_next::Wire for WireExposeService<'static> {
16804 type Decoded<'de> = WireExposeService<'de>;
16805
16806 #[inline]
16807 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
16808 ::fidl_next::munge!(let Self { table } = out);
16809 ::fidl_next::WireTable::zero_padding(table);
16810 }
16811}
16812
16813unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeService<'static>
16814where
16815 ___D: ::fidl_next::Decoder + ?Sized,
16816{
16817 fn decode(
16818 slot: ::fidl_next::Slot<'_, Self>,
16819 decoder: &mut ___D,
16820 ) -> Result<(), ::fidl_next::DecodeError> {
16821 ::fidl_next::munge!(let Self { table } = slot);
16822
16823 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
16824 match ordinal {
16825 0 => unsafe { ::core::hint::unreachable_unchecked() },
16826
16827 1 => {
16828 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
16829 slot.as_mut(),
16830 decoder,
16831 )?;
16832
16833 Ok(())
16834 }
16835
16836 2 => {
16837 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
16838 slot.as_mut(),
16839 decoder,
16840 )?;
16841
16842 let source_name = unsafe {
16843 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
16844 };
16845
16846 if source_name.len() > 100 {
16847 return Err(::fidl_next::DecodeError::VectorTooLong {
16848 size: source_name.len() as u64,
16849 limit: 100,
16850 });
16851 }
16852
16853 Ok(())
16854 }
16855
16856 3 => {
16857 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
16858 slot.as_mut(),
16859 decoder,
16860 )?;
16861
16862 Ok(())
16863 }
16864
16865 4 => {
16866 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
16867 slot.as_mut(),
16868 decoder,
16869 )?;
16870
16871 let target_name = unsafe {
16872 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
16873 };
16874
16875 if target_name.len() > 100 {
16876 return Err(::fidl_next::DecodeError::VectorTooLong {
16877 size: target_name.len() as u64,
16878 limit: 100,
16879 });
16880 }
16881
16882 Ok(())
16883 }
16884
16885 5 => {
16886 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
16887 slot.as_mut(),
16888 decoder,
16889 )?;
16890
16891 Ok(())
16892 }
16893
16894 6 => {
16895 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
16896 slot.as_mut(),
16897 decoder,
16898 )?;
16899
16900 let source_dictionary = unsafe {
16901 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
16902 };
16903
16904 if source_dictionary.len() > 1024 {
16905 return Err(::fidl_next::DecodeError::VectorTooLong {
16906 size: source_dictionary.len() as u64,
16907 limit: 1024,
16908 });
16909 }
16910
16911 Ok(())
16912 }
16913
16914 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
16915 }
16916 })
16917 }
16918}
16919
16920impl<'de> WireExposeService<'de> {
16921 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
16922 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
16923 }
16924
16925 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
16926 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
16927 }
16928
16929 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
16930 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
16931 }
16932
16933 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
16934 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
16935 }
16936
16937 pub fn availability(&self) -> Option<&crate::WireAvailability> {
16938 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
16939 }
16940
16941 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
16942 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
16943 }
16944}
16945
16946impl<'de> ::core::fmt::Debug for WireExposeService<'de> {
16947 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
16948 f.debug_struct("ExposeService")
16949 .field("source", &self.source())
16950 .field("source_name", &self.source_name())
16951 .field("target", &self.target())
16952 .field("target_name", &self.target_name())
16953 .field("availability", &self.availability())
16954 .field("source_dictionary", &self.source_dictionary())
16955 .finish()
16956 }
16957}
16958
16959#[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"]
16960#[derive(Clone, Debug, Default)]
16961pub struct ExposeProtocol {
16962 pub source: Option<crate::Ref>,
16963
16964 pub source_name: Option<String>,
16965
16966 pub target: Option<crate::Ref>,
16967
16968 pub target_name: Option<String>,
16969
16970 pub availability: Option<crate::Availability>,
16971
16972 pub source_dictionary: Option<String>,
16973}
16974
16975impl ExposeProtocol {
16976 fn __max_ordinal(&self) -> usize {
16977 if self.source_dictionary.is_some() {
16978 return 6;
16979 }
16980
16981 if self.availability.is_some() {
16982 return 5;
16983 }
16984
16985 if self.target_name.is_some() {
16986 return 4;
16987 }
16988
16989 if self.target.is_some() {
16990 return 3;
16991 }
16992
16993 if self.source_name.is_some() {
16994 return 2;
16995 }
16996
16997 if self.source.is_some() {
16998 return 1;
16999 }
17000
17001 0
17002 }
17003}
17004
17005impl ::fidl_next::Encodable for ExposeProtocol {
17006 type Encoded = WireExposeProtocol<'static>;
17007}
17008
17009unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeProtocol
17010where
17011 ___E: ::fidl_next::Encoder + ?Sized,
17012{
17013 #[inline]
17014 fn encode(
17015 mut self,
17016 encoder: &mut ___E,
17017 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17018 ) -> Result<(), ::fidl_next::EncodeError> {
17019 ::fidl_next::munge!(let WireExposeProtocol { table } = out);
17020
17021 let max_ord = self.__max_ordinal();
17022
17023 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
17024 ::fidl_next::Wire::zero_padding(&mut out);
17025
17026 let mut preallocated =
17027 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
17028
17029 for i in 1..=max_ord {
17030 match i {
17031 6 => {
17032 if let Some(source_dictionary) = self.source_dictionary.take() {
17033 ::fidl_next::WireEnvelope::encode_value(
17034 source_dictionary,
17035 preallocated.encoder,
17036 &mut out,
17037 )?;
17038 } else {
17039 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17040 }
17041 }
17042
17043 5 => {
17044 if let Some(availability) = self.availability.take() {
17045 ::fidl_next::WireEnvelope::encode_value(
17046 availability,
17047 preallocated.encoder,
17048 &mut out,
17049 )?;
17050 } else {
17051 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17052 }
17053 }
17054
17055 4 => {
17056 if let Some(target_name) = self.target_name.take() {
17057 ::fidl_next::WireEnvelope::encode_value(
17058 target_name,
17059 preallocated.encoder,
17060 &mut out,
17061 )?;
17062 } else {
17063 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17064 }
17065 }
17066
17067 3 => {
17068 if let Some(target) = self.target.take() {
17069 ::fidl_next::WireEnvelope::encode_value(
17070 target,
17071 preallocated.encoder,
17072 &mut out,
17073 )?;
17074 } else {
17075 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17076 }
17077 }
17078
17079 2 => {
17080 if let Some(source_name) = self.source_name.take() {
17081 ::fidl_next::WireEnvelope::encode_value(
17082 source_name,
17083 preallocated.encoder,
17084 &mut out,
17085 )?;
17086 } else {
17087 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17088 }
17089 }
17090
17091 1 => {
17092 if let Some(source) = self.source.take() {
17093 ::fidl_next::WireEnvelope::encode_value(
17094 source,
17095 preallocated.encoder,
17096 &mut out,
17097 )?;
17098 } else {
17099 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17100 }
17101 }
17102
17103 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
17104 }
17105 unsafe {
17106 preallocated.write_next(out.assume_init_ref());
17107 }
17108 }
17109
17110 ::fidl_next::WireTable::encode_len(table, max_ord);
17111
17112 Ok(())
17113 }
17114}
17115
17116unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExposeProtocol
17117where
17118 ___E: ::fidl_next::Encoder + ?Sized,
17119{
17120 #[inline]
17121 fn encode_ref(
17122 &self,
17123 encoder: &mut ___E,
17124 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17125 ) -> Result<(), ::fidl_next::EncodeError> {
17126 ::fidl_next::munge!(let WireExposeProtocol { table } = out);
17127
17128 let max_ord = self.__max_ordinal();
17129
17130 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
17131 ::fidl_next::Wire::zero_padding(&mut out);
17132
17133 let mut preallocated =
17134 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
17135
17136 for i in 1..=max_ord {
17137 match i {
17138 6 => {
17139 if let Some(source_dictionary) = &self.source_dictionary {
17140 ::fidl_next::WireEnvelope::encode_value(
17141 source_dictionary,
17142 preallocated.encoder,
17143 &mut out,
17144 )?;
17145 } else {
17146 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17147 }
17148 }
17149
17150 5 => {
17151 if let Some(availability) = &self.availability {
17152 ::fidl_next::WireEnvelope::encode_value(
17153 availability,
17154 preallocated.encoder,
17155 &mut out,
17156 )?;
17157 } else {
17158 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17159 }
17160 }
17161
17162 4 => {
17163 if let Some(target_name) = &self.target_name {
17164 ::fidl_next::WireEnvelope::encode_value(
17165 target_name,
17166 preallocated.encoder,
17167 &mut out,
17168 )?;
17169 } else {
17170 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17171 }
17172 }
17173
17174 3 => {
17175 if let Some(target) = &self.target {
17176 ::fidl_next::WireEnvelope::encode_value(
17177 target,
17178 preallocated.encoder,
17179 &mut out,
17180 )?;
17181 } else {
17182 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17183 }
17184 }
17185
17186 2 => {
17187 if let Some(source_name) = &self.source_name {
17188 ::fidl_next::WireEnvelope::encode_value(
17189 source_name,
17190 preallocated.encoder,
17191 &mut out,
17192 )?;
17193 } else {
17194 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17195 }
17196 }
17197
17198 1 => {
17199 if let Some(source) = &self.source {
17200 ::fidl_next::WireEnvelope::encode_value(
17201 source,
17202 preallocated.encoder,
17203 &mut out,
17204 )?;
17205 } else {
17206 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17207 }
17208 }
17209
17210 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
17211 }
17212 unsafe {
17213 preallocated.write_next(out.assume_init_ref());
17214 }
17215 }
17216
17217 ::fidl_next::WireTable::encode_len(table, max_ord);
17218
17219 Ok(())
17220 }
17221}
17222
17223impl<'de> ::fidl_next::FromWire<WireExposeProtocol<'de>> for ExposeProtocol {
17224 #[inline]
17225 fn from_wire(wire: WireExposeProtocol<'de>) -> Self {
17226 let wire = ::core::mem::ManuallyDrop::new(wire);
17227
17228 let source = wire.table.get(1);
17229
17230 let source_name = wire.table.get(2);
17231
17232 let target = wire.table.get(3);
17233
17234 let target_name = wire.table.get(4);
17235
17236 let availability = wire.table.get(5);
17237
17238 let source_dictionary = wire.table.get(6);
17239
17240 Self {
17241 source: source.map(|envelope| {
17242 ::fidl_next::FromWire::from_wire(unsafe {
17243 envelope.read_unchecked::<crate::WireRef<'de>>()
17244 })
17245 }),
17246
17247 source_name: source_name.map(|envelope| {
17248 ::fidl_next::FromWire::from_wire(unsafe {
17249 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17250 })
17251 }),
17252
17253 target: target.map(|envelope| {
17254 ::fidl_next::FromWire::from_wire(unsafe {
17255 envelope.read_unchecked::<crate::WireRef<'de>>()
17256 })
17257 }),
17258
17259 target_name: target_name.map(|envelope| {
17260 ::fidl_next::FromWire::from_wire(unsafe {
17261 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17262 })
17263 }),
17264
17265 availability: availability.map(|envelope| {
17266 ::fidl_next::FromWire::from_wire(unsafe {
17267 envelope.read_unchecked::<crate::WireAvailability>()
17268 })
17269 }),
17270
17271 source_dictionary: source_dictionary.map(|envelope| {
17272 ::fidl_next::FromWire::from_wire(unsafe {
17273 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17274 })
17275 }),
17276 }
17277 }
17278}
17279
17280impl<'de> ::fidl_next::FromWireRef<WireExposeProtocol<'de>> for ExposeProtocol {
17281 #[inline]
17282 fn from_wire_ref(wire: &WireExposeProtocol<'de>) -> Self {
17283 Self {
17284 source: wire.table.get(1).map(|envelope| {
17285 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17286 envelope.deref_unchecked::<crate::WireRef<'de>>()
17287 })
17288 }),
17289
17290 source_name: wire.table.get(2).map(|envelope| {
17291 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17292 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17293 })
17294 }),
17295
17296 target: wire.table.get(3).map(|envelope| {
17297 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17298 envelope.deref_unchecked::<crate::WireRef<'de>>()
17299 })
17300 }),
17301
17302 target_name: wire.table.get(4).map(|envelope| {
17303 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17304 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17305 })
17306 }),
17307
17308 availability: wire.table.get(5).map(|envelope| {
17309 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17310 envelope.deref_unchecked::<crate::WireAvailability>()
17311 })
17312 }),
17313
17314 source_dictionary: wire.table.get(6).map(|envelope| {
17315 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17316 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17317 })
17318 }),
17319 }
17320 }
17321}
17322
17323#[repr(C)]
17325pub struct WireExposeProtocol<'de> {
17326 table: ::fidl_next::WireTable<'de>,
17327}
17328
17329impl<'de> Drop for WireExposeProtocol<'de> {
17330 fn drop(&mut self) {
17331 let _ = self
17332 .table
17333 .get(1)
17334 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
17335
17336 let _ = self
17337 .table
17338 .get(2)
17339 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
17340
17341 let _ = self
17342 .table
17343 .get(3)
17344 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
17345
17346 let _ = self
17347 .table
17348 .get(4)
17349 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
17350
17351 let _ = self
17352 .table
17353 .get(5)
17354 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
17355
17356 let _ = self
17357 .table
17358 .get(6)
17359 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
17360 }
17361}
17362
17363unsafe impl ::fidl_next::Wire for WireExposeProtocol<'static> {
17364 type Decoded<'de> = WireExposeProtocol<'de>;
17365
17366 #[inline]
17367 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
17368 ::fidl_next::munge!(let Self { table } = out);
17369 ::fidl_next::WireTable::zero_padding(table);
17370 }
17371}
17372
17373unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeProtocol<'static>
17374where
17375 ___D: ::fidl_next::Decoder + ?Sized,
17376{
17377 fn decode(
17378 slot: ::fidl_next::Slot<'_, Self>,
17379 decoder: &mut ___D,
17380 ) -> Result<(), ::fidl_next::DecodeError> {
17381 ::fidl_next::munge!(let Self { table } = slot);
17382
17383 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
17384 match ordinal {
17385 0 => unsafe { ::core::hint::unreachable_unchecked() },
17386
17387 1 => {
17388 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
17389 slot.as_mut(),
17390 decoder,
17391 )?;
17392
17393 Ok(())
17394 }
17395
17396 2 => {
17397 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
17398 slot.as_mut(),
17399 decoder,
17400 )?;
17401
17402 let source_name = unsafe {
17403 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
17404 };
17405
17406 if source_name.len() > 100 {
17407 return Err(::fidl_next::DecodeError::VectorTooLong {
17408 size: source_name.len() as u64,
17409 limit: 100,
17410 });
17411 }
17412
17413 Ok(())
17414 }
17415
17416 3 => {
17417 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
17418 slot.as_mut(),
17419 decoder,
17420 )?;
17421
17422 Ok(())
17423 }
17424
17425 4 => {
17426 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
17427 slot.as_mut(),
17428 decoder,
17429 )?;
17430
17431 let target_name = unsafe {
17432 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
17433 };
17434
17435 if target_name.len() > 100 {
17436 return Err(::fidl_next::DecodeError::VectorTooLong {
17437 size: target_name.len() as u64,
17438 limit: 100,
17439 });
17440 }
17441
17442 Ok(())
17443 }
17444
17445 5 => {
17446 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
17447 slot.as_mut(),
17448 decoder,
17449 )?;
17450
17451 Ok(())
17452 }
17453
17454 6 => {
17455 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
17456 slot.as_mut(),
17457 decoder,
17458 )?;
17459
17460 let source_dictionary = unsafe {
17461 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
17462 };
17463
17464 if source_dictionary.len() > 1024 {
17465 return Err(::fidl_next::DecodeError::VectorTooLong {
17466 size: source_dictionary.len() as u64,
17467 limit: 1024,
17468 });
17469 }
17470
17471 Ok(())
17472 }
17473
17474 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
17475 }
17476 })
17477 }
17478}
17479
17480impl<'de> WireExposeProtocol<'de> {
17481 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
17482 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
17483 }
17484
17485 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
17486 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
17487 }
17488
17489 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
17490 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
17491 }
17492
17493 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
17494 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
17495 }
17496
17497 pub fn availability(&self) -> Option<&crate::WireAvailability> {
17498 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
17499 }
17500
17501 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
17502 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
17503 }
17504}
17505
17506impl<'de> ::core::fmt::Debug for WireExposeProtocol<'de> {
17507 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
17508 f.debug_struct("ExposeProtocol")
17509 .field("source", &self.source())
17510 .field("source_name", &self.source_name())
17511 .field("target", &self.target())
17512 .field("target_name", &self.target_name())
17513 .field("availability", &self.availability())
17514 .field("source_dictionary", &self.source_dictionary())
17515 .finish()
17516 }
17517}
17518
17519#[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"]
17520#[derive(Clone, Debug, Default)]
17521pub struct ExposeDirectory {
17522 pub source: Option<crate::Ref>,
17523
17524 pub source_name: Option<String>,
17525
17526 pub target: Option<crate::Ref>,
17527
17528 pub target_name: Option<String>,
17529
17530 pub rights: Option<::fidl_next_fuchsia_io::Operations>,
17531
17532 pub subdir: Option<String>,
17533
17534 pub availability: Option<crate::Availability>,
17535
17536 pub source_dictionary: Option<String>,
17537}
17538
17539impl ExposeDirectory {
17540 fn __max_ordinal(&self) -> usize {
17541 if self.source_dictionary.is_some() {
17542 return 8;
17543 }
17544
17545 if self.availability.is_some() {
17546 return 7;
17547 }
17548
17549 if self.subdir.is_some() {
17550 return 6;
17551 }
17552
17553 if self.rights.is_some() {
17554 return 5;
17555 }
17556
17557 if self.target_name.is_some() {
17558 return 4;
17559 }
17560
17561 if self.target.is_some() {
17562 return 3;
17563 }
17564
17565 if self.source_name.is_some() {
17566 return 2;
17567 }
17568
17569 if self.source.is_some() {
17570 return 1;
17571 }
17572
17573 0
17574 }
17575}
17576
17577impl ::fidl_next::Encodable for ExposeDirectory {
17578 type Encoded = WireExposeDirectory<'static>;
17579}
17580
17581unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeDirectory
17582where
17583 ___E: ::fidl_next::Encoder + ?Sized,
17584{
17585 #[inline]
17586 fn encode(
17587 mut self,
17588 encoder: &mut ___E,
17589 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17590 ) -> Result<(), ::fidl_next::EncodeError> {
17591 ::fidl_next::munge!(let WireExposeDirectory { table } = out);
17592
17593 let max_ord = self.__max_ordinal();
17594
17595 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
17596 ::fidl_next::Wire::zero_padding(&mut out);
17597
17598 let mut preallocated =
17599 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
17600
17601 for i in 1..=max_ord {
17602 match i {
17603 8 => {
17604 if let Some(source_dictionary) = self.source_dictionary.take() {
17605 ::fidl_next::WireEnvelope::encode_value(
17606 source_dictionary,
17607 preallocated.encoder,
17608 &mut out,
17609 )?;
17610 } else {
17611 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17612 }
17613 }
17614
17615 7 => {
17616 if let Some(availability) = self.availability.take() {
17617 ::fidl_next::WireEnvelope::encode_value(
17618 availability,
17619 preallocated.encoder,
17620 &mut out,
17621 )?;
17622 } else {
17623 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17624 }
17625 }
17626
17627 6 => {
17628 if let Some(subdir) = self.subdir.take() {
17629 ::fidl_next::WireEnvelope::encode_value(
17630 subdir,
17631 preallocated.encoder,
17632 &mut out,
17633 )?;
17634 } else {
17635 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17636 }
17637 }
17638
17639 5 => {
17640 if let Some(rights) = self.rights.take() {
17641 ::fidl_next::WireEnvelope::encode_value(
17642 rights,
17643 preallocated.encoder,
17644 &mut out,
17645 )?;
17646 } else {
17647 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17648 }
17649 }
17650
17651 4 => {
17652 if let Some(target_name) = self.target_name.take() {
17653 ::fidl_next::WireEnvelope::encode_value(
17654 target_name,
17655 preallocated.encoder,
17656 &mut out,
17657 )?;
17658 } else {
17659 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17660 }
17661 }
17662
17663 3 => {
17664 if let Some(target) = self.target.take() {
17665 ::fidl_next::WireEnvelope::encode_value(
17666 target,
17667 preallocated.encoder,
17668 &mut out,
17669 )?;
17670 } else {
17671 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17672 }
17673 }
17674
17675 2 => {
17676 if let Some(source_name) = self.source_name.take() {
17677 ::fidl_next::WireEnvelope::encode_value(
17678 source_name,
17679 preallocated.encoder,
17680 &mut out,
17681 )?;
17682 } else {
17683 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17684 }
17685 }
17686
17687 1 => {
17688 if let Some(source) = self.source.take() {
17689 ::fidl_next::WireEnvelope::encode_value(
17690 source,
17691 preallocated.encoder,
17692 &mut out,
17693 )?;
17694 } else {
17695 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17696 }
17697 }
17698
17699 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
17700 }
17701 unsafe {
17702 preallocated.write_next(out.assume_init_ref());
17703 }
17704 }
17705
17706 ::fidl_next::WireTable::encode_len(table, max_ord);
17707
17708 Ok(())
17709 }
17710}
17711
17712unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExposeDirectory
17713where
17714 ___E: ::fidl_next::Encoder + ?Sized,
17715{
17716 #[inline]
17717 fn encode_ref(
17718 &self,
17719 encoder: &mut ___E,
17720 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17721 ) -> Result<(), ::fidl_next::EncodeError> {
17722 ::fidl_next::munge!(let WireExposeDirectory { table } = out);
17723
17724 let max_ord = self.__max_ordinal();
17725
17726 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
17727 ::fidl_next::Wire::zero_padding(&mut out);
17728
17729 let mut preallocated =
17730 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
17731
17732 for i in 1..=max_ord {
17733 match i {
17734 8 => {
17735 if let Some(source_dictionary) = &self.source_dictionary {
17736 ::fidl_next::WireEnvelope::encode_value(
17737 source_dictionary,
17738 preallocated.encoder,
17739 &mut out,
17740 )?;
17741 } else {
17742 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17743 }
17744 }
17745
17746 7 => {
17747 if let Some(availability) = &self.availability {
17748 ::fidl_next::WireEnvelope::encode_value(
17749 availability,
17750 preallocated.encoder,
17751 &mut out,
17752 )?;
17753 } else {
17754 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17755 }
17756 }
17757
17758 6 => {
17759 if let Some(subdir) = &self.subdir {
17760 ::fidl_next::WireEnvelope::encode_value(
17761 subdir,
17762 preallocated.encoder,
17763 &mut out,
17764 )?;
17765 } else {
17766 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17767 }
17768 }
17769
17770 5 => {
17771 if let Some(rights) = &self.rights {
17772 ::fidl_next::WireEnvelope::encode_value(
17773 rights,
17774 preallocated.encoder,
17775 &mut out,
17776 )?;
17777 } else {
17778 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17779 }
17780 }
17781
17782 4 => {
17783 if let Some(target_name) = &self.target_name {
17784 ::fidl_next::WireEnvelope::encode_value(
17785 target_name,
17786 preallocated.encoder,
17787 &mut out,
17788 )?;
17789 } else {
17790 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17791 }
17792 }
17793
17794 3 => {
17795 if let Some(target) = &self.target {
17796 ::fidl_next::WireEnvelope::encode_value(
17797 target,
17798 preallocated.encoder,
17799 &mut out,
17800 )?;
17801 } else {
17802 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17803 }
17804 }
17805
17806 2 => {
17807 if let Some(source_name) = &self.source_name {
17808 ::fidl_next::WireEnvelope::encode_value(
17809 source_name,
17810 preallocated.encoder,
17811 &mut out,
17812 )?;
17813 } else {
17814 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17815 }
17816 }
17817
17818 1 => {
17819 if let Some(source) = &self.source {
17820 ::fidl_next::WireEnvelope::encode_value(
17821 source,
17822 preallocated.encoder,
17823 &mut out,
17824 )?;
17825 } else {
17826 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17827 }
17828 }
17829
17830 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
17831 }
17832 unsafe {
17833 preallocated.write_next(out.assume_init_ref());
17834 }
17835 }
17836
17837 ::fidl_next::WireTable::encode_len(table, max_ord);
17838
17839 Ok(())
17840 }
17841}
17842
17843impl<'de> ::fidl_next::FromWire<WireExposeDirectory<'de>> for ExposeDirectory {
17844 #[inline]
17845 fn from_wire(wire: WireExposeDirectory<'de>) -> Self {
17846 let wire = ::core::mem::ManuallyDrop::new(wire);
17847
17848 let source = wire.table.get(1);
17849
17850 let source_name = wire.table.get(2);
17851
17852 let target = wire.table.get(3);
17853
17854 let target_name = wire.table.get(4);
17855
17856 let rights = wire.table.get(5);
17857
17858 let subdir = wire.table.get(6);
17859
17860 let availability = wire.table.get(7);
17861
17862 let source_dictionary = wire.table.get(8);
17863
17864 Self {
17865 source: source.map(|envelope| {
17866 ::fidl_next::FromWire::from_wire(unsafe {
17867 envelope.read_unchecked::<crate::WireRef<'de>>()
17868 })
17869 }),
17870
17871 source_name: source_name.map(|envelope| {
17872 ::fidl_next::FromWire::from_wire(unsafe {
17873 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17874 })
17875 }),
17876
17877 target: target.map(|envelope| {
17878 ::fidl_next::FromWire::from_wire(unsafe {
17879 envelope.read_unchecked::<crate::WireRef<'de>>()
17880 })
17881 }),
17882
17883 target_name: target_name.map(|envelope| {
17884 ::fidl_next::FromWire::from_wire(unsafe {
17885 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17886 })
17887 }),
17888
17889 rights: rights.map(|envelope| {
17890 ::fidl_next::FromWire::from_wire(unsafe {
17891 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
17892 })
17893 }),
17894
17895 subdir: subdir.map(|envelope| {
17896 ::fidl_next::FromWire::from_wire(unsafe {
17897 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17898 })
17899 }),
17900
17901 availability: availability.map(|envelope| {
17902 ::fidl_next::FromWire::from_wire(unsafe {
17903 envelope.read_unchecked::<crate::WireAvailability>()
17904 })
17905 }),
17906
17907 source_dictionary: source_dictionary.map(|envelope| {
17908 ::fidl_next::FromWire::from_wire(unsafe {
17909 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17910 })
17911 }),
17912 }
17913 }
17914}
17915
17916impl<'de> ::fidl_next::FromWireRef<WireExposeDirectory<'de>> for ExposeDirectory {
17917 #[inline]
17918 fn from_wire_ref(wire: &WireExposeDirectory<'de>) -> Self {
17919 Self {
17920 source: wire.table.get(1).map(|envelope| {
17921 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17922 envelope.deref_unchecked::<crate::WireRef<'de>>()
17923 })
17924 }),
17925
17926 source_name: wire.table.get(2).map(|envelope| {
17927 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17928 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17929 })
17930 }),
17931
17932 target: wire.table.get(3).map(|envelope| {
17933 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17934 envelope.deref_unchecked::<crate::WireRef<'de>>()
17935 })
17936 }),
17937
17938 target_name: wire.table.get(4).map(|envelope| {
17939 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17940 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17941 })
17942 }),
17943
17944 rights: wire.table.get(5).map(|envelope| {
17945 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17946 envelope.deref_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
17947 })
17948 }),
17949
17950 subdir: wire.table.get(6).map(|envelope| {
17951 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17952 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17953 })
17954 }),
17955
17956 availability: wire.table.get(7).map(|envelope| {
17957 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17958 envelope.deref_unchecked::<crate::WireAvailability>()
17959 })
17960 }),
17961
17962 source_dictionary: wire.table.get(8).map(|envelope| {
17963 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17964 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17965 })
17966 }),
17967 }
17968 }
17969}
17970
17971#[repr(C)]
17973pub struct WireExposeDirectory<'de> {
17974 table: ::fidl_next::WireTable<'de>,
17975}
17976
17977impl<'de> Drop for WireExposeDirectory<'de> {
17978 fn drop(&mut self) {
17979 let _ = self
17980 .table
17981 .get(1)
17982 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
17983
17984 let _ = self
17985 .table
17986 .get(2)
17987 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
17988
17989 let _ = self
17990 .table
17991 .get(3)
17992 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
17993
17994 let _ = self
17995 .table
17996 .get(4)
17997 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
17998
17999 let _ = self.table.get(5).map(|envelope| unsafe {
18000 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
18001 });
18002
18003 let _ = self
18004 .table
18005 .get(6)
18006 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
18007
18008 let _ = self
18009 .table
18010 .get(7)
18011 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
18012
18013 let _ = self
18014 .table
18015 .get(8)
18016 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
18017 }
18018}
18019
18020unsafe impl ::fidl_next::Wire for WireExposeDirectory<'static> {
18021 type Decoded<'de> = WireExposeDirectory<'de>;
18022
18023 #[inline]
18024 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
18025 ::fidl_next::munge!(let Self { table } = out);
18026 ::fidl_next::WireTable::zero_padding(table);
18027 }
18028}
18029
18030unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeDirectory<'static>
18031where
18032 ___D: ::fidl_next::Decoder + ?Sized,
18033{
18034 fn decode(
18035 slot: ::fidl_next::Slot<'_, Self>,
18036 decoder: &mut ___D,
18037 ) -> Result<(), ::fidl_next::DecodeError> {
18038 ::fidl_next::munge!(let Self { table } = slot);
18039
18040 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
18041 match ordinal {
18042 0 => unsafe { ::core::hint::unreachable_unchecked() },
18043
18044 1 => {
18045 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
18046 slot.as_mut(),
18047 decoder,
18048 )?;
18049
18050 Ok(())
18051 }
18052
18053 2 => {
18054 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
18055 slot.as_mut(),
18056 decoder,
18057 )?;
18058
18059 let source_name = unsafe {
18060 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
18061 };
18062
18063 if source_name.len() > 100 {
18064 return Err(::fidl_next::DecodeError::VectorTooLong {
18065 size: source_name.len() as u64,
18066 limit: 100,
18067 });
18068 }
18069
18070 Ok(())
18071 }
18072
18073 3 => {
18074 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
18075 slot.as_mut(),
18076 decoder,
18077 )?;
18078
18079 Ok(())
18080 }
18081
18082 4 => {
18083 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
18084 slot.as_mut(),
18085 decoder,
18086 )?;
18087
18088 let target_name = unsafe {
18089 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
18090 };
18091
18092 if target_name.len() > 100 {
18093 return Err(::fidl_next::DecodeError::VectorTooLong {
18094 size: target_name.len() as u64,
18095 limit: 100,
18096 });
18097 }
18098
18099 Ok(())
18100 }
18101
18102 5 => {
18103 ::fidl_next::WireEnvelope::decode_as::<
18104 ___D,
18105 ::fidl_next_fuchsia_io::WireOperations,
18106 >(slot.as_mut(), decoder)?;
18107
18108 Ok(())
18109 }
18110
18111 6 => {
18112 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
18113 slot.as_mut(),
18114 decoder,
18115 )?;
18116
18117 let subdir = unsafe {
18118 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
18119 };
18120
18121 if subdir.len() > 1024 {
18122 return Err(::fidl_next::DecodeError::VectorTooLong {
18123 size: subdir.len() as u64,
18124 limit: 1024,
18125 });
18126 }
18127
18128 Ok(())
18129 }
18130
18131 7 => {
18132 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
18133 slot.as_mut(),
18134 decoder,
18135 )?;
18136
18137 Ok(())
18138 }
18139
18140 8 => {
18141 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
18142 slot.as_mut(),
18143 decoder,
18144 )?;
18145
18146 let source_dictionary = unsafe {
18147 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
18148 };
18149
18150 if source_dictionary.len() > 1024 {
18151 return Err(::fidl_next::DecodeError::VectorTooLong {
18152 size: source_dictionary.len() as u64,
18153 limit: 1024,
18154 });
18155 }
18156
18157 Ok(())
18158 }
18159
18160 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
18161 }
18162 })
18163 }
18164}
18165
18166impl<'de> WireExposeDirectory<'de> {
18167 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
18168 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
18169 }
18170
18171 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
18172 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
18173 }
18174
18175 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
18176 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
18177 }
18178
18179 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
18180 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
18181 }
18182
18183 pub fn rights(&self) -> Option<&::fidl_next_fuchsia_io::WireOperations> {
18184 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
18185 }
18186
18187 pub fn subdir(&self) -> Option<&::fidl_next::WireString<'de>> {
18188 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
18189 }
18190
18191 pub fn availability(&self) -> Option<&crate::WireAvailability> {
18192 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
18193 }
18194
18195 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
18196 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
18197 }
18198}
18199
18200impl<'de> ::core::fmt::Debug for WireExposeDirectory<'de> {
18201 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
18202 f.debug_struct("ExposeDirectory")
18203 .field("source", &self.source())
18204 .field("source_name", &self.source_name())
18205 .field("target", &self.target())
18206 .field("target_name", &self.target_name())
18207 .field("rights", &self.rights())
18208 .field("subdir", &self.subdir())
18209 .field("availability", &self.availability())
18210 .field("source_dictionary", &self.source_dictionary())
18211 .finish()
18212 }
18213}
18214
18215#[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"]
18216#[derive(Clone, Debug, Default)]
18217pub struct ExposeRunner {
18218 pub source: Option<crate::Ref>,
18219
18220 pub source_name: Option<String>,
18221
18222 pub target: Option<crate::Ref>,
18223
18224 pub target_name: Option<String>,
18225
18226 pub source_dictionary: Option<String>,
18227}
18228
18229impl ExposeRunner {
18230 fn __max_ordinal(&self) -> usize {
18231 if self.source_dictionary.is_some() {
18232 return 6;
18233 }
18234
18235 if self.target_name.is_some() {
18236 return 4;
18237 }
18238
18239 if self.target.is_some() {
18240 return 3;
18241 }
18242
18243 if self.source_name.is_some() {
18244 return 2;
18245 }
18246
18247 if self.source.is_some() {
18248 return 1;
18249 }
18250
18251 0
18252 }
18253}
18254
18255impl ::fidl_next::Encodable for ExposeRunner {
18256 type Encoded = WireExposeRunner<'static>;
18257}
18258
18259unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeRunner
18260where
18261 ___E: ::fidl_next::Encoder + ?Sized,
18262{
18263 #[inline]
18264 fn encode(
18265 mut self,
18266 encoder: &mut ___E,
18267 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18268 ) -> Result<(), ::fidl_next::EncodeError> {
18269 ::fidl_next::munge!(let WireExposeRunner { table } = out);
18270
18271 let max_ord = self.__max_ordinal();
18272
18273 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18274 ::fidl_next::Wire::zero_padding(&mut out);
18275
18276 let mut preallocated =
18277 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18278
18279 for i in 1..=max_ord {
18280 match i {
18281 6 => {
18282 if let Some(source_dictionary) = self.source_dictionary.take() {
18283 ::fidl_next::WireEnvelope::encode_value(
18284 source_dictionary,
18285 preallocated.encoder,
18286 &mut out,
18287 )?;
18288 } else {
18289 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18290 }
18291 }
18292
18293 4 => {
18294 if let Some(target_name) = self.target_name.take() {
18295 ::fidl_next::WireEnvelope::encode_value(
18296 target_name,
18297 preallocated.encoder,
18298 &mut out,
18299 )?;
18300 } else {
18301 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18302 }
18303 }
18304
18305 3 => {
18306 if let Some(target) = self.target.take() {
18307 ::fidl_next::WireEnvelope::encode_value(
18308 target,
18309 preallocated.encoder,
18310 &mut out,
18311 )?;
18312 } else {
18313 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18314 }
18315 }
18316
18317 2 => {
18318 if let Some(source_name) = self.source_name.take() {
18319 ::fidl_next::WireEnvelope::encode_value(
18320 source_name,
18321 preallocated.encoder,
18322 &mut out,
18323 )?;
18324 } else {
18325 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18326 }
18327 }
18328
18329 1 => {
18330 if let Some(source) = self.source.take() {
18331 ::fidl_next::WireEnvelope::encode_value(
18332 source,
18333 preallocated.encoder,
18334 &mut out,
18335 )?;
18336 } else {
18337 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18338 }
18339 }
18340
18341 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18342 }
18343 unsafe {
18344 preallocated.write_next(out.assume_init_ref());
18345 }
18346 }
18347
18348 ::fidl_next::WireTable::encode_len(table, max_ord);
18349
18350 Ok(())
18351 }
18352}
18353
18354unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExposeRunner
18355where
18356 ___E: ::fidl_next::Encoder + ?Sized,
18357{
18358 #[inline]
18359 fn encode_ref(
18360 &self,
18361 encoder: &mut ___E,
18362 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18363 ) -> Result<(), ::fidl_next::EncodeError> {
18364 ::fidl_next::munge!(let WireExposeRunner { table } = out);
18365
18366 let max_ord = self.__max_ordinal();
18367
18368 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18369 ::fidl_next::Wire::zero_padding(&mut out);
18370
18371 let mut preallocated =
18372 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18373
18374 for i in 1..=max_ord {
18375 match i {
18376 6 => {
18377 if let Some(source_dictionary) = &self.source_dictionary {
18378 ::fidl_next::WireEnvelope::encode_value(
18379 source_dictionary,
18380 preallocated.encoder,
18381 &mut out,
18382 )?;
18383 } else {
18384 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18385 }
18386 }
18387
18388 4 => {
18389 if let Some(target_name) = &self.target_name {
18390 ::fidl_next::WireEnvelope::encode_value(
18391 target_name,
18392 preallocated.encoder,
18393 &mut out,
18394 )?;
18395 } else {
18396 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18397 }
18398 }
18399
18400 3 => {
18401 if let Some(target) = &self.target {
18402 ::fidl_next::WireEnvelope::encode_value(
18403 target,
18404 preallocated.encoder,
18405 &mut out,
18406 )?;
18407 } else {
18408 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18409 }
18410 }
18411
18412 2 => {
18413 if let Some(source_name) = &self.source_name {
18414 ::fidl_next::WireEnvelope::encode_value(
18415 source_name,
18416 preallocated.encoder,
18417 &mut out,
18418 )?;
18419 } else {
18420 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18421 }
18422 }
18423
18424 1 => {
18425 if let Some(source) = &self.source {
18426 ::fidl_next::WireEnvelope::encode_value(
18427 source,
18428 preallocated.encoder,
18429 &mut out,
18430 )?;
18431 } else {
18432 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18433 }
18434 }
18435
18436 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18437 }
18438 unsafe {
18439 preallocated.write_next(out.assume_init_ref());
18440 }
18441 }
18442
18443 ::fidl_next::WireTable::encode_len(table, max_ord);
18444
18445 Ok(())
18446 }
18447}
18448
18449impl<'de> ::fidl_next::FromWire<WireExposeRunner<'de>> for ExposeRunner {
18450 #[inline]
18451 fn from_wire(wire: WireExposeRunner<'de>) -> Self {
18452 let wire = ::core::mem::ManuallyDrop::new(wire);
18453
18454 let source = wire.table.get(1);
18455
18456 let source_name = wire.table.get(2);
18457
18458 let target = wire.table.get(3);
18459
18460 let target_name = wire.table.get(4);
18461
18462 let source_dictionary = wire.table.get(6);
18463
18464 Self {
18465 source: source.map(|envelope| {
18466 ::fidl_next::FromWire::from_wire(unsafe {
18467 envelope.read_unchecked::<crate::WireRef<'de>>()
18468 })
18469 }),
18470
18471 source_name: source_name.map(|envelope| {
18472 ::fidl_next::FromWire::from_wire(unsafe {
18473 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
18474 })
18475 }),
18476
18477 target: target.map(|envelope| {
18478 ::fidl_next::FromWire::from_wire(unsafe {
18479 envelope.read_unchecked::<crate::WireRef<'de>>()
18480 })
18481 }),
18482
18483 target_name: target_name.map(|envelope| {
18484 ::fidl_next::FromWire::from_wire(unsafe {
18485 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
18486 })
18487 }),
18488
18489 source_dictionary: source_dictionary.map(|envelope| {
18490 ::fidl_next::FromWire::from_wire(unsafe {
18491 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
18492 })
18493 }),
18494 }
18495 }
18496}
18497
18498impl<'de> ::fidl_next::FromWireRef<WireExposeRunner<'de>> for ExposeRunner {
18499 #[inline]
18500 fn from_wire_ref(wire: &WireExposeRunner<'de>) -> Self {
18501 Self {
18502 source: wire.table.get(1).map(|envelope| {
18503 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18504 envelope.deref_unchecked::<crate::WireRef<'de>>()
18505 })
18506 }),
18507
18508 source_name: wire.table.get(2).map(|envelope| {
18509 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18510 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
18511 })
18512 }),
18513
18514 target: wire.table.get(3).map(|envelope| {
18515 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18516 envelope.deref_unchecked::<crate::WireRef<'de>>()
18517 })
18518 }),
18519
18520 target_name: wire.table.get(4).map(|envelope| {
18521 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18522 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
18523 })
18524 }),
18525
18526 source_dictionary: wire.table.get(6).map(|envelope| {
18527 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18528 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
18529 })
18530 }),
18531 }
18532 }
18533}
18534
18535#[repr(C)]
18537pub struct WireExposeRunner<'de> {
18538 table: ::fidl_next::WireTable<'de>,
18539}
18540
18541impl<'de> Drop for WireExposeRunner<'de> {
18542 fn drop(&mut self) {
18543 let _ = self
18544 .table
18545 .get(1)
18546 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
18547
18548 let _ = self
18549 .table
18550 .get(2)
18551 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
18552
18553 let _ = self
18554 .table
18555 .get(3)
18556 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
18557
18558 let _ = self
18559 .table
18560 .get(4)
18561 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
18562
18563 let _ = self
18564 .table
18565 .get(6)
18566 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
18567 }
18568}
18569
18570unsafe impl ::fidl_next::Wire for WireExposeRunner<'static> {
18571 type Decoded<'de> = WireExposeRunner<'de>;
18572
18573 #[inline]
18574 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
18575 ::fidl_next::munge!(let Self { table } = out);
18576 ::fidl_next::WireTable::zero_padding(table);
18577 }
18578}
18579
18580unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeRunner<'static>
18581where
18582 ___D: ::fidl_next::Decoder + ?Sized,
18583{
18584 fn decode(
18585 slot: ::fidl_next::Slot<'_, Self>,
18586 decoder: &mut ___D,
18587 ) -> Result<(), ::fidl_next::DecodeError> {
18588 ::fidl_next::munge!(let Self { table } = slot);
18589
18590 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
18591 match ordinal {
18592 0 => unsafe { ::core::hint::unreachable_unchecked() },
18593
18594 1 => {
18595 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
18596 slot.as_mut(),
18597 decoder,
18598 )?;
18599
18600 Ok(())
18601 }
18602
18603 2 => {
18604 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
18605 slot.as_mut(),
18606 decoder,
18607 )?;
18608
18609 let source_name = unsafe {
18610 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
18611 };
18612
18613 if source_name.len() > 100 {
18614 return Err(::fidl_next::DecodeError::VectorTooLong {
18615 size: source_name.len() as u64,
18616 limit: 100,
18617 });
18618 }
18619
18620 Ok(())
18621 }
18622
18623 3 => {
18624 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
18625 slot.as_mut(),
18626 decoder,
18627 )?;
18628
18629 Ok(())
18630 }
18631
18632 4 => {
18633 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
18634 slot.as_mut(),
18635 decoder,
18636 )?;
18637
18638 let target_name = unsafe {
18639 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
18640 };
18641
18642 if target_name.len() > 100 {
18643 return Err(::fidl_next::DecodeError::VectorTooLong {
18644 size: target_name.len() as u64,
18645 limit: 100,
18646 });
18647 }
18648
18649 Ok(())
18650 }
18651
18652 6 => {
18653 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
18654 slot.as_mut(),
18655 decoder,
18656 )?;
18657
18658 let source_dictionary = unsafe {
18659 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
18660 };
18661
18662 if source_dictionary.len() > 1024 {
18663 return Err(::fidl_next::DecodeError::VectorTooLong {
18664 size: source_dictionary.len() as u64,
18665 limit: 1024,
18666 });
18667 }
18668
18669 Ok(())
18670 }
18671
18672 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
18673 }
18674 })
18675 }
18676}
18677
18678impl<'de> WireExposeRunner<'de> {
18679 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
18680 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
18681 }
18682
18683 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
18684 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
18685 }
18686
18687 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
18688 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
18689 }
18690
18691 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
18692 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
18693 }
18694
18695 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
18696 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
18697 }
18698}
18699
18700impl<'de> ::core::fmt::Debug for WireExposeRunner<'de> {
18701 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
18702 f.debug_struct("ExposeRunner")
18703 .field("source", &self.source())
18704 .field("source_name", &self.source_name())
18705 .field("target", &self.target())
18706 .field("target_name", &self.target_name())
18707 .field("source_dictionary", &self.source_dictionary())
18708 .finish()
18709 }
18710}
18711
18712#[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"]
18713#[derive(Clone, Debug, Default)]
18714pub struct ExposeResolver {
18715 pub source: Option<crate::Ref>,
18716
18717 pub source_name: Option<String>,
18718
18719 pub target: Option<crate::Ref>,
18720
18721 pub target_name: Option<String>,
18722
18723 pub source_dictionary: Option<String>,
18724}
18725
18726impl ExposeResolver {
18727 fn __max_ordinal(&self) -> usize {
18728 if self.source_dictionary.is_some() {
18729 return 6;
18730 }
18731
18732 if self.target_name.is_some() {
18733 return 4;
18734 }
18735
18736 if self.target.is_some() {
18737 return 3;
18738 }
18739
18740 if self.source_name.is_some() {
18741 return 2;
18742 }
18743
18744 if self.source.is_some() {
18745 return 1;
18746 }
18747
18748 0
18749 }
18750}
18751
18752impl ::fidl_next::Encodable for ExposeResolver {
18753 type Encoded = WireExposeResolver<'static>;
18754}
18755
18756unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeResolver
18757where
18758 ___E: ::fidl_next::Encoder + ?Sized,
18759{
18760 #[inline]
18761 fn encode(
18762 mut self,
18763 encoder: &mut ___E,
18764 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18765 ) -> Result<(), ::fidl_next::EncodeError> {
18766 ::fidl_next::munge!(let WireExposeResolver { table } = out);
18767
18768 let max_ord = self.__max_ordinal();
18769
18770 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18771 ::fidl_next::Wire::zero_padding(&mut out);
18772
18773 let mut preallocated =
18774 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18775
18776 for i in 1..=max_ord {
18777 match i {
18778 6 => {
18779 if let Some(source_dictionary) = self.source_dictionary.take() {
18780 ::fidl_next::WireEnvelope::encode_value(
18781 source_dictionary,
18782 preallocated.encoder,
18783 &mut out,
18784 )?;
18785 } else {
18786 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18787 }
18788 }
18789
18790 4 => {
18791 if let Some(target_name) = self.target_name.take() {
18792 ::fidl_next::WireEnvelope::encode_value(
18793 target_name,
18794 preallocated.encoder,
18795 &mut out,
18796 )?;
18797 } else {
18798 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18799 }
18800 }
18801
18802 3 => {
18803 if let Some(target) = self.target.take() {
18804 ::fidl_next::WireEnvelope::encode_value(
18805 target,
18806 preallocated.encoder,
18807 &mut out,
18808 )?;
18809 } else {
18810 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18811 }
18812 }
18813
18814 2 => {
18815 if let Some(source_name) = self.source_name.take() {
18816 ::fidl_next::WireEnvelope::encode_value(
18817 source_name,
18818 preallocated.encoder,
18819 &mut out,
18820 )?;
18821 } else {
18822 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18823 }
18824 }
18825
18826 1 => {
18827 if let Some(source) = self.source.take() {
18828 ::fidl_next::WireEnvelope::encode_value(
18829 source,
18830 preallocated.encoder,
18831 &mut out,
18832 )?;
18833 } else {
18834 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18835 }
18836 }
18837
18838 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18839 }
18840 unsafe {
18841 preallocated.write_next(out.assume_init_ref());
18842 }
18843 }
18844
18845 ::fidl_next::WireTable::encode_len(table, max_ord);
18846
18847 Ok(())
18848 }
18849}
18850
18851unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExposeResolver
18852where
18853 ___E: ::fidl_next::Encoder + ?Sized,
18854{
18855 #[inline]
18856 fn encode_ref(
18857 &self,
18858 encoder: &mut ___E,
18859 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18860 ) -> Result<(), ::fidl_next::EncodeError> {
18861 ::fidl_next::munge!(let WireExposeResolver { table } = out);
18862
18863 let max_ord = self.__max_ordinal();
18864
18865 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18866 ::fidl_next::Wire::zero_padding(&mut out);
18867
18868 let mut preallocated =
18869 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18870
18871 for i in 1..=max_ord {
18872 match i {
18873 6 => {
18874 if let Some(source_dictionary) = &self.source_dictionary {
18875 ::fidl_next::WireEnvelope::encode_value(
18876 source_dictionary,
18877 preallocated.encoder,
18878 &mut out,
18879 )?;
18880 } else {
18881 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18882 }
18883 }
18884
18885 4 => {
18886 if let Some(target_name) = &self.target_name {
18887 ::fidl_next::WireEnvelope::encode_value(
18888 target_name,
18889 preallocated.encoder,
18890 &mut out,
18891 )?;
18892 } else {
18893 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18894 }
18895 }
18896
18897 3 => {
18898 if let Some(target) = &self.target {
18899 ::fidl_next::WireEnvelope::encode_value(
18900 target,
18901 preallocated.encoder,
18902 &mut out,
18903 )?;
18904 } else {
18905 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18906 }
18907 }
18908
18909 2 => {
18910 if let Some(source_name) = &self.source_name {
18911 ::fidl_next::WireEnvelope::encode_value(
18912 source_name,
18913 preallocated.encoder,
18914 &mut out,
18915 )?;
18916 } else {
18917 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18918 }
18919 }
18920
18921 1 => {
18922 if let Some(source) = &self.source {
18923 ::fidl_next::WireEnvelope::encode_value(
18924 source,
18925 preallocated.encoder,
18926 &mut out,
18927 )?;
18928 } else {
18929 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18930 }
18931 }
18932
18933 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18934 }
18935 unsafe {
18936 preallocated.write_next(out.assume_init_ref());
18937 }
18938 }
18939
18940 ::fidl_next::WireTable::encode_len(table, max_ord);
18941
18942 Ok(())
18943 }
18944}
18945
18946impl<'de> ::fidl_next::FromWire<WireExposeResolver<'de>> for ExposeResolver {
18947 #[inline]
18948 fn from_wire(wire: WireExposeResolver<'de>) -> Self {
18949 let wire = ::core::mem::ManuallyDrop::new(wire);
18950
18951 let source = wire.table.get(1);
18952
18953 let source_name = wire.table.get(2);
18954
18955 let target = wire.table.get(3);
18956
18957 let target_name = wire.table.get(4);
18958
18959 let source_dictionary = wire.table.get(6);
18960
18961 Self {
18962 source: source.map(|envelope| {
18963 ::fidl_next::FromWire::from_wire(unsafe {
18964 envelope.read_unchecked::<crate::WireRef<'de>>()
18965 })
18966 }),
18967
18968 source_name: source_name.map(|envelope| {
18969 ::fidl_next::FromWire::from_wire(unsafe {
18970 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
18971 })
18972 }),
18973
18974 target: target.map(|envelope| {
18975 ::fidl_next::FromWire::from_wire(unsafe {
18976 envelope.read_unchecked::<crate::WireRef<'de>>()
18977 })
18978 }),
18979
18980 target_name: target_name.map(|envelope| {
18981 ::fidl_next::FromWire::from_wire(unsafe {
18982 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
18983 })
18984 }),
18985
18986 source_dictionary: source_dictionary.map(|envelope| {
18987 ::fidl_next::FromWire::from_wire(unsafe {
18988 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
18989 })
18990 }),
18991 }
18992 }
18993}
18994
18995impl<'de> ::fidl_next::FromWireRef<WireExposeResolver<'de>> for ExposeResolver {
18996 #[inline]
18997 fn from_wire_ref(wire: &WireExposeResolver<'de>) -> Self {
18998 Self {
18999 source: wire.table.get(1).map(|envelope| {
19000 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19001 envelope.deref_unchecked::<crate::WireRef<'de>>()
19002 })
19003 }),
19004
19005 source_name: wire.table.get(2).map(|envelope| {
19006 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19007 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
19008 })
19009 }),
19010
19011 target: wire.table.get(3).map(|envelope| {
19012 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19013 envelope.deref_unchecked::<crate::WireRef<'de>>()
19014 })
19015 }),
19016
19017 target_name: wire.table.get(4).map(|envelope| {
19018 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19019 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
19020 })
19021 }),
19022
19023 source_dictionary: wire.table.get(6).map(|envelope| {
19024 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19025 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
19026 })
19027 }),
19028 }
19029 }
19030}
19031
19032#[repr(C)]
19034pub struct WireExposeResolver<'de> {
19035 table: ::fidl_next::WireTable<'de>,
19036}
19037
19038impl<'de> Drop for WireExposeResolver<'de> {
19039 fn drop(&mut self) {
19040 let _ = self
19041 .table
19042 .get(1)
19043 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
19044
19045 let _ = self
19046 .table
19047 .get(2)
19048 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
19049
19050 let _ = self
19051 .table
19052 .get(3)
19053 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
19054
19055 let _ = self
19056 .table
19057 .get(4)
19058 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
19059
19060 let _ = self
19061 .table
19062 .get(6)
19063 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
19064 }
19065}
19066
19067unsafe impl ::fidl_next::Wire for WireExposeResolver<'static> {
19068 type Decoded<'de> = WireExposeResolver<'de>;
19069
19070 #[inline]
19071 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
19072 ::fidl_next::munge!(let Self { table } = out);
19073 ::fidl_next::WireTable::zero_padding(table);
19074 }
19075}
19076
19077unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeResolver<'static>
19078where
19079 ___D: ::fidl_next::Decoder + ?Sized,
19080{
19081 fn decode(
19082 slot: ::fidl_next::Slot<'_, Self>,
19083 decoder: &mut ___D,
19084 ) -> Result<(), ::fidl_next::DecodeError> {
19085 ::fidl_next::munge!(let Self { table } = slot);
19086
19087 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
19088 match ordinal {
19089 0 => unsafe { ::core::hint::unreachable_unchecked() },
19090
19091 1 => {
19092 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
19093 slot.as_mut(),
19094 decoder,
19095 )?;
19096
19097 Ok(())
19098 }
19099
19100 2 => {
19101 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
19102 slot.as_mut(),
19103 decoder,
19104 )?;
19105
19106 let source_name = unsafe {
19107 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
19108 };
19109
19110 if source_name.len() > 100 {
19111 return Err(::fidl_next::DecodeError::VectorTooLong {
19112 size: source_name.len() as u64,
19113 limit: 100,
19114 });
19115 }
19116
19117 Ok(())
19118 }
19119
19120 3 => {
19121 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
19122 slot.as_mut(),
19123 decoder,
19124 )?;
19125
19126 Ok(())
19127 }
19128
19129 4 => {
19130 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
19131 slot.as_mut(),
19132 decoder,
19133 )?;
19134
19135 let target_name = unsafe {
19136 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
19137 };
19138
19139 if target_name.len() > 100 {
19140 return Err(::fidl_next::DecodeError::VectorTooLong {
19141 size: target_name.len() as u64,
19142 limit: 100,
19143 });
19144 }
19145
19146 Ok(())
19147 }
19148
19149 6 => {
19150 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
19151 slot.as_mut(),
19152 decoder,
19153 )?;
19154
19155 let source_dictionary = unsafe {
19156 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
19157 };
19158
19159 if source_dictionary.len() > 1024 {
19160 return Err(::fidl_next::DecodeError::VectorTooLong {
19161 size: source_dictionary.len() as u64,
19162 limit: 1024,
19163 });
19164 }
19165
19166 Ok(())
19167 }
19168
19169 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
19170 }
19171 })
19172 }
19173}
19174
19175impl<'de> WireExposeResolver<'de> {
19176 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
19177 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
19178 }
19179
19180 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
19181 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
19182 }
19183
19184 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
19185 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
19186 }
19187
19188 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
19189 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
19190 }
19191
19192 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
19193 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
19194 }
19195}
19196
19197impl<'de> ::core::fmt::Debug for WireExposeResolver<'de> {
19198 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
19199 f.debug_struct("ExposeResolver")
19200 .field("source", &self.source())
19201 .field("source_name", &self.source_name())
19202 .field("target", &self.target())
19203 .field("target_name", &self.target_name())
19204 .field("source_dictionary", &self.source_dictionary())
19205 .finish()
19206 }
19207}
19208
19209#[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"]
19210#[derive(Clone, Debug, Default)]
19211pub struct ExposeDictionary {
19212 pub source: Option<crate::Ref>,
19213
19214 pub source_name: Option<String>,
19215
19216 pub target: Option<crate::Ref>,
19217
19218 pub target_name: Option<String>,
19219
19220 pub availability: Option<crate::Availability>,
19221
19222 pub source_dictionary: Option<String>,
19223}
19224
19225impl ExposeDictionary {
19226 fn __max_ordinal(&self) -> usize {
19227 if self.source_dictionary.is_some() {
19228 return 6;
19229 }
19230
19231 if self.availability.is_some() {
19232 return 5;
19233 }
19234
19235 if self.target_name.is_some() {
19236 return 4;
19237 }
19238
19239 if self.target.is_some() {
19240 return 3;
19241 }
19242
19243 if self.source_name.is_some() {
19244 return 2;
19245 }
19246
19247 if self.source.is_some() {
19248 return 1;
19249 }
19250
19251 0
19252 }
19253}
19254
19255impl ::fidl_next::Encodable for ExposeDictionary {
19256 type Encoded = WireExposeDictionary<'static>;
19257}
19258
19259unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeDictionary
19260where
19261 ___E: ::fidl_next::Encoder + ?Sized,
19262{
19263 #[inline]
19264 fn encode(
19265 mut self,
19266 encoder: &mut ___E,
19267 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19268 ) -> Result<(), ::fidl_next::EncodeError> {
19269 ::fidl_next::munge!(let WireExposeDictionary { table } = out);
19270
19271 let max_ord = self.__max_ordinal();
19272
19273 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
19274 ::fidl_next::Wire::zero_padding(&mut out);
19275
19276 let mut preallocated =
19277 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
19278
19279 for i in 1..=max_ord {
19280 match i {
19281 6 => {
19282 if let Some(source_dictionary) = self.source_dictionary.take() {
19283 ::fidl_next::WireEnvelope::encode_value(
19284 source_dictionary,
19285 preallocated.encoder,
19286 &mut out,
19287 )?;
19288 } else {
19289 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19290 }
19291 }
19292
19293 5 => {
19294 if let Some(availability) = self.availability.take() {
19295 ::fidl_next::WireEnvelope::encode_value(
19296 availability,
19297 preallocated.encoder,
19298 &mut out,
19299 )?;
19300 } else {
19301 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19302 }
19303 }
19304
19305 4 => {
19306 if let Some(target_name) = self.target_name.take() {
19307 ::fidl_next::WireEnvelope::encode_value(
19308 target_name,
19309 preallocated.encoder,
19310 &mut out,
19311 )?;
19312 } else {
19313 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19314 }
19315 }
19316
19317 3 => {
19318 if let Some(target) = self.target.take() {
19319 ::fidl_next::WireEnvelope::encode_value(
19320 target,
19321 preallocated.encoder,
19322 &mut out,
19323 )?;
19324 } else {
19325 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19326 }
19327 }
19328
19329 2 => {
19330 if let Some(source_name) = self.source_name.take() {
19331 ::fidl_next::WireEnvelope::encode_value(
19332 source_name,
19333 preallocated.encoder,
19334 &mut out,
19335 )?;
19336 } else {
19337 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19338 }
19339 }
19340
19341 1 => {
19342 if let Some(source) = self.source.take() {
19343 ::fidl_next::WireEnvelope::encode_value(
19344 source,
19345 preallocated.encoder,
19346 &mut out,
19347 )?;
19348 } else {
19349 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19350 }
19351 }
19352
19353 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
19354 }
19355 unsafe {
19356 preallocated.write_next(out.assume_init_ref());
19357 }
19358 }
19359
19360 ::fidl_next::WireTable::encode_len(table, max_ord);
19361
19362 Ok(())
19363 }
19364}
19365
19366unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExposeDictionary
19367where
19368 ___E: ::fidl_next::Encoder + ?Sized,
19369{
19370 #[inline]
19371 fn encode_ref(
19372 &self,
19373 encoder: &mut ___E,
19374 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19375 ) -> Result<(), ::fidl_next::EncodeError> {
19376 ::fidl_next::munge!(let WireExposeDictionary { table } = out);
19377
19378 let max_ord = self.__max_ordinal();
19379
19380 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
19381 ::fidl_next::Wire::zero_padding(&mut out);
19382
19383 let mut preallocated =
19384 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
19385
19386 for i in 1..=max_ord {
19387 match i {
19388 6 => {
19389 if let Some(source_dictionary) = &self.source_dictionary {
19390 ::fidl_next::WireEnvelope::encode_value(
19391 source_dictionary,
19392 preallocated.encoder,
19393 &mut out,
19394 )?;
19395 } else {
19396 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19397 }
19398 }
19399
19400 5 => {
19401 if let Some(availability) = &self.availability {
19402 ::fidl_next::WireEnvelope::encode_value(
19403 availability,
19404 preallocated.encoder,
19405 &mut out,
19406 )?;
19407 } else {
19408 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19409 }
19410 }
19411
19412 4 => {
19413 if let Some(target_name) = &self.target_name {
19414 ::fidl_next::WireEnvelope::encode_value(
19415 target_name,
19416 preallocated.encoder,
19417 &mut out,
19418 )?;
19419 } else {
19420 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19421 }
19422 }
19423
19424 3 => {
19425 if let Some(target) = &self.target {
19426 ::fidl_next::WireEnvelope::encode_value(
19427 target,
19428 preallocated.encoder,
19429 &mut out,
19430 )?;
19431 } else {
19432 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19433 }
19434 }
19435
19436 2 => {
19437 if let Some(source_name) = &self.source_name {
19438 ::fidl_next::WireEnvelope::encode_value(
19439 source_name,
19440 preallocated.encoder,
19441 &mut out,
19442 )?;
19443 } else {
19444 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19445 }
19446 }
19447
19448 1 => {
19449 if let Some(source) = &self.source {
19450 ::fidl_next::WireEnvelope::encode_value(
19451 source,
19452 preallocated.encoder,
19453 &mut out,
19454 )?;
19455 } else {
19456 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19457 }
19458 }
19459
19460 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
19461 }
19462 unsafe {
19463 preallocated.write_next(out.assume_init_ref());
19464 }
19465 }
19466
19467 ::fidl_next::WireTable::encode_len(table, max_ord);
19468
19469 Ok(())
19470 }
19471}
19472
19473impl<'de> ::fidl_next::FromWire<WireExposeDictionary<'de>> for ExposeDictionary {
19474 #[inline]
19475 fn from_wire(wire: WireExposeDictionary<'de>) -> Self {
19476 let wire = ::core::mem::ManuallyDrop::new(wire);
19477
19478 let source = wire.table.get(1);
19479
19480 let source_name = wire.table.get(2);
19481
19482 let target = wire.table.get(3);
19483
19484 let target_name = wire.table.get(4);
19485
19486 let availability = wire.table.get(5);
19487
19488 let source_dictionary = wire.table.get(6);
19489
19490 Self {
19491 source: source.map(|envelope| {
19492 ::fidl_next::FromWire::from_wire(unsafe {
19493 envelope.read_unchecked::<crate::WireRef<'de>>()
19494 })
19495 }),
19496
19497 source_name: source_name.map(|envelope| {
19498 ::fidl_next::FromWire::from_wire(unsafe {
19499 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
19500 })
19501 }),
19502
19503 target: target.map(|envelope| {
19504 ::fidl_next::FromWire::from_wire(unsafe {
19505 envelope.read_unchecked::<crate::WireRef<'de>>()
19506 })
19507 }),
19508
19509 target_name: target_name.map(|envelope| {
19510 ::fidl_next::FromWire::from_wire(unsafe {
19511 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
19512 })
19513 }),
19514
19515 availability: availability.map(|envelope| {
19516 ::fidl_next::FromWire::from_wire(unsafe {
19517 envelope.read_unchecked::<crate::WireAvailability>()
19518 })
19519 }),
19520
19521 source_dictionary: source_dictionary.map(|envelope| {
19522 ::fidl_next::FromWire::from_wire(unsafe {
19523 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
19524 })
19525 }),
19526 }
19527 }
19528}
19529
19530impl<'de> ::fidl_next::FromWireRef<WireExposeDictionary<'de>> for ExposeDictionary {
19531 #[inline]
19532 fn from_wire_ref(wire: &WireExposeDictionary<'de>) -> Self {
19533 Self {
19534 source: wire.table.get(1).map(|envelope| {
19535 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19536 envelope.deref_unchecked::<crate::WireRef<'de>>()
19537 })
19538 }),
19539
19540 source_name: wire.table.get(2).map(|envelope| {
19541 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19542 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
19543 })
19544 }),
19545
19546 target: wire.table.get(3).map(|envelope| {
19547 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19548 envelope.deref_unchecked::<crate::WireRef<'de>>()
19549 })
19550 }),
19551
19552 target_name: wire.table.get(4).map(|envelope| {
19553 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19554 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
19555 })
19556 }),
19557
19558 availability: wire.table.get(5).map(|envelope| {
19559 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19560 envelope.deref_unchecked::<crate::WireAvailability>()
19561 })
19562 }),
19563
19564 source_dictionary: wire.table.get(6).map(|envelope| {
19565 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19566 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
19567 })
19568 }),
19569 }
19570 }
19571}
19572
19573#[repr(C)]
19575pub struct WireExposeDictionary<'de> {
19576 table: ::fidl_next::WireTable<'de>,
19577}
19578
19579impl<'de> Drop for WireExposeDictionary<'de> {
19580 fn drop(&mut self) {
19581 let _ = self
19582 .table
19583 .get(1)
19584 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
19585
19586 let _ = self
19587 .table
19588 .get(2)
19589 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
19590
19591 let _ = self
19592 .table
19593 .get(3)
19594 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
19595
19596 let _ = self
19597 .table
19598 .get(4)
19599 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
19600
19601 let _ = self
19602 .table
19603 .get(5)
19604 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
19605
19606 let _ = self
19607 .table
19608 .get(6)
19609 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
19610 }
19611}
19612
19613unsafe impl ::fidl_next::Wire for WireExposeDictionary<'static> {
19614 type Decoded<'de> = WireExposeDictionary<'de>;
19615
19616 #[inline]
19617 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
19618 ::fidl_next::munge!(let Self { table } = out);
19619 ::fidl_next::WireTable::zero_padding(table);
19620 }
19621}
19622
19623unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeDictionary<'static>
19624where
19625 ___D: ::fidl_next::Decoder + ?Sized,
19626{
19627 fn decode(
19628 slot: ::fidl_next::Slot<'_, Self>,
19629 decoder: &mut ___D,
19630 ) -> Result<(), ::fidl_next::DecodeError> {
19631 ::fidl_next::munge!(let Self { table } = slot);
19632
19633 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
19634 match ordinal {
19635 0 => unsafe { ::core::hint::unreachable_unchecked() },
19636
19637 1 => {
19638 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
19639 slot.as_mut(),
19640 decoder,
19641 )?;
19642
19643 Ok(())
19644 }
19645
19646 2 => {
19647 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
19648 slot.as_mut(),
19649 decoder,
19650 )?;
19651
19652 let source_name = unsafe {
19653 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
19654 };
19655
19656 if source_name.len() > 100 {
19657 return Err(::fidl_next::DecodeError::VectorTooLong {
19658 size: source_name.len() as u64,
19659 limit: 100,
19660 });
19661 }
19662
19663 Ok(())
19664 }
19665
19666 3 => {
19667 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
19668 slot.as_mut(),
19669 decoder,
19670 )?;
19671
19672 Ok(())
19673 }
19674
19675 4 => {
19676 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
19677 slot.as_mut(),
19678 decoder,
19679 )?;
19680
19681 let target_name = unsafe {
19682 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
19683 };
19684
19685 if target_name.len() > 100 {
19686 return Err(::fidl_next::DecodeError::VectorTooLong {
19687 size: target_name.len() as u64,
19688 limit: 100,
19689 });
19690 }
19691
19692 Ok(())
19693 }
19694
19695 5 => {
19696 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
19697 slot.as_mut(),
19698 decoder,
19699 )?;
19700
19701 Ok(())
19702 }
19703
19704 6 => {
19705 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
19706 slot.as_mut(),
19707 decoder,
19708 )?;
19709
19710 let source_dictionary = unsafe {
19711 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
19712 };
19713
19714 if source_dictionary.len() > 1024 {
19715 return Err(::fidl_next::DecodeError::VectorTooLong {
19716 size: source_dictionary.len() as u64,
19717 limit: 1024,
19718 });
19719 }
19720
19721 Ok(())
19722 }
19723
19724 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
19725 }
19726 })
19727 }
19728}
19729
19730impl<'de> WireExposeDictionary<'de> {
19731 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
19732 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
19733 }
19734
19735 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
19736 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
19737 }
19738
19739 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
19740 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
19741 }
19742
19743 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
19744 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
19745 }
19746
19747 pub fn availability(&self) -> Option<&crate::WireAvailability> {
19748 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
19749 }
19750
19751 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
19752 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
19753 }
19754}
19755
19756impl<'de> ::core::fmt::Debug for WireExposeDictionary<'de> {
19757 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
19758 f.debug_struct("ExposeDictionary")
19759 .field("source", &self.source())
19760 .field("source_name", &self.source_name())
19761 .field("target", &self.target())
19762 .field("target_name", &self.target_name())
19763 .field("availability", &self.availability())
19764 .field("source_dictionary", &self.source_dictionary())
19765 .finish()
19766 }
19767}
19768
19769#[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"]
19770#[derive(Clone, Debug, Default)]
19771pub struct ExposeConfiguration {
19772 pub source: Option<crate::Ref>,
19773
19774 pub source_name: Option<String>,
19775
19776 pub target: Option<crate::Ref>,
19777
19778 pub target_name: Option<String>,
19779
19780 pub availability: Option<crate::Availability>,
19781
19782 pub source_dictionary: Option<String>,
19783}
19784
19785impl ExposeConfiguration {
19786 fn __max_ordinal(&self) -> usize {
19787 if self.source_dictionary.is_some() {
19788 return 6;
19789 }
19790
19791 if self.availability.is_some() {
19792 return 5;
19793 }
19794
19795 if self.target_name.is_some() {
19796 return 4;
19797 }
19798
19799 if self.target.is_some() {
19800 return 3;
19801 }
19802
19803 if self.source_name.is_some() {
19804 return 2;
19805 }
19806
19807 if self.source.is_some() {
19808 return 1;
19809 }
19810
19811 0
19812 }
19813}
19814
19815impl ::fidl_next::Encodable for ExposeConfiguration {
19816 type Encoded = WireExposeConfiguration<'static>;
19817}
19818
19819unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeConfiguration
19820where
19821 ___E: ::fidl_next::Encoder + ?Sized,
19822{
19823 #[inline]
19824 fn encode(
19825 mut self,
19826 encoder: &mut ___E,
19827 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19828 ) -> Result<(), ::fidl_next::EncodeError> {
19829 ::fidl_next::munge!(let WireExposeConfiguration { table } = out);
19830
19831 let max_ord = self.__max_ordinal();
19832
19833 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
19834 ::fidl_next::Wire::zero_padding(&mut out);
19835
19836 let mut preallocated =
19837 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
19838
19839 for i in 1..=max_ord {
19840 match i {
19841 6 => {
19842 if let Some(source_dictionary) = self.source_dictionary.take() {
19843 ::fidl_next::WireEnvelope::encode_value(
19844 source_dictionary,
19845 preallocated.encoder,
19846 &mut out,
19847 )?;
19848 } else {
19849 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19850 }
19851 }
19852
19853 5 => {
19854 if let Some(availability) = self.availability.take() {
19855 ::fidl_next::WireEnvelope::encode_value(
19856 availability,
19857 preallocated.encoder,
19858 &mut out,
19859 )?;
19860 } else {
19861 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19862 }
19863 }
19864
19865 4 => {
19866 if let Some(target_name) = self.target_name.take() {
19867 ::fidl_next::WireEnvelope::encode_value(
19868 target_name,
19869 preallocated.encoder,
19870 &mut out,
19871 )?;
19872 } else {
19873 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19874 }
19875 }
19876
19877 3 => {
19878 if let Some(target) = self.target.take() {
19879 ::fidl_next::WireEnvelope::encode_value(
19880 target,
19881 preallocated.encoder,
19882 &mut out,
19883 )?;
19884 } else {
19885 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19886 }
19887 }
19888
19889 2 => {
19890 if let Some(source_name) = self.source_name.take() {
19891 ::fidl_next::WireEnvelope::encode_value(
19892 source_name,
19893 preallocated.encoder,
19894 &mut out,
19895 )?;
19896 } else {
19897 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19898 }
19899 }
19900
19901 1 => {
19902 if let Some(source) = self.source.take() {
19903 ::fidl_next::WireEnvelope::encode_value(
19904 source,
19905 preallocated.encoder,
19906 &mut out,
19907 )?;
19908 } else {
19909 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19910 }
19911 }
19912
19913 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
19914 }
19915 unsafe {
19916 preallocated.write_next(out.assume_init_ref());
19917 }
19918 }
19919
19920 ::fidl_next::WireTable::encode_len(table, max_ord);
19921
19922 Ok(())
19923 }
19924}
19925
19926unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExposeConfiguration
19927where
19928 ___E: ::fidl_next::Encoder + ?Sized,
19929{
19930 #[inline]
19931 fn encode_ref(
19932 &self,
19933 encoder: &mut ___E,
19934 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19935 ) -> Result<(), ::fidl_next::EncodeError> {
19936 ::fidl_next::munge!(let WireExposeConfiguration { table } = out);
19937
19938 let max_ord = self.__max_ordinal();
19939
19940 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
19941 ::fidl_next::Wire::zero_padding(&mut out);
19942
19943 let mut preallocated =
19944 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
19945
19946 for i in 1..=max_ord {
19947 match i {
19948 6 => {
19949 if let Some(source_dictionary) = &self.source_dictionary {
19950 ::fidl_next::WireEnvelope::encode_value(
19951 source_dictionary,
19952 preallocated.encoder,
19953 &mut out,
19954 )?;
19955 } else {
19956 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19957 }
19958 }
19959
19960 5 => {
19961 if let Some(availability) = &self.availability {
19962 ::fidl_next::WireEnvelope::encode_value(
19963 availability,
19964 preallocated.encoder,
19965 &mut out,
19966 )?;
19967 } else {
19968 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19969 }
19970 }
19971
19972 4 => {
19973 if let Some(target_name) = &self.target_name {
19974 ::fidl_next::WireEnvelope::encode_value(
19975 target_name,
19976 preallocated.encoder,
19977 &mut out,
19978 )?;
19979 } else {
19980 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19981 }
19982 }
19983
19984 3 => {
19985 if let Some(target) = &self.target {
19986 ::fidl_next::WireEnvelope::encode_value(
19987 target,
19988 preallocated.encoder,
19989 &mut out,
19990 )?;
19991 } else {
19992 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19993 }
19994 }
19995
19996 2 => {
19997 if let Some(source_name) = &self.source_name {
19998 ::fidl_next::WireEnvelope::encode_value(
19999 source_name,
20000 preallocated.encoder,
20001 &mut out,
20002 )?;
20003 } else {
20004 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20005 }
20006 }
20007
20008 1 => {
20009 if let Some(source) = &self.source {
20010 ::fidl_next::WireEnvelope::encode_value(
20011 source,
20012 preallocated.encoder,
20013 &mut out,
20014 )?;
20015 } else {
20016 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20017 }
20018 }
20019
20020 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
20021 }
20022 unsafe {
20023 preallocated.write_next(out.assume_init_ref());
20024 }
20025 }
20026
20027 ::fidl_next::WireTable::encode_len(table, max_ord);
20028
20029 Ok(())
20030 }
20031}
20032
20033impl<'de> ::fidl_next::FromWire<WireExposeConfiguration<'de>> for ExposeConfiguration {
20034 #[inline]
20035 fn from_wire(wire: WireExposeConfiguration<'de>) -> Self {
20036 let wire = ::core::mem::ManuallyDrop::new(wire);
20037
20038 let source = wire.table.get(1);
20039
20040 let source_name = wire.table.get(2);
20041
20042 let target = wire.table.get(3);
20043
20044 let target_name = wire.table.get(4);
20045
20046 let availability = wire.table.get(5);
20047
20048 let source_dictionary = wire.table.get(6);
20049
20050 Self {
20051 source: source.map(|envelope| {
20052 ::fidl_next::FromWire::from_wire(unsafe {
20053 envelope.read_unchecked::<crate::WireRef<'de>>()
20054 })
20055 }),
20056
20057 source_name: source_name.map(|envelope| {
20058 ::fidl_next::FromWire::from_wire(unsafe {
20059 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
20060 })
20061 }),
20062
20063 target: target.map(|envelope| {
20064 ::fidl_next::FromWire::from_wire(unsafe {
20065 envelope.read_unchecked::<crate::WireRef<'de>>()
20066 })
20067 }),
20068
20069 target_name: target_name.map(|envelope| {
20070 ::fidl_next::FromWire::from_wire(unsafe {
20071 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
20072 })
20073 }),
20074
20075 availability: availability.map(|envelope| {
20076 ::fidl_next::FromWire::from_wire(unsafe {
20077 envelope.read_unchecked::<crate::WireAvailability>()
20078 })
20079 }),
20080
20081 source_dictionary: source_dictionary.map(|envelope| {
20082 ::fidl_next::FromWire::from_wire(unsafe {
20083 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
20084 })
20085 }),
20086 }
20087 }
20088}
20089
20090impl<'de> ::fidl_next::FromWireRef<WireExposeConfiguration<'de>> for ExposeConfiguration {
20091 #[inline]
20092 fn from_wire_ref(wire: &WireExposeConfiguration<'de>) -> Self {
20093 Self {
20094 source: wire.table.get(1).map(|envelope| {
20095 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20096 envelope.deref_unchecked::<crate::WireRef<'de>>()
20097 })
20098 }),
20099
20100 source_name: wire.table.get(2).map(|envelope| {
20101 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20102 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
20103 })
20104 }),
20105
20106 target: wire.table.get(3).map(|envelope| {
20107 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20108 envelope.deref_unchecked::<crate::WireRef<'de>>()
20109 })
20110 }),
20111
20112 target_name: wire.table.get(4).map(|envelope| {
20113 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20114 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
20115 })
20116 }),
20117
20118 availability: wire.table.get(5).map(|envelope| {
20119 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20120 envelope.deref_unchecked::<crate::WireAvailability>()
20121 })
20122 }),
20123
20124 source_dictionary: wire.table.get(6).map(|envelope| {
20125 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20126 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
20127 })
20128 }),
20129 }
20130 }
20131}
20132
20133#[repr(C)]
20135pub struct WireExposeConfiguration<'de> {
20136 table: ::fidl_next::WireTable<'de>,
20137}
20138
20139impl<'de> Drop for WireExposeConfiguration<'de> {
20140 fn drop(&mut self) {
20141 let _ = self
20142 .table
20143 .get(1)
20144 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
20145
20146 let _ = self
20147 .table
20148 .get(2)
20149 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
20150
20151 let _ = self
20152 .table
20153 .get(3)
20154 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
20155
20156 let _ = self
20157 .table
20158 .get(4)
20159 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
20160
20161 let _ = self
20162 .table
20163 .get(5)
20164 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
20165
20166 let _ = self
20167 .table
20168 .get(6)
20169 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
20170 }
20171}
20172
20173unsafe impl ::fidl_next::Wire for WireExposeConfiguration<'static> {
20174 type Decoded<'de> = WireExposeConfiguration<'de>;
20175
20176 #[inline]
20177 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
20178 ::fidl_next::munge!(let Self { table } = out);
20179 ::fidl_next::WireTable::zero_padding(table);
20180 }
20181}
20182
20183unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeConfiguration<'static>
20184where
20185 ___D: ::fidl_next::Decoder + ?Sized,
20186{
20187 fn decode(
20188 slot: ::fidl_next::Slot<'_, Self>,
20189 decoder: &mut ___D,
20190 ) -> Result<(), ::fidl_next::DecodeError> {
20191 ::fidl_next::munge!(let Self { table } = slot);
20192
20193 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
20194 match ordinal {
20195 0 => unsafe { ::core::hint::unreachable_unchecked() },
20196
20197 1 => {
20198 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
20199 slot.as_mut(),
20200 decoder,
20201 )?;
20202
20203 Ok(())
20204 }
20205
20206 2 => {
20207 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
20208 slot.as_mut(),
20209 decoder,
20210 )?;
20211
20212 let source_name = unsafe {
20213 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
20214 };
20215
20216 if source_name.len() > 100 {
20217 return Err(::fidl_next::DecodeError::VectorTooLong {
20218 size: source_name.len() as u64,
20219 limit: 100,
20220 });
20221 }
20222
20223 Ok(())
20224 }
20225
20226 3 => {
20227 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
20228 slot.as_mut(),
20229 decoder,
20230 )?;
20231
20232 Ok(())
20233 }
20234
20235 4 => {
20236 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
20237 slot.as_mut(),
20238 decoder,
20239 )?;
20240
20241 let target_name = unsafe {
20242 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
20243 };
20244
20245 if target_name.len() > 100 {
20246 return Err(::fidl_next::DecodeError::VectorTooLong {
20247 size: target_name.len() as u64,
20248 limit: 100,
20249 });
20250 }
20251
20252 Ok(())
20253 }
20254
20255 5 => {
20256 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
20257 slot.as_mut(),
20258 decoder,
20259 )?;
20260
20261 Ok(())
20262 }
20263
20264 6 => {
20265 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
20266 slot.as_mut(),
20267 decoder,
20268 )?;
20269
20270 let source_dictionary = unsafe {
20271 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
20272 };
20273
20274 if source_dictionary.len() > 1024 {
20275 return Err(::fidl_next::DecodeError::VectorTooLong {
20276 size: source_dictionary.len() as u64,
20277 limit: 1024,
20278 });
20279 }
20280
20281 Ok(())
20282 }
20283
20284 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
20285 }
20286 })
20287 }
20288}
20289
20290impl<'de> WireExposeConfiguration<'de> {
20291 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
20292 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
20293 }
20294
20295 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
20296 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
20297 }
20298
20299 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
20300 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
20301 }
20302
20303 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
20304 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
20305 }
20306
20307 pub fn availability(&self) -> Option<&crate::WireAvailability> {
20308 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
20309 }
20310
20311 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
20312 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
20313 }
20314}
20315
20316impl<'de> ::core::fmt::Debug for WireExposeConfiguration<'de> {
20317 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
20318 f.debug_struct("ExposeConfiguration")
20319 .field("source", &self.source())
20320 .field("source_name", &self.source_name())
20321 .field("target", &self.target())
20322 .field("target_name", &self.target_name())
20323 .field("availability", &self.availability())
20324 .field("source_dictionary", &self.source_dictionary())
20325 .finish()
20326 }
20327}
20328
20329#[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"]
20330#[derive(Clone, Debug)]
20331pub enum Expose {
20332 Service(crate::ExposeService),
20333
20334 Protocol(crate::ExposeProtocol),
20335
20336 Directory(crate::ExposeDirectory),
20337
20338 Runner(crate::ExposeRunner),
20339
20340 Resolver(crate::ExposeResolver),
20341
20342 Dictionary(crate::ExposeDictionary),
20343
20344 Config(crate::ExposeConfiguration),
20345
20346 UnknownOrdinal_(u64),
20347}
20348
20349impl ::fidl_next::Encodable for Expose {
20350 type Encoded = WireExpose<'static>;
20351}
20352
20353unsafe impl<___E> ::fidl_next::Encode<___E> for Expose
20354where
20355 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20356 ___E: ::fidl_next::Encoder,
20357{
20358 #[inline]
20359 fn encode(
20360 self,
20361 encoder: &mut ___E,
20362 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20363 ) -> Result<(), ::fidl_next::EncodeError> {
20364 ::fidl_next::munge!(let WireExpose { raw, _phantom: _ } = out);
20365
20366 match self {
20367 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
20368 ___E,
20369 crate::ExposeService,
20370 >(value, 1, encoder, raw)?,
20371
20372 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
20373 ___E,
20374 crate::ExposeProtocol,
20375 >(value, 2, encoder, raw)?,
20376
20377 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
20378 ___E,
20379 crate::ExposeDirectory,
20380 >(value, 3, encoder, raw)?,
20381
20382 Self::Runner(value) => {
20383 ::fidl_next::RawWireUnion::encode_as::<___E, crate::ExposeRunner>(
20384 value, 4, encoder, raw,
20385 )?
20386 }
20387
20388 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
20389 ___E,
20390 crate::ExposeResolver,
20391 >(value, 5, encoder, raw)?,
20392
20393 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
20394 ___E,
20395 crate::ExposeDictionary,
20396 >(value, 7, encoder, raw)?,
20397
20398 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
20399 ___E,
20400 crate::ExposeConfiguration,
20401 >(value, 8, encoder, raw)?,
20402
20403 Self::UnknownOrdinal_(ordinal) => {
20404 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
20405 }
20406 }
20407
20408 Ok(())
20409 }
20410}
20411
20412unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Expose
20413where
20414 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20415 ___E: ::fidl_next::Encoder,
20416{
20417 #[inline]
20418 fn encode_ref(
20419 &self,
20420 encoder: &mut ___E,
20421 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20422 ) -> Result<(), ::fidl_next::EncodeError> {
20423 ::fidl_next::munge!(let WireExpose { raw, _phantom: _ } = out);
20424
20425 match self {
20426 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
20427 ___E,
20428 &crate::ExposeService,
20429 >(value, 1, encoder, raw)?,
20430
20431 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
20432 ___E,
20433 &crate::ExposeProtocol,
20434 >(value, 2, encoder, raw)?,
20435
20436 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
20437 ___E,
20438 &crate::ExposeDirectory,
20439 >(value, 3, encoder, raw)?,
20440
20441 Self::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<
20442 ___E,
20443 &crate::ExposeRunner,
20444 >(value, 4, encoder, raw)?,
20445
20446 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
20447 ___E,
20448 &crate::ExposeResolver,
20449 >(value, 5, encoder, raw)?,
20450
20451 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
20452 ___E,
20453 &crate::ExposeDictionary,
20454 >(value, 7, encoder, raw)?,
20455
20456 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
20457 ___E,
20458 &crate::ExposeConfiguration,
20459 >(value, 8, encoder, raw)?,
20460
20461 Self::UnknownOrdinal_(ordinal) => {
20462 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
20463 }
20464 }
20465
20466 Ok(())
20467 }
20468}
20469
20470impl ::fidl_next::EncodableOption for Expose {
20471 type EncodedOption = WireOptionalExpose<'static>;
20472}
20473
20474unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Expose
20475where
20476 ___E: ?Sized,
20477 Expose: ::fidl_next::Encode<___E>,
20478{
20479 #[inline]
20480 fn encode_option(
20481 this: Option<Self>,
20482 encoder: &mut ___E,
20483 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20484 ) -> Result<(), ::fidl_next::EncodeError> {
20485 ::fidl_next::munge!(let WireOptionalExpose { raw, _phantom: _ } = &mut *out);
20486
20487 if let Some(inner) = this {
20488 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
20489 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
20490 } else {
20491 ::fidl_next::RawWireUnion::encode_absent(raw);
20492 }
20493
20494 Ok(())
20495 }
20496}
20497
20498unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Expose
20499where
20500 ___E: ?Sized,
20501 Expose: ::fidl_next::EncodeRef<___E>,
20502{
20503 #[inline]
20504 fn encode_option_ref(
20505 this: Option<&Self>,
20506 encoder: &mut ___E,
20507 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
20508 ) -> Result<(), ::fidl_next::EncodeError> {
20509 ::fidl_next::munge!(let WireOptionalExpose { raw, _phantom: _ } = &mut *out);
20510
20511 if let Some(inner) = this {
20512 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
20513 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
20514 } else {
20515 ::fidl_next::RawWireUnion::encode_absent(raw);
20516 }
20517
20518 Ok(())
20519 }
20520}
20521
20522impl<'de> ::fidl_next::FromWire<WireExpose<'de>> for Expose {
20523 #[inline]
20524 fn from_wire(wire: WireExpose<'de>) -> Self {
20525 let wire = ::core::mem::ManuallyDrop::new(wire);
20526 match wire.raw.ordinal() {
20527 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
20528 wire.raw.get().read_unchecked::<crate::WireExposeService<'de>>()
20529 })),
20530
20531 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
20532 wire.raw.get().read_unchecked::<crate::WireExposeProtocol<'de>>()
20533 })),
20534
20535 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
20536 wire.raw.get().read_unchecked::<crate::WireExposeDirectory<'de>>()
20537 })),
20538
20539 4 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
20540 wire.raw.get().read_unchecked::<crate::WireExposeRunner<'de>>()
20541 })),
20542
20543 5 => Self::Resolver(::fidl_next::FromWire::from_wire(unsafe {
20544 wire.raw.get().read_unchecked::<crate::WireExposeResolver<'de>>()
20545 })),
20546
20547 7 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
20548 wire.raw.get().read_unchecked::<crate::WireExposeDictionary<'de>>()
20549 })),
20550
20551 8 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
20552 wire.raw.get().read_unchecked::<crate::WireExposeConfiguration<'de>>()
20553 })),
20554
20555 _ => unsafe { ::core::hint::unreachable_unchecked() },
20556 }
20557 }
20558}
20559
20560impl<'de> ::fidl_next::FromWireRef<WireExpose<'de>> for Expose {
20561 #[inline]
20562 fn from_wire_ref(wire: &WireExpose<'de>) -> Self {
20563 match wire.raw.ordinal() {
20564 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
20565 wire.raw.get().deref_unchecked::<crate::WireExposeService<'de>>()
20566 })),
20567
20568 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
20569 wire.raw.get().deref_unchecked::<crate::WireExposeProtocol<'de>>()
20570 })),
20571
20572 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
20573 wire.raw.get().deref_unchecked::<crate::WireExposeDirectory<'de>>()
20574 })),
20575
20576 4 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
20577 wire.raw.get().deref_unchecked::<crate::WireExposeRunner<'de>>()
20578 })),
20579
20580 5 => Self::Resolver(::fidl_next::FromWireRef::from_wire_ref(unsafe {
20581 wire.raw.get().deref_unchecked::<crate::WireExposeResolver<'de>>()
20582 })),
20583
20584 7 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
20585 wire.raw.get().deref_unchecked::<crate::WireExposeDictionary<'de>>()
20586 })),
20587
20588 8 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
20589 wire.raw.get().deref_unchecked::<crate::WireExposeConfiguration<'de>>()
20590 })),
20591
20592 _ => unsafe { ::core::hint::unreachable_unchecked() },
20593 }
20594 }
20595}
20596
20597impl<'de> ::fidl_next::FromWireOption<WireOptionalExpose<'de>> for Box<Expose> {
20598 #[inline]
20599 fn from_wire_option(wire: WireOptionalExpose<'de>) -> Option<Self> {
20600 if let Some(inner) = wire.into_option() {
20601 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
20602 } else {
20603 None
20604 }
20605 }
20606}
20607
20608impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalExpose<'de>> for Box<Expose> {
20609 #[inline]
20610 fn from_wire_option_ref(wire: &WireOptionalExpose<'de>) -> Option<Self> {
20611 if let Some(inner) = wire.as_ref() {
20612 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
20613 } else {
20614 None
20615 }
20616 }
20617}
20618
20619#[repr(transparent)]
20621pub struct WireExpose<'de> {
20622 raw: ::fidl_next::RawWireUnion,
20623 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
20624}
20625
20626impl<'de> Drop for WireExpose<'de> {
20627 fn drop(&mut self) {
20628 match self.raw.ordinal() {
20629 1 => {
20630 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireExposeService<'de>>() };
20631 }
20632
20633 2 => {
20634 let _ =
20635 unsafe { self.raw.get().read_unchecked::<crate::WireExposeProtocol<'de>>() };
20636 }
20637
20638 3 => {
20639 let _ =
20640 unsafe { self.raw.get().read_unchecked::<crate::WireExposeDirectory<'de>>() };
20641 }
20642
20643 4 => {
20644 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireExposeRunner<'de>>() };
20645 }
20646
20647 5 => {
20648 let _ =
20649 unsafe { self.raw.get().read_unchecked::<crate::WireExposeResolver<'de>>() };
20650 }
20651
20652 7 => {
20653 let _ =
20654 unsafe { self.raw.get().read_unchecked::<crate::WireExposeDictionary<'de>>() };
20655 }
20656
20657 8 => {
20658 let _ = unsafe {
20659 self.raw.get().read_unchecked::<crate::WireExposeConfiguration<'de>>()
20660 };
20661 }
20662
20663 _ => (),
20664 }
20665 }
20666}
20667
20668unsafe impl ::fidl_next::Wire for WireExpose<'static> {
20669 type Decoded<'de> = WireExpose<'de>;
20670
20671 #[inline]
20672 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
20673 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
20674 ::fidl_next::RawWireUnion::zero_padding(raw);
20675 }
20676}
20677
20678pub mod expose {
20679 pub enum Ref<'de> {
20680 Service(&'de crate::WireExposeService<'de>),
20681
20682 Protocol(&'de crate::WireExposeProtocol<'de>),
20683
20684 Directory(&'de crate::WireExposeDirectory<'de>),
20685
20686 Runner(&'de crate::WireExposeRunner<'de>),
20687
20688 Resolver(&'de crate::WireExposeResolver<'de>),
20689
20690 Dictionary(&'de crate::WireExposeDictionary<'de>),
20691
20692 Config(&'de crate::WireExposeConfiguration<'de>),
20693
20694 UnknownOrdinal_(u64),
20695 }
20696}
20697
20698impl<'de> WireExpose<'de> {
20699 pub fn as_ref(&self) -> crate::expose::Ref<'_> {
20700 match self.raw.ordinal() {
20701 1 => crate::expose::Ref::Service(unsafe {
20702 self.raw.get().deref_unchecked::<crate::WireExposeService<'_>>()
20703 }),
20704
20705 2 => crate::expose::Ref::Protocol(unsafe {
20706 self.raw.get().deref_unchecked::<crate::WireExposeProtocol<'_>>()
20707 }),
20708
20709 3 => crate::expose::Ref::Directory(unsafe {
20710 self.raw.get().deref_unchecked::<crate::WireExposeDirectory<'_>>()
20711 }),
20712
20713 4 => crate::expose::Ref::Runner(unsafe {
20714 self.raw.get().deref_unchecked::<crate::WireExposeRunner<'_>>()
20715 }),
20716
20717 5 => crate::expose::Ref::Resolver(unsafe {
20718 self.raw.get().deref_unchecked::<crate::WireExposeResolver<'_>>()
20719 }),
20720
20721 7 => crate::expose::Ref::Dictionary(unsafe {
20722 self.raw.get().deref_unchecked::<crate::WireExposeDictionary<'_>>()
20723 }),
20724
20725 8 => crate::expose::Ref::Config(unsafe {
20726 self.raw.get().deref_unchecked::<crate::WireExposeConfiguration<'_>>()
20727 }),
20728
20729 unknown => crate::expose::Ref::UnknownOrdinal_(unknown),
20730 }
20731 }
20732}
20733
20734unsafe impl<___D> ::fidl_next::Decode<___D> for WireExpose<'static>
20735where
20736 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20737 ___D: ::fidl_next::Decoder,
20738{
20739 fn decode(
20740 mut slot: ::fidl_next::Slot<'_, Self>,
20741 decoder: &mut ___D,
20742 ) -> Result<(), ::fidl_next::DecodeError> {
20743 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
20744 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
20745 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeService<'static>>(
20746 raw, decoder,
20747 )?,
20748
20749 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeProtocol<'static>>(
20750 raw, decoder,
20751 )?,
20752
20753 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeDirectory<'static>>(
20754 raw, decoder,
20755 )?,
20756
20757 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeRunner<'static>>(
20758 raw, decoder,
20759 )?,
20760
20761 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeResolver<'static>>(
20762 raw, decoder,
20763 )?,
20764
20765 7 => {
20766 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeDictionary<'static>>(
20767 raw, decoder,
20768 )?
20769 }
20770
20771 8 => ::fidl_next::RawWireUnion::decode_as::<
20772 ___D,
20773 crate::WireExposeConfiguration<'static>,
20774 >(raw, decoder)?,
20775
20776 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
20777 }
20778
20779 Ok(())
20780 }
20781}
20782
20783impl<'de> ::core::fmt::Debug for WireExpose<'de> {
20784 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
20785 match self.raw.ordinal() {
20786 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireExposeService<'_>>().fmt(f) },
20787 2 => unsafe {
20788 self.raw.get().deref_unchecked::<crate::WireExposeProtocol<'_>>().fmt(f)
20789 },
20790 3 => unsafe {
20791 self.raw.get().deref_unchecked::<crate::WireExposeDirectory<'_>>().fmt(f)
20792 },
20793 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireExposeRunner<'_>>().fmt(f) },
20794 5 => unsafe {
20795 self.raw.get().deref_unchecked::<crate::WireExposeResolver<'_>>().fmt(f)
20796 },
20797 7 => unsafe {
20798 self.raw.get().deref_unchecked::<crate::WireExposeDictionary<'_>>().fmt(f)
20799 },
20800 8 => unsafe {
20801 self.raw.get().deref_unchecked::<crate::WireExposeConfiguration<'_>>().fmt(f)
20802 },
20803 _ => unsafe { ::core::hint::unreachable_unchecked() },
20804 }
20805 }
20806}
20807
20808#[repr(transparent)]
20809pub struct WireOptionalExpose<'de> {
20810 raw: ::fidl_next::RawWireUnion,
20811 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
20812}
20813
20814unsafe impl ::fidl_next::Wire for WireOptionalExpose<'static> {
20815 type Decoded<'de> = WireOptionalExpose<'de>;
20816
20817 #[inline]
20818 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
20819 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
20820 ::fidl_next::RawWireUnion::zero_padding(raw);
20821 }
20822}
20823
20824impl<'de> WireOptionalExpose<'de> {
20825 pub fn is_some(&self) -> bool {
20826 self.raw.is_some()
20827 }
20828
20829 pub fn is_none(&self) -> bool {
20830 self.raw.is_none()
20831 }
20832
20833 pub fn as_ref(&self) -> Option<&WireExpose<'de>> {
20834 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
20835 }
20836
20837 pub fn into_option(self) -> Option<WireExpose<'de>> {
20838 if self.is_some() {
20839 Some(WireExpose { raw: self.raw, _phantom: ::core::marker::PhantomData })
20840 } else {
20841 None
20842 }
20843 }
20844}
20845
20846unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalExpose<'static>
20847where
20848 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
20849 ___D: ::fidl_next::Decoder,
20850{
20851 fn decode(
20852 mut slot: ::fidl_next::Slot<'_, Self>,
20853 decoder: &mut ___D,
20854 ) -> Result<(), ::fidl_next::DecodeError> {
20855 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
20856 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
20857 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeService<'static>>(
20858 raw, decoder,
20859 )?,
20860
20861 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeProtocol<'static>>(
20862 raw, decoder,
20863 )?,
20864
20865 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeDirectory<'static>>(
20866 raw, decoder,
20867 )?,
20868
20869 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeRunner<'static>>(
20870 raw, decoder,
20871 )?,
20872
20873 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeResolver<'static>>(
20874 raw, decoder,
20875 )?,
20876
20877 7 => {
20878 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeDictionary<'static>>(
20879 raw, decoder,
20880 )?
20881 }
20882
20883 8 => ::fidl_next::RawWireUnion::decode_as::<
20884 ___D,
20885 crate::WireExposeConfiguration<'static>,
20886 >(raw, decoder)?,
20887
20888 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
20889 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
20890 }
20891
20892 Ok(())
20893 }
20894}
20895
20896impl<'de> ::core::fmt::Debug for WireOptionalExpose<'de> {
20897 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
20898 self.as_ref().fmt(f)
20899 }
20900}
20901
20902#[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"]
20903#[derive(Clone, Debug, Default)]
20904pub struct OfferService {
20905 pub source: Option<crate::Ref>,
20906
20907 pub source_name: Option<String>,
20908
20909 pub target: Option<crate::Ref>,
20910
20911 pub target_name: Option<String>,
20912
20913 pub source_instance_filter: Option<Vec<String>>,
20914
20915 pub renamed_instances: Option<Vec<crate::NameMapping>>,
20916
20917 pub availability: Option<crate::Availability>,
20918
20919 pub source_dictionary: Option<String>,
20920
20921 pub dependency_type: Option<crate::DependencyType>,
20922}
20923
20924impl OfferService {
20925 fn __max_ordinal(&self) -> usize {
20926 if self.dependency_type.is_some() {
20927 return 9;
20928 }
20929
20930 if self.source_dictionary.is_some() {
20931 return 8;
20932 }
20933
20934 if self.availability.is_some() {
20935 return 7;
20936 }
20937
20938 if self.renamed_instances.is_some() {
20939 return 6;
20940 }
20941
20942 if self.source_instance_filter.is_some() {
20943 return 5;
20944 }
20945
20946 if self.target_name.is_some() {
20947 return 4;
20948 }
20949
20950 if self.target.is_some() {
20951 return 3;
20952 }
20953
20954 if self.source_name.is_some() {
20955 return 2;
20956 }
20957
20958 if self.source.is_some() {
20959 return 1;
20960 }
20961
20962 0
20963 }
20964}
20965
20966impl ::fidl_next::Encodable for OfferService {
20967 type Encoded = WireOfferService<'static>;
20968}
20969
20970unsafe impl<___E> ::fidl_next::Encode<___E> for OfferService
20971where
20972 ___E: ::fidl_next::Encoder + ?Sized,
20973{
20974 #[inline]
20975 fn encode(
20976 mut self,
20977 encoder: &mut ___E,
20978 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20979 ) -> Result<(), ::fidl_next::EncodeError> {
20980 ::fidl_next::munge!(let WireOfferService { table } = out);
20981
20982 let max_ord = self.__max_ordinal();
20983
20984 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
20985 ::fidl_next::Wire::zero_padding(&mut out);
20986
20987 let mut preallocated =
20988 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
20989
20990 for i in 1..=max_ord {
20991 match i {
20992 9 => {
20993 if let Some(dependency_type) = self.dependency_type.take() {
20994 ::fidl_next::WireEnvelope::encode_value(
20995 dependency_type,
20996 preallocated.encoder,
20997 &mut out,
20998 )?;
20999 } else {
21000 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21001 }
21002 }
21003
21004 8 => {
21005 if let Some(source_dictionary) = self.source_dictionary.take() {
21006 ::fidl_next::WireEnvelope::encode_value(
21007 source_dictionary,
21008 preallocated.encoder,
21009 &mut out,
21010 )?;
21011 } else {
21012 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21013 }
21014 }
21015
21016 7 => {
21017 if let Some(availability) = self.availability.take() {
21018 ::fidl_next::WireEnvelope::encode_value(
21019 availability,
21020 preallocated.encoder,
21021 &mut out,
21022 )?;
21023 } else {
21024 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21025 }
21026 }
21027
21028 6 => {
21029 if let Some(renamed_instances) = self.renamed_instances.take() {
21030 ::fidl_next::WireEnvelope::encode_value(
21031 renamed_instances,
21032 preallocated.encoder,
21033 &mut out,
21034 )?;
21035 } else {
21036 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21037 }
21038 }
21039
21040 5 => {
21041 if let Some(source_instance_filter) = self.source_instance_filter.take() {
21042 ::fidl_next::WireEnvelope::encode_value(
21043 source_instance_filter,
21044 preallocated.encoder,
21045 &mut out,
21046 )?;
21047 } else {
21048 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21049 }
21050 }
21051
21052 4 => {
21053 if let Some(target_name) = self.target_name.take() {
21054 ::fidl_next::WireEnvelope::encode_value(
21055 target_name,
21056 preallocated.encoder,
21057 &mut out,
21058 )?;
21059 } else {
21060 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21061 }
21062 }
21063
21064 3 => {
21065 if let Some(target) = self.target.take() {
21066 ::fidl_next::WireEnvelope::encode_value(
21067 target,
21068 preallocated.encoder,
21069 &mut out,
21070 )?;
21071 } else {
21072 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21073 }
21074 }
21075
21076 2 => {
21077 if let Some(source_name) = self.source_name.take() {
21078 ::fidl_next::WireEnvelope::encode_value(
21079 source_name,
21080 preallocated.encoder,
21081 &mut out,
21082 )?;
21083 } else {
21084 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21085 }
21086 }
21087
21088 1 => {
21089 if let Some(source) = self.source.take() {
21090 ::fidl_next::WireEnvelope::encode_value(
21091 source,
21092 preallocated.encoder,
21093 &mut out,
21094 )?;
21095 } else {
21096 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21097 }
21098 }
21099
21100 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
21101 }
21102 unsafe {
21103 preallocated.write_next(out.assume_init_ref());
21104 }
21105 }
21106
21107 ::fidl_next::WireTable::encode_len(table, max_ord);
21108
21109 Ok(())
21110 }
21111}
21112
21113unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferService
21114where
21115 ___E: ::fidl_next::Encoder + ?Sized,
21116{
21117 #[inline]
21118 fn encode_ref(
21119 &self,
21120 encoder: &mut ___E,
21121 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21122 ) -> Result<(), ::fidl_next::EncodeError> {
21123 ::fidl_next::munge!(let WireOfferService { table } = out);
21124
21125 let max_ord = self.__max_ordinal();
21126
21127 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
21128 ::fidl_next::Wire::zero_padding(&mut out);
21129
21130 let mut preallocated =
21131 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
21132
21133 for i in 1..=max_ord {
21134 match i {
21135 9 => {
21136 if let Some(dependency_type) = &self.dependency_type {
21137 ::fidl_next::WireEnvelope::encode_value(
21138 dependency_type,
21139 preallocated.encoder,
21140 &mut out,
21141 )?;
21142 } else {
21143 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21144 }
21145 }
21146
21147 8 => {
21148 if let Some(source_dictionary) = &self.source_dictionary {
21149 ::fidl_next::WireEnvelope::encode_value(
21150 source_dictionary,
21151 preallocated.encoder,
21152 &mut out,
21153 )?;
21154 } else {
21155 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21156 }
21157 }
21158
21159 7 => {
21160 if let Some(availability) = &self.availability {
21161 ::fidl_next::WireEnvelope::encode_value(
21162 availability,
21163 preallocated.encoder,
21164 &mut out,
21165 )?;
21166 } else {
21167 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21168 }
21169 }
21170
21171 6 => {
21172 if let Some(renamed_instances) = &self.renamed_instances {
21173 ::fidl_next::WireEnvelope::encode_value(
21174 renamed_instances,
21175 preallocated.encoder,
21176 &mut out,
21177 )?;
21178 } else {
21179 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21180 }
21181 }
21182
21183 5 => {
21184 if let Some(source_instance_filter) = &self.source_instance_filter {
21185 ::fidl_next::WireEnvelope::encode_value(
21186 source_instance_filter,
21187 preallocated.encoder,
21188 &mut out,
21189 )?;
21190 } else {
21191 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21192 }
21193 }
21194
21195 4 => {
21196 if let Some(target_name) = &self.target_name {
21197 ::fidl_next::WireEnvelope::encode_value(
21198 target_name,
21199 preallocated.encoder,
21200 &mut out,
21201 )?;
21202 } else {
21203 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21204 }
21205 }
21206
21207 3 => {
21208 if let Some(target) = &self.target {
21209 ::fidl_next::WireEnvelope::encode_value(
21210 target,
21211 preallocated.encoder,
21212 &mut out,
21213 )?;
21214 } else {
21215 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21216 }
21217 }
21218
21219 2 => {
21220 if let Some(source_name) = &self.source_name {
21221 ::fidl_next::WireEnvelope::encode_value(
21222 source_name,
21223 preallocated.encoder,
21224 &mut out,
21225 )?;
21226 } else {
21227 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21228 }
21229 }
21230
21231 1 => {
21232 if let Some(source) = &self.source {
21233 ::fidl_next::WireEnvelope::encode_value(
21234 source,
21235 preallocated.encoder,
21236 &mut out,
21237 )?;
21238 } else {
21239 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21240 }
21241 }
21242
21243 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
21244 }
21245 unsafe {
21246 preallocated.write_next(out.assume_init_ref());
21247 }
21248 }
21249
21250 ::fidl_next::WireTable::encode_len(table, max_ord);
21251
21252 Ok(())
21253 }
21254}
21255
21256impl<'de> ::fidl_next::FromWire<WireOfferService<'de>> for OfferService {
21257 #[inline]
21258 fn from_wire(wire: WireOfferService<'de>) -> Self {
21259 let wire = ::core::mem::ManuallyDrop::new(wire);
21260
21261 let source = wire.table.get(1);
21262
21263 let source_name = wire.table.get(2);
21264
21265 let target = wire.table.get(3);
21266
21267 let target_name = wire.table.get(4);
21268
21269 let source_instance_filter = wire.table.get(5);
21270
21271 let renamed_instances = wire.table.get(6);
21272
21273 let availability = wire.table.get(7);
21274
21275 let source_dictionary = wire.table.get(8);
21276
21277 let dependency_type = wire.table.get(9);
21278
21279 Self {
21280
21281
21282 source: source.map(|envelope| ::fidl_next::FromWire::from_wire(
21283 unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() }
21284 )),
21285
21286
21287 source_name: source_name.map(|envelope| ::fidl_next::FromWire::from_wire(
21288 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
21289 )),
21290
21291
21292 target: target.map(|envelope| ::fidl_next::FromWire::from_wire(
21293 unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() }
21294 )),
21295
21296
21297 target_name: target_name.map(|envelope| ::fidl_next::FromWire::from_wire(
21298 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
21299 )),
21300
21301
21302 source_instance_filter: source_instance_filter.map(|envelope| ::fidl_next::FromWire::from_wire(
21303 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>() }
21304 )),
21305
21306
21307 renamed_instances: renamed_instances.map(|envelope| ::fidl_next::FromWire::from_wire(
21308 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNameMapping<'de>>>() }
21309 )),
21310
21311
21312 availability: availability.map(|envelope| ::fidl_next::FromWire::from_wire(
21313 unsafe { envelope.read_unchecked::<crate::WireAvailability>() }
21314 )),
21315
21316
21317 source_dictionary: source_dictionary.map(|envelope| ::fidl_next::FromWire::from_wire(
21318 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
21319 )),
21320
21321
21322 dependency_type: dependency_type.map(|envelope| ::fidl_next::FromWire::from_wire(
21323 unsafe { envelope.read_unchecked::<crate::WireDependencyType>() }
21324 )),
21325
21326 }
21327 }
21328}
21329
21330impl<'de> ::fidl_next::FromWireRef<WireOfferService<'de>> for OfferService {
21331 #[inline]
21332 fn from_wire_ref(wire: &WireOfferService<'de>) -> Self {
21333 Self {
21334
21335
21336 source: wire.table.get(1)
21337 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
21338 unsafe { envelope.deref_unchecked::<crate::WireRef<'de>>() }
21339 )),
21340
21341
21342 source_name: wire.table.get(2)
21343 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
21344 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
21345 )),
21346
21347
21348 target: wire.table.get(3)
21349 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
21350 unsafe { envelope.deref_unchecked::<crate::WireRef<'de>>() }
21351 )),
21352
21353
21354 target_name: wire.table.get(4)
21355 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
21356 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
21357 )),
21358
21359
21360 source_instance_filter: wire.table.get(5)
21361 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
21362 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>() }
21363 )),
21364
21365
21366 renamed_instances: wire.table.get(6)
21367 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
21368 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireNameMapping<'de>>>() }
21369 )),
21370
21371
21372 availability: wire.table.get(7)
21373 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
21374 unsafe { envelope.deref_unchecked::<crate::WireAvailability>() }
21375 )),
21376
21377
21378 source_dictionary: wire.table.get(8)
21379 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
21380 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
21381 )),
21382
21383
21384 dependency_type: wire.table.get(9)
21385 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
21386 unsafe { envelope.deref_unchecked::<crate::WireDependencyType>() }
21387 )),
21388
21389 }
21390 }
21391}
21392
21393#[repr(C)]
21395pub struct WireOfferService<'de> {
21396 table: ::fidl_next::WireTable<'de>,
21397}
21398
21399impl<'de> Drop for WireOfferService<'de> {
21400 fn drop(&mut self) {
21401 let _ = self
21402 .table
21403 .get(1)
21404 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
21405
21406 let _ = self
21407 .table
21408 .get(2)
21409 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
21410
21411 let _ = self
21412 .table
21413 .get(3)
21414 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
21415
21416 let _ = self
21417 .table
21418 .get(4)
21419 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
21420
21421 let _ = self.table.get(5).map(|envelope| unsafe {
21422 envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
21423 });
21424
21425 let _ = self.table.get(6).map(|envelope| unsafe {
21426 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNameMapping<'de>>>()
21427 });
21428
21429 let _ = self
21430 .table
21431 .get(7)
21432 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
21433
21434 let _ = self
21435 .table
21436 .get(8)
21437 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
21438
21439 let _ = self
21440 .table
21441 .get(9)
21442 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDependencyType>() });
21443 }
21444}
21445
21446unsafe impl ::fidl_next::Wire for WireOfferService<'static> {
21447 type Decoded<'de> = WireOfferService<'de>;
21448
21449 #[inline]
21450 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
21451 ::fidl_next::munge!(let Self { table } = out);
21452 ::fidl_next::WireTable::zero_padding(table);
21453 }
21454}
21455
21456unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferService<'static>
21457where
21458 ___D: ::fidl_next::Decoder + ?Sized,
21459{
21460 fn decode(
21461 slot: ::fidl_next::Slot<'_, Self>,
21462 decoder: &mut ___D,
21463 ) -> Result<(), ::fidl_next::DecodeError> {
21464 ::fidl_next::munge!(let Self { table } = slot);
21465
21466 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
21467 match ordinal {
21468 0 => unsafe { ::core::hint::unreachable_unchecked() },
21469
21470 1 => {
21471 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
21472 slot.as_mut(),
21473 decoder,
21474 )?;
21475
21476 Ok(())
21477 }
21478
21479 2 => {
21480 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
21481 slot.as_mut(),
21482 decoder,
21483 )?;
21484
21485 let source_name = unsafe {
21486 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
21487 };
21488
21489 if source_name.len() > 100 {
21490 return Err(::fidl_next::DecodeError::VectorTooLong {
21491 size: source_name.len() as u64,
21492 limit: 100,
21493 });
21494 }
21495
21496 Ok(())
21497 }
21498
21499 3 => {
21500 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
21501 slot.as_mut(),
21502 decoder,
21503 )?;
21504
21505 Ok(())
21506 }
21507
21508 4 => {
21509 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
21510 slot.as_mut(),
21511 decoder,
21512 )?;
21513
21514 let target_name = unsafe {
21515 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
21516 };
21517
21518 if target_name.len() > 100 {
21519 return Err(::fidl_next::DecodeError::VectorTooLong {
21520 size: target_name.len() as u64,
21521 limit: 100,
21522 });
21523 }
21524
21525 Ok(())
21526 }
21527
21528 5 => {
21529 ::fidl_next::WireEnvelope::decode_as::<
21530 ___D,
21531 ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
21532 >(slot.as_mut(), decoder)?;
21533
21534 Ok(())
21535 }
21536
21537 6 => {
21538 ::fidl_next::WireEnvelope::decode_as::<
21539 ___D,
21540 ::fidl_next::WireVector<'static, crate::WireNameMapping<'static>>,
21541 >(slot.as_mut(), decoder)?;
21542
21543 Ok(())
21544 }
21545
21546 7 => {
21547 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
21548 slot.as_mut(),
21549 decoder,
21550 )?;
21551
21552 Ok(())
21553 }
21554
21555 8 => {
21556 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
21557 slot.as_mut(),
21558 decoder,
21559 )?;
21560
21561 let source_dictionary = unsafe {
21562 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
21563 };
21564
21565 if source_dictionary.len() > 1024 {
21566 return Err(::fidl_next::DecodeError::VectorTooLong {
21567 size: source_dictionary.len() as u64,
21568 limit: 1024,
21569 });
21570 }
21571
21572 Ok(())
21573 }
21574
21575 9 => {
21576 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
21577 slot.as_mut(),
21578 decoder,
21579 )?;
21580
21581 Ok(())
21582 }
21583
21584 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
21585 }
21586 })
21587 }
21588}
21589
21590impl<'de> WireOfferService<'de> {
21591 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
21592 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
21593 }
21594
21595 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
21596 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
21597 }
21598
21599 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
21600 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
21601 }
21602
21603 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
21604 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
21605 }
21606
21607 pub fn source_instance_filter(
21608 &self,
21609 ) -> Option<&::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>> {
21610 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
21611 }
21612
21613 pub fn renamed_instances(
21614 &self,
21615 ) -> Option<&::fidl_next::WireVector<'de, crate::WireNameMapping<'de>>> {
21616 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
21617 }
21618
21619 pub fn availability(&self) -> Option<&crate::WireAvailability> {
21620 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
21621 }
21622
21623 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
21624 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
21625 }
21626
21627 pub fn dependency_type(&self) -> Option<&crate::WireDependencyType> {
21628 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
21629 }
21630}
21631
21632impl<'de> ::core::fmt::Debug for WireOfferService<'de> {
21633 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
21634 f.debug_struct("OfferService")
21635 .field("source", &self.source())
21636 .field("source_name", &self.source_name())
21637 .field("target", &self.target())
21638 .field("target_name", &self.target_name())
21639 .field("source_instance_filter", &self.source_instance_filter())
21640 .field("renamed_instances", &self.renamed_instances())
21641 .field("availability", &self.availability())
21642 .field("source_dictionary", &self.source_dictionary())
21643 .field("dependency_type", &self.dependency_type())
21644 .finish()
21645 }
21646}
21647
21648#[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"]
21649#[derive(Clone, Debug, Default)]
21650pub struct OfferProtocol {
21651 pub source: Option<crate::Ref>,
21652
21653 pub source_name: Option<String>,
21654
21655 pub target: Option<crate::Ref>,
21656
21657 pub target_name: Option<String>,
21658
21659 pub dependency_type: Option<crate::DependencyType>,
21660
21661 pub availability: Option<crate::Availability>,
21662
21663 pub source_dictionary: Option<String>,
21664}
21665
21666impl OfferProtocol {
21667 fn __max_ordinal(&self) -> usize {
21668 if self.source_dictionary.is_some() {
21669 return 7;
21670 }
21671
21672 if self.availability.is_some() {
21673 return 6;
21674 }
21675
21676 if self.dependency_type.is_some() {
21677 return 5;
21678 }
21679
21680 if self.target_name.is_some() {
21681 return 4;
21682 }
21683
21684 if self.target.is_some() {
21685 return 3;
21686 }
21687
21688 if self.source_name.is_some() {
21689 return 2;
21690 }
21691
21692 if self.source.is_some() {
21693 return 1;
21694 }
21695
21696 0
21697 }
21698}
21699
21700impl ::fidl_next::Encodable for OfferProtocol {
21701 type Encoded = WireOfferProtocol<'static>;
21702}
21703
21704unsafe impl<___E> ::fidl_next::Encode<___E> for OfferProtocol
21705where
21706 ___E: ::fidl_next::Encoder + ?Sized,
21707{
21708 #[inline]
21709 fn encode(
21710 mut self,
21711 encoder: &mut ___E,
21712 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21713 ) -> Result<(), ::fidl_next::EncodeError> {
21714 ::fidl_next::munge!(let WireOfferProtocol { table } = out);
21715
21716 let max_ord = self.__max_ordinal();
21717
21718 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
21719 ::fidl_next::Wire::zero_padding(&mut out);
21720
21721 let mut preallocated =
21722 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
21723
21724 for i in 1..=max_ord {
21725 match i {
21726 7 => {
21727 if let Some(source_dictionary) = self.source_dictionary.take() {
21728 ::fidl_next::WireEnvelope::encode_value(
21729 source_dictionary,
21730 preallocated.encoder,
21731 &mut out,
21732 )?;
21733 } else {
21734 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21735 }
21736 }
21737
21738 6 => {
21739 if let Some(availability) = self.availability.take() {
21740 ::fidl_next::WireEnvelope::encode_value(
21741 availability,
21742 preallocated.encoder,
21743 &mut out,
21744 )?;
21745 } else {
21746 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21747 }
21748 }
21749
21750 5 => {
21751 if let Some(dependency_type) = self.dependency_type.take() {
21752 ::fidl_next::WireEnvelope::encode_value(
21753 dependency_type,
21754 preallocated.encoder,
21755 &mut out,
21756 )?;
21757 } else {
21758 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21759 }
21760 }
21761
21762 4 => {
21763 if let Some(target_name) = self.target_name.take() {
21764 ::fidl_next::WireEnvelope::encode_value(
21765 target_name,
21766 preallocated.encoder,
21767 &mut out,
21768 )?;
21769 } else {
21770 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21771 }
21772 }
21773
21774 3 => {
21775 if let Some(target) = self.target.take() {
21776 ::fidl_next::WireEnvelope::encode_value(
21777 target,
21778 preallocated.encoder,
21779 &mut out,
21780 )?;
21781 } else {
21782 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21783 }
21784 }
21785
21786 2 => {
21787 if let Some(source_name) = self.source_name.take() {
21788 ::fidl_next::WireEnvelope::encode_value(
21789 source_name,
21790 preallocated.encoder,
21791 &mut out,
21792 )?;
21793 } else {
21794 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21795 }
21796 }
21797
21798 1 => {
21799 if let Some(source) = self.source.take() {
21800 ::fidl_next::WireEnvelope::encode_value(
21801 source,
21802 preallocated.encoder,
21803 &mut out,
21804 )?;
21805 } else {
21806 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21807 }
21808 }
21809
21810 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
21811 }
21812 unsafe {
21813 preallocated.write_next(out.assume_init_ref());
21814 }
21815 }
21816
21817 ::fidl_next::WireTable::encode_len(table, max_ord);
21818
21819 Ok(())
21820 }
21821}
21822
21823unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferProtocol
21824where
21825 ___E: ::fidl_next::Encoder + ?Sized,
21826{
21827 #[inline]
21828 fn encode_ref(
21829 &self,
21830 encoder: &mut ___E,
21831 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21832 ) -> Result<(), ::fidl_next::EncodeError> {
21833 ::fidl_next::munge!(let WireOfferProtocol { table } = out);
21834
21835 let max_ord = self.__max_ordinal();
21836
21837 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
21838 ::fidl_next::Wire::zero_padding(&mut out);
21839
21840 let mut preallocated =
21841 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
21842
21843 for i in 1..=max_ord {
21844 match i {
21845 7 => {
21846 if let Some(source_dictionary) = &self.source_dictionary {
21847 ::fidl_next::WireEnvelope::encode_value(
21848 source_dictionary,
21849 preallocated.encoder,
21850 &mut out,
21851 )?;
21852 } else {
21853 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21854 }
21855 }
21856
21857 6 => {
21858 if let Some(availability) = &self.availability {
21859 ::fidl_next::WireEnvelope::encode_value(
21860 availability,
21861 preallocated.encoder,
21862 &mut out,
21863 )?;
21864 } else {
21865 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21866 }
21867 }
21868
21869 5 => {
21870 if let Some(dependency_type) = &self.dependency_type {
21871 ::fidl_next::WireEnvelope::encode_value(
21872 dependency_type,
21873 preallocated.encoder,
21874 &mut out,
21875 )?;
21876 } else {
21877 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21878 }
21879 }
21880
21881 4 => {
21882 if let Some(target_name) = &self.target_name {
21883 ::fidl_next::WireEnvelope::encode_value(
21884 target_name,
21885 preallocated.encoder,
21886 &mut out,
21887 )?;
21888 } else {
21889 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21890 }
21891 }
21892
21893 3 => {
21894 if let Some(target) = &self.target {
21895 ::fidl_next::WireEnvelope::encode_value(
21896 target,
21897 preallocated.encoder,
21898 &mut out,
21899 )?;
21900 } else {
21901 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21902 }
21903 }
21904
21905 2 => {
21906 if let Some(source_name) = &self.source_name {
21907 ::fidl_next::WireEnvelope::encode_value(
21908 source_name,
21909 preallocated.encoder,
21910 &mut out,
21911 )?;
21912 } else {
21913 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21914 }
21915 }
21916
21917 1 => {
21918 if let Some(source) = &self.source {
21919 ::fidl_next::WireEnvelope::encode_value(
21920 source,
21921 preallocated.encoder,
21922 &mut out,
21923 )?;
21924 } else {
21925 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21926 }
21927 }
21928
21929 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
21930 }
21931 unsafe {
21932 preallocated.write_next(out.assume_init_ref());
21933 }
21934 }
21935
21936 ::fidl_next::WireTable::encode_len(table, max_ord);
21937
21938 Ok(())
21939 }
21940}
21941
21942impl<'de> ::fidl_next::FromWire<WireOfferProtocol<'de>> for OfferProtocol {
21943 #[inline]
21944 fn from_wire(wire: WireOfferProtocol<'de>) -> Self {
21945 let wire = ::core::mem::ManuallyDrop::new(wire);
21946
21947 let source = wire.table.get(1);
21948
21949 let source_name = wire.table.get(2);
21950
21951 let target = wire.table.get(3);
21952
21953 let target_name = wire.table.get(4);
21954
21955 let dependency_type = wire.table.get(5);
21956
21957 let availability = wire.table.get(6);
21958
21959 let source_dictionary = wire.table.get(7);
21960
21961 Self {
21962 source: source.map(|envelope| {
21963 ::fidl_next::FromWire::from_wire(unsafe {
21964 envelope.read_unchecked::<crate::WireRef<'de>>()
21965 })
21966 }),
21967
21968 source_name: source_name.map(|envelope| {
21969 ::fidl_next::FromWire::from_wire(unsafe {
21970 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
21971 })
21972 }),
21973
21974 target: target.map(|envelope| {
21975 ::fidl_next::FromWire::from_wire(unsafe {
21976 envelope.read_unchecked::<crate::WireRef<'de>>()
21977 })
21978 }),
21979
21980 target_name: target_name.map(|envelope| {
21981 ::fidl_next::FromWire::from_wire(unsafe {
21982 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
21983 })
21984 }),
21985
21986 dependency_type: dependency_type.map(|envelope| {
21987 ::fidl_next::FromWire::from_wire(unsafe {
21988 envelope.read_unchecked::<crate::WireDependencyType>()
21989 })
21990 }),
21991
21992 availability: availability.map(|envelope| {
21993 ::fidl_next::FromWire::from_wire(unsafe {
21994 envelope.read_unchecked::<crate::WireAvailability>()
21995 })
21996 }),
21997
21998 source_dictionary: source_dictionary.map(|envelope| {
21999 ::fidl_next::FromWire::from_wire(unsafe {
22000 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
22001 })
22002 }),
22003 }
22004 }
22005}
22006
22007impl<'de> ::fidl_next::FromWireRef<WireOfferProtocol<'de>> for OfferProtocol {
22008 #[inline]
22009 fn from_wire_ref(wire: &WireOfferProtocol<'de>) -> Self {
22010 Self {
22011 source: wire.table.get(1).map(|envelope| {
22012 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22013 envelope.deref_unchecked::<crate::WireRef<'de>>()
22014 })
22015 }),
22016
22017 source_name: wire.table.get(2).map(|envelope| {
22018 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22019 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
22020 })
22021 }),
22022
22023 target: wire.table.get(3).map(|envelope| {
22024 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22025 envelope.deref_unchecked::<crate::WireRef<'de>>()
22026 })
22027 }),
22028
22029 target_name: wire.table.get(4).map(|envelope| {
22030 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22031 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
22032 })
22033 }),
22034
22035 dependency_type: wire.table.get(5).map(|envelope| {
22036 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22037 envelope.deref_unchecked::<crate::WireDependencyType>()
22038 })
22039 }),
22040
22041 availability: wire.table.get(6).map(|envelope| {
22042 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22043 envelope.deref_unchecked::<crate::WireAvailability>()
22044 })
22045 }),
22046
22047 source_dictionary: wire.table.get(7).map(|envelope| {
22048 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22049 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
22050 })
22051 }),
22052 }
22053 }
22054}
22055
22056#[repr(C)]
22058pub struct WireOfferProtocol<'de> {
22059 table: ::fidl_next::WireTable<'de>,
22060}
22061
22062impl<'de> Drop for WireOfferProtocol<'de> {
22063 fn drop(&mut self) {
22064 let _ = self
22065 .table
22066 .get(1)
22067 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
22068
22069 let _ = self
22070 .table
22071 .get(2)
22072 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
22073
22074 let _ = self
22075 .table
22076 .get(3)
22077 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
22078
22079 let _ = self
22080 .table
22081 .get(4)
22082 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
22083
22084 let _ = self
22085 .table
22086 .get(5)
22087 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDependencyType>() });
22088
22089 let _ = self
22090 .table
22091 .get(6)
22092 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
22093
22094 let _ = self
22095 .table
22096 .get(7)
22097 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
22098 }
22099}
22100
22101unsafe impl ::fidl_next::Wire for WireOfferProtocol<'static> {
22102 type Decoded<'de> = WireOfferProtocol<'de>;
22103
22104 #[inline]
22105 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22106 ::fidl_next::munge!(let Self { table } = out);
22107 ::fidl_next::WireTable::zero_padding(table);
22108 }
22109}
22110
22111unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferProtocol<'static>
22112where
22113 ___D: ::fidl_next::Decoder + ?Sized,
22114{
22115 fn decode(
22116 slot: ::fidl_next::Slot<'_, Self>,
22117 decoder: &mut ___D,
22118 ) -> Result<(), ::fidl_next::DecodeError> {
22119 ::fidl_next::munge!(let Self { table } = slot);
22120
22121 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
22122 match ordinal {
22123 0 => unsafe { ::core::hint::unreachable_unchecked() },
22124
22125 1 => {
22126 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
22127 slot.as_mut(),
22128 decoder,
22129 )?;
22130
22131 Ok(())
22132 }
22133
22134 2 => {
22135 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
22136 slot.as_mut(),
22137 decoder,
22138 )?;
22139
22140 let source_name = unsafe {
22141 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
22142 };
22143
22144 if source_name.len() > 100 {
22145 return Err(::fidl_next::DecodeError::VectorTooLong {
22146 size: source_name.len() as u64,
22147 limit: 100,
22148 });
22149 }
22150
22151 Ok(())
22152 }
22153
22154 3 => {
22155 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
22156 slot.as_mut(),
22157 decoder,
22158 )?;
22159
22160 Ok(())
22161 }
22162
22163 4 => {
22164 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
22165 slot.as_mut(),
22166 decoder,
22167 )?;
22168
22169 let target_name = unsafe {
22170 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
22171 };
22172
22173 if target_name.len() > 100 {
22174 return Err(::fidl_next::DecodeError::VectorTooLong {
22175 size: target_name.len() as u64,
22176 limit: 100,
22177 });
22178 }
22179
22180 Ok(())
22181 }
22182
22183 5 => {
22184 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
22185 slot.as_mut(),
22186 decoder,
22187 )?;
22188
22189 Ok(())
22190 }
22191
22192 6 => {
22193 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
22194 slot.as_mut(),
22195 decoder,
22196 )?;
22197
22198 Ok(())
22199 }
22200
22201 7 => {
22202 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
22203 slot.as_mut(),
22204 decoder,
22205 )?;
22206
22207 let source_dictionary = unsafe {
22208 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
22209 };
22210
22211 if source_dictionary.len() > 1024 {
22212 return Err(::fidl_next::DecodeError::VectorTooLong {
22213 size: source_dictionary.len() as u64,
22214 limit: 1024,
22215 });
22216 }
22217
22218 Ok(())
22219 }
22220
22221 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
22222 }
22223 })
22224 }
22225}
22226
22227impl<'de> WireOfferProtocol<'de> {
22228 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
22229 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
22230 }
22231
22232 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
22233 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
22234 }
22235
22236 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
22237 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
22238 }
22239
22240 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
22241 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
22242 }
22243
22244 pub fn dependency_type(&self) -> Option<&crate::WireDependencyType> {
22245 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
22246 }
22247
22248 pub fn availability(&self) -> Option<&crate::WireAvailability> {
22249 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
22250 }
22251
22252 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
22253 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
22254 }
22255}
22256
22257impl<'de> ::core::fmt::Debug for WireOfferProtocol<'de> {
22258 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
22259 f.debug_struct("OfferProtocol")
22260 .field("source", &self.source())
22261 .field("source_name", &self.source_name())
22262 .field("target", &self.target())
22263 .field("target_name", &self.target_name())
22264 .field("dependency_type", &self.dependency_type())
22265 .field("availability", &self.availability())
22266 .field("source_dictionary", &self.source_dictionary())
22267 .finish()
22268 }
22269}
22270
22271#[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"]
22272#[derive(Clone, Debug, Default)]
22273pub struct OfferDirectory {
22274 pub source: Option<crate::Ref>,
22275
22276 pub source_name: Option<String>,
22277
22278 pub target: Option<crate::Ref>,
22279
22280 pub target_name: Option<String>,
22281
22282 pub rights: Option<::fidl_next_fuchsia_io::Operations>,
22283
22284 pub subdir: Option<String>,
22285
22286 pub dependency_type: Option<crate::DependencyType>,
22287
22288 pub availability: Option<crate::Availability>,
22289
22290 pub source_dictionary: Option<String>,
22291}
22292
22293impl OfferDirectory {
22294 fn __max_ordinal(&self) -> usize {
22295 if self.source_dictionary.is_some() {
22296 return 9;
22297 }
22298
22299 if self.availability.is_some() {
22300 return 8;
22301 }
22302
22303 if self.dependency_type.is_some() {
22304 return 7;
22305 }
22306
22307 if self.subdir.is_some() {
22308 return 6;
22309 }
22310
22311 if self.rights.is_some() {
22312 return 5;
22313 }
22314
22315 if self.target_name.is_some() {
22316 return 4;
22317 }
22318
22319 if self.target.is_some() {
22320 return 3;
22321 }
22322
22323 if self.source_name.is_some() {
22324 return 2;
22325 }
22326
22327 if self.source.is_some() {
22328 return 1;
22329 }
22330
22331 0
22332 }
22333}
22334
22335impl ::fidl_next::Encodable for OfferDirectory {
22336 type Encoded = WireOfferDirectory<'static>;
22337}
22338
22339unsafe impl<___E> ::fidl_next::Encode<___E> for OfferDirectory
22340where
22341 ___E: ::fidl_next::Encoder + ?Sized,
22342{
22343 #[inline]
22344 fn encode(
22345 mut self,
22346 encoder: &mut ___E,
22347 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22348 ) -> Result<(), ::fidl_next::EncodeError> {
22349 ::fidl_next::munge!(let WireOfferDirectory { table } = out);
22350
22351 let max_ord = self.__max_ordinal();
22352
22353 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
22354 ::fidl_next::Wire::zero_padding(&mut out);
22355
22356 let mut preallocated =
22357 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
22358
22359 for i in 1..=max_ord {
22360 match i {
22361 9 => {
22362 if let Some(source_dictionary) = self.source_dictionary.take() {
22363 ::fidl_next::WireEnvelope::encode_value(
22364 source_dictionary,
22365 preallocated.encoder,
22366 &mut out,
22367 )?;
22368 } else {
22369 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22370 }
22371 }
22372
22373 8 => {
22374 if let Some(availability) = self.availability.take() {
22375 ::fidl_next::WireEnvelope::encode_value(
22376 availability,
22377 preallocated.encoder,
22378 &mut out,
22379 )?;
22380 } else {
22381 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22382 }
22383 }
22384
22385 7 => {
22386 if let Some(dependency_type) = self.dependency_type.take() {
22387 ::fidl_next::WireEnvelope::encode_value(
22388 dependency_type,
22389 preallocated.encoder,
22390 &mut out,
22391 )?;
22392 } else {
22393 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22394 }
22395 }
22396
22397 6 => {
22398 if let Some(subdir) = self.subdir.take() {
22399 ::fidl_next::WireEnvelope::encode_value(
22400 subdir,
22401 preallocated.encoder,
22402 &mut out,
22403 )?;
22404 } else {
22405 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22406 }
22407 }
22408
22409 5 => {
22410 if let Some(rights) = self.rights.take() {
22411 ::fidl_next::WireEnvelope::encode_value(
22412 rights,
22413 preallocated.encoder,
22414 &mut out,
22415 )?;
22416 } else {
22417 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22418 }
22419 }
22420
22421 4 => {
22422 if let Some(target_name) = self.target_name.take() {
22423 ::fidl_next::WireEnvelope::encode_value(
22424 target_name,
22425 preallocated.encoder,
22426 &mut out,
22427 )?;
22428 } else {
22429 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22430 }
22431 }
22432
22433 3 => {
22434 if let Some(target) = self.target.take() {
22435 ::fidl_next::WireEnvelope::encode_value(
22436 target,
22437 preallocated.encoder,
22438 &mut out,
22439 )?;
22440 } else {
22441 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22442 }
22443 }
22444
22445 2 => {
22446 if let Some(source_name) = self.source_name.take() {
22447 ::fidl_next::WireEnvelope::encode_value(
22448 source_name,
22449 preallocated.encoder,
22450 &mut out,
22451 )?;
22452 } else {
22453 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22454 }
22455 }
22456
22457 1 => {
22458 if let Some(source) = self.source.take() {
22459 ::fidl_next::WireEnvelope::encode_value(
22460 source,
22461 preallocated.encoder,
22462 &mut out,
22463 )?;
22464 } else {
22465 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22466 }
22467 }
22468
22469 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
22470 }
22471 unsafe {
22472 preallocated.write_next(out.assume_init_ref());
22473 }
22474 }
22475
22476 ::fidl_next::WireTable::encode_len(table, max_ord);
22477
22478 Ok(())
22479 }
22480}
22481
22482unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferDirectory
22483where
22484 ___E: ::fidl_next::Encoder + ?Sized,
22485{
22486 #[inline]
22487 fn encode_ref(
22488 &self,
22489 encoder: &mut ___E,
22490 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22491 ) -> Result<(), ::fidl_next::EncodeError> {
22492 ::fidl_next::munge!(let WireOfferDirectory { table } = out);
22493
22494 let max_ord = self.__max_ordinal();
22495
22496 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
22497 ::fidl_next::Wire::zero_padding(&mut out);
22498
22499 let mut preallocated =
22500 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
22501
22502 for i in 1..=max_ord {
22503 match i {
22504 9 => {
22505 if let Some(source_dictionary) = &self.source_dictionary {
22506 ::fidl_next::WireEnvelope::encode_value(
22507 source_dictionary,
22508 preallocated.encoder,
22509 &mut out,
22510 )?;
22511 } else {
22512 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22513 }
22514 }
22515
22516 8 => {
22517 if let Some(availability) = &self.availability {
22518 ::fidl_next::WireEnvelope::encode_value(
22519 availability,
22520 preallocated.encoder,
22521 &mut out,
22522 )?;
22523 } else {
22524 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22525 }
22526 }
22527
22528 7 => {
22529 if let Some(dependency_type) = &self.dependency_type {
22530 ::fidl_next::WireEnvelope::encode_value(
22531 dependency_type,
22532 preallocated.encoder,
22533 &mut out,
22534 )?;
22535 } else {
22536 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22537 }
22538 }
22539
22540 6 => {
22541 if let Some(subdir) = &self.subdir {
22542 ::fidl_next::WireEnvelope::encode_value(
22543 subdir,
22544 preallocated.encoder,
22545 &mut out,
22546 )?;
22547 } else {
22548 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22549 }
22550 }
22551
22552 5 => {
22553 if let Some(rights) = &self.rights {
22554 ::fidl_next::WireEnvelope::encode_value(
22555 rights,
22556 preallocated.encoder,
22557 &mut out,
22558 )?;
22559 } else {
22560 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22561 }
22562 }
22563
22564 4 => {
22565 if let Some(target_name) = &self.target_name {
22566 ::fidl_next::WireEnvelope::encode_value(
22567 target_name,
22568 preallocated.encoder,
22569 &mut out,
22570 )?;
22571 } else {
22572 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22573 }
22574 }
22575
22576 3 => {
22577 if let Some(target) = &self.target {
22578 ::fidl_next::WireEnvelope::encode_value(
22579 target,
22580 preallocated.encoder,
22581 &mut out,
22582 )?;
22583 } else {
22584 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22585 }
22586 }
22587
22588 2 => {
22589 if let Some(source_name) = &self.source_name {
22590 ::fidl_next::WireEnvelope::encode_value(
22591 source_name,
22592 preallocated.encoder,
22593 &mut out,
22594 )?;
22595 } else {
22596 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22597 }
22598 }
22599
22600 1 => {
22601 if let Some(source) = &self.source {
22602 ::fidl_next::WireEnvelope::encode_value(
22603 source,
22604 preallocated.encoder,
22605 &mut out,
22606 )?;
22607 } else {
22608 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22609 }
22610 }
22611
22612 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
22613 }
22614 unsafe {
22615 preallocated.write_next(out.assume_init_ref());
22616 }
22617 }
22618
22619 ::fidl_next::WireTable::encode_len(table, max_ord);
22620
22621 Ok(())
22622 }
22623}
22624
22625impl<'de> ::fidl_next::FromWire<WireOfferDirectory<'de>> for OfferDirectory {
22626 #[inline]
22627 fn from_wire(wire: WireOfferDirectory<'de>) -> Self {
22628 let wire = ::core::mem::ManuallyDrop::new(wire);
22629
22630 let source = wire.table.get(1);
22631
22632 let source_name = wire.table.get(2);
22633
22634 let target = wire.table.get(3);
22635
22636 let target_name = wire.table.get(4);
22637
22638 let rights = wire.table.get(5);
22639
22640 let subdir = wire.table.get(6);
22641
22642 let dependency_type = wire.table.get(7);
22643
22644 let availability = wire.table.get(8);
22645
22646 let source_dictionary = wire.table.get(9);
22647
22648 Self {
22649 source: source.map(|envelope| {
22650 ::fidl_next::FromWire::from_wire(unsafe {
22651 envelope.read_unchecked::<crate::WireRef<'de>>()
22652 })
22653 }),
22654
22655 source_name: source_name.map(|envelope| {
22656 ::fidl_next::FromWire::from_wire(unsafe {
22657 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
22658 })
22659 }),
22660
22661 target: target.map(|envelope| {
22662 ::fidl_next::FromWire::from_wire(unsafe {
22663 envelope.read_unchecked::<crate::WireRef<'de>>()
22664 })
22665 }),
22666
22667 target_name: target_name.map(|envelope| {
22668 ::fidl_next::FromWire::from_wire(unsafe {
22669 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
22670 })
22671 }),
22672
22673 rights: rights.map(|envelope| {
22674 ::fidl_next::FromWire::from_wire(unsafe {
22675 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
22676 })
22677 }),
22678
22679 subdir: subdir.map(|envelope| {
22680 ::fidl_next::FromWire::from_wire(unsafe {
22681 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
22682 })
22683 }),
22684
22685 dependency_type: dependency_type.map(|envelope| {
22686 ::fidl_next::FromWire::from_wire(unsafe {
22687 envelope.read_unchecked::<crate::WireDependencyType>()
22688 })
22689 }),
22690
22691 availability: availability.map(|envelope| {
22692 ::fidl_next::FromWire::from_wire(unsafe {
22693 envelope.read_unchecked::<crate::WireAvailability>()
22694 })
22695 }),
22696
22697 source_dictionary: source_dictionary.map(|envelope| {
22698 ::fidl_next::FromWire::from_wire(unsafe {
22699 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
22700 })
22701 }),
22702 }
22703 }
22704}
22705
22706impl<'de> ::fidl_next::FromWireRef<WireOfferDirectory<'de>> for OfferDirectory {
22707 #[inline]
22708 fn from_wire_ref(wire: &WireOfferDirectory<'de>) -> Self {
22709 Self {
22710 source: wire.table.get(1).map(|envelope| {
22711 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22712 envelope.deref_unchecked::<crate::WireRef<'de>>()
22713 })
22714 }),
22715
22716 source_name: wire.table.get(2).map(|envelope| {
22717 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22718 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
22719 })
22720 }),
22721
22722 target: wire.table.get(3).map(|envelope| {
22723 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22724 envelope.deref_unchecked::<crate::WireRef<'de>>()
22725 })
22726 }),
22727
22728 target_name: wire.table.get(4).map(|envelope| {
22729 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22730 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
22731 })
22732 }),
22733
22734 rights: wire.table.get(5).map(|envelope| {
22735 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22736 envelope.deref_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
22737 })
22738 }),
22739
22740 subdir: wire.table.get(6).map(|envelope| {
22741 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22742 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
22743 })
22744 }),
22745
22746 dependency_type: wire.table.get(7).map(|envelope| {
22747 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22748 envelope.deref_unchecked::<crate::WireDependencyType>()
22749 })
22750 }),
22751
22752 availability: wire.table.get(8).map(|envelope| {
22753 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22754 envelope.deref_unchecked::<crate::WireAvailability>()
22755 })
22756 }),
22757
22758 source_dictionary: wire.table.get(9).map(|envelope| {
22759 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
22760 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
22761 })
22762 }),
22763 }
22764 }
22765}
22766
22767#[repr(C)]
22769pub struct WireOfferDirectory<'de> {
22770 table: ::fidl_next::WireTable<'de>,
22771}
22772
22773impl<'de> Drop for WireOfferDirectory<'de> {
22774 fn drop(&mut self) {
22775 let _ = self
22776 .table
22777 .get(1)
22778 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
22779
22780 let _ = self
22781 .table
22782 .get(2)
22783 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
22784
22785 let _ = self
22786 .table
22787 .get(3)
22788 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
22789
22790 let _ = self
22791 .table
22792 .get(4)
22793 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
22794
22795 let _ = self.table.get(5).map(|envelope| unsafe {
22796 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
22797 });
22798
22799 let _ = self
22800 .table
22801 .get(6)
22802 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
22803
22804 let _ = self
22805 .table
22806 .get(7)
22807 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDependencyType>() });
22808
22809 let _ = self
22810 .table
22811 .get(8)
22812 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
22813
22814 let _ = self
22815 .table
22816 .get(9)
22817 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
22818 }
22819}
22820
22821unsafe impl ::fidl_next::Wire for WireOfferDirectory<'static> {
22822 type Decoded<'de> = WireOfferDirectory<'de>;
22823
22824 #[inline]
22825 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22826 ::fidl_next::munge!(let Self { table } = out);
22827 ::fidl_next::WireTable::zero_padding(table);
22828 }
22829}
22830
22831unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferDirectory<'static>
22832where
22833 ___D: ::fidl_next::Decoder + ?Sized,
22834{
22835 fn decode(
22836 slot: ::fidl_next::Slot<'_, Self>,
22837 decoder: &mut ___D,
22838 ) -> Result<(), ::fidl_next::DecodeError> {
22839 ::fidl_next::munge!(let Self { table } = slot);
22840
22841 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
22842 match ordinal {
22843 0 => unsafe { ::core::hint::unreachable_unchecked() },
22844
22845 1 => {
22846 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
22847 slot.as_mut(),
22848 decoder,
22849 )?;
22850
22851 Ok(())
22852 }
22853
22854 2 => {
22855 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
22856 slot.as_mut(),
22857 decoder,
22858 )?;
22859
22860 let source_name = unsafe {
22861 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
22862 };
22863
22864 if source_name.len() > 100 {
22865 return Err(::fidl_next::DecodeError::VectorTooLong {
22866 size: source_name.len() as u64,
22867 limit: 100,
22868 });
22869 }
22870
22871 Ok(())
22872 }
22873
22874 3 => {
22875 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
22876 slot.as_mut(),
22877 decoder,
22878 )?;
22879
22880 Ok(())
22881 }
22882
22883 4 => {
22884 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
22885 slot.as_mut(),
22886 decoder,
22887 )?;
22888
22889 let target_name = unsafe {
22890 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
22891 };
22892
22893 if target_name.len() > 100 {
22894 return Err(::fidl_next::DecodeError::VectorTooLong {
22895 size: target_name.len() as u64,
22896 limit: 100,
22897 });
22898 }
22899
22900 Ok(())
22901 }
22902
22903 5 => {
22904 ::fidl_next::WireEnvelope::decode_as::<
22905 ___D,
22906 ::fidl_next_fuchsia_io::WireOperations,
22907 >(slot.as_mut(), decoder)?;
22908
22909 Ok(())
22910 }
22911
22912 6 => {
22913 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
22914 slot.as_mut(),
22915 decoder,
22916 )?;
22917
22918 let subdir = unsafe {
22919 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
22920 };
22921
22922 if subdir.len() > 1024 {
22923 return Err(::fidl_next::DecodeError::VectorTooLong {
22924 size: subdir.len() as u64,
22925 limit: 1024,
22926 });
22927 }
22928
22929 Ok(())
22930 }
22931
22932 7 => {
22933 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
22934 slot.as_mut(),
22935 decoder,
22936 )?;
22937
22938 Ok(())
22939 }
22940
22941 8 => {
22942 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
22943 slot.as_mut(),
22944 decoder,
22945 )?;
22946
22947 Ok(())
22948 }
22949
22950 9 => {
22951 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
22952 slot.as_mut(),
22953 decoder,
22954 )?;
22955
22956 let source_dictionary = unsafe {
22957 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
22958 };
22959
22960 if source_dictionary.len() > 1024 {
22961 return Err(::fidl_next::DecodeError::VectorTooLong {
22962 size: source_dictionary.len() as u64,
22963 limit: 1024,
22964 });
22965 }
22966
22967 Ok(())
22968 }
22969
22970 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
22971 }
22972 })
22973 }
22974}
22975
22976impl<'de> WireOfferDirectory<'de> {
22977 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
22978 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
22979 }
22980
22981 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
22982 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
22983 }
22984
22985 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
22986 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
22987 }
22988
22989 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
22990 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
22991 }
22992
22993 pub fn rights(&self) -> Option<&::fidl_next_fuchsia_io::WireOperations> {
22994 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
22995 }
22996
22997 pub fn subdir(&self) -> Option<&::fidl_next::WireString<'de>> {
22998 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
22999 }
23000
23001 pub fn dependency_type(&self) -> Option<&crate::WireDependencyType> {
23002 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
23003 }
23004
23005 pub fn availability(&self) -> Option<&crate::WireAvailability> {
23006 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
23007 }
23008
23009 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
23010 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
23011 }
23012}
23013
23014impl<'de> ::core::fmt::Debug for WireOfferDirectory<'de> {
23015 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
23016 f.debug_struct("OfferDirectory")
23017 .field("source", &self.source())
23018 .field("source_name", &self.source_name())
23019 .field("target", &self.target())
23020 .field("target_name", &self.target_name())
23021 .field("rights", &self.rights())
23022 .field("subdir", &self.subdir())
23023 .field("dependency_type", &self.dependency_type())
23024 .field("availability", &self.availability())
23025 .field("source_dictionary", &self.source_dictionary())
23026 .finish()
23027 }
23028}
23029
23030#[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"]
23031#[derive(Clone, Debug, Default)]
23032pub struct OfferStorage {
23033 pub source_name: Option<String>,
23034
23035 pub source: Option<crate::Ref>,
23036
23037 pub target: Option<crate::Ref>,
23038
23039 pub target_name: Option<String>,
23040
23041 pub availability: Option<crate::Availability>,
23042}
23043
23044impl OfferStorage {
23045 fn __max_ordinal(&self) -> usize {
23046 if self.availability.is_some() {
23047 return 5;
23048 }
23049
23050 if self.target_name.is_some() {
23051 return 4;
23052 }
23053
23054 if self.target.is_some() {
23055 return 3;
23056 }
23057
23058 if self.source.is_some() {
23059 return 2;
23060 }
23061
23062 if self.source_name.is_some() {
23063 return 1;
23064 }
23065
23066 0
23067 }
23068}
23069
23070impl ::fidl_next::Encodable for OfferStorage {
23071 type Encoded = WireOfferStorage<'static>;
23072}
23073
23074unsafe impl<___E> ::fidl_next::Encode<___E> for OfferStorage
23075where
23076 ___E: ::fidl_next::Encoder + ?Sized,
23077{
23078 #[inline]
23079 fn encode(
23080 mut self,
23081 encoder: &mut ___E,
23082 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23083 ) -> Result<(), ::fidl_next::EncodeError> {
23084 ::fidl_next::munge!(let WireOfferStorage { table } = out);
23085
23086 let max_ord = self.__max_ordinal();
23087
23088 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
23089 ::fidl_next::Wire::zero_padding(&mut out);
23090
23091 let mut preallocated =
23092 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
23093
23094 for i in 1..=max_ord {
23095 match i {
23096 5 => {
23097 if let Some(availability) = self.availability.take() {
23098 ::fidl_next::WireEnvelope::encode_value(
23099 availability,
23100 preallocated.encoder,
23101 &mut out,
23102 )?;
23103 } else {
23104 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23105 }
23106 }
23107
23108 4 => {
23109 if let Some(target_name) = self.target_name.take() {
23110 ::fidl_next::WireEnvelope::encode_value(
23111 target_name,
23112 preallocated.encoder,
23113 &mut out,
23114 )?;
23115 } else {
23116 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23117 }
23118 }
23119
23120 3 => {
23121 if let Some(target) = self.target.take() {
23122 ::fidl_next::WireEnvelope::encode_value(
23123 target,
23124 preallocated.encoder,
23125 &mut out,
23126 )?;
23127 } else {
23128 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23129 }
23130 }
23131
23132 2 => {
23133 if let Some(source) = self.source.take() {
23134 ::fidl_next::WireEnvelope::encode_value(
23135 source,
23136 preallocated.encoder,
23137 &mut out,
23138 )?;
23139 } else {
23140 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23141 }
23142 }
23143
23144 1 => {
23145 if let Some(source_name) = self.source_name.take() {
23146 ::fidl_next::WireEnvelope::encode_value(
23147 source_name,
23148 preallocated.encoder,
23149 &mut out,
23150 )?;
23151 } else {
23152 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23153 }
23154 }
23155
23156 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
23157 }
23158 unsafe {
23159 preallocated.write_next(out.assume_init_ref());
23160 }
23161 }
23162
23163 ::fidl_next::WireTable::encode_len(table, max_ord);
23164
23165 Ok(())
23166 }
23167}
23168
23169unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferStorage
23170where
23171 ___E: ::fidl_next::Encoder + ?Sized,
23172{
23173 #[inline]
23174 fn encode_ref(
23175 &self,
23176 encoder: &mut ___E,
23177 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23178 ) -> Result<(), ::fidl_next::EncodeError> {
23179 ::fidl_next::munge!(let WireOfferStorage { table } = out);
23180
23181 let max_ord = self.__max_ordinal();
23182
23183 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
23184 ::fidl_next::Wire::zero_padding(&mut out);
23185
23186 let mut preallocated =
23187 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
23188
23189 for i in 1..=max_ord {
23190 match i {
23191 5 => {
23192 if let Some(availability) = &self.availability {
23193 ::fidl_next::WireEnvelope::encode_value(
23194 availability,
23195 preallocated.encoder,
23196 &mut out,
23197 )?;
23198 } else {
23199 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23200 }
23201 }
23202
23203 4 => {
23204 if let Some(target_name) = &self.target_name {
23205 ::fidl_next::WireEnvelope::encode_value(
23206 target_name,
23207 preallocated.encoder,
23208 &mut out,
23209 )?;
23210 } else {
23211 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23212 }
23213 }
23214
23215 3 => {
23216 if let Some(target) = &self.target {
23217 ::fidl_next::WireEnvelope::encode_value(
23218 target,
23219 preallocated.encoder,
23220 &mut out,
23221 )?;
23222 } else {
23223 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23224 }
23225 }
23226
23227 2 => {
23228 if let Some(source) = &self.source {
23229 ::fidl_next::WireEnvelope::encode_value(
23230 source,
23231 preallocated.encoder,
23232 &mut out,
23233 )?;
23234 } else {
23235 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23236 }
23237 }
23238
23239 1 => {
23240 if let Some(source_name) = &self.source_name {
23241 ::fidl_next::WireEnvelope::encode_value(
23242 source_name,
23243 preallocated.encoder,
23244 &mut out,
23245 )?;
23246 } else {
23247 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23248 }
23249 }
23250
23251 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
23252 }
23253 unsafe {
23254 preallocated.write_next(out.assume_init_ref());
23255 }
23256 }
23257
23258 ::fidl_next::WireTable::encode_len(table, max_ord);
23259
23260 Ok(())
23261 }
23262}
23263
23264impl<'de> ::fidl_next::FromWire<WireOfferStorage<'de>> for OfferStorage {
23265 #[inline]
23266 fn from_wire(wire: WireOfferStorage<'de>) -> Self {
23267 let wire = ::core::mem::ManuallyDrop::new(wire);
23268
23269 let source_name = wire.table.get(1);
23270
23271 let source = wire.table.get(2);
23272
23273 let target = wire.table.get(3);
23274
23275 let target_name = wire.table.get(4);
23276
23277 let availability = wire.table.get(5);
23278
23279 Self {
23280 source_name: source_name.map(|envelope| {
23281 ::fidl_next::FromWire::from_wire(unsafe {
23282 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
23283 })
23284 }),
23285
23286 source: source.map(|envelope| {
23287 ::fidl_next::FromWire::from_wire(unsafe {
23288 envelope.read_unchecked::<crate::WireRef<'de>>()
23289 })
23290 }),
23291
23292 target: target.map(|envelope| {
23293 ::fidl_next::FromWire::from_wire(unsafe {
23294 envelope.read_unchecked::<crate::WireRef<'de>>()
23295 })
23296 }),
23297
23298 target_name: target_name.map(|envelope| {
23299 ::fidl_next::FromWire::from_wire(unsafe {
23300 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
23301 })
23302 }),
23303
23304 availability: availability.map(|envelope| {
23305 ::fidl_next::FromWire::from_wire(unsafe {
23306 envelope.read_unchecked::<crate::WireAvailability>()
23307 })
23308 }),
23309 }
23310 }
23311}
23312
23313impl<'de> ::fidl_next::FromWireRef<WireOfferStorage<'de>> for OfferStorage {
23314 #[inline]
23315 fn from_wire_ref(wire: &WireOfferStorage<'de>) -> Self {
23316 Self {
23317 source_name: wire.table.get(1).map(|envelope| {
23318 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23319 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
23320 })
23321 }),
23322
23323 source: wire.table.get(2).map(|envelope| {
23324 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23325 envelope.deref_unchecked::<crate::WireRef<'de>>()
23326 })
23327 }),
23328
23329 target: wire.table.get(3).map(|envelope| {
23330 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23331 envelope.deref_unchecked::<crate::WireRef<'de>>()
23332 })
23333 }),
23334
23335 target_name: wire.table.get(4).map(|envelope| {
23336 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23337 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
23338 })
23339 }),
23340
23341 availability: wire.table.get(5).map(|envelope| {
23342 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23343 envelope.deref_unchecked::<crate::WireAvailability>()
23344 })
23345 }),
23346 }
23347 }
23348}
23349
23350#[repr(C)]
23352pub struct WireOfferStorage<'de> {
23353 table: ::fidl_next::WireTable<'de>,
23354}
23355
23356impl<'de> Drop for WireOfferStorage<'de> {
23357 fn drop(&mut self) {
23358 let _ = self
23359 .table
23360 .get(1)
23361 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
23362
23363 let _ = self
23364 .table
23365 .get(2)
23366 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
23367
23368 let _ = self
23369 .table
23370 .get(3)
23371 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
23372
23373 let _ = self
23374 .table
23375 .get(4)
23376 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
23377
23378 let _ = self
23379 .table
23380 .get(5)
23381 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
23382 }
23383}
23384
23385unsafe impl ::fidl_next::Wire for WireOfferStorage<'static> {
23386 type Decoded<'de> = WireOfferStorage<'de>;
23387
23388 #[inline]
23389 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23390 ::fidl_next::munge!(let Self { table } = out);
23391 ::fidl_next::WireTable::zero_padding(table);
23392 }
23393}
23394
23395unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferStorage<'static>
23396where
23397 ___D: ::fidl_next::Decoder + ?Sized,
23398{
23399 fn decode(
23400 slot: ::fidl_next::Slot<'_, Self>,
23401 decoder: &mut ___D,
23402 ) -> Result<(), ::fidl_next::DecodeError> {
23403 ::fidl_next::munge!(let Self { table } = slot);
23404
23405 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
23406 match ordinal {
23407 0 => unsafe { ::core::hint::unreachable_unchecked() },
23408
23409 1 => {
23410 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
23411 slot.as_mut(),
23412 decoder,
23413 )?;
23414
23415 let source_name = unsafe {
23416 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
23417 };
23418
23419 if source_name.len() > 100 {
23420 return Err(::fidl_next::DecodeError::VectorTooLong {
23421 size: source_name.len() as u64,
23422 limit: 100,
23423 });
23424 }
23425
23426 Ok(())
23427 }
23428
23429 2 => {
23430 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
23431 slot.as_mut(),
23432 decoder,
23433 )?;
23434
23435 Ok(())
23436 }
23437
23438 3 => {
23439 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
23440 slot.as_mut(),
23441 decoder,
23442 )?;
23443
23444 Ok(())
23445 }
23446
23447 4 => {
23448 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
23449 slot.as_mut(),
23450 decoder,
23451 )?;
23452
23453 let target_name = unsafe {
23454 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
23455 };
23456
23457 if target_name.len() > 100 {
23458 return Err(::fidl_next::DecodeError::VectorTooLong {
23459 size: target_name.len() as u64,
23460 limit: 100,
23461 });
23462 }
23463
23464 Ok(())
23465 }
23466
23467 5 => {
23468 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
23469 slot.as_mut(),
23470 decoder,
23471 )?;
23472
23473 Ok(())
23474 }
23475
23476 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
23477 }
23478 })
23479 }
23480}
23481
23482impl<'de> WireOfferStorage<'de> {
23483 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
23484 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
23485 }
23486
23487 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
23488 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
23489 }
23490
23491 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
23492 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
23493 }
23494
23495 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
23496 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
23497 }
23498
23499 pub fn availability(&self) -> Option<&crate::WireAvailability> {
23500 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
23501 }
23502}
23503
23504impl<'de> ::core::fmt::Debug for WireOfferStorage<'de> {
23505 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
23506 f.debug_struct("OfferStorage")
23507 .field("source_name", &self.source_name())
23508 .field("source", &self.source())
23509 .field("target", &self.target())
23510 .field("target_name", &self.target_name())
23511 .field("availability", &self.availability())
23512 .finish()
23513 }
23514}
23515
23516#[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"]
23517#[derive(Clone, Debug, Default)]
23518pub struct OfferRunner {
23519 pub source: Option<crate::Ref>,
23520
23521 pub source_name: Option<String>,
23522
23523 pub target: Option<crate::Ref>,
23524
23525 pub target_name: Option<String>,
23526
23527 pub source_dictionary: Option<String>,
23528}
23529
23530impl OfferRunner {
23531 fn __max_ordinal(&self) -> usize {
23532 if self.source_dictionary.is_some() {
23533 return 5;
23534 }
23535
23536 if self.target_name.is_some() {
23537 return 4;
23538 }
23539
23540 if self.target.is_some() {
23541 return 3;
23542 }
23543
23544 if self.source_name.is_some() {
23545 return 2;
23546 }
23547
23548 if self.source.is_some() {
23549 return 1;
23550 }
23551
23552 0
23553 }
23554}
23555
23556impl ::fidl_next::Encodable for OfferRunner {
23557 type Encoded = WireOfferRunner<'static>;
23558}
23559
23560unsafe impl<___E> ::fidl_next::Encode<___E> for OfferRunner
23561where
23562 ___E: ::fidl_next::Encoder + ?Sized,
23563{
23564 #[inline]
23565 fn encode(
23566 mut self,
23567 encoder: &mut ___E,
23568 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23569 ) -> Result<(), ::fidl_next::EncodeError> {
23570 ::fidl_next::munge!(let WireOfferRunner { table } = out);
23571
23572 let max_ord = self.__max_ordinal();
23573
23574 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
23575 ::fidl_next::Wire::zero_padding(&mut out);
23576
23577 let mut preallocated =
23578 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
23579
23580 for i in 1..=max_ord {
23581 match i {
23582 5 => {
23583 if let Some(source_dictionary) = self.source_dictionary.take() {
23584 ::fidl_next::WireEnvelope::encode_value(
23585 source_dictionary,
23586 preallocated.encoder,
23587 &mut out,
23588 )?;
23589 } else {
23590 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23591 }
23592 }
23593
23594 4 => {
23595 if let Some(target_name) = self.target_name.take() {
23596 ::fidl_next::WireEnvelope::encode_value(
23597 target_name,
23598 preallocated.encoder,
23599 &mut out,
23600 )?;
23601 } else {
23602 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23603 }
23604 }
23605
23606 3 => {
23607 if let Some(target) = self.target.take() {
23608 ::fidl_next::WireEnvelope::encode_value(
23609 target,
23610 preallocated.encoder,
23611 &mut out,
23612 )?;
23613 } else {
23614 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23615 }
23616 }
23617
23618 2 => {
23619 if let Some(source_name) = self.source_name.take() {
23620 ::fidl_next::WireEnvelope::encode_value(
23621 source_name,
23622 preallocated.encoder,
23623 &mut out,
23624 )?;
23625 } else {
23626 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23627 }
23628 }
23629
23630 1 => {
23631 if let Some(source) = self.source.take() {
23632 ::fidl_next::WireEnvelope::encode_value(
23633 source,
23634 preallocated.encoder,
23635 &mut out,
23636 )?;
23637 } else {
23638 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23639 }
23640 }
23641
23642 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
23643 }
23644 unsafe {
23645 preallocated.write_next(out.assume_init_ref());
23646 }
23647 }
23648
23649 ::fidl_next::WireTable::encode_len(table, max_ord);
23650
23651 Ok(())
23652 }
23653}
23654
23655unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferRunner
23656where
23657 ___E: ::fidl_next::Encoder + ?Sized,
23658{
23659 #[inline]
23660 fn encode_ref(
23661 &self,
23662 encoder: &mut ___E,
23663 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23664 ) -> Result<(), ::fidl_next::EncodeError> {
23665 ::fidl_next::munge!(let WireOfferRunner { table } = out);
23666
23667 let max_ord = self.__max_ordinal();
23668
23669 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
23670 ::fidl_next::Wire::zero_padding(&mut out);
23671
23672 let mut preallocated =
23673 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
23674
23675 for i in 1..=max_ord {
23676 match i {
23677 5 => {
23678 if let Some(source_dictionary) = &self.source_dictionary {
23679 ::fidl_next::WireEnvelope::encode_value(
23680 source_dictionary,
23681 preallocated.encoder,
23682 &mut out,
23683 )?;
23684 } else {
23685 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23686 }
23687 }
23688
23689 4 => {
23690 if let Some(target_name) = &self.target_name {
23691 ::fidl_next::WireEnvelope::encode_value(
23692 target_name,
23693 preallocated.encoder,
23694 &mut out,
23695 )?;
23696 } else {
23697 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23698 }
23699 }
23700
23701 3 => {
23702 if let Some(target) = &self.target {
23703 ::fidl_next::WireEnvelope::encode_value(
23704 target,
23705 preallocated.encoder,
23706 &mut out,
23707 )?;
23708 } else {
23709 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23710 }
23711 }
23712
23713 2 => {
23714 if let Some(source_name) = &self.source_name {
23715 ::fidl_next::WireEnvelope::encode_value(
23716 source_name,
23717 preallocated.encoder,
23718 &mut out,
23719 )?;
23720 } else {
23721 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23722 }
23723 }
23724
23725 1 => {
23726 if let Some(source) = &self.source {
23727 ::fidl_next::WireEnvelope::encode_value(
23728 source,
23729 preallocated.encoder,
23730 &mut out,
23731 )?;
23732 } else {
23733 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23734 }
23735 }
23736
23737 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
23738 }
23739 unsafe {
23740 preallocated.write_next(out.assume_init_ref());
23741 }
23742 }
23743
23744 ::fidl_next::WireTable::encode_len(table, max_ord);
23745
23746 Ok(())
23747 }
23748}
23749
23750impl<'de> ::fidl_next::FromWire<WireOfferRunner<'de>> for OfferRunner {
23751 #[inline]
23752 fn from_wire(wire: WireOfferRunner<'de>) -> Self {
23753 let wire = ::core::mem::ManuallyDrop::new(wire);
23754
23755 let source = wire.table.get(1);
23756
23757 let source_name = wire.table.get(2);
23758
23759 let target = wire.table.get(3);
23760
23761 let target_name = wire.table.get(4);
23762
23763 let source_dictionary = wire.table.get(5);
23764
23765 Self {
23766 source: source.map(|envelope| {
23767 ::fidl_next::FromWire::from_wire(unsafe {
23768 envelope.read_unchecked::<crate::WireRef<'de>>()
23769 })
23770 }),
23771
23772 source_name: source_name.map(|envelope| {
23773 ::fidl_next::FromWire::from_wire(unsafe {
23774 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
23775 })
23776 }),
23777
23778 target: target.map(|envelope| {
23779 ::fidl_next::FromWire::from_wire(unsafe {
23780 envelope.read_unchecked::<crate::WireRef<'de>>()
23781 })
23782 }),
23783
23784 target_name: target_name.map(|envelope| {
23785 ::fidl_next::FromWire::from_wire(unsafe {
23786 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
23787 })
23788 }),
23789
23790 source_dictionary: source_dictionary.map(|envelope| {
23791 ::fidl_next::FromWire::from_wire(unsafe {
23792 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
23793 })
23794 }),
23795 }
23796 }
23797}
23798
23799impl<'de> ::fidl_next::FromWireRef<WireOfferRunner<'de>> for OfferRunner {
23800 #[inline]
23801 fn from_wire_ref(wire: &WireOfferRunner<'de>) -> Self {
23802 Self {
23803 source: wire.table.get(1).map(|envelope| {
23804 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23805 envelope.deref_unchecked::<crate::WireRef<'de>>()
23806 })
23807 }),
23808
23809 source_name: wire.table.get(2).map(|envelope| {
23810 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23811 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
23812 })
23813 }),
23814
23815 target: wire.table.get(3).map(|envelope| {
23816 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23817 envelope.deref_unchecked::<crate::WireRef<'de>>()
23818 })
23819 }),
23820
23821 target_name: wire.table.get(4).map(|envelope| {
23822 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23823 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
23824 })
23825 }),
23826
23827 source_dictionary: wire.table.get(5).map(|envelope| {
23828 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23829 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
23830 })
23831 }),
23832 }
23833 }
23834}
23835
23836#[repr(C)]
23838pub struct WireOfferRunner<'de> {
23839 table: ::fidl_next::WireTable<'de>,
23840}
23841
23842impl<'de> Drop for WireOfferRunner<'de> {
23843 fn drop(&mut self) {
23844 let _ = self
23845 .table
23846 .get(1)
23847 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
23848
23849 let _ = self
23850 .table
23851 .get(2)
23852 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
23853
23854 let _ = self
23855 .table
23856 .get(3)
23857 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
23858
23859 let _ = self
23860 .table
23861 .get(4)
23862 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
23863
23864 let _ = self
23865 .table
23866 .get(5)
23867 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
23868 }
23869}
23870
23871unsafe impl ::fidl_next::Wire for WireOfferRunner<'static> {
23872 type Decoded<'de> = WireOfferRunner<'de>;
23873
23874 #[inline]
23875 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23876 ::fidl_next::munge!(let Self { table } = out);
23877 ::fidl_next::WireTable::zero_padding(table);
23878 }
23879}
23880
23881unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferRunner<'static>
23882where
23883 ___D: ::fidl_next::Decoder + ?Sized,
23884{
23885 fn decode(
23886 slot: ::fidl_next::Slot<'_, Self>,
23887 decoder: &mut ___D,
23888 ) -> Result<(), ::fidl_next::DecodeError> {
23889 ::fidl_next::munge!(let Self { table } = slot);
23890
23891 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
23892 match ordinal {
23893 0 => unsafe { ::core::hint::unreachable_unchecked() },
23894
23895 1 => {
23896 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
23897 slot.as_mut(),
23898 decoder,
23899 )?;
23900
23901 Ok(())
23902 }
23903
23904 2 => {
23905 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
23906 slot.as_mut(),
23907 decoder,
23908 )?;
23909
23910 let source_name = unsafe {
23911 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
23912 };
23913
23914 if source_name.len() > 100 {
23915 return Err(::fidl_next::DecodeError::VectorTooLong {
23916 size: source_name.len() as u64,
23917 limit: 100,
23918 });
23919 }
23920
23921 Ok(())
23922 }
23923
23924 3 => {
23925 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
23926 slot.as_mut(),
23927 decoder,
23928 )?;
23929
23930 Ok(())
23931 }
23932
23933 4 => {
23934 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
23935 slot.as_mut(),
23936 decoder,
23937 )?;
23938
23939 let target_name = unsafe {
23940 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
23941 };
23942
23943 if target_name.len() > 100 {
23944 return Err(::fidl_next::DecodeError::VectorTooLong {
23945 size: target_name.len() as u64,
23946 limit: 100,
23947 });
23948 }
23949
23950 Ok(())
23951 }
23952
23953 5 => {
23954 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
23955 slot.as_mut(),
23956 decoder,
23957 )?;
23958
23959 let source_dictionary = unsafe {
23960 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
23961 };
23962
23963 if source_dictionary.len() > 1024 {
23964 return Err(::fidl_next::DecodeError::VectorTooLong {
23965 size: source_dictionary.len() as u64,
23966 limit: 1024,
23967 });
23968 }
23969
23970 Ok(())
23971 }
23972
23973 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
23974 }
23975 })
23976 }
23977}
23978
23979impl<'de> WireOfferRunner<'de> {
23980 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
23981 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
23982 }
23983
23984 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
23985 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
23986 }
23987
23988 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
23989 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
23990 }
23991
23992 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
23993 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
23994 }
23995
23996 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
23997 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
23998 }
23999}
24000
24001impl<'de> ::core::fmt::Debug for WireOfferRunner<'de> {
24002 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
24003 f.debug_struct("OfferRunner")
24004 .field("source", &self.source())
24005 .field("source_name", &self.source_name())
24006 .field("target", &self.target())
24007 .field("target_name", &self.target_name())
24008 .field("source_dictionary", &self.source_dictionary())
24009 .finish()
24010 }
24011}
24012
24013#[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"]
24014#[derive(Clone, Debug, Default)]
24015pub struct OfferResolver {
24016 pub source: Option<crate::Ref>,
24017
24018 pub source_name: Option<String>,
24019
24020 pub target: Option<crate::Ref>,
24021
24022 pub target_name: Option<String>,
24023
24024 pub source_dictionary: Option<String>,
24025}
24026
24027impl OfferResolver {
24028 fn __max_ordinal(&self) -> usize {
24029 if self.source_dictionary.is_some() {
24030 return 5;
24031 }
24032
24033 if self.target_name.is_some() {
24034 return 4;
24035 }
24036
24037 if self.target.is_some() {
24038 return 3;
24039 }
24040
24041 if self.source_name.is_some() {
24042 return 2;
24043 }
24044
24045 if self.source.is_some() {
24046 return 1;
24047 }
24048
24049 0
24050 }
24051}
24052
24053impl ::fidl_next::Encodable for OfferResolver {
24054 type Encoded = WireOfferResolver<'static>;
24055}
24056
24057unsafe impl<___E> ::fidl_next::Encode<___E> for OfferResolver
24058where
24059 ___E: ::fidl_next::Encoder + ?Sized,
24060{
24061 #[inline]
24062 fn encode(
24063 mut self,
24064 encoder: &mut ___E,
24065 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24066 ) -> Result<(), ::fidl_next::EncodeError> {
24067 ::fidl_next::munge!(let WireOfferResolver { table } = out);
24068
24069 let max_ord = self.__max_ordinal();
24070
24071 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
24072 ::fidl_next::Wire::zero_padding(&mut out);
24073
24074 let mut preallocated =
24075 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
24076
24077 for i in 1..=max_ord {
24078 match i {
24079 5 => {
24080 if let Some(source_dictionary) = self.source_dictionary.take() {
24081 ::fidl_next::WireEnvelope::encode_value(
24082 source_dictionary,
24083 preallocated.encoder,
24084 &mut out,
24085 )?;
24086 } else {
24087 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24088 }
24089 }
24090
24091 4 => {
24092 if let Some(target_name) = self.target_name.take() {
24093 ::fidl_next::WireEnvelope::encode_value(
24094 target_name,
24095 preallocated.encoder,
24096 &mut out,
24097 )?;
24098 } else {
24099 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24100 }
24101 }
24102
24103 3 => {
24104 if let Some(target) = self.target.take() {
24105 ::fidl_next::WireEnvelope::encode_value(
24106 target,
24107 preallocated.encoder,
24108 &mut out,
24109 )?;
24110 } else {
24111 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24112 }
24113 }
24114
24115 2 => {
24116 if let Some(source_name) = self.source_name.take() {
24117 ::fidl_next::WireEnvelope::encode_value(
24118 source_name,
24119 preallocated.encoder,
24120 &mut out,
24121 )?;
24122 } else {
24123 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24124 }
24125 }
24126
24127 1 => {
24128 if let Some(source) = self.source.take() {
24129 ::fidl_next::WireEnvelope::encode_value(
24130 source,
24131 preallocated.encoder,
24132 &mut out,
24133 )?;
24134 } else {
24135 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24136 }
24137 }
24138
24139 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
24140 }
24141 unsafe {
24142 preallocated.write_next(out.assume_init_ref());
24143 }
24144 }
24145
24146 ::fidl_next::WireTable::encode_len(table, max_ord);
24147
24148 Ok(())
24149 }
24150}
24151
24152unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferResolver
24153where
24154 ___E: ::fidl_next::Encoder + ?Sized,
24155{
24156 #[inline]
24157 fn encode_ref(
24158 &self,
24159 encoder: &mut ___E,
24160 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24161 ) -> Result<(), ::fidl_next::EncodeError> {
24162 ::fidl_next::munge!(let WireOfferResolver { table } = out);
24163
24164 let max_ord = self.__max_ordinal();
24165
24166 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
24167 ::fidl_next::Wire::zero_padding(&mut out);
24168
24169 let mut preallocated =
24170 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
24171
24172 for i in 1..=max_ord {
24173 match i {
24174 5 => {
24175 if let Some(source_dictionary) = &self.source_dictionary {
24176 ::fidl_next::WireEnvelope::encode_value(
24177 source_dictionary,
24178 preallocated.encoder,
24179 &mut out,
24180 )?;
24181 } else {
24182 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24183 }
24184 }
24185
24186 4 => {
24187 if let Some(target_name) = &self.target_name {
24188 ::fidl_next::WireEnvelope::encode_value(
24189 target_name,
24190 preallocated.encoder,
24191 &mut out,
24192 )?;
24193 } else {
24194 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24195 }
24196 }
24197
24198 3 => {
24199 if let Some(target) = &self.target {
24200 ::fidl_next::WireEnvelope::encode_value(
24201 target,
24202 preallocated.encoder,
24203 &mut out,
24204 )?;
24205 } else {
24206 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24207 }
24208 }
24209
24210 2 => {
24211 if let Some(source_name) = &self.source_name {
24212 ::fidl_next::WireEnvelope::encode_value(
24213 source_name,
24214 preallocated.encoder,
24215 &mut out,
24216 )?;
24217 } else {
24218 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24219 }
24220 }
24221
24222 1 => {
24223 if let Some(source) = &self.source {
24224 ::fidl_next::WireEnvelope::encode_value(
24225 source,
24226 preallocated.encoder,
24227 &mut out,
24228 )?;
24229 } else {
24230 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24231 }
24232 }
24233
24234 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
24235 }
24236 unsafe {
24237 preallocated.write_next(out.assume_init_ref());
24238 }
24239 }
24240
24241 ::fidl_next::WireTable::encode_len(table, max_ord);
24242
24243 Ok(())
24244 }
24245}
24246
24247impl<'de> ::fidl_next::FromWire<WireOfferResolver<'de>> for OfferResolver {
24248 #[inline]
24249 fn from_wire(wire: WireOfferResolver<'de>) -> Self {
24250 let wire = ::core::mem::ManuallyDrop::new(wire);
24251
24252 let source = wire.table.get(1);
24253
24254 let source_name = wire.table.get(2);
24255
24256 let target = wire.table.get(3);
24257
24258 let target_name = wire.table.get(4);
24259
24260 let source_dictionary = wire.table.get(5);
24261
24262 Self {
24263 source: source.map(|envelope| {
24264 ::fidl_next::FromWire::from_wire(unsafe {
24265 envelope.read_unchecked::<crate::WireRef<'de>>()
24266 })
24267 }),
24268
24269 source_name: source_name.map(|envelope| {
24270 ::fidl_next::FromWire::from_wire(unsafe {
24271 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24272 })
24273 }),
24274
24275 target: target.map(|envelope| {
24276 ::fidl_next::FromWire::from_wire(unsafe {
24277 envelope.read_unchecked::<crate::WireRef<'de>>()
24278 })
24279 }),
24280
24281 target_name: target_name.map(|envelope| {
24282 ::fidl_next::FromWire::from_wire(unsafe {
24283 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24284 })
24285 }),
24286
24287 source_dictionary: source_dictionary.map(|envelope| {
24288 ::fidl_next::FromWire::from_wire(unsafe {
24289 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24290 })
24291 }),
24292 }
24293 }
24294}
24295
24296impl<'de> ::fidl_next::FromWireRef<WireOfferResolver<'de>> for OfferResolver {
24297 #[inline]
24298 fn from_wire_ref(wire: &WireOfferResolver<'de>) -> Self {
24299 Self {
24300 source: wire.table.get(1).map(|envelope| {
24301 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24302 envelope.deref_unchecked::<crate::WireRef<'de>>()
24303 })
24304 }),
24305
24306 source_name: wire.table.get(2).map(|envelope| {
24307 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24308 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
24309 })
24310 }),
24311
24312 target: wire.table.get(3).map(|envelope| {
24313 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24314 envelope.deref_unchecked::<crate::WireRef<'de>>()
24315 })
24316 }),
24317
24318 target_name: wire.table.get(4).map(|envelope| {
24319 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24320 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
24321 })
24322 }),
24323
24324 source_dictionary: wire.table.get(5).map(|envelope| {
24325 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24326 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
24327 })
24328 }),
24329 }
24330 }
24331}
24332
24333#[repr(C)]
24335pub struct WireOfferResolver<'de> {
24336 table: ::fidl_next::WireTable<'de>,
24337}
24338
24339impl<'de> Drop for WireOfferResolver<'de> {
24340 fn drop(&mut self) {
24341 let _ = self
24342 .table
24343 .get(1)
24344 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
24345
24346 let _ = self
24347 .table
24348 .get(2)
24349 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
24350
24351 let _ = self
24352 .table
24353 .get(3)
24354 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
24355
24356 let _ = self
24357 .table
24358 .get(4)
24359 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
24360
24361 let _ = self
24362 .table
24363 .get(5)
24364 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
24365 }
24366}
24367
24368unsafe impl ::fidl_next::Wire for WireOfferResolver<'static> {
24369 type Decoded<'de> = WireOfferResolver<'de>;
24370
24371 #[inline]
24372 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24373 ::fidl_next::munge!(let Self { table } = out);
24374 ::fidl_next::WireTable::zero_padding(table);
24375 }
24376}
24377
24378unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferResolver<'static>
24379where
24380 ___D: ::fidl_next::Decoder + ?Sized,
24381{
24382 fn decode(
24383 slot: ::fidl_next::Slot<'_, Self>,
24384 decoder: &mut ___D,
24385 ) -> Result<(), ::fidl_next::DecodeError> {
24386 ::fidl_next::munge!(let Self { table } = slot);
24387
24388 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
24389 match ordinal {
24390 0 => unsafe { ::core::hint::unreachable_unchecked() },
24391
24392 1 => {
24393 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
24394 slot.as_mut(),
24395 decoder,
24396 )?;
24397
24398 Ok(())
24399 }
24400
24401 2 => {
24402 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
24403 slot.as_mut(),
24404 decoder,
24405 )?;
24406
24407 let source_name = unsafe {
24408 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24409 };
24410
24411 if source_name.len() > 100 {
24412 return Err(::fidl_next::DecodeError::VectorTooLong {
24413 size: source_name.len() as u64,
24414 limit: 100,
24415 });
24416 }
24417
24418 Ok(())
24419 }
24420
24421 3 => {
24422 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
24423 slot.as_mut(),
24424 decoder,
24425 )?;
24426
24427 Ok(())
24428 }
24429
24430 4 => {
24431 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
24432 slot.as_mut(),
24433 decoder,
24434 )?;
24435
24436 let target_name = unsafe {
24437 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24438 };
24439
24440 if target_name.len() > 100 {
24441 return Err(::fidl_next::DecodeError::VectorTooLong {
24442 size: target_name.len() as u64,
24443 limit: 100,
24444 });
24445 }
24446
24447 Ok(())
24448 }
24449
24450 5 => {
24451 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
24452 slot.as_mut(),
24453 decoder,
24454 )?;
24455
24456 let source_dictionary = unsafe {
24457 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24458 };
24459
24460 if source_dictionary.len() > 1024 {
24461 return Err(::fidl_next::DecodeError::VectorTooLong {
24462 size: source_dictionary.len() as u64,
24463 limit: 1024,
24464 });
24465 }
24466
24467 Ok(())
24468 }
24469
24470 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
24471 }
24472 })
24473 }
24474}
24475
24476impl<'de> WireOfferResolver<'de> {
24477 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
24478 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
24479 }
24480
24481 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
24482 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
24483 }
24484
24485 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
24486 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
24487 }
24488
24489 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
24490 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
24491 }
24492
24493 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
24494 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
24495 }
24496}
24497
24498impl<'de> ::core::fmt::Debug for WireOfferResolver<'de> {
24499 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
24500 f.debug_struct("OfferResolver")
24501 .field("source", &self.source())
24502 .field("source_name", &self.source_name())
24503 .field("target", &self.target())
24504 .field("target_name", &self.target_name())
24505 .field("source_dictionary", &self.source_dictionary())
24506 .finish()
24507 }
24508}
24509
24510#[doc = " Declares an event stream offered by a component.\n"]
24511#[derive(Clone, Debug, Default)]
24512pub struct OfferEventStream {
24513 pub source: Option<crate::Ref>,
24514
24515 pub source_name: Option<String>,
24516
24517 pub scope: Option<Vec<crate::Ref>>,
24518
24519 pub target: Option<crate::Ref>,
24520
24521 pub target_name: Option<String>,
24522
24523 pub availability: Option<crate::Availability>,
24524}
24525
24526impl OfferEventStream {
24527 fn __max_ordinal(&self) -> usize {
24528 if self.availability.is_some() {
24529 return 7;
24530 }
24531
24532 if self.target_name.is_some() {
24533 return 5;
24534 }
24535
24536 if self.target.is_some() {
24537 return 4;
24538 }
24539
24540 if self.scope.is_some() {
24541 return 3;
24542 }
24543
24544 if self.source_name.is_some() {
24545 return 2;
24546 }
24547
24548 if self.source.is_some() {
24549 return 1;
24550 }
24551
24552 0
24553 }
24554}
24555
24556impl ::fidl_next::Encodable for OfferEventStream {
24557 type Encoded = WireOfferEventStream<'static>;
24558}
24559
24560unsafe impl<___E> ::fidl_next::Encode<___E> for OfferEventStream
24561where
24562 ___E: ::fidl_next::Encoder + ?Sized,
24563{
24564 #[inline]
24565 fn encode(
24566 mut self,
24567 encoder: &mut ___E,
24568 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24569 ) -> Result<(), ::fidl_next::EncodeError> {
24570 ::fidl_next::munge!(let WireOfferEventStream { table } = out);
24571
24572 let max_ord = self.__max_ordinal();
24573
24574 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
24575 ::fidl_next::Wire::zero_padding(&mut out);
24576
24577 let mut preallocated =
24578 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
24579
24580 for i in 1..=max_ord {
24581 match i {
24582 7 => {
24583 if let Some(availability) = self.availability.take() {
24584 ::fidl_next::WireEnvelope::encode_value(
24585 availability,
24586 preallocated.encoder,
24587 &mut out,
24588 )?;
24589 } else {
24590 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24591 }
24592 }
24593
24594 5 => {
24595 if let Some(target_name) = self.target_name.take() {
24596 ::fidl_next::WireEnvelope::encode_value(
24597 target_name,
24598 preallocated.encoder,
24599 &mut out,
24600 )?;
24601 } else {
24602 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24603 }
24604 }
24605
24606 4 => {
24607 if let Some(target) = self.target.take() {
24608 ::fidl_next::WireEnvelope::encode_value(
24609 target,
24610 preallocated.encoder,
24611 &mut out,
24612 )?;
24613 } else {
24614 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24615 }
24616 }
24617
24618 3 => {
24619 if let Some(scope) = self.scope.take() {
24620 ::fidl_next::WireEnvelope::encode_value(
24621 scope,
24622 preallocated.encoder,
24623 &mut out,
24624 )?;
24625 } else {
24626 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24627 }
24628 }
24629
24630 2 => {
24631 if let Some(source_name) = self.source_name.take() {
24632 ::fidl_next::WireEnvelope::encode_value(
24633 source_name,
24634 preallocated.encoder,
24635 &mut out,
24636 )?;
24637 } else {
24638 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24639 }
24640 }
24641
24642 1 => {
24643 if let Some(source) = self.source.take() {
24644 ::fidl_next::WireEnvelope::encode_value(
24645 source,
24646 preallocated.encoder,
24647 &mut out,
24648 )?;
24649 } else {
24650 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24651 }
24652 }
24653
24654 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
24655 }
24656 unsafe {
24657 preallocated.write_next(out.assume_init_ref());
24658 }
24659 }
24660
24661 ::fidl_next::WireTable::encode_len(table, max_ord);
24662
24663 Ok(())
24664 }
24665}
24666
24667unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferEventStream
24668where
24669 ___E: ::fidl_next::Encoder + ?Sized,
24670{
24671 #[inline]
24672 fn encode_ref(
24673 &self,
24674 encoder: &mut ___E,
24675 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24676 ) -> Result<(), ::fidl_next::EncodeError> {
24677 ::fidl_next::munge!(let WireOfferEventStream { table } = out);
24678
24679 let max_ord = self.__max_ordinal();
24680
24681 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
24682 ::fidl_next::Wire::zero_padding(&mut out);
24683
24684 let mut preallocated =
24685 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
24686
24687 for i in 1..=max_ord {
24688 match i {
24689 7 => {
24690 if let Some(availability) = &self.availability {
24691 ::fidl_next::WireEnvelope::encode_value(
24692 availability,
24693 preallocated.encoder,
24694 &mut out,
24695 )?;
24696 } else {
24697 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24698 }
24699 }
24700
24701 5 => {
24702 if let Some(target_name) = &self.target_name {
24703 ::fidl_next::WireEnvelope::encode_value(
24704 target_name,
24705 preallocated.encoder,
24706 &mut out,
24707 )?;
24708 } else {
24709 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24710 }
24711 }
24712
24713 4 => {
24714 if let Some(target) = &self.target {
24715 ::fidl_next::WireEnvelope::encode_value(
24716 target,
24717 preallocated.encoder,
24718 &mut out,
24719 )?;
24720 } else {
24721 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24722 }
24723 }
24724
24725 3 => {
24726 if let Some(scope) = &self.scope {
24727 ::fidl_next::WireEnvelope::encode_value(
24728 scope,
24729 preallocated.encoder,
24730 &mut out,
24731 )?;
24732 } else {
24733 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24734 }
24735 }
24736
24737 2 => {
24738 if let Some(source_name) = &self.source_name {
24739 ::fidl_next::WireEnvelope::encode_value(
24740 source_name,
24741 preallocated.encoder,
24742 &mut out,
24743 )?;
24744 } else {
24745 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24746 }
24747 }
24748
24749 1 => {
24750 if let Some(source) = &self.source {
24751 ::fidl_next::WireEnvelope::encode_value(
24752 source,
24753 preallocated.encoder,
24754 &mut out,
24755 )?;
24756 } else {
24757 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24758 }
24759 }
24760
24761 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
24762 }
24763 unsafe {
24764 preallocated.write_next(out.assume_init_ref());
24765 }
24766 }
24767
24768 ::fidl_next::WireTable::encode_len(table, max_ord);
24769
24770 Ok(())
24771 }
24772}
24773
24774impl<'de> ::fidl_next::FromWire<WireOfferEventStream<'de>> for OfferEventStream {
24775 #[inline]
24776 fn from_wire(wire: WireOfferEventStream<'de>) -> Self {
24777 let wire = ::core::mem::ManuallyDrop::new(wire);
24778
24779 let source = wire.table.get(1);
24780
24781 let source_name = wire.table.get(2);
24782
24783 let scope = wire.table.get(3);
24784
24785 let target = wire.table.get(4);
24786
24787 let target_name = wire.table.get(5);
24788
24789 let availability = wire.table.get(7);
24790
24791 Self {
24792 source: source.map(|envelope| {
24793 ::fidl_next::FromWire::from_wire(unsafe {
24794 envelope.read_unchecked::<crate::WireRef<'de>>()
24795 })
24796 }),
24797
24798 source_name: source_name.map(|envelope| {
24799 ::fidl_next::FromWire::from_wire(unsafe {
24800 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24801 })
24802 }),
24803
24804 scope: scope.map(|envelope| {
24805 ::fidl_next::FromWire::from_wire(unsafe {
24806 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireRef<'de>>>()
24807 })
24808 }),
24809
24810 target: target.map(|envelope| {
24811 ::fidl_next::FromWire::from_wire(unsafe {
24812 envelope.read_unchecked::<crate::WireRef<'de>>()
24813 })
24814 }),
24815
24816 target_name: target_name.map(|envelope| {
24817 ::fidl_next::FromWire::from_wire(unsafe {
24818 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24819 })
24820 }),
24821
24822 availability: availability.map(|envelope| {
24823 ::fidl_next::FromWire::from_wire(unsafe {
24824 envelope.read_unchecked::<crate::WireAvailability>()
24825 })
24826 }),
24827 }
24828 }
24829}
24830
24831impl<'de> ::fidl_next::FromWireRef<WireOfferEventStream<'de>> for OfferEventStream {
24832 #[inline]
24833 fn from_wire_ref(wire: &WireOfferEventStream<'de>) -> Self {
24834 Self {
24835 source: wire.table.get(1).map(|envelope| {
24836 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24837 envelope.deref_unchecked::<crate::WireRef<'de>>()
24838 })
24839 }),
24840
24841 source_name: wire.table.get(2).map(|envelope| {
24842 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24843 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
24844 })
24845 }),
24846
24847 scope: wire.table.get(3).map(|envelope| {
24848 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24849 envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireRef<'de>>>()
24850 })
24851 }),
24852
24853 target: wire.table.get(4).map(|envelope| {
24854 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24855 envelope.deref_unchecked::<crate::WireRef<'de>>()
24856 })
24857 }),
24858
24859 target_name: wire.table.get(5).map(|envelope| {
24860 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24861 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
24862 })
24863 }),
24864
24865 availability: wire.table.get(7).map(|envelope| {
24866 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24867 envelope.deref_unchecked::<crate::WireAvailability>()
24868 })
24869 }),
24870 }
24871 }
24872}
24873
24874#[repr(C)]
24876pub struct WireOfferEventStream<'de> {
24877 table: ::fidl_next::WireTable<'de>,
24878}
24879
24880impl<'de> Drop for WireOfferEventStream<'de> {
24881 fn drop(&mut self) {
24882 let _ = self
24883 .table
24884 .get(1)
24885 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
24886
24887 let _ = self
24888 .table
24889 .get(2)
24890 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
24891
24892 let _ = self.table.get(3).map(|envelope| unsafe {
24893 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireRef<'de>>>()
24894 });
24895
24896 let _ = self
24897 .table
24898 .get(4)
24899 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
24900
24901 let _ = self
24902 .table
24903 .get(5)
24904 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
24905
24906 let _ = self
24907 .table
24908 .get(7)
24909 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
24910 }
24911}
24912
24913unsafe impl ::fidl_next::Wire for WireOfferEventStream<'static> {
24914 type Decoded<'de> = WireOfferEventStream<'de>;
24915
24916 #[inline]
24917 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24918 ::fidl_next::munge!(let Self { table } = out);
24919 ::fidl_next::WireTable::zero_padding(table);
24920 }
24921}
24922
24923unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferEventStream<'static>
24924where
24925 ___D: ::fidl_next::Decoder + ?Sized,
24926{
24927 fn decode(
24928 slot: ::fidl_next::Slot<'_, Self>,
24929 decoder: &mut ___D,
24930 ) -> Result<(), ::fidl_next::DecodeError> {
24931 ::fidl_next::munge!(let Self { table } = slot);
24932
24933 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
24934 match ordinal {
24935 0 => unsafe { ::core::hint::unreachable_unchecked() },
24936
24937 1 => {
24938 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
24939 slot.as_mut(),
24940 decoder,
24941 )?;
24942
24943 Ok(())
24944 }
24945
24946 2 => {
24947 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
24948 slot.as_mut(),
24949 decoder,
24950 )?;
24951
24952 let source_name = unsafe {
24953 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24954 };
24955
24956 if source_name.len() > 100 {
24957 return Err(::fidl_next::DecodeError::VectorTooLong {
24958 size: source_name.len() as u64,
24959 limit: 100,
24960 });
24961 }
24962
24963 Ok(())
24964 }
24965
24966 3 => {
24967 ::fidl_next::WireEnvelope::decode_as::<
24968 ___D,
24969 ::fidl_next::WireVector<'static, crate::WireRef<'static>>,
24970 >(slot.as_mut(), decoder)?;
24971
24972 Ok(())
24973 }
24974
24975 4 => {
24976 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
24977 slot.as_mut(),
24978 decoder,
24979 )?;
24980
24981 Ok(())
24982 }
24983
24984 5 => {
24985 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
24986 slot.as_mut(),
24987 decoder,
24988 )?;
24989
24990 let target_name = unsafe {
24991 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24992 };
24993
24994 if target_name.len() > 100 {
24995 return Err(::fidl_next::DecodeError::VectorTooLong {
24996 size: target_name.len() as u64,
24997 limit: 100,
24998 });
24999 }
25000
25001 Ok(())
25002 }
25003
25004 7 => {
25005 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
25006 slot.as_mut(),
25007 decoder,
25008 )?;
25009
25010 Ok(())
25011 }
25012
25013 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
25014 }
25015 })
25016 }
25017}
25018
25019impl<'de> WireOfferEventStream<'de> {
25020 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
25021 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
25022 }
25023
25024 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
25025 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
25026 }
25027
25028 pub fn scope(&self) -> Option<&::fidl_next::WireVector<'de, crate::WireRef<'de>>> {
25029 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
25030 }
25031
25032 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
25033 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
25034 }
25035
25036 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
25037 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
25038 }
25039
25040 pub fn availability(&self) -> Option<&crate::WireAvailability> {
25041 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
25042 }
25043}
25044
25045impl<'de> ::core::fmt::Debug for WireOfferEventStream<'de> {
25046 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
25047 f.debug_struct("OfferEventStream")
25048 .field("source", &self.source())
25049 .field("source_name", &self.source_name())
25050 .field("scope", &self.scope())
25051 .field("target", &self.target())
25052 .field("target_name", &self.target_name())
25053 .field("availability", &self.availability())
25054 .finish()
25055 }
25056}
25057
25058#[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"]
25059#[derive(Clone, Debug, Default)]
25060pub struct OfferDictionary {
25061 pub source: Option<crate::Ref>,
25062
25063 pub source_name: Option<String>,
25064
25065 pub target: Option<crate::Ref>,
25066
25067 pub target_name: Option<String>,
25068
25069 pub dependency_type: Option<crate::DependencyType>,
25070
25071 pub availability: Option<crate::Availability>,
25072
25073 pub source_dictionary: Option<String>,
25074}
25075
25076impl OfferDictionary {
25077 fn __max_ordinal(&self) -> usize {
25078 if self.source_dictionary.is_some() {
25079 return 7;
25080 }
25081
25082 if self.availability.is_some() {
25083 return 6;
25084 }
25085
25086 if self.dependency_type.is_some() {
25087 return 5;
25088 }
25089
25090 if self.target_name.is_some() {
25091 return 4;
25092 }
25093
25094 if self.target.is_some() {
25095 return 3;
25096 }
25097
25098 if self.source_name.is_some() {
25099 return 2;
25100 }
25101
25102 if self.source.is_some() {
25103 return 1;
25104 }
25105
25106 0
25107 }
25108}
25109
25110impl ::fidl_next::Encodable for OfferDictionary {
25111 type Encoded = WireOfferDictionary<'static>;
25112}
25113
25114unsafe impl<___E> ::fidl_next::Encode<___E> for OfferDictionary
25115where
25116 ___E: ::fidl_next::Encoder + ?Sized,
25117{
25118 #[inline]
25119 fn encode(
25120 mut self,
25121 encoder: &mut ___E,
25122 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25123 ) -> Result<(), ::fidl_next::EncodeError> {
25124 ::fidl_next::munge!(let WireOfferDictionary { table } = out);
25125
25126 let max_ord = self.__max_ordinal();
25127
25128 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
25129 ::fidl_next::Wire::zero_padding(&mut out);
25130
25131 let mut preallocated =
25132 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
25133
25134 for i in 1..=max_ord {
25135 match i {
25136 7 => {
25137 if let Some(source_dictionary) = self.source_dictionary.take() {
25138 ::fidl_next::WireEnvelope::encode_value(
25139 source_dictionary,
25140 preallocated.encoder,
25141 &mut out,
25142 )?;
25143 } else {
25144 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25145 }
25146 }
25147
25148 6 => {
25149 if let Some(availability) = self.availability.take() {
25150 ::fidl_next::WireEnvelope::encode_value(
25151 availability,
25152 preallocated.encoder,
25153 &mut out,
25154 )?;
25155 } else {
25156 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25157 }
25158 }
25159
25160 5 => {
25161 if let Some(dependency_type) = self.dependency_type.take() {
25162 ::fidl_next::WireEnvelope::encode_value(
25163 dependency_type,
25164 preallocated.encoder,
25165 &mut out,
25166 )?;
25167 } else {
25168 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25169 }
25170 }
25171
25172 4 => {
25173 if let Some(target_name) = self.target_name.take() {
25174 ::fidl_next::WireEnvelope::encode_value(
25175 target_name,
25176 preallocated.encoder,
25177 &mut out,
25178 )?;
25179 } else {
25180 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25181 }
25182 }
25183
25184 3 => {
25185 if let Some(target) = self.target.take() {
25186 ::fidl_next::WireEnvelope::encode_value(
25187 target,
25188 preallocated.encoder,
25189 &mut out,
25190 )?;
25191 } else {
25192 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25193 }
25194 }
25195
25196 2 => {
25197 if let Some(source_name) = self.source_name.take() {
25198 ::fidl_next::WireEnvelope::encode_value(
25199 source_name,
25200 preallocated.encoder,
25201 &mut out,
25202 )?;
25203 } else {
25204 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25205 }
25206 }
25207
25208 1 => {
25209 if let Some(source) = self.source.take() {
25210 ::fidl_next::WireEnvelope::encode_value(
25211 source,
25212 preallocated.encoder,
25213 &mut out,
25214 )?;
25215 } else {
25216 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25217 }
25218 }
25219
25220 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
25221 }
25222 unsafe {
25223 preallocated.write_next(out.assume_init_ref());
25224 }
25225 }
25226
25227 ::fidl_next::WireTable::encode_len(table, max_ord);
25228
25229 Ok(())
25230 }
25231}
25232
25233unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferDictionary
25234where
25235 ___E: ::fidl_next::Encoder + ?Sized,
25236{
25237 #[inline]
25238 fn encode_ref(
25239 &self,
25240 encoder: &mut ___E,
25241 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25242 ) -> Result<(), ::fidl_next::EncodeError> {
25243 ::fidl_next::munge!(let WireOfferDictionary { table } = out);
25244
25245 let max_ord = self.__max_ordinal();
25246
25247 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
25248 ::fidl_next::Wire::zero_padding(&mut out);
25249
25250 let mut preallocated =
25251 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
25252
25253 for i in 1..=max_ord {
25254 match i {
25255 7 => {
25256 if let Some(source_dictionary) = &self.source_dictionary {
25257 ::fidl_next::WireEnvelope::encode_value(
25258 source_dictionary,
25259 preallocated.encoder,
25260 &mut out,
25261 )?;
25262 } else {
25263 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25264 }
25265 }
25266
25267 6 => {
25268 if let Some(availability) = &self.availability {
25269 ::fidl_next::WireEnvelope::encode_value(
25270 availability,
25271 preallocated.encoder,
25272 &mut out,
25273 )?;
25274 } else {
25275 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25276 }
25277 }
25278
25279 5 => {
25280 if let Some(dependency_type) = &self.dependency_type {
25281 ::fidl_next::WireEnvelope::encode_value(
25282 dependency_type,
25283 preallocated.encoder,
25284 &mut out,
25285 )?;
25286 } else {
25287 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25288 }
25289 }
25290
25291 4 => {
25292 if let Some(target_name) = &self.target_name {
25293 ::fidl_next::WireEnvelope::encode_value(
25294 target_name,
25295 preallocated.encoder,
25296 &mut out,
25297 )?;
25298 } else {
25299 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25300 }
25301 }
25302
25303 3 => {
25304 if let Some(target) = &self.target {
25305 ::fidl_next::WireEnvelope::encode_value(
25306 target,
25307 preallocated.encoder,
25308 &mut out,
25309 )?;
25310 } else {
25311 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25312 }
25313 }
25314
25315 2 => {
25316 if let Some(source_name) = &self.source_name {
25317 ::fidl_next::WireEnvelope::encode_value(
25318 source_name,
25319 preallocated.encoder,
25320 &mut out,
25321 )?;
25322 } else {
25323 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25324 }
25325 }
25326
25327 1 => {
25328 if let Some(source) = &self.source {
25329 ::fidl_next::WireEnvelope::encode_value(
25330 source,
25331 preallocated.encoder,
25332 &mut out,
25333 )?;
25334 } else {
25335 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25336 }
25337 }
25338
25339 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
25340 }
25341 unsafe {
25342 preallocated.write_next(out.assume_init_ref());
25343 }
25344 }
25345
25346 ::fidl_next::WireTable::encode_len(table, max_ord);
25347
25348 Ok(())
25349 }
25350}
25351
25352impl<'de> ::fidl_next::FromWire<WireOfferDictionary<'de>> for OfferDictionary {
25353 #[inline]
25354 fn from_wire(wire: WireOfferDictionary<'de>) -> Self {
25355 let wire = ::core::mem::ManuallyDrop::new(wire);
25356
25357 let source = wire.table.get(1);
25358
25359 let source_name = wire.table.get(2);
25360
25361 let target = wire.table.get(3);
25362
25363 let target_name = wire.table.get(4);
25364
25365 let dependency_type = wire.table.get(5);
25366
25367 let availability = wire.table.get(6);
25368
25369 let source_dictionary = wire.table.get(7);
25370
25371 Self {
25372 source: source.map(|envelope| {
25373 ::fidl_next::FromWire::from_wire(unsafe {
25374 envelope.read_unchecked::<crate::WireRef<'de>>()
25375 })
25376 }),
25377
25378 source_name: source_name.map(|envelope| {
25379 ::fidl_next::FromWire::from_wire(unsafe {
25380 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25381 })
25382 }),
25383
25384 target: target.map(|envelope| {
25385 ::fidl_next::FromWire::from_wire(unsafe {
25386 envelope.read_unchecked::<crate::WireRef<'de>>()
25387 })
25388 }),
25389
25390 target_name: target_name.map(|envelope| {
25391 ::fidl_next::FromWire::from_wire(unsafe {
25392 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25393 })
25394 }),
25395
25396 dependency_type: dependency_type.map(|envelope| {
25397 ::fidl_next::FromWire::from_wire(unsafe {
25398 envelope.read_unchecked::<crate::WireDependencyType>()
25399 })
25400 }),
25401
25402 availability: availability.map(|envelope| {
25403 ::fidl_next::FromWire::from_wire(unsafe {
25404 envelope.read_unchecked::<crate::WireAvailability>()
25405 })
25406 }),
25407
25408 source_dictionary: source_dictionary.map(|envelope| {
25409 ::fidl_next::FromWire::from_wire(unsafe {
25410 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25411 })
25412 }),
25413 }
25414 }
25415}
25416
25417impl<'de> ::fidl_next::FromWireRef<WireOfferDictionary<'de>> for OfferDictionary {
25418 #[inline]
25419 fn from_wire_ref(wire: &WireOfferDictionary<'de>) -> Self {
25420 Self {
25421 source: wire.table.get(1).map(|envelope| {
25422 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25423 envelope.deref_unchecked::<crate::WireRef<'de>>()
25424 })
25425 }),
25426
25427 source_name: wire.table.get(2).map(|envelope| {
25428 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25429 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
25430 })
25431 }),
25432
25433 target: wire.table.get(3).map(|envelope| {
25434 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25435 envelope.deref_unchecked::<crate::WireRef<'de>>()
25436 })
25437 }),
25438
25439 target_name: wire.table.get(4).map(|envelope| {
25440 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25441 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
25442 })
25443 }),
25444
25445 dependency_type: wire.table.get(5).map(|envelope| {
25446 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25447 envelope.deref_unchecked::<crate::WireDependencyType>()
25448 })
25449 }),
25450
25451 availability: wire.table.get(6).map(|envelope| {
25452 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25453 envelope.deref_unchecked::<crate::WireAvailability>()
25454 })
25455 }),
25456
25457 source_dictionary: wire.table.get(7).map(|envelope| {
25458 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25459 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
25460 })
25461 }),
25462 }
25463 }
25464}
25465
25466#[repr(C)]
25468pub struct WireOfferDictionary<'de> {
25469 table: ::fidl_next::WireTable<'de>,
25470}
25471
25472impl<'de> Drop for WireOfferDictionary<'de> {
25473 fn drop(&mut self) {
25474 let _ = self
25475 .table
25476 .get(1)
25477 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
25478
25479 let _ = self
25480 .table
25481 .get(2)
25482 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
25483
25484 let _ = self
25485 .table
25486 .get(3)
25487 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
25488
25489 let _ = self
25490 .table
25491 .get(4)
25492 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
25493
25494 let _ = self
25495 .table
25496 .get(5)
25497 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDependencyType>() });
25498
25499 let _ = self
25500 .table
25501 .get(6)
25502 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
25503
25504 let _ = self
25505 .table
25506 .get(7)
25507 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
25508 }
25509}
25510
25511unsafe impl ::fidl_next::Wire for WireOfferDictionary<'static> {
25512 type Decoded<'de> = WireOfferDictionary<'de>;
25513
25514 #[inline]
25515 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25516 ::fidl_next::munge!(let Self { table } = out);
25517 ::fidl_next::WireTable::zero_padding(table);
25518 }
25519}
25520
25521unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferDictionary<'static>
25522where
25523 ___D: ::fidl_next::Decoder + ?Sized,
25524{
25525 fn decode(
25526 slot: ::fidl_next::Slot<'_, Self>,
25527 decoder: &mut ___D,
25528 ) -> Result<(), ::fidl_next::DecodeError> {
25529 ::fidl_next::munge!(let Self { table } = slot);
25530
25531 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
25532 match ordinal {
25533 0 => unsafe { ::core::hint::unreachable_unchecked() },
25534
25535 1 => {
25536 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
25537 slot.as_mut(),
25538 decoder,
25539 )?;
25540
25541 Ok(())
25542 }
25543
25544 2 => {
25545 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
25546 slot.as_mut(),
25547 decoder,
25548 )?;
25549
25550 let source_name = unsafe {
25551 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
25552 };
25553
25554 if source_name.len() > 100 {
25555 return Err(::fidl_next::DecodeError::VectorTooLong {
25556 size: source_name.len() as u64,
25557 limit: 100,
25558 });
25559 }
25560
25561 Ok(())
25562 }
25563
25564 3 => {
25565 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
25566 slot.as_mut(),
25567 decoder,
25568 )?;
25569
25570 Ok(())
25571 }
25572
25573 4 => {
25574 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
25575 slot.as_mut(),
25576 decoder,
25577 )?;
25578
25579 let target_name = unsafe {
25580 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
25581 };
25582
25583 if target_name.len() > 100 {
25584 return Err(::fidl_next::DecodeError::VectorTooLong {
25585 size: target_name.len() as u64,
25586 limit: 100,
25587 });
25588 }
25589
25590 Ok(())
25591 }
25592
25593 5 => {
25594 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
25595 slot.as_mut(),
25596 decoder,
25597 )?;
25598
25599 Ok(())
25600 }
25601
25602 6 => {
25603 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
25604 slot.as_mut(),
25605 decoder,
25606 )?;
25607
25608 Ok(())
25609 }
25610
25611 7 => {
25612 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
25613 slot.as_mut(),
25614 decoder,
25615 )?;
25616
25617 let source_dictionary = unsafe {
25618 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
25619 };
25620
25621 if source_dictionary.len() > 1024 {
25622 return Err(::fidl_next::DecodeError::VectorTooLong {
25623 size: source_dictionary.len() as u64,
25624 limit: 1024,
25625 });
25626 }
25627
25628 Ok(())
25629 }
25630
25631 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
25632 }
25633 })
25634 }
25635}
25636
25637impl<'de> WireOfferDictionary<'de> {
25638 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
25639 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
25640 }
25641
25642 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
25643 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
25644 }
25645
25646 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
25647 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
25648 }
25649
25650 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
25651 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
25652 }
25653
25654 pub fn dependency_type(&self) -> Option<&crate::WireDependencyType> {
25655 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
25656 }
25657
25658 pub fn availability(&self) -> Option<&crate::WireAvailability> {
25659 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
25660 }
25661
25662 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
25663 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
25664 }
25665}
25666
25667impl<'de> ::core::fmt::Debug for WireOfferDictionary<'de> {
25668 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
25669 f.debug_struct("OfferDictionary")
25670 .field("source", &self.source())
25671 .field("source_name", &self.source_name())
25672 .field("target", &self.target())
25673 .field("target_name", &self.target_name())
25674 .field("dependency_type", &self.dependency_type())
25675 .field("availability", &self.availability())
25676 .field("source_dictionary", &self.source_dictionary())
25677 .finish()
25678 }
25679}
25680
25681#[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"]
25682#[derive(Clone, Debug, Default)]
25683pub struct OfferConfiguration {
25684 pub source: Option<crate::Ref>,
25685
25686 pub source_name: Option<String>,
25687
25688 pub target: Option<crate::Ref>,
25689
25690 pub target_name: Option<String>,
25691
25692 pub availability: Option<crate::Availability>,
25693
25694 pub source_dictionary: Option<String>,
25695}
25696
25697impl OfferConfiguration {
25698 fn __max_ordinal(&self) -> usize {
25699 if self.source_dictionary.is_some() {
25700 return 6;
25701 }
25702
25703 if self.availability.is_some() {
25704 return 5;
25705 }
25706
25707 if self.target_name.is_some() {
25708 return 4;
25709 }
25710
25711 if self.target.is_some() {
25712 return 3;
25713 }
25714
25715 if self.source_name.is_some() {
25716 return 2;
25717 }
25718
25719 if self.source.is_some() {
25720 return 1;
25721 }
25722
25723 0
25724 }
25725}
25726
25727impl ::fidl_next::Encodable for OfferConfiguration {
25728 type Encoded = WireOfferConfiguration<'static>;
25729}
25730
25731unsafe impl<___E> ::fidl_next::Encode<___E> for OfferConfiguration
25732where
25733 ___E: ::fidl_next::Encoder + ?Sized,
25734{
25735 #[inline]
25736 fn encode(
25737 mut self,
25738 encoder: &mut ___E,
25739 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25740 ) -> Result<(), ::fidl_next::EncodeError> {
25741 ::fidl_next::munge!(let WireOfferConfiguration { table } = out);
25742
25743 let max_ord = self.__max_ordinal();
25744
25745 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
25746 ::fidl_next::Wire::zero_padding(&mut out);
25747
25748 let mut preallocated =
25749 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
25750
25751 for i in 1..=max_ord {
25752 match i {
25753 6 => {
25754 if let Some(source_dictionary) = self.source_dictionary.take() {
25755 ::fidl_next::WireEnvelope::encode_value(
25756 source_dictionary,
25757 preallocated.encoder,
25758 &mut out,
25759 )?;
25760 } else {
25761 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25762 }
25763 }
25764
25765 5 => {
25766 if let Some(availability) = self.availability.take() {
25767 ::fidl_next::WireEnvelope::encode_value(
25768 availability,
25769 preallocated.encoder,
25770 &mut out,
25771 )?;
25772 } else {
25773 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25774 }
25775 }
25776
25777 4 => {
25778 if let Some(target_name) = self.target_name.take() {
25779 ::fidl_next::WireEnvelope::encode_value(
25780 target_name,
25781 preallocated.encoder,
25782 &mut out,
25783 )?;
25784 } else {
25785 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25786 }
25787 }
25788
25789 3 => {
25790 if let Some(target) = self.target.take() {
25791 ::fidl_next::WireEnvelope::encode_value(
25792 target,
25793 preallocated.encoder,
25794 &mut out,
25795 )?;
25796 } else {
25797 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25798 }
25799 }
25800
25801 2 => {
25802 if let Some(source_name) = self.source_name.take() {
25803 ::fidl_next::WireEnvelope::encode_value(
25804 source_name,
25805 preallocated.encoder,
25806 &mut out,
25807 )?;
25808 } else {
25809 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25810 }
25811 }
25812
25813 1 => {
25814 if let Some(source) = self.source.take() {
25815 ::fidl_next::WireEnvelope::encode_value(
25816 source,
25817 preallocated.encoder,
25818 &mut out,
25819 )?;
25820 } else {
25821 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25822 }
25823 }
25824
25825 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
25826 }
25827 unsafe {
25828 preallocated.write_next(out.assume_init_ref());
25829 }
25830 }
25831
25832 ::fidl_next::WireTable::encode_len(table, max_ord);
25833
25834 Ok(())
25835 }
25836}
25837
25838unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferConfiguration
25839where
25840 ___E: ::fidl_next::Encoder + ?Sized,
25841{
25842 #[inline]
25843 fn encode_ref(
25844 &self,
25845 encoder: &mut ___E,
25846 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25847 ) -> Result<(), ::fidl_next::EncodeError> {
25848 ::fidl_next::munge!(let WireOfferConfiguration { table } = out);
25849
25850 let max_ord = self.__max_ordinal();
25851
25852 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
25853 ::fidl_next::Wire::zero_padding(&mut out);
25854
25855 let mut preallocated =
25856 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
25857
25858 for i in 1..=max_ord {
25859 match i {
25860 6 => {
25861 if let Some(source_dictionary) = &self.source_dictionary {
25862 ::fidl_next::WireEnvelope::encode_value(
25863 source_dictionary,
25864 preallocated.encoder,
25865 &mut out,
25866 )?;
25867 } else {
25868 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25869 }
25870 }
25871
25872 5 => {
25873 if let Some(availability) = &self.availability {
25874 ::fidl_next::WireEnvelope::encode_value(
25875 availability,
25876 preallocated.encoder,
25877 &mut out,
25878 )?;
25879 } else {
25880 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25881 }
25882 }
25883
25884 4 => {
25885 if let Some(target_name) = &self.target_name {
25886 ::fidl_next::WireEnvelope::encode_value(
25887 target_name,
25888 preallocated.encoder,
25889 &mut out,
25890 )?;
25891 } else {
25892 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25893 }
25894 }
25895
25896 3 => {
25897 if let Some(target) = &self.target {
25898 ::fidl_next::WireEnvelope::encode_value(
25899 target,
25900 preallocated.encoder,
25901 &mut out,
25902 )?;
25903 } else {
25904 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25905 }
25906 }
25907
25908 2 => {
25909 if let Some(source_name) = &self.source_name {
25910 ::fidl_next::WireEnvelope::encode_value(
25911 source_name,
25912 preallocated.encoder,
25913 &mut out,
25914 )?;
25915 } else {
25916 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25917 }
25918 }
25919
25920 1 => {
25921 if let Some(source) = &self.source {
25922 ::fidl_next::WireEnvelope::encode_value(
25923 source,
25924 preallocated.encoder,
25925 &mut out,
25926 )?;
25927 } else {
25928 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25929 }
25930 }
25931
25932 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
25933 }
25934 unsafe {
25935 preallocated.write_next(out.assume_init_ref());
25936 }
25937 }
25938
25939 ::fidl_next::WireTable::encode_len(table, max_ord);
25940
25941 Ok(())
25942 }
25943}
25944
25945impl<'de> ::fidl_next::FromWire<WireOfferConfiguration<'de>> for OfferConfiguration {
25946 #[inline]
25947 fn from_wire(wire: WireOfferConfiguration<'de>) -> Self {
25948 let wire = ::core::mem::ManuallyDrop::new(wire);
25949
25950 let source = wire.table.get(1);
25951
25952 let source_name = wire.table.get(2);
25953
25954 let target = wire.table.get(3);
25955
25956 let target_name = wire.table.get(4);
25957
25958 let availability = wire.table.get(5);
25959
25960 let source_dictionary = wire.table.get(6);
25961
25962 Self {
25963 source: source.map(|envelope| {
25964 ::fidl_next::FromWire::from_wire(unsafe {
25965 envelope.read_unchecked::<crate::WireRef<'de>>()
25966 })
25967 }),
25968
25969 source_name: source_name.map(|envelope| {
25970 ::fidl_next::FromWire::from_wire(unsafe {
25971 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25972 })
25973 }),
25974
25975 target: target.map(|envelope| {
25976 ::fidl_next::FromWire::from_wire(unsafe {
25977 envelope.read_unchecked::<crate::WireRef<'de>>()
25978 })
25979 }),
25980
25981 target_name: target_name.map(|envelope| {
25982 ::fidl_next::FromWire::from_wire(unsafe {
25983 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25984 })
25985 }),
25986
25987 availability: availability.map(|envelope| {
25988 ::fidl_next::FromWire::from_wire(unsafe {
25989 envelope.read_unchecked::<crate::WireAvailability>()
25990 })
25991 }),
25992
25993 source_dictionary: source_dictionary.map(|envelope| {
25994 ::fidl_next::FromWire::from_wire(unsafe {
25995 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25996 })
25997 }),
25998 }
25999 }
26000}
26001
26002impl<'de> ::fidl_next::FromWireRef<WireOfferConfiguration<'de>> for OfferConfiguration {
26003 #[inline]
26004 fn from_wire_ref(wire: &WireOfferConfiguration<'de>) -> Self {
26005 Self {
26006 source: wire.table.get(1).map(|envelope| {
26007 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26008 envelope.deref_unchecked::<crate::WireRef<'de>>()
26009 })
26010 }),
26011
26012 source_name: wire.table.get(2).map(|envelope| {
26013 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26014 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
26015 })
26016 }),
26017
26018 target: wire.table.get(3).map(|envelope| {
26019 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26020 envelope.deref_unchecked::<crate::WireRef<'de>>()
26021 })
26022 }),
26023
26024 target_name: wire.table.get(4).map(|envelope| {
26025 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26026 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
26027 })
26028 }),
26029
26030 availability: wire.table.get(5).map(|envelope| {
26031 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26032 envelope.deref_unchecked::<crate::WireAvailability>()
26033 })
26034 }),
26035
26036 source_dictionary: wire.table.get(6).map(|envelope| {
26037 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26038 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
26039 })
26040 }),
26041 }
26042 }
26043}
26044
26045#[repr(C)]
26047pub struct WireOfferConfiguration<'de> {
26048 table: ::fidl_next::WireTable<'de>,
26049}
26050
26051impl<'de> Drop for WireOfferConfiguration<'de> {
26052 fn drop(&mut self) {
26053 let _ = self
26054 .table
26055 .get(1)
26056 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
26057
26058 let _ = self
26059 .table
26060 .get(2)
26061 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
26062
26063 let _ = self
26064 .table
26065 .get(3)
26066 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
26067
26068 let _ = self
26069 .table
26070 .get(4)
26071 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
26072
26073 let _ = self
26074 .table
26075 .get(5)
26076 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
26077
26078 let _ = self
26079 .table
26080 .get(6)
26081 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
26082 }
26083}
26084
26085unsafe impl ::fidl_next::Wire for WireOfferConfiguration<'static> {
26086 type Decoded<'de> = WireOfferConfiguration<'de>;
26087
26088 #[inline]
26089 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26090 ::fidl_next::munge!(let Self { table } = out);
26091 ::fidl_next::WireTable::zero_padding(table);
26092 }
26093}
26094
26095unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferConfiguration<'static>
26096where
26097 ___D: ::fidl_next::Decoder + ?Sized,
26098{
26099 fn decode(
26100 slot: ::fidl_next::Slot<'_, Self>,
26101 decoder: &mut ___D,
26102 ) -> Result<(), ::fidl_next::DecodeError> {
26103 ::fidl_next::munge!(let Self { table } = slot);
26104
26105 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
26106 match ordinal {
26107 0 => unsafe { ::core::hint::unreachable_unchecked() },
26108
26109 1 => {
26110 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
26111 slot.as_mut(),
26112 decoder,
26113 )?;
26114
26115 Ok(())
26116 }
26117
26118 2 => {
26119 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
26120 slot.as_mut(),
26121 decoder,
26122 )?;
26123
26124 let source_name = unsafe {
26125 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26126 };
26127
26128 if source_name.len() > 100 {
26129 return Err(::fidl_next::DecodeError::VectorTooLong {
26130 size: source_name.len() as u64,
26131 limit: 100,
26132 });
26133 }
26134
26135 Ok(())
26136 }
26137
26138 3 => {
26139 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
26140 slot.as_mut(),
26141 decoder,
26142 )?;
26143
26144 Ok(())
26145 }
26146
26147 4 => {
26148 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
26149 slot.as_mut(),
26150 decoder,
26151 )?;
26152
26153 let target_name = unsafe {
26154 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26155 };
26156
26157 if target_name.len() > 100 {
26158 return Err(::fidl_next::DecodeError::VectorTooLong {
26159 size: target_name.len() as u64,
26160 limit: 100,
26161 });
26162 }
26163
26164 Ok(())
26165 }
26166
26167 5 => {
26168 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
26169 slot.as_mut(),
26170 decoder,
26171 )?;
26172
26173 Ok(())
26174 }
26175
26176 6 => {
26177 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
26178 slot.as_mut(),
26179 decoder,
26180 )?;
26181
26182 let source_dictionary = unsafe {
26183 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26184 };
26185
26186 if source_dictionary.len() > 1024 {
26187 return Err(::fidl_next::DecodeError::VectorTooLong {
26188 size: source_dictionary.len() as u64,
26189 limit: 1024,
26190 });
26191 }
26192
26193 Ok(())
26194 }
26195
26196 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
26197 }
26198 })
26199 }
26200}
26201
26202impl<'de> WireOfferConfiguration<'de> {
26203 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
26204 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26205 }
26206
26207 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
26208 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
26209 }
26210
26211 pub fn target(&self) -> Option<&crate::WireRef<'de>> {
26212 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
26213 }
26214
26215 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
26216 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
26217 }
26218
26219 pub fn availability(&self) -> Option<&crate::WireAvailability> {
26220 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
26221 }
26222
26223 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString<'de>> {
26224 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
26225 }
26226}
26227
26228impl<'de> ::core::fmt::Debug for WireOfferConfiguration<'de> {
26229 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
26230 f.debug_struct("OfferConfiguration")
26231 .field("source", &self.source())
26232 .field("source_name", &self.source_name())
26233 .field("target", &self.target())
26234 .field("target_name", &self.target_name())
26235 .field("availability", &self.availability())
26236 .field("source_dictionary", &self.source_dictionary())
26237 .finish()
26238 }
26239}
26240
26241#[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"]
26242#[derive(Clone, Debug)]
26243pub enum Offer {
26244 Service(crate::OfferService),
26245
26246 Protocol(crate::OfferProtocol),
26247
26248 Directory(crate::OfferDirectory),
26249
26250 Storage(crate::OfferStorage),
26251
26252 Runner(crate::OfferRunner),
26253
26254 Resolver(crate::OfferResolver),
26255
26256 EventStream(crate::OfferEventStream),
26257
26258 Dictionary(crate::OfferDictionary),
26259
26260 Config(crate::OfferConfiguration),
26261
26262 UnknownOrdinal_(u64),
26263}
26264
26265impl ::fidl_next::Encodable for Offer {
26266 type Encoded = WireOffer<'static>;
26267}
26268
26269unsafe impl<___E> ::fidl_next::Encode<___E> for Offer
26270where
26271 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26272 ___E: ::fidl_next::Encoder,
26273{
26274 #[inline]
26275 fn encode(
26276 self,
26277 encoder: &mut ___E,
26278 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26279 ) -> Result<(), ::fidl_next::EncodeError> {
26280 ::fidl_next::munge!(let WireOffer { raw, _phantom: _ } = out);
26281
26282 match self {
26283 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
26284 ___E,
26285 crate::OfferService,
26286 >(value, 1, encoder, raw)?,
26287
26288 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
26289 ___E,
26290 crate::OfferProtocol,
26291 >(value, 2, encoder, raw)?,
26292
26293 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
26294 ___E,
26295 crate::OfferDirectory,
26296 >(value, 3, encoder, raw)?,
26297
26298 Self::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<
26299 ___E,
26300 crate::OfferStorage,
26301 >(value, 4, encoder, raw)?,
26302
26303 Self::Runner(value) => {
26304 ::fidl_next::RawWireUnion::encode_as::<___E, crate::OfferRunner>(
26305 value, 5, encoder, raw,
26306 )?
26307 }
26308
26309 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
26310 ___E,
26311 crate::OfferResolver,
26312 >(value, 6, encoder, raw)?,
26313
26314 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
26315 ___E,
26316 crate::OfferEventStream,
26317 >(value, 8, encoder, raw)?,
26318
26319 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
26320 ___E,
26321 crate::OfferDictionary,
26322 >(value, 9, encoder, raw)?,
26323
26324 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
26325 ___E,
26326 crate::OfferConfiguration,
26327 >(value, 10, encoder, raw)?,
26328
26329 Self::UnknownOrdinal_(ordinal) => {
26330 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
26331 }
26332 }
26333
26334 Ok(())
26335 }
26336}
26337
26338unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Offer
26339where
26340 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
26341 ___E: ::fidl_next::Encoder,
26342{
26343 #[inline]
26344 fn encode_ref(
26345 &self,
26346 encoder: &mut ___E,
26347 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26348 ) -> Result<(), ::fidl_next::EncodeError> {
26349 ::fidl_next::munge!(let WireOffer { raw, _phantom: _ } = out);
26350
26351 match self {
26352 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
26353 ___E,
26354 &crate::OfferService,
26355 >(value, 1, encoder, raw)?,
26356
26357 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
26358 ___E,
26359 &crate::OfferProtocol,
26360 >(value, 2, encoder, raw)?,
26361
26362 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
26363 ___E,
26364 &crate::OfferDirectory,
26365 >(value, 3, encoder, raw)?,
26366
26367 Self::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<
26368 ___E,
26369 &crate::OfferStorage,
26370 >(value, 4, encoder, raw)?,
26371
26372 Self::Runner(value) => {
26373 ::fidl_next::RawWireUnion::encode_as::<___E, &crate::OfferRunner>(
26374 value, 5, encoder, raw,
26375 )?
26376 }
26377
26378 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
26379 ___E,
26380 &crate::OfferResolver,
26381 >(value, 6, encoder, raw)?,
26382
26383 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
26384 ___E,
26385 &crate::OfferEventStream,
26386 >(value, 8, encoder, raw)?,
26387
26388 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
26389 ___E,
26390 &crate::OfferDictionary,
26391 >(value, 9, encoder, raw)?,
26392
26393 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
26394 ___E,
26395 &crate::OfferConfiguration,
26396 >(value, 10, encoder, raw)?,
26397
26398 Self::UnknownOrdinal_(ordinal) => {
26399 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
26400 }
26401 }
26402
26403 Ok(())
26404 }
26405}
26406
26407impl ::fidl_next::EncodableOption for Offer {
26408 type EncodedOption = WireOptionalOffer<'static>;
26409}
26410
26411unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Offer
26412where
26413 ___E: ?Sized,
26414 Offer: ::fidl_next::Encode<___E>,
26415{
26416 #[inline]
26417 fn encode_option(
26418 this: Option<Self>,
26419 encoder: &mut ___E,
26420 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
26421 ) -> Result<(), ::fidl_next::EncodeError> {
26422 ::fidl_next::munge!(let WireOptionalOffer { raw, _phantom: _ } = &mut *out);
26423
26424 if let Some(inner) = this {
26425 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
26426 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
26427 } else {
26428 ::fidl_next::RawWireUnion::encode_absent(raw);
26429 }
26430
26431 Ok(())
26432 }
26433}
26434
26435unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Offer
26436where
26437 ___E: ?Sized,
26438 Offer: ::fidl_next::EncodeRef<___E>,
26439{
26440 #[inline]
26441 fn encode_option_ref(
26442 this: Option<&Self>,
26443 encoder: &mut ___E,
26444 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
26445 ) -> Result<(), ::fidl_next::EncodeError> {
26446 ::fidl_next::munge!(let WireOptionalOffer { raw, _phantom: _ } = &mut *out);
26447
26448 if let Some(inner) = this {
26449 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
26450 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
26451 } else {
26452 ::fidl_next::RawWireUnion::encode_absent(raw);
26453 }
26454
26455 Ok(())
26456 }
26457}
26458
26459impl<'de> ::fidl_next::FromWire<WireOffer<'de>> for Offer {
26460 #[inline]
26461 fn from_wire(wire: WireOffer<'de>) -> Self {
26462 let wire = ::core::mem::ManuallyDrop::new(wire);
26463 match wire.raw.ordinal() {
26464 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
26465 wire.raw.get().read_unchecked::<crate::WireOfferService<'de>>()
26466 })),
26467
26468 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
26469 wire.raw.get().read_unchecked::<crate::WireOfferProtocol<'de>>()
26470 })),
26471
26472 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
26473 wire.raw.get().read_unchecked::<crate::WireOfferDirectory<'de>>()
26474 })),
26475
26476 4 => Self::Storage(::fidl_next::FromWire::from_wire(unsafe {
26477 wire.raw.get().read_unchecked::<crate::WireOfferStorage<'de>>()
26478 })),
26479
26480 5 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
26481 wire.raw.get().read_unchecked::<crate::WireOfferRunner<'de>>()
26482 })),
26483
26484 6 => Self::Resolver(::fidl_next::FromWire::from_wire(unsafe {
26485 wire.raw.get().read_unchecked::<crate::WireOfferResolver<'de>>()
26486 })),
26487
26488 8 => Self::EventStream(::fidl_next::FromWire::from_wire(unsafe {
26489 wire.raw.get().read_unchecked::<crate::WireOfferEventStream<'de>>()
26490 })),
26491
26492 9 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
26493 wire.raw.get().read_unchecked::<crate::WireOfferDictionary<'de>>()
26494 })),
26495
26496 10 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
26497 wire.raw.get().read_unchecked::<crate::WireOfferConfiguration<'de>>()
26498 })),
26499
26500 _ => unsafe { ::core::hint::unreachable_unchecked() },
26501 }
26502 }
26503}
26504
26505impl<'de> ::fidl_next::FromWireRef<WireOffer<'de>> for Offer {
26506 #[inline]
26507 fn from_wire_ref(wire: &WireOffer<'de>) -> Self {
26508 match wire.raw.ordinal() {
26509 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
26510 wire.raw.get().deref_unchecked::<crate::WireOfferService<'de>>()
26511 })),
26512
26513 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
26514 wire.raw.get().deref_unchecked::<crate::WireOfferProtocol<'de>>()
26515 })),
26516
26517 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
26518 wire.raw.get().deref_unchecked::<crate::WireOfferDirectory<'de>>()
26519 })),
26520
26521 4 => Self::Storage(::fidl_next::FromWireRef::from_wire_ref(unsafe {
26522 wire.raw.get().deref_unchecked::<crate::WireOfferStorage<'de>>()
26523 })),
26524
26525 5 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
26526 wire.raw.get().deref_unchecked::<crate::WireOfferRunner<'de>>()
26527 })),
26528
26529 6 => Self::Resolver(::fidl_next::FromWireRef::from_wire_ref(unsafe {
26530 wire.raw.get().deref_unchecked::<crate::WireOfferResolver<'de>>()
26531 })),
26532
26533 8 => Self::EventStream(::fidl_next::FromWireRef::from_wire_ref(unsafe {
26534 wire.raw.get().deref_unchecked::<crate::WireOfferEventStream<'de>>()
26535 })),
26536
26537 9 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
26538 wire.raw.get().deref_unchecked::<crate::WireOfferDictionary<'de>>()
26539 })),
26540
26541 10 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
26542 wire.raw.get().deref_unchecked::<crate::WireOfferConfiguration<'de>>()
26543 })),
26544
26545 _ => unsafe { ::core::hint::unreachable_unchecked() },
26546 }
26547 }
26548}
26549
26550impl<'de> ::fidl_next::FromWireOption<WireOptionalOffer<'de>> for Box<Offer> {
26551 #[inline]
26552 fn from_wire_option(wire: WireOptionalOffer<'de>) -> Option<Self> {
26553 if let Some(inner) = wire.into_option() {
26554 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
26555 } else {
26556 None
26557 }
26558 }
26559}
26560
26561impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalOffer<'de>> for Box<Offer> {
26562 #[inline]
26563 fn from_wire_option_ref(wire: &WireOptionalOffer<'de>) -> Option<Self> {
26564 if let Some(inner) = wire.as_ref() {
26565 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
26566 } else {
26567 None
26568 }
26569 }
26570}
26571
26572#[repr(transparent)]
26574pub struct WireOffer<'de> {
26575 raw: ::fidl_next::RawWireUnion,
26576 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
26577}
26578
26579impl<'de> Drop for WireOffer<'de> {
26580 fn drop(&mut self) {
26581 match self.raw.ordinal() {
26582 1 => {
26583 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireOfferService<'de>>() };
26584 }
26585
26586 2 => {
26587 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireOfferProtocol<'de>>() };
26588 }
26589
26590 3 => {
26591 let _ =
26592 unsafe { self.raw.get().read_unchecked::<crate::WireOfferDirectory<'de>>() };
26593 }
26594
26595 4 => {
26596 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireOfferStorage<'de>>() };
26597 }
26598
26599 5 => {
26600 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireOfferRunner<'de>>() };
26601 }
26602
26603 6 => {
26604 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireOfferResolver<'de>>() };
26605 }
26606
26607 8 => {
26608 let _ =
26609 unsafe { self.raw.get().read_unchecked::<crate::WireOfferEventStream<'de>>() };
26610 }
26611
26612 9 => {
26613 let _ =
26614 unsafe { self.raw.get().read_unchecked::<crate::WireOfferDictionary<'de>>() };
26615 }
26616
26617 10 => {
26618 let _ = unsafe {
26619 self.raw.get().read_unchecked::<crate::WireOfferConfiguration<'de>>()
26620 };
26621 }
26622
26623 _ => (),
26624 }
26625 }
26626}
26627
26628unsafe impl ::fidl_next::Wire for WireOffer<'static> {
26629 type Decoded<'de> = WireOffer<'de>;
26630
26631 #[inline]
26632 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26633 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
26634 ::fidl_next::RawWireUnion::zero_padding(raw);
26635 }
26636}
26637
26638pub mod offer {
26639 pub enum Ref<'de> {
26640 Service(&'de crate::WireOfferService<'de>),
26641
26642 Protocol(&'de crate::WireOfferProtocol<'de>),
26643
26644 Directory(&'de crate::WireOfferDirectory<'de>),
26645
26646 Storage(&'de crate::WireOfferStorage<'de>),
26647
26648 Runner(&'de crate::WireOfferRunner<'de>),
26649
26650 Resolver(&'de crate::WireOfferResolver<'de>),
26651
26652 EventStream(&'de crate::WireOfferEventStream<'de>),
26653
26654 Dictionary(&'de crate::WireOfferDictionary<'de>),
26655
26656 Config(&'de crate::WireOfferConfiguration<'de>),
26657
26658 UnknownOrdinal_(u64),
26659 }
26660}
26661
26662impl<'de> WireOffer<'de> {
26663 pub fn as_ref(&self) -> crate::offer::Ref<'_> {
26664 match self.raw.ordinal() {
26665 1 => crate::offer::Ref::Service(unsafe {
26666 self.raw.get().deref_unchecked::<crate::WireOfferService<'_>>()
26667 }),
26668
26669 2 => crate::offer::Ref::Protocol(unsafe {
26670 self.raw.get().deref_unchecked::<crate::WireOfferProtocol<'_>>()
26671 }),
26672
26673 3 => crate::offer::Ref::Directory(unsafe {
26674 self.raw.get().deref_unchecked::<crate::WireOfferDirectory<'_>>()
26675 }),
26676
26677 4 => crate::offer::Ref::Storage(unsafe {
26678 self.raw.get().deref_unchecked::<crate::WireOfferStorage<'_>>()
26679 }),
26680
26681 5 => crate::offer::Ref::Runner(unsafe {
26682 self.raw.get().deref_unchecked::<crate::WireOfferRunner<'_>>()
26683 }),
26684
26685 6 => crate::offer::Ref::Resolver(unsafe {
26686 self.raw.get().deref_unchecked::<crate::WireOfferResolver<'_>>()
26687 }),
26688
26689 8 => crate::offer::Ref::EventStream(unsafe {
26690 self.raw.get().deref_unchecked::<crate::WireOfferEventStream<'_>>()
26691 }),
26692
26693 9 => crate::offer::Ref::Dictionary(unsafe {
26694 self.raw.get().deref_unchecked::<crate::WireOfferDictionary<'_>>()
26695 }),
26696
26697 10 => crate::offer::Ref::Config(unsafe {
26698 self.raw.get().deref_unchecked::<crate::WireOfferConfiguration<'_>>()
26699 }),
26700
26701 unknown => crate::offer::Ref::UnknownOrdinal_(unknown),
26702 }
26703 }
26704}
26705
26706unsafe impl<___D> ::fidl_next::Decode<___D> for WireOffer<'static>
26707where
26708 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
26709 ___D: ::fidl_next::Decoder,
26710{
26711 fn decode(
26712 mut slot: ::fidl_next::Slot<'_, Self>,
26713 decoder: &mut ___D,
26714 ) -> Result<(), ::fidl_next::DecodeError> {
26715 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
26716 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
26717 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferService<'static>>(
26718 raw, decoder,
26719 )?,
26720
26721 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferProtocol<'static>>(
26722 raw, decoder,
26723 )?,
26724
26725 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferDirectory<'static>>(
26726 raw, decoder,
26727 )?,
26728
26729 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferStorage<'static>>(
26730 raw, decoder,
26731 )?,
26732
26733 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferRunner<'static>>(
26734 raw, decoder,
26735 )?,
26736
26737 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferResolver<'static>>(
26738 raw, decoder,
26739 )?,
26740
26741 8 => {
26742 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferEventStream<'static>>(
26743 raw, decoder,
26744 )?
26745 }
26746
26747 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferDictionary<'static>>(
26748 raw, decoder,
26749 )?,
26750
26751 10 => ::fidl_next::RawWireUnion::decode_as::<
26752 ___D,
26753 crate::WireOfferConfiguration<'static>,
26754 >(raw, decoder)?,
26755
26756 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
26757 }
26758
26759 Ok(())
26760 }
26761}
26762
26763impl<'de> ::core::fmt::Debug for WireOffer<'de> {
26764 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
26765 match self.raw.ordinal() {
26766 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferService<'_>>().fmt(f) },
26767 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferProtocol<'_>>().fmt(f) },
26768 3 => unsafe {
26769 self.raw.get().deref_unchecked::<crate::WireOfferDirectory<'_>>().fmt(f)
26770 },
26771 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferStorage<'_>>().fmt(f) },
26772 5 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferRunner<'_>>().fmt(f) },
26773 6 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferResolver<'_>>().fmt(f) },
26774 8 => unsafe {
26775 self.raw.get().deref_unchecked::<crate::WireOfferEventStream<'_>>().fmt(f)
26776 },
26777 9 => unsafe {
26778 self.raw.get().deref_unchecked::<crate::WireOfferDictionary<'_>>().fmt(f)
26779 },
26780 10 => unsafe {
26781 self.raw.get().deref_unchecked::<crate::WireOfferConfiguration<'_>>().fmt(f)
26782 },
26783 _ => unsafe { ::core::hint::unreachable_unchecked() },
26784 }
26785 }
26786}
26787
26788#[repr(transparent)]
26789pub struct WireOptionalOffer<'de> {
26790 raw: ::fidl_next::RawWireUnion,
26791 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
26792}
26793
26794unsafe impl ::fidl_next::Wire for WireOptionalOffer<'static> {
26795 type Decoded<'de> = WireOptionalOffer<'de>;
26796
26797 #[inline]
26798 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26799 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
26800 ::fidl_next::RawWireUnion::zero_padding(raw);
26801 }
26802}
26803
26804impl<'de> WireOptionalOffer<'de> {
26805 pub fn is_some(&self) -> bool {
26806 self.raw.is_some()
26807 }
26808
26809 pub fn is_none(&self) -> bool {
26810 self.raw.is_none()
26811 }
26812
26813 pub fn as_ref(&self) -> Option<&WireOffer<'de>> {
26814 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
26815 }
26816
26817 pub fn into_option(self) -> Option<WireOffer<'de>> {
26818 if self.is_some() {
26819 Some(WireOffer { raw: self.raw, _phantom: ::core::marker::PhantomData })
26820 } else {
26821 None
26822 }
26823 }
26824}
26825
26826unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalOffer<'static>
26827where
26828 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
26829 ___D: ::fidl_next::Decoder,
26830{
26831 fn decode(
26832 mut slot: ::fidl_next::Slot<'_, Self>,
26833 decoder: &mut ___D,
26834 ) -> Result<(), ::fidl_next::DecodeError> {
26835 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
26836 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
26837 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferService<'static>>(
26838 raw, decoder,
26839 )?,
26840
26841 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferProtocol<'static>>(
26842 raw, decoder,
26843 )?,
26844
26845 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferDirectory<'static>>(
26846 raw, decoder,
26847 )?,
26848
26849 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferStorage<'static>>(
26850 raw, decoder,
26851 )?,
26852
26853 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferRunner<'static>>(
26854 raw, decoder,
26855 )?,
26856
26857 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferResolver<'static>>(
26858 raw, decoder,
26859 )?,
26860
26861 8 => {
26862 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferEventStream<'static>>(
26863 raw, decoder,
26864 )?
26865 }
26866
26867 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferDictionary<'static>>(
26868 raw, decoder,
26869 )?,
26870
26871 10 => ::fidl_next::RawWireUnion::decode_as::<
26872 ___D,
26873 crate::WireOfferConfiguration<'static>,
26874 >(raw, decoder)?,
26875
26876 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
26877 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
26878 }
26879
26880 Ok(())
26881 }
26882}
26883
26884impl<'de> ::core::fmt::Debug for WireOptionalOffer<'de> {
26885 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
26886 self.as_ref().fmt(f)
26887 }
26888}
26889
26890#[doc = " A repository of the runners available in an environment.\n"]
26891#[derive(Clone, Debug, Default)]
26892pub struct RunnerRegistration {
26893 pub source_name: Option<String>,
26894
26895 pub source: Option<crate::Ref>,
26896
26897 pub target_name: Option<String>,
26898}
26899
26900impl RunnerRegistration {
26901 fn __max_ordinal(&self) -> usize {
26902 if self.target_name.is_some() {
26903 return 3;
26904 }
26905
26906 if self.source.is_some() {
26907 return 2;
26908 }
26909
26910 if self.source_name.is_some() {
26911 return 1;
26912 }
26913
26914 0
26915 }
26916}
26917
26918impl ::fidl_next::Encodable for RunnerRegistration {
26919 type Encoded = WireRunnerRegistration<'static>;
26920}
26921
26922unsafe impl<___E> ::fidl_next::Encode<___E> for RunnerRegistration
26923where
26924 ___E: ::fidl_next::Encoder + ?Sized,
26925{
26926 #[inline]
26927 fn encode(
26928 mut self,
26929 encoder: &mut ___E,
26930 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26931 ) -> Result<(), ::fidl_next::EncodeError> {
26932 ::fidl_next::munge!(let WireRunnerRegistration { table } = out);
26933
26934 let max_ord = self.__max_ordinal();
26935
26936 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
26937 ::fidl_next::Wire::zero_padding(&mut out);
26938
26939 let mut preallocated =
26940 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
26941
26942 for i in 1..=max_ord {
26943 match i {
26944 3 => {
26945 if let Some(target_name) = self.target_name.take() {
26946 ::fidl_next::WireEnvelope::encode_value(
26947 target_name,
26948 preallocated.encoder,
26949 &mut out,
26950 )?;
26951 } else {
26952 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26953 }
26954 }
26955
26956 2 => {
26957 if let Some(source) = self.source.take() {
26958 ::fidl_next::WireEnvelope::encode_value(
26959 source,
26960 preallocated.encoder,
26961 &mut out,
26962 )?;
26963 } else {
26964 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26965 }
26966 }
26967
26968 1 => {
26969 if let Some(source_name) = self.source_name.take() {
26970 ::fidl_next::WireEnvelope::encode_value(
26971 source_name,
26972 preallocated.encoder,
26973 &mut out,
26974 )?;
26975 } else {
26976 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26977 }
26978 }
26979
26980 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
26981 }
26982 unsafe {
26983 preallocated.write_next(out.assume_init_ref());
26984 }
26985 }
26986
26987 ::fidl_next::WireTable::encode_len(table, max_ord);
26988
26989 Ok(())
26990 }
26991}
26992
26993unsafe impl<___E> ::fidl_next::EncodeRef<___E> for RunnerRegistration
26994where
26995 ___E: ::fidl_next::Encoder + ?Sized,
26996{
26997 #[inline]
26998 fn encode_ref(
26999 &self,
27000 encoder: &mut ___E,
27001 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27002 ) -> Result<(), ::fidl_next::EncodeError> {
27003 ::fidl_next::munge!(let WireRunnerRegistration { table } = out);
27004
27005 let max_ord = self.__max_ordinal();
27006
27007 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
27008 ::fidl_next::Wire::zero_padding(&mut out);
27009
27010 let mut preallocated =
27011 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
27012
27013 for i in 1..=max_ord {
27014 match i {
27015 3 => {
27016 if let Some(target_name) = &self.target_name {
27017 ::fidl_next::WireEnvelope::encode_value(
27018 target_name,
27019 preallocated.encoder,
27020 &mut out,
27021 )?;
27022 } else {
27023 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27024 }
27025 }
27026
27027 2 => {
27028 if let Some(source) = &self.source {
27029 ::fidl_next::WireEnvelope::encode_value(
27030 source,
27031 preallocated.encoder,
27032 &mut out,
27033 )?;
27034 } else {
27035 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27036 }
27037 }
27038
27039 1 => {
27040 if let Some(source_name) = &self.source_name {
27041 ::fidl_next::WireEnvelope::encode_value(
27042 source_name,
27043 preallocated.encoder,
27044 &mut out,
27045 )?;
27046 } else {
27047 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27048 }
27049 }
27050
27051 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
27052 }
27053 unsafe {
27054 preallocated.write_next(out.assume_init_ref());
27055 }
27056 }
27057
27058 ::fidl_next::WireTable::encode_len(table, max_ord);
27059
27060 Ok(())
27061 }
27062}
27063
27064impl<'de> ::fidl_next::FromWire<WireRunnerRegistration<'de>> for RunnerRegistration {
27065 #[inline]
27066 fn from_wire(wire: WireRunnerRegistration<'de>) -> Self {
27067 let wire = ::core::mem::ManuallyDrop::new(wire);
27068
27069 let source_name = wire.table.get(1);
27070
27071 let source = wire.table.get(2);
27072
27073 let target_name = wire.table.get(3);
27074
27075 Self {
27076 source_name: source_name.map(|envelope| {
27077 ::fidl_next::FromWire::from_wire(unsafe {
27078 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27079 })
27080 }),
27081
27082 source: source.map(|envelope| {
27083 ::fidl_next::FromWire::from_wire(unsafe {
27084 envelope.read_unchecked::<crate::WireRef<'de>>()
27085 })
27086 }),
27087
27088 target_name: target_name.map(|envelope| {
27089 ::fidl_next::FromWire::from_wire(unsafe {
27090 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27091 })
27092 }),
27093 }
27094 }
27095}
27096
27097impl<'de> ::fidl_next::FromWireRef<WireRunnerRegistration<'de>> for RunnerRegistration {
27098 #[inline]
27099 fn from_wire_ref(wire: &WireRunnerRegistration<'de>) -> Self {
27100 Self {
27101 source_name: wire.table.get(1).map(|envelope| {
27102 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
27103 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
27104 })
27105 }),
27106
27107 source: wire.table.get(2).map(|envelope| {
27108 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
27109 envelope.deref_unchecked::<crate::WireRef<'de>>()
27110 })
27111 }),
27112
27113 target_name: wire.table.get(3).map(|envelope| {
27114 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
27115 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
27116 })
27117 }),
27118 }
27119 }
27120}
27121
27122#[repr(C)]
27124pub struct WireRunnerRegistration<'de> {
27125 table: ::fidl_next::WireTable<'de>,
27126}
27127
27128impl<'de> Drop for WireRunnerRegistration<'de> {
27129 fn drop(&mut self) {
27130 let _ = self
27131 .table
27132 .get(1)
27133 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
27134
27135 let _ = self
27136 .table
27137 .get(2)
27138 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
27139
27140 let _ = self
27141 .table
27142 .get(3)
27143 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
27144 }
27145}
27146
27147unsafe impl ::fidl_next::Wire for WireRunnerRegistration<'static> {
27148 type Decoded<'de> = WireRunnerRegistration<'de>;
27149
27150 #[inline]
27151 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27152 ::fidl_next::munge!(let Self { table } = out);
27153 ::fidl_next::WireTable::zero_padding(table);
27154 }
27155}
27156
27157unsafe impl<___D> ::fidl_next::Decode<___D> for WireRunnerRegistration<'static>
27158where
27159 ___D: ::fidl_next::Decoder + ?Sized,
27160{
27161 fn decode(
27162 slot: ::fidl_next::Slot<'_, Self>,
27163 decoder: &mut ___D,
27164 ) -> Result<(), ::fidl_next::DecodeError> {
27165 ::fidl_next::munge!(let Self { table } = slot);
27166
27167 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27168 match ordinal {
27169 0 => unsafe { ::core::hint::unreachable_unchecked() },
27170
27171 1 => {
27172 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
27173 slot.as_mut(),
27174 decoder,
27175 )?;
27176
27177 let source_name = unsafe {
27178 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27179 };
27180
27181 if source_name.len() > 100 {
27182 return Err(::fidl_next::DecodeError::VectorTooLong {
27183 size: source_name.len() as u64,
27184 limit: 100,
27185 });
27186 }
27187
27188 Ok(())
27189 }
27190
27191 2 => {
27192 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
27193 slot.as_mut(),
27194 decoder,
27195 )?;
27196
27197 Ok(())
27198 }
27199
27200 3 => {
27201 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
27202 slot.as_mut(),
27203 decoder,
27204 )?;
27205
27206 let target_name = unsafe {
27207 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27208 };
27209
27210 if target_name.len() > 100 {
27211 return Err(::fidl_next::DecodeError::VectorTooLong {
27212 size: target_name.len() as u64,
27213 limit: 100,
27214 });
27215 }
27216
27217 Ok(())
27218 }
27219
27220 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
27221 }
27222 })
27223 }
27224}
27225
27226impl<'de> WireRunnerRegistration<'de> {
27227 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
27228 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27229 }
27230
27231 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
27232 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27233 }
27234
27235 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
27236 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27237 }
27238}
27239
27240impl<'de> ::core::fmt::Debug for WireRunnerRegistration<'de> {
27241 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
27242 f.debug_struct("RunnerRegistration")
27243 .field("source_name", &self.source_name())
27244 .field("source", &self.source())
27245 .field("target_name", &self.target_name())
27246 .finish()
27247 }
27248}
27249
27250#[doc = " A mapping of URL scheme to resolver name.\n"]
27251#[derive(Clone, Debug, Default)]
27252pub struct ResolverRegistration {
27253 pub resolver: Option<String>,
27254
27255 pub source: Option<crate::Ref>,
27256
27257 pub scheme: Option<String>,
27258}
27259
27260impl ResolverRegistration {
27261 fn __max_ordinal(&self) -> usize {
27262 if self.scheme.is_some() {
27263 return 3;
27264 }
27265
27266 if self.source.is_some() {
27267 return 2;
27268 }
27269
27270 if self.resolver.is_some() {
27271 return 1;
27272 }
27273
27274 0
27275 }
27276}
27277
27278impl ::fidl_next::Encodable for ResolverRegistration {
27279 type Encoded = WireResolverRegistration<'static>;
27280}
27281
27282unsafe impl<___E> ::fidl_next::Encode<___E> for ResolverRegistration
27283where
27284 ___E: ::fidl_next::Encoder + ?Sized,
27285{
27286 #[inline]
27287 fn encode(
27288 mut self,
27289 encoder: &mut ___E,
27290 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27291 ) -> Result<(), ::fidl_next::EncodeError> {
27292 ::fidl_next::munge!(let WireResolverRegistration { table } = out);
27293
27294 let max_ord = self.__max_ordinal();
27295
27296 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
27297 ::fidl_next::Wire::zero_padding(&mut out);
27298
27299 let mut preallocated =
27300 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
27301
27302 for i in 1..=max_ord {
27303 match i {
27304 3 => {
27305 if let Some(scheme) = self.scheme.take() {
27306 ::fidl_next::WireEnvelope::encode_value(
27307 scheme,
27308 preallocated.encoder,
27309 &mut out,
27310 )?;
27311 } else {
27312 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27313 }
27314 }
27315
27316 2 => {
27317 if let Some(source) = self.source.take() {
27318 ::fidl_next::WireEnvelope::encode_value(
27319 source,
27320 preallocated.encoder,
27321 &mut out,
27322 )?;
27323 } else {
27324 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27325 }
27326 }
27327
27328 1 => {
27329 if let Some(resolver) = self.resolver.take() {
27330 ::fidl_next::WireEnvelope::encode_value(
27331 resolver,
27332 preallocated.encoder,
27333 &mut out,
27334 )?;
27335 } else {
27336 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27337 }
27338 }
27339
27340 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
27341 }
27342 unsafe {
27343 preallocated.write_next(out.assume_init_ref());
27344 }
27345 }
27346
27347 ::fidl_next::WireTable::encode_len(table, max_ord);
27348
27349 Ok(())
27350 }
27351}
27352
27353unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ResolverRegistration
27354where
27355 ___E: ::fidl_next::Encoder + ?Sized,
27356{
27357 #[inline]
27358 fn encode_ref(
27359 &self,
27360 encoder: &mut ___E,
27361 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27362 ) -> Result<(), ::fidl_next::EncodeError> {
27363 ::fidl_next::munge!(let WireResolverRegistration { table } = out);
27364
27365 let max_ord = self.__max_ordinal();
27366
27367 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
27368 ::fidl_next::Wire::zero_padding(&mut out);
27369
27370 let mut preallocated =
27371 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
27372
27373 for i in 1..=max_ord {
27374 match i {
27375 3 => {
27376 if let Some(scheme) = &self.scheme {
27377 ::fidl_next::WireEnvelope::encode_value(
27378 scheme,
27379 preallocated.encoder,
27380 &mut out,
27381 )?;
27382 } else {
27383 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27384 }
27385 }
27386
27387 2 => {
27388 if let Some(source) = &self.source {
27389 ::fidl_next::WireEnvelope::encode_value(
27390 source,
27391 preallocated.encoder,
27392 &mut out,
27393 )?;
27394 } else {
27395 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27396 }
27397 }
27398
27399 1 => {
27400 if let Some(resolver) = &self.resolver {
27401 ::fidl_next::WireEnvelope::encode_value(
27402 resolver,
27403 preallocated.encoder,
27404 &mut out,
27405 )?;
27406 } else {
27407 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27408 }
27409 }
27410
27411 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
27412 }
27413 unsafe {
27414 preallocated.write_next(out.assume_init_ref());
27415 }
27416 }
27417
27418 ::fidl_next::WireTable::encode_len(table, max_ord);
27419
27420 Ok(())
27421 }
27422}
27423
27424impl<'de> ::fidl_next::FromWire<WireResolverRegistration<'de>> for ResolverRegistration {
27425 #[inline]
27426 fn from_wire(wire: WireResolverRegistration<'de>) -> Self {
27427 let wire = ::core::mem::ManuallyDrop::new(wire);
27428
27429 let resolver = wire.table.get(1);
27430
27431 let source = wire.table.get(2);
27432
27433 let scheme = wire.table.get(3);
27434
27435 Self {
27436 resolver: resolver.map(|envelope| {
27437 ::fidl_next::FromWire::from_wire(unsafe {
27438 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27439 })
27440 }),
27441
27442 source: source.map(|envelope| {
27443 ::fidl_next::FromWire::from_wire(unsafe {
27444 envelope.read_unchecked::<crate::WireRef<'de>>()
27445 })
27446 }),
27447
27448 scheme: scheme.map(|envelope| {
27449 ::fidl_next::FromWire::from_wire(unsafe {
27450 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27451 })
27452 }),
27453 }
27454 }
27455}
27456
27457impl<'de> ::fidl_next::FromWireRef<WireResolverRegistration<'de>> for ResolverRegistration {
27458 #[inline]
27459 fn from_wire_ref(wire: &WireResolverRegistration<'de>) -> Self {
27460 Self {
27461 resolver: wire.table.get(1).map(|envelope| {
27462 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
27463 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
27464 })
27465 }),
27466
27467 source: wire.table.get(2).map(|envelope| {
27468 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
27469 envelope.deref_unchecked::<crate::WireRef<'de>>()
27470 })
27471 }),
27472
27473 scheme: wire.table.get(3).map(|envelope| {
27474 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
27475 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
27476 })
27477 }),
27478 }
27479 }
27480}
27481
27482#[repr(C)]
27484pub struct WireResolverRegistration<'de> {
27485 table: ::fidl_next::WireTable<'de>,
27486}
27487
27488impl<'de> Drop for WireResolverRegistration<'de> {
27489 fn drop(&mut self) {
27490 let _ = self
27491 .table
27492 .get(1)
27493 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
27494
27495 let _ = self
27496 .table
27497 .get(2)
27498 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
27499
27500 let _ = self
27501 .table
27502 .get(3)
27503 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
27504 }
27505}
27506
27507unsafe impl ::fidl_next::Wire for WireResolverRegistration<'static> {
27508 type Decoded<'de> = WireResolverRegistration<'de>;
27509
27510 #[inline]
27511 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27512 ::fidl_next::munge!(let Self { table } = out);
27513 ::fidl_next::WireTable::zero_padding(table);
27514 }
27515}
27516
27517unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolverRegistration<'static>
27518where
27519 ___D: ::fidl_next::Decoder + ?Sized,
27520{
27521 fn decode(
27522 slot: ::fidl_next::Slot<'_, Self>,
27523 decoder: &mut ___D,
27524 ) -> Result<(), ::fidl_next::DecodeError> {
27525 ::fidl_next::munge!(let Self { table } = slot);
27526
27527 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27528 match ordinal {
27529 0 => unsafe { ::core::hint::unreachable_unchecked() },
27530
27531 1 => {
27532 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
27533 slot.as_mut(),
27534 decoder,
27535 )?;
27536
27537 let resolver = unsafe {
27538 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27539 };
27540
27541 if resolver.len() > 100 {
27542 return Err(::fidl_next::DecodeError::VectorTooLong {
27543 size: resolver.len() as u64,
27544 limit: 100,
27545 });
27546 }
27547
27548 Ok(())
27549 }
27550
27551 2 => {
27552 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
27553 slot.as_mut(),
27554 decoder,
27555 )?;
27556
27557 Ok(())
27558 }
27559
27560 3 => {
27561 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
27562 slot.as_mut(),
27563 decoder,
27564 )?;
27565
27566 let scheme = unsafe {
27567 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27568 };
27569
27570 if scheme.len() > 100 {
27571 return Err(::fidl_next::DecodeError::VectorTooLong {
27572 size: scheme.len() as u64,
27573 limit: 100,
27574 });
27575 }
27576
27577 Ok(())
27578 }
27579
27580 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
27581 }
27582 })
27583 }
27584}
27585
27586impl<'de> WireResolverRegistration<'de> {
27587 pub fn resolver(&self) -> Option<&::fidl_next::WireString<'de>> {
27588 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27589 }
27590
27591 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
27592 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27593 }
27594
27595 pub fn scheme(&self) -> Option<&::fidl_next::WireString<'de>> {
27596 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27597 }
27598}
27599
27600impl<'de> ::core::fmt::Debug for WireResolverRegistration<'de> {
27601 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
27602 f.debug_struct("ResolverRegistration")
27603 .field("resolver", &self.resolver())
27604 .field("source", &self.source())
27605 .field("scheme", &self.scheme())
27606 .finish()
27607 }
27608}
27609
27610#[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"]
27611#[derive(Clone, Debug, Default)]
27612pub struct DebugProtocolRegistration {
27613 pub source: Option<crate::Ref>,
27614
27615 pub source_name: Option<String>,
27616
27617 pub target_name: Option<String>,
27618}
27619
27620impl DebugProtocolRegistration {
27621 fn __max_ordinal(&self) -> usize {
27622 if self.target_name.is_some() {
27623 return 3;
27624 }
27625
27626 if self.source_name.is_some() {
27627 return 2;
27628 }
27629
27630 if self.source.is_some() {
27631 return 1;
27632 }
27633
27634 0
27635 }
27636}
27637
27638impl ::fidl_next::Encodable for DebugProtocolRegistration {
27639 type Encoded = WireDebugProtocolRegistration<'static>;
27640}
27641
27642unsafe impl<___E> ::fidl_next::Encode<___E> for DebugProtocolRegistration
27643where
27644 ___E: ::fidl_next::Encoder + ?Sized,
27645{
27646 #[inline]
27647 fn encode(
27648 mut self,
27649 encoder: &mut ___E,
27650 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27651 ) -> Result<(), ::fidl_next::EncodeError> {
27652 ::fidl_next::munge!(let WireDebugProtocolRegistration { table } = out);
27653
27654 let max_ord = self.__max_ordinal();
27655
27656 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
27657 ::fidl_next::Wire::zero_padding(&mut out);
27658
27659 let mut preallocated =
27660 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
27661
27662 for i in 1..=max_ord {
27663 match i {
27664 3 => {
27665 if let Some(target_name) = self.target_name.take() {
27666 ::fidl_next::WireEnvelope::encode_value(
27667 target_name,
27668 preallocated.encoder,
27669 &mut out,
27670 )?;
27671 } else {
27672 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27673 }
27674 }
27675
27676 2 => {
27677 if let Some(source_name) = self.source_name.take() {
27678 ::fidl_next::WireEnvelope::encode_value(
27679 source_name,
27680 preallocated.encoder,
27681 &mut out,
27682 )?;
27683 } else {
27684 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27685 }
27686 }
27687
27688 1 => {
27689 if let Some(source) = self.source.take() {
27690 ::fidl_next::WireEnvelope::encode_value(
27691 source,
27692 preallocated.encoder,
27693 &mut out,
27694 )?;
27695 } else {
27696 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27697 }
27698 }
27699
27700 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
27701 }
27702 unsafe {
27703 preallocated.write_next(out.assume_init_ref());
27704 }
27705 }
27706
27707 ::fidl_next::WireTable::encode_len(table, max_ord);
27708
27709 Ok(())
27710 }
27711}
27712
27713unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DebugProtocolRegistration
27714where
27715 ___E: ::fidl_next::Encoder + ?Sized,
27716{
27717 #[inline]
27718 fn encode_ref(
27719 &self,
27720 encoder: &mut ___E,
27721 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27722 ) -> Result<(), ::fidl_next::EncodeError> {
27723 ::fidl_next::munge!(let WireDebugProtocolRegistration { table } = out);
27724
27725 let max_ord = self.__max_ordinal();
27726
27727 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
27728 ::fidl_next::Wire::zero_padding(&mut out);
27729
27730 let mut preallocated =
27731 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
27732
27733 for i in 1..=max_ord {
27734 match i {
27735 3 => {
27736 if let Some(target_name) = &self.target_name {
27737 ::fidl_next::WireEnvelope::encode_value(
27738 target_name,
27739 preallocated.encoder,
27740 &mut out,
27741 )?;
27742 } else {
27743 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27744 }
27745 }
27746
27747 2 => {
27748 if let Some(source_name) = &self.source_name {
27749 ::fidl_next::WireEnvelope::encode_value(
27750 source_name,
27751 preallocated.encoder,
27752 &mut out,
27753 )?;
27754 } else {
27755 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27756 }
27757 }
27758
27759 1 => {
27760 if let Some(source) = &self.source {
27761 ::fidl_next::WireEnvelope::encode_value(
27762 source,
27763 preallocated.encoder,
27764 &mut out,
27765 )?;
27766 } else {
27767 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27768 }
27769 }
27770
27771 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
27772 }
27773 unsafe {
27774 preallocated.write_next(out.assume_init_ref());
27775 }
27776 }
27777
27778 ::fidl_next::WireTable::encode_len(table, max_ord);
27779
27780 Ok(())
27781 }
27782}
27783
27784impl<'de> ::fidl_next::FromWire<WireDebugProtocolRegistration<'de>> for DebugProtocolRegistration {
27785 #[inline]
27786 fn from_wire(wire: WireDebugProtocolRegistration<'de>) -> Self {
27787 let wire = ::core::mem::ManuallyDrop::new(wire);
27788
27789 let source = wire.table.get(1);
27790
27791 let source_name = wire.table.get(2);
27792
27793 let target_name = wire.table.get(3);
27794
27795 Self {
27796 source: source.map(|envelope| {
27797 ::fidl_next::FromWire::from_wire(unsafe {
27798 envelope.read_unchecked::<crate::WireRef<'de>>()
27799 })
27800 }),
27801
27802 source_name: source_name.map(|envelope| {
27803 ::fidl_next::FromWire::from_wire(unsafe {
27804 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27805 })
27806 }),
27807
27808 target_name: target_name.map(|envelope| {
27809 ::fidl_next::FromWire::from_wire(unsafe {
27810 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27811 })
27812 }),
27813 }
27814 }
27815}
27816
27817impl<'de> ::fidl_next::FromWireRef<WireDebugProtocolRegistration<'de>>
27818 for DebugProtocolRegistration
27819{
27820 #[inline]
27821 fn from_wire_ref(wire: &WireDebugProtocolRegistration<'de>) -> Self {
27822 Self {
27823 source: wire.table.get(1).map(|envelope| {
27824 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
27825 envelope.deref_unchecked::<crate::WireRef<'de>>()
27826 })
27827 }),
27828
27829 source_name: wire.table.get(2).map(|envelope| {
27830 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
27831 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
27832 })
27833 }),
27834
27835 target_name: wire.table.get(3).map(|envelope| {
27836 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
27837 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
27838 })
27839 }),
27840 }
27841 }
27842}
27843
27844#[repr(C)]
27846pub struct WireDebugProtocolRegistration<'de> {
27847 table: ::fidl_next::WireTable<'de>,
27848}
27849
27850impl<'de> Drop for WireDebugProtocolRegistration<'de> {
27851 fn drop(&mut self) {
27852 let _ = self
27853 .table
27854 .get(1)
27855 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
27856
27857 let _ = self
27858 .table
27859 .get(2)
27860 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
27861
27862 let _ = self
27863 .table
27864 .get(3)
27865 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
27866 }
27867}
27868
27869unsafe impl ::fidl_next::Wire for WireDebugProtocolRegistration<'static> {
27870 type Decoded<'de> = WireDebugProtocolRegistration<'de>;
27871
27872 #[inline]
27873 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27874 ::fidl_next::munge!(let Self { table } = out);
27875 ::fidl_next::WireTable::zero_padding(table);
27876 }
27877}
27878
27879unsafe impl<___D> ::fidl_next::Decode<___D> for WireDebugProtocolRegistration<'static>
27880where
27881 ___D: ::fidl_next::Decoder + ?Sized,
27882{
27883 fn decode(
27884 slot: ::fidl_next::Slot<'_, Self>,
27885 decoder: &mut ___D,
27886 ) -> Result<(), ::fidl_next::DecodeError> {
27887 ::fidl_next::munge!(let Self { table } = slot);
27888
27889 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27890 match ordinal {
27891 0 => unsafe { ::core::hint::unreachable_unchecked() },
27892
27893 1 => {
27894 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
27895 slot.as_mut(),
27896 decoder,
27897 )?;
27898
27899 Ok(())
27900 }
27901
27902 2 => {
27903 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
27904 slot.as_mut(),
27905 decoder,
27906 )?;
27907
27908 let source_name = unsafe {
27909 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27910 };
27911
27912 if source_name.len() > 100 {
27913 return Err(::fidl_next::DecodeError::VectorTooLong {
27914 size: source_name.len() as u64,
27915 limit: 100,
27916 });
27917 }
27918
27919 Ok(())
27920 }
27921
27922 3 => {
27923 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
27924 slot.as_mut(),
27925 decoder,
27926 )?;
27927
27928 let target_name = unsafe {
27929 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27930 };
27931
27932 if target_name.len() > 100 {
27933 return Err(::fidl_next::DecodeError::VectorTooLong {
27934 size: target_name.len() as u64,
27935 limit: 100,
27936 });
27937 }
27938
27939 Ok(())
27940 }
27941
27942 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
27943 }
27944 })
27945 }
27946}
27947
27948impl<'de> WireDebugProtocolRegistration<'de> {
27949 pub fn source(&self) -> Option<&crate::WireRef<'de>> {
27950 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27951 }
27952
27953 pub fn source_name(&self) -> Option<&::fidl_next::WireString<'de>> {
27954 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27955 }
27956
27957 pub fn target_name(&self) -> Option<&::fidl_next::WireString<'de>> {
27958 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27959 }
27960}
27961
27962impl<'de> ::core::fmt::Debug for WireDebugProtocolRegistration<'de> {
27963 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
27964 f.debug_struct("DebugProtocolRegistration")
27965 .field("source", &self.source())
27966 .field("source_name", &self.source_name())
27967 .field("target_name", &self.target_name())
27968 .finish()
27969 }
27970}
27971
27972#[doc = " Declares a capability registered in the debug section of an environment.\n"]
27973#[derive(Clone, Debug)]
27974pub enum DebugRegistration {
27975 Protocol(crate::DebugProtocolRegistration),
27976
27977 UnknownOrdinal_(u64),
27978}
27979
27980impl ::fidl_next::Encodable for DebugRegistration {
27981 type Encoded = WireDebugRegistration<'static>;
27982}
27983
27984unsafe impl<___E> ::fidl_next::Encode<___E> for DebugRegistration
27985where
27986 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27987 ___E: ::fidl_next::Encoder,
27988{
27989 #[inline]
27990 fn encode(
27991 self,
27992 encoder: &mut ___E,
27993 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27994 ) -> Result<(), ::fidl_next::EncodeError> {
27995 ::fidl_next::munge!(let WireDebugRegistration { raw, _phantom: _ } = out);
27996
27997 match self {
27998 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
27999 ___E,
28000 crate::DebugProtocolRegistration,
28001 >(value, 1, encoder, raw)?,
28002
28003 Self::UnknownOrdinal_(ordinal) => {
28004 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
28005 }
28006 }
28007
28008 Ok(())
28009 }
28010}
28011
28012unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DebugRegistration
28013where
28014 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
28015 ___E: ::fidl_next::Encoder,
28016{
28017 #[inline]
28018 fn encode_ref(
28019 &self,
28020 encoder: &mut ___E,
28021 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28022 ) -> Result<(), ::fidl_next::EncodeError> {
28023 ::fidl_next::munge!(let WireDebugRegistration { raw, _phantom: _ } = out);
28024
28025 match self {
28026 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
28027 ___E,
28028 &crate::DebugProtocolRegistration,
28029 >(value, 1, encoder, raw)?,
28030
28031 Self::UnknownOrdinal_(ordinal) => {
28032 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
28033 }
28034 }
28035
28036 Ok(())
28037 }
28038}
28039
28040impl ::fidl_next::EncodableOption for DebugRegistration {
28041 type EncodedOption = WireOptionalDebugRegistration<'static>;
28042}
28043
28044unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DebugRegistration
28045where
28046 ___E: ?Sized,
28047 DebugRegistration: ::fidl_next::Encode<___E>,
28048{
28049 #[inline]
28050 fn encode_option(
28051 this: Option<Self>,
28052 encoder: &mut ___E,
28053 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
28054 ) -> Result<(), ::fidl_next::EncodeError> {
28055 ::fidl_next::munge!(let WireOptionalDebugRegistration { raw, _phantom: _ } = &mut *out);
28056
28057 if let Some(inner) = this {
28058 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
28059 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
28060 } else {
28061 ::fidl_next::RawWireUnion::encode_absent(raw);
28062 }
28063
28064 Ok(())
28065 }
28066}
28067
28068unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DebugRegistration
28069where
28070 ___E: ?Sized,
28071 DebugRegistration: ::fidl_next::EncodeRef<___E>,
28072{
28073 #[inline]
28074 fn encode_option_ref(
28075 this: Option<&Self>,
28076 encoder: &mut ___E,
28077 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
28078 ) -> Result<(), ::fidl_next::EncodeError> {
28079 ::fidl_next::munge!(let WireOptionalDebugRegistration { raw, _phantom: _ } = &mut *out);
28080
28081 if let Some(inner) = this {
28082 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
28083 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
28084 } else {
28085 ::fidl_next::RawWireUnion::encode_absent(raw);
28086 }
28087
28088 Ok(())
28089 }
28090}
28091
28092impl<'de> ::fidl_next::FromWire<WireDebugRegistration<'de>> for DebugRegistration {
28093 #[inline]
28094 fn from_wire(wire: WireDebugRegistration<'de>) -> Self {
28095 let wire = ::core::mem::ManuallyDrop::new(wire);
28096 match wire.raw.ordinal() {
28097 1 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
28098 wire.raw.get().read_unchecked::<crate::WireDebugProtocolRegistration<'de>>()
28099 })),
28100
28101 _ => unsafe { ::core::hint::unreachable_unchecked() },
28102 }
28103 }
28104}
28105
28106impl<'de> ::fidl_next::FromWireRef<WireDebugRegistration<'de>> for DebugRegistration {
28107 #[inline]
28108 fn from_wire_ref(wire: &WireDebugRegistration<'de>) -> Self {
28109 match wire.raw.ordinal() {
28110 1 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
28111 wire.raw.get().deref_unchecked::<crate::WireDebugProtocolRegistration<'de>>()
28112 })),
28113
28114 _ => unsafe { ::core::hint::unreachable_unchecked() },
28115 }
28116 }
28117}
28118
28119impl<'de> ::fidl_next::FromWireOption<WireOptionalDebugRegistration<'de>>
28120 for Box<DebugRegistration>
28121{
28122 #[inline]
28123 fn from_wire_option(wire: WireOptionalDebugRegistration<'de>) -> Option<Self> {
28124 if let Some(inner) = wire.into_option() {
28125 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
28126 } else {
28127 None
28128 }
28129 }
28130}
28131
28132impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalDebugRegistration<'de>>
28133 for Box<DebugRegistration>
28134{
28135 #[inline]
28136 fn from_wire_option_ref(wire: &WireOptionalDebugRegistration<'de>) -> Option<Self> {
28137 if let Some(inner) = wire.as_ref() {
28138 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
28139 } else {
28140 None
28141 }
28142 }
28143}
28144
28145#[repr(transparent)]
28147pub struct WireDebugRegistration<'de> {
28148 raw: ::fidl_next::RawWireUnion,
28149 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
28150}
28151
28152impl<'de> Drop for WireDebugRegistration<'de> {
28153 fn drop(&mut self) {
28154 match self.raw.ordinal() {
28155 1 => {
28156 let _ = unsafe {
28157 self.raw.get().read_unchecked::<crate::WireDebugProtocolRegistration<'de>>()
28158 };
28159 }
28160
28161 _ => (),
28162 }
28163 }
28164}
28165
28166unsafe impl ::fidl_next::Wire for WireDebugRegistration<'static> {
28167 type Decoded<'de> = WireDebugRegistration<'de>;
28168
28169 #[inline]
28170 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28171 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
28172 ::fidl_next::RawWireUnion::zero_padding(raw);
28173 }
28174}
28175
28176pub mod debug_registration {
28177 pub enum Ref<'de> {
28178 Protocol(&'de crate::WireDebugProtocolRegistration<'de>),
28179
28180 UnknownOrdinal_(u64),
28181 }
28182}
28183
28184impl<'de> WireDebugRegistration<'de> {
28185 pub fn as_ref(&self) -> crate::debug_registration::Ref<'_> {
28186 match self.raw.ordinal() {
28187 1 => crate::debug_registration::Ref::Protocol(unsafe {
28188 self.raw.get().deref_unchecked::<crate::WireDebugProtocolRegistration<'_>>()
28189 }),
28190
28191 unknown => crate::debug_registration::Ref::UnknownOrdinal_(unknown),
28192 }
28193 }
28194}
28195
28196unsafe impl<___D> ::fidl_next::Decode<___D> for WireDebugRegistration<'static>
28197where
28198 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
28199 ___D: ::fidl_next::Decoder,
28200{
28201 fn decode(
28202 mut slot: ::fidl_next::Slot<'_, Self>,
28203 decoder: &mut ___D,
28204 ) -> Result<(), ::fidl_next::DecodeError> {
28205 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
28206 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
28207 1 => ::fidl_next::RawWireUnion::decode_as::<
28208 ___D,
28209 crate::WireDebugProtocolRegistration<'static>,
28210 >(raw, decoder)?,
28211
28212 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
28213 }
28214
28215 Ok(())
28216 }
28217}
28218
28219impl<'de> ::core::fmt::Debug for WireDebugRegistration<'de> {
28220 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
28221 match self.raw.ordinal() {
28222 1 => unsafe {
28223 self.raw.get().deref_unchecked::<crate::WireDebugProtocolRegistration<'_>>().fmt(f)
28224 },
28225 _ => unsafe { ::core::hint::unreachable_unchecked() },
28226 }
28227 }
28228}
28229
28230#[repr(transparent)]
28231pub struct WireOptionalDebugRegistration<'de> {
28232 raw: ::fidl_next::RawWireUnion,
28233 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
28234}
28235
28236unsafe impl ::fidl_next::Wire for WireOptionalDebugRegistration<'static> {
28237 type Decoded<'de> = WireOptionalDebugRegistration<'de>;
28238
28239 #[inline]
28240 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28241 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
28242 ::fidl_next::RawWireUnion::zero_padding(raw);
28243 }
28244}
28245
28246impl<'de> WireOptionalDebugRegistration<'de> {
28247 pub fn is_some(&self) -> bool {
28248 self.raw.is_some()
28249 }
28250
28251 pub fn is_none(&self) -> bool {
28252 self.raw.is_none()
28253 }
28254
28255 pub fn as_ref(&self) -> Option<&WireDebugRegistration<'de>> {
28256 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
28257 }
28258
28259 pub fn into_option(self) -> Option<WireDebugRegistration<'de>> {
28260 if self.is_some() {
28261 Some(WireDebugRegistration { raw: self.raw, _phantom: ::core::marker::PhantomData })
28262 } else {
28263 None
28264 }
28265 }
28266}
28267
28268unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDebugRegistration<'static>
28269where
28270 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
28271 ___D: ::fidl_next::Decoder,
28272{
28273 fn decode(
28274 mut slot: ::fidl_next::Slot<'_, Self>,
28275 decoder: &mut ___D,
28276 ) -> Result<(), ::fidl_next::DecodeError> {
28277 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
28278 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
28279 1 => ::fidl_next::RawWireUnion::decode_as::<
28280 ___D,
28281 crate::WireDebugProtocolRegistration<'static>,
28282 >(raw, decoder)?,
28283
28284 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
28285 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
28286 }
28287
28288 Ok(())
28289 }
28290}
28291
28292impl<'de> ::core::fmt::Debug for WireOptionalDebugRegistration<'de> {
28293 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
28294 self.as_ref().fmt(f)
28295 }
28296}
28297
28298#[doc = " Declares an environment which configures a realm.\n"]
28299#[derive(Clone, Debug, Default)]
28300pub struct Environment {
28301 pub name: Option<String>,
28302
28303 pub extends: Option<crate::EnvironmentExtends>,
28304
28305 pub runners: Option<Vec<crate::RunnerRegistration>>,
28306
28307 pub resolvers: Option<Vec<crate::ResolverRegistration>>,
28308
28309 pub debug_capabilities: Option<Vec<crate::DebugRegistration>>,
28310
28311 pub stop_timeout_ms: Option<u32>,
28312}
28313
28314impl Environment {
28315 fn __max_ordinal(&self) -> usize {
28316 if self.stop_timeout_ms.is_some() {
28317 return 6;
28318 }
28319
28320 if self.debug_capabilities.is_some() {
28321 return 5;
28322 }
28323
28324 if self.resolvers.is_some() {
28325 return 4;
28326 }
28327
28328 if self.runners.is_some() {
28329 return 3;
28330 }
28331
28332 if self.extends.is_some() {
28333 return 2;
28334 }
28335
28336 if self.name.is_some() {
28337 return 1;
28338 }
28339
28340 0
28341 }
28342}
28343
28344impl ::fidl_next::Encodable for Environment {
28345 type Encoded = WireEnvironment<'static>;
28346}
28347
28348unsafe impl<___E> ::fidl_next::Encode<___E> for Environment
28349where
28350 ___E: ::fidl_next::Encoder + ?Sized,
28351{
28352 #[inline]
28353 fn encode(
28354 mut self,
28355 encoder: &mut ___E,
28356 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28357 ) -> Result<(), ::fidl_next::EncodeError> {
28358 ::fidl_next::munge!(let WireEnvironment { table } = out);
28359
28360 let max_ord = self.__max_ordinal();
28361
28362 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
28363 ::fidl_next::Wire::zero_padding(&mut out);
28364
28365 let mut preallocated =
28366 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
28367
28368 for i in 1..=max_ord {
28369 match i {
28370 6 => {
28371 if let Some(stop_timeout_ms) = self.stop_timeout_ms.take() {
28372 ::fidl_next::WireEnvelope::encode_value(
28373 stop_timeout_ms,
28374 preallocated.encoder,
28375 &mut out,
28376 )?;
28377 } else {
28378 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28379 }
28380 }
28381
28382 5 => {
28383 if let Some(debug_capabilities) = self.debug_capabilities.take() {
28384 ::fidl_next::WireEnvelope::encode_value(
28385 debug_capabilities,
28386 preallocated.encoder,
28387 &mut out,
28388 )?;
28389 } else {
28390 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28391 }
28392 }
28393
28394 4 => {
28395 if let Some(resolvers) = self.resolvers.take() {
28396 ::fidl_next::WireEnvelope::encode_value(
28397 resolvers,
28398 preallocated.encoder,
28399 &mut out,
28400 )?;
28401 } else {
28402 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28403 }
28404 }
28405
28406 3 => {
28407 if let Some(runners) = self.runners.take() {
28408 ::fidl_next::WireEnvelope::encode_value(
28409 runners,
28410 preallocated.encoder,
28411 &mut out,
28412 )?;
28413 } else {
28414 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28415 }
28416 }
28417
28418 2 => {
28419 if let Some(extends) = self.extends.take() {
28420 ::fidl_next::WireEnvelope::encode_value(
28421 extends,
28422 preallocated.encoder,
28423 &mut out,
28424 )?;
28425 } else {
28426 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28427 }
28428 }
28429
28430 1 => {
28431 if let Some(name) = self.name.take() {
28432 ::fidl_next::WireEnvelope::encode_value(
28433 name,
28434 preallocated.encoder,
28435 &mut out,
28436 )?;
28437 } else {
28438 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28439 }
28440 }
28441
28442 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
28443 }
28444 unsafe {
28445 preallocated.write_next(out.assume_init_ref());
28446 }
28447 }
28448
28449 ::fidl_next::WireTable::encode_len(table, max_ord);
28450
28451 Ok(())
28452 }
28453}
28454
28455unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Environment
28456where
28457 ___E: ::fidl_next::Encoder + ?Sized,
28458{
28459 #[inline]
28460 fn encode_ref(
28461 &self,
28462 encoder: &mut ___E,
28463 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28464 ) -> Result<(), ::fidl_next::EncodeError> {
28465 ::fidl_next::munge!(let WireEnvironment { table } = out);
28466
28467 let max_ord = self.__max_ordinal();
28468
28469 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
28470 ::fidl_next::Wire::zero_padding(&mut out);
28471
28472 let mut preallocated =
28473 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
28474
28475 for i in 1..=max_ord {
28476 match i {
28477 6 => {
28478 if let Some(stop_timeout_ms) = &self.stop_timeout_ms {
28479 ::fidl_next::WireEnvelope::encode_value(
28480 stop_timeout_ms,
28481 preallocated.encoder,
28482 &mut out,
28483 )?;
28484 } else {
28485 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28486 }
28487 }
28488
28489 5 => {
28490 if let Some(debug_capabilities) = &self.debug_capabilities {
28491 ::fidl_next::WireEnvelope::encode_value(
28492 debug_capabilities,
28493 preallocated.encoder,
28494 &mut out,
28495 )?;
28496 } else {
28497 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28498 }
28499 }
28500
28501 4 => {
28502 if let Some(resolvers) = &self.resolvers {
28503 ::fidl_next::WireEnvelope::encode_value(
28504 resolvers,
28505 preallocated.encoder,
28506 &mut out,
28507 )?;
28508 } else {
28509 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28510 }
28511 }
28512
28513 3 => {
28514 if let Some(runners) = &self.runners {
28515 ::fidl_next::WireEnvelope::encode_value(
28516 runners,
28517 preallocated.encoder,
28518 &mut out,
28519 )?;
28520 } else {
28521 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28522 }
28523 }
28524
28525 2 => {
28526 if let Some(extends) = &self.extends {
28527 ::fidl_next::WireEnvelope::encode_value(
28528 extends,
28529 preallocated.encoder,
28530 &mut out,
28531 )?;
28532 } else {
28533 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28534 }
28535 }
28536
28537 1 => {
28538 if let Some(name) = &self.name {
28539 ::fidl_next::WireEnvelope::encode_value(
28540 name,
28541 preallocated.encoder,
28542 &mut out,
28543 )?;
28544 } else {
28545 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28546 }
28547 }
28548
28549 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
28550 }
28551 unsafe {
28552 preallocated.write_next(out.assume_init_ref());
28553 }
28554 }
28555
28556 ::fidl_next::WireTable::encode_len(table, max_ord);
28557
28558 Ok(())
28559 }
28560}
28561
28562impl<'de> ::fidl_next::FromWire<WireEnvironment<'de>> for Environment {
28563 #[inline]
28564 fn from_wire(wire: WireEnvironment<'de>) -> Self {
28565 let wire = ::core::mem::ManuallyDrop::new(wire);
28566
28567 let name = wire.table.get(1);
28568
28569 let extends = wire.table.get(2);
28570
28571 let runners = wire.table.get(3);
28572
28573 let resolvers = wire.table.get(4);
28574
28575 let debug_capabilities = wire.table.get(5);
28576
28577 let stop_timeout_ms = wire.table.get(6);
28578
28579 Self {
28580
28581
28582 name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
28583 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
28584 )),
28585
28586
28587 extends: extends.map(|envelope| ::fidl_next::FromWire::from_wire(
28588 unsafe { envelope.read_unchecked::<crate::WireEnvironmentExtends>() }
28589 )),
28590
28591
28592 runners: runners.map(|envelope| ::fidl_next::FromWire::from_wire(
28593 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireRunnerRegistration<'de>>>() }
28594 )),
28595
28596
28597 resolvers: resolvers.map(|envelope| ::fidl_next::FromWire::from_wire(
28598 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireResolverRegistration<'de>>>() }
28599 )),
28600
28601
28602 debug_capabilities: debug_capabilities.map(|envelope| ::fidl_next::FromWire::from_wire(
28603 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireDebugRegistration<'de>>>() }
28604 )),
28605
28606
28607 stop_timeout_ms: stop_timeout_ms.map(|envelope| ::fidl_next::FromWire::from_wire(
28608 unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() }
28609 )),
28610
28611 }
28612 }
28613}
28614
28615impl<'de> ::fidl_next::FromWireRef<WireEnvironment<'de>> for Environment {
28616 #[inline]
28617 fn from_wire_ref(wire: &WireEnvironment<'de>) -> Self {
28618 Self {
28619
28620
28621 name: wire.table.get(1)
28622 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
28623 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
28624 )),
28625
28626
28627 extends: wire.table.get(2)
28628 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
28629 unsafe { envelope.deref_unchecked::<crate::WireEnvironmentExtends>() }
28630 )),
28631
28632
28633 runners: wire.table.get(3)
28634 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
28635 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireRunnerRegistration<'de>>>() }
28636 )),
28637
28638
28639 resolvers: wire.table.get(4)
28640 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
28641 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireResolverRegistration<'de>>>() }
28642 )),
28643
28644
28645 debug_capabilities: wire.table.get(5)
28646 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
28647 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireDebugRegistration<'de>>>() }
28648 )),
28649
28650
28651 stop_timeout_ms: wire.table.get(6)
28652 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
28653 unsafe { envelope.deref_unchecked::<::fidl_next::WireU32>() }
28654 )),
28655
28656 }
28657 }
28658}
28659
28660#[repr(C)]
28662pub struct WireEnvironment<'de> {
28663 table: ::fidl_next::WireTable<'de>,
28664}
28665
28666impl<'de> Drop for WireEnvironment<'de> {
28667 fn drop(&mut self) {
28668 let _ = self
28669 .table
28670 .get(1)
28671 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
28672
28673 let _ = self
28674 .table
28675 .get(2)
28676 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireEnvironmentExtends>() });
28677
28678 let _ = self.table.get(3).map(|envelope| unsafe {
28679 envelope
28680 .read_unchecked::<::fidl_next::WireVector<'de, crate::WireRunnerRegistration<'de>>>(
28681 )
28682 });
28683
28684 let _ = self.table.get(4)
28685 .map(|envelope| unsafe {
28686 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireResolverRegistration<'de>>>()
28687 });
28688
28689 let _ = self.table.get(5)
28690 .map(|envelope| unsafe {
28691 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireDebugRegistration<'de>>>()
28692 });
28693
28694 let _ = self
28695 .table
28696 .get(6)
28697 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
28698 }
28699}
28700
28701unsafe impl ::fidl_next::Wire for WireEnvironment<'static> {
28702 type Decoded<'de> = WireEnvironment<'de>;
28703
28704 #[inline]
28705 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28706 ::fidl_next::munge!(let Self { table } = out);
28707 ::fidl_next::WireTable::zero_padding(table);
28708 }
28709}
28710
28711unsafe impl<___D> ::fidl_next::Decode<___D> for WireEnvironment<'static>
28712where
28713 ___D: ::fidl_next::Decoder + ?Sized,
28714{
28715 fn decode(
28716 slot: ::fidl_next::Slot<'_, Self>,
28717 decoder: &mut ___D,
28718 ) -> Result<(), ::fidl_next::DecodeError> {
28719 ::fidl_next::munge!(let Self { table } = slot);
28720
28721 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28722 match ordinal {
28723 0 => unsafe { ::core::hint::unreachable_unchecked() },
28724
28725 1 => {
28726 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
28727 slot.as_mut(),
28728 decoder,
28729 )?;
28730
28731 let name = unsafe {
28732 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28733 };
28734
28735 if name.len() > 100 {
28736 return Err(::fidl_next::DecodeError::VectorTooLong {
28737 size: name.len() as u64,
28738 limit: 100,
28739 });
28740 }
28741
28742 Ok(())
28743 }
28744
28745 2 => {
28746 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireEnvironmentExtends>(
28747 slot.as_mut(),
28748 decoder,
28749 )?;
28750
28751 Ok(())
28752 }
28753
28754 3 => {
28755 ::fidl_next::WireEnvelope::decode_as::<
28756 ___D,
28757 ::fidl_next::WireVector<'static, crate::WireRunnerRegistration<'static>>,
28758 >(slot.as_mut(), decoder)?;
28759
28760 Ok(())
28761 }
28762
28763 4 => {
28764 ::fidl_next::WireEnvelope::decode_as::<
28765 ___D,
28766 ::fidl_next::WireVector<'static, crate::WireResolverRegistration<'static>>,
28767 >(slot.as_mut(), decoder)?;
28768
28769 Ok(())
28770 }
28771
28772 5 => {
28773 ::fidl_next::WireEnvelope::decode_as::<
28774 ___D,
28775 ::fidl_next::WireVector<'static, crate::WireDebugRegistration<'static>>,
28776 >(slot.as_mut(), decoder)?;
28777
28778 Ok(())
28779 }
28780
28781 6 => {
28782 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
28783 slot.as_mut(),
28784 decoder,
28785 )?;
28786
28787 Ok(())
28788 }
28789
28790 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
28791 }
28792 })
28793 }
28794}
28795
28796impl<'de> WireEnvironment<'de> {
28797 pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
28798 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28799 }
28800
28801 pub fn extends(&self) -> Option<&crate::WireEnvironmentExtends> {
28802 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28803 }
28804
28805 pub fn runners(
28806 &self,
28807 ) -> Option<&::fidl_next::WireVector<'de, crate::WireRunnerRegistration<'de>>> {
28808 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28809 }
28810
28811 pub fn resolvers(
28812 &self,
28813 ) -> Option<&::fidl_next::WireVector<'de, crate::WireResolverRegistration<'de>>> {
28814 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
28815 }
28816
28817 pub fn debug_capabilities(
28818 &self,
28819 ) -> Option<&::fidl_next::WireVector<'de, crate::WireDebugRegistration<'de>>> {
28820 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
28821 }
28822
28823 pub fn stop_timeout_ms(&self) -> Option<&::fidl_next::WireU32> {
28824 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
28825 }
28826}
28827
28828impl<'de> ::core::fmt::Debug for WireEnvironment<'de> {
28829 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
28830 f.debug_struct("Environment")
28831 .field("name", &self.name())
28832 .field("extends", &self.extends())
28833 .field("runners", &self.runners())
28834 .field("resolvers", &self.resolvers())
28835 .field("debug_capabilities", &self.debug_capabilities())
28836 .field("stop_timeout_ms", &self.stop_timeout_ms())
28837 .finish()
28838 }
28839}
28840
28841#[derive(Clone, Debug, Default)]
28842pub struct ConfigSourceCapabilities {}
28843
28844impl ConfigSourceCapabilities {
28845 fn __max_ordinal(&self) -> usize {
28846 0
28847 }
28848}
28849
28850impl ::fidl_next::Encodable for ConfigSourceCapabilities {
28851 type Encoded = WireConfigSourceCapabilities<'static>;
28852}
28853
28854unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigSourceCapabilities
28855where
28856 ___E: ::fidl_next::Encoder + ?Sized,
28857{
28858 #[inline]
28859 fn encode(
28860 mut self,
28861 encoder: &mut ___E,
28862 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28863 ) -> Result<(), ::fidl_next::EncodeError> {
28864 ::fidl_next::munge!(let WireConfigSourceCapabilities { table } = out);
28865
28866 let max_ord = self.__max_ordinal();
28867
28868 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
28869 ::fidl_next::Wire::zero_padding(&mut out);
28870
28871 let mut preallocated =
28872 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
28873
28874 for i in 1..=max_ord {
28875 match i {
28876 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
28877 }
28878 unsafe {
28879 preallocated.write_next(out.assume_init_ref());
28880 }
28881 }
28882
28883 ::fidl_next::WireTable::encode_len(table, max_ord);
28884
28885 Ok(())
28886 }
28887}
28888
28889unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigSourceCapabilities
28890where
28891 ___E: ::fidl_next::Encoder + ?Sized,
28892{
28893 #[inline]
28894 fn encode_ref(
28895 &self,
28896 encoder: &mut ___E,
28897 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28898 ) -> Result<(), ::fidl_next::EncodeError> {
28899 ::fidl_next::munge!(let WireConfigSourceCapabilities { table } = out);
28900
28901 let max_ord = self.__max_ordinal();
28902
28903 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
28904 ::fidl_next::Wire::zero_padding(&mut out);
28905
28906 let mut preallocated =
28907 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
28908
28909 for i in 1..=max_ord {
28910 match i {
28911 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
28912 }
28913 unsafe {
28914 preallocated.write_next(out.assume_init_ref());
28915 }
28916 }
28917
28918 ::fidl_next::WireTable::encode_len(table, max_ord);
28919
28920 Ok(())
28921 }
28922}
28923
28924impl<'de> ::fidl_next::FromWire<WireConfigSourceCapabilities<'de>> for ConfigSourceCapabilities {
28925 #[inline]
28926 fn from_wire(wire: WireConfigSourceCapabilities<'de>) -> Self {
28927 let wire = ::core::mem::ManuallyDrop::new(wire);
28928
28929 Self {}
28930 }
28931}
28932
28933impl<'de> ::fidl_next::FromWireRef<WireConfigSourceCapabilities<'de>> for ConfigSourceCapabilities {
28934 #[inline]
28935 fn from_wire_ref(wire: &WireConfigSourceCapabilities<'de>) -> Self {
28936 Self {}
28937 }
28938}
28939
28940#[repr(C)]
28942pub struct WireConfigSourceCapabilities<'de> {
28943 table: ::fidl_next::WireTable<'de>,
28944}
28945
28946impl<'de> Drop for WireConfigSourceCapabilities<'de> {
28947 fn drop(&mut self) {}
28948}
28949
28950unsafe impl ::fidl_next::Wire for WireConfigSourceCapabilities<'static> {
28951 type Decoded<'de> = WireConfigSourceCapabilities<'de>;
28952
28953 #[inline]
28954 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28955 ::fidl_next::munge!(let Self { table } = out);
28956 ::fidl_next::WireTable::zero_padding(table);
28957 }
28958}
28959
28960unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigSourceCapabilities<'static>
28961where
28962 ___D: ::fidl_next::Decoder + ?Sized,
28963{
28964 fn decode(
28965 slot: ::fidl_next::Slot<'_, Self>,
28966 decoder: &mut ___D,
28967 ) -> Result<(), ::fidl_next::DecodeError> {
28968 ::fidl_next::munge!(let Self { table } = slot);
28969
28970 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28971 match ordinal {
28972 0 => unsafe { ::core::hint::unreachable_unchecked() },
28973
28974 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
28975 }
28976 })
28977 }
28978}
28979
28980impl<'de> WireConfigSourceCapabilities<'de> {}
28981
28982impl<'de> ::core::fmt::Debug for WireConfigSourceCapabilities<'de> {
28983 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
28984 f.debug_struct("ConfigSourceCapabilities").finish()
28985 }
28986}
28987
28988#[doc = " Strategies available for resolving configuration values.\n"]
28989#[derive(Clone, Debug)]
28990pub enum ConfigValueSource {
28991 PackagePath(String),
28992
28993 Capabilities(crate::ConfigSourceCapabilities),
28994
28995 UnknownOrdinal_(u64),
28996}
28997
28998impl ::fidl_next::Encodable for ConfigValueSource {
28999 type Encoded = WireConfigValueSource<'static>;
29000}
29001
29002unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigValueSource
29003where
29004 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
29005 ___E: ::fidl_next::Encoder,
29006{
29007 #[inline]
29008 fn encode(
29009 self,
29010 encoder: &mut ___E,
29011 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
29012 ) -> Result<(), ::fidl_next::EncodeError> {
29013 ::fidl_next::munge!(let WireConfigValueSource { raw, _phantom: _ } = out);
29014
29015 match self {
29016 Self::PackagePath(value) => {
29017 ::fidl_next::RawWireUnion::encode_as::<___E, String>(value, 1, encoder, raw)?
29018 }
29019
29020 Self::Capabilities(value) => ::fidl_next::RawWireUnion::encode_as::<
29021 ___E,
29022 crate::ConfigSourceCapabilities,
29023 >(value, 2, encoder, raw)?,
29024
29025 Self::UnknownOrdinal_(ordinal) => {
29026 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
29027 }
29028 }
29029
29030 Ok(())
29031 }
29032}
29033
29034unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigValueSource
29035where
29036 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
29037 ___E: ::fidl_next::Encoder,
29038{
29039 #[inline]
29040 fn encode_ref(
29041 &self,
29042 encoder: &mut ___E,
29043 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
29044 ) -> Result<(), ::fidl_next::EncodeError> {
29045 ::fidl_next::munge!(let WireConfigValueSource { raw, _phantom: _ } = out);
29046
29047 match self {
29048 Self::PackagePath(value) => {
29049 ::fidl_next::RawWireUnion::encode_as::<___E, &String>(value, 1, encoder, raw)?
29050 }
29051
29052 Self::Capabilities(value) => ::fidl_next::RawWireUnion::encode_as::<
29053 ___E,
29054 &crate::ConfigSourceCapabilities,
29055 >(value, 2, encoder, raw)?,
29056
29057 Self::UnknownOrdinal_(ordinal) => {
29058 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
29059 }
29060 }
29061
29062 Ok(())
29063 }
29064}
29065
29066impl ::fidl_next::EncodableOption for ConfigValueSource {
29067 type EncodedOption = WireOptionalConfigValueSource<'static>;
29068}
29069
29070unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ConfigValueSource
29071where
29072 ___E: ?Sized,
29073 ConfigValueSource: ::fidl_next::Encode<___E>,
29074{
29075 #[inline]
29076 fn encode_option(
29077 this: Option<Self>,
29078 encoder: &mut ___E,
29079 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
29080 ) -> Result<(), ::fidl_next::EncodeError> {
29081 ::fidl_next::munge!(let WireOptionalConfigValueSource { raw, _phantom: _ } = &mut *out);
29082
29083 if let Some(inner) = this {
29084 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
29085 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
29086 } else {
29087 ::fidl_next::RawWireUnion::encode_absent(raw);
29088 }
29089
29090 Ok(())
29091 }
29092}
29093
29094unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ConfigValueSource
29095where
29096 ___E: ?Sized,
29097 ConfigValueSource: ::fidl_next::EncodeRef<___E>,
29098{
29099 #[inline]
29100 fn encode_option_ref(
29101 this: Option<&Self>,
29102 encoder: &mut ___E,
29103 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
29104 ) -> Result<(), ::fidl_next::EncodeError> {
29105 ::fidl_next::munge!(let WireOptionalConfigValueSource { raw, _phantom: _ } = &mut *out);
29106
29107 if let Some(inner) = this {
29108 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
29109 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
29110 } else {
29111 ::fidl_next::RawWireUnion::encode_absent(raw);
29112 }
29113
29114 Ok(())
29115 }
29116}
29117
29118impl<'de> ::fidl_next::FromWire<WireConfigValueSource<'de>> for ConfigValueSource {
29119 #[inline]
29120 fn from_wire(wire: WireConfigValueSource<'de>) -> Self {
29121 let wire = ::core::mem::ManuallyDrop::new(wire);
29122 match wire.raw.ordinal() {
29123 1 => Self::PackagePath(::fidl_next::FromWire::from_wire(unsafe {
29124 wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
29125 })),
29126
29127 2 => Self::Capabilities(::fidl_next::FromWire::from_wire(unsafe {
29128 wire.raw.get().read_unchecked::<crate::WireConfigSourceCapabilities<'de>>()
29129 })),
29130
29131 _ => unsafe { ::core::hint::unreachable_unchecked() },
29132 }
29133 }
29134}
29135
29136impl<'de> ::fidl_next::FromWireRef<WireConfigValueSource<'de>> for ConfigValueSource {
29137 #[inline]
29138 fn from_wire_ref(wire: &WireConfigValueSource<'de>) -> Self {
29139 match wire.raw.ordinal() {
29140 1 => Self::PackagePath(::fidl_next::FromWireRef::from_wire_ref(unsafe {
29141 wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
29142 })),
29143
29144 2 => Self::Capabilities(::fidl_next::FromWireRef::from_wire_ref(unsafe {
29145 wire.raw.get().deref_unchecked::<crate::WireConfigSourceCapabilities<'de>>()
29146 })),
29147
29148 _ => unsafe { ::core::hint::unreachable_unchecked() },
29149 }
29150 }
29151}
29152
29153impl<'de> ::fidl_next::FromWireOption<WireOptionalConfigValueSource<'de>>
29154 for Box<ConfigValueSource>
29155{
29156 #[inline]
29157 fn from_wire_option(wire: WireOptionalConfigValueSource<'de>) -> Option<Self> {
29158 if let Some(inner) = wire.into_option() {
29159 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
29160 } else {
29161 None
29162 }
29163 }
29164}
29165
29166impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalConfigValueSource<'de>>
29167 for Box<ConfigValueSource>
29168{
29169 #[inline]
29170 fn from_wire_option_ref(wire: &WireOptionalConfigValueSource<'de>) -> Option<Self> {
29171 if let Some(inner) = wire.as_ref() {
29172 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
29173 } else {
29174 None
29175 }
29176 }
29177}
29178
29179#[repr(transparent)]
29181pub struct WireConfigValueSource<'de> {
29182 raw: ::fidl_next::RawWireUnion,
29183 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
29184}
29185
29186impl<'de> Drop for WireConfigValueSource<'de> {
29187 fn drop(&mut self) {
29188 match self.raw.ordinal() {
29189 1 => {
29190 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
29191 }
29192
29193 2 => {
29194 let _ = unsafe {
29195 self.raw.get().read_unchecked::<crate::WireConfigSourceCapabilities<'de>>()
29196 };
29197 }
29198
29199 _ => (),
29200 }
29201 }
29202}
29203
29204unsafe impl ::fidl_next::Wire for WireConfigValueSource<'static> {
29205 type Decoded<'de> = WireConfigValueSource<'de>;
29206
29207 #[inline]
29208 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29209 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
29210 ::fidl_next::RawWireUnion::zero_padding(raw);
29211 }
29212}
29213
29214pub mod config_value_source {
29215 pub enum Ref<'de> {
29216 PackagePath(&'de ::fidl_next::WireString<'de>),
29217
29218 Capabilities(&'de crate::WireConfigSourceCapabilities<'de>),
29219
29220 UnknownOrdinal_(u64),
29221 }
29222}
29223
29224impl<'de> WireConfigValueSource<'de> {
29225 pub fn as_ref(&self) -> crate::config_value_source::Ref<'_> {
29226 match self.raw.ordinal() {
29227 1 => crate::config_value_source::Ref::PackagePath(unsafe {
29228 self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
29229 }),
29230
29231 2 => crate::config_value_source::Ref::Capabilities(unsafe {
29232 self.raw.get().deref_unchecked::<crate::WireConfigSourceCapabilities<'_>>()
29233 }),
29234
29235 unknown => crate::config_value_source::Ref::UnknownOrdinal_(unknown),
29236 }
29237 }
29238}
29239
29240unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigValueSource<'static>
29241where
29242 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
29243 ___D: ::fidl_next::Decoder,
29244{
29245 fn decode(
29246 mut slot: ::fidl_next::Slot<'_, Self>,
29247 decoder: &mut ___D,
29248 ) -> Result<(), ::fidl_next::DecodeError> {
29249 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
29250 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
29251 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
29252 raw, decoder,
29253 )?,
29254
29255 2 => ::fidl_next::RawWireUnion::decode_as::<
29256 ___D,
29257 crate::WireConfigSourceCapabilities<'static>,
29258 >(raw, decoder)?,
29259
29260 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
29261 }
29262
29263 Ok(())
29264 }
29265}
29266
29267impl<'de> ::core::fmt::Debug for WireConfigValueSource<'de> {
29268 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
29269 match self.raw.ordinal() {
29270 1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f) },
29271 2 => unsafe {
29272 self.raw.get().deref_unchecked::<crate::WireConfigSourceCapabilities<'_>>().fmt(f)
29273 },
29274 _ => unsafe { ::core::hint::unreachable_unchecked() },
29275 }
29276 }
29277}
29278
29279#[repr(transparent)]
29280pub struct WireOptionalConfigValueSource<'de> {
29281 raw: ::fidl_next::RawWireUnion,
29282 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
29283}
29284
29285unsafe impl ::fidl_next::Wire for WireOptionalConfigValueSource<'static> {
29286 type Decoded<'de> = WireOptionalConfigValueSource<'de>;
29287
29288 #[inline]
29289 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29290 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
29291 ::fidl_next::RawWireUnion::zero_padding(raw);
29292 }
29293}
29294
29295impl<'de> WireOptionalConfigValueSource<'de> {
29296 pub fn is_some(&self) -> bool {
29297 self.raw.is_some()
29298 }
29299
29300 pub fn is_none(&self) -> bool {
29301 self.raw.is_none()
29302 }
29303
29304 pub fn as_ref(&self) -> Option<&WireConfigValueSource<'de>> {
29305 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
29306 }
29307
29308 pub fn into_option(self) -> Option<WireConfigValueSource<'de>> {
29309 if self.is_some() {
29310 Some(WireConfigValueSource { raw: self.raw, _phantom: ::core::marker::PhantomData })
29311 } else {
29312 None
29313 }
29314 }
29315}
29316
29317unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConfigValueSource<'static>
29318where
29319 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
29320 ___D: ::fidl_next::Decoder,
29321{
29322 fn decode(
29323 mut slot: ::fidl_next::Slot<'_, Self>,
29324 decoder: &mut ___D,
29325 ) -> Result<(), ::fidl_next::DecodeError> {
29326 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
29327 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
29328 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
29329 raw, decoder,
29330 )?,
29331
29332 2 => ::fidl_next::RawWireUnion::decode_as::<
29333 ___D,
29334 crate::WireConfigSourceCapabilities<'static>,
29335 >(raw, decoder)?,
29336
29337 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
29338 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
29339 }
29340
29341 Ok(())
29342 }
29343}
29344
29345impl<'de> ::core::fmt::Debug for WireOptionalConfigValueSource<'de> {
29346 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
29347 self.as_ref().fmt(f)
29348 }
29349}
29350
29351#[doc = " The schema of a component\'s configuration interface.\n"]
29352#[derive(Clone, Debug, Default)]
29353pub struct ConfigSchema {
29354 pub fields: Option<Vec<crate::ConfigField>>,
29355
29356 pub checksum: Option<crate::ConfigChecksum>,
29357
29358 pub value_source: Option<crate::ConfigValueSource>,
29359}
29360
29361impl ConfigSchema {
29362 fn __max_ordinal(&self) -> usize {
29363 if self.value_source.is_some() {
29364 return 3;
29365 }
29366
29367 if self.checksum.is_some() {
29368 return 2;
29369 }
29370
29371 if self.fields.is_some() {
29372 return 1;
29373 }
29374
29375 0
29376 }
29377}
29378
29379impl ::fidl_next::Encodable for ConfigSchema {
29380 type Encoded = WireConfigSchema<'static>;
29381}
29382
29383unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigSchema
29384where
29385 ___E: ::fidl_next::Encoder + ?Sized,
29386{
29387 #[inline]
29388 fn encode(
29389 mut self,
29390 encoder: &mut ___E,
29391 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
29392 ) -> Result<(), ::fidl_next::EncodeError> {
29393 ::fidl_next::munge!(let WireConfigSchema { table } = out);
29394
29395 let max_ord = self.__max_ordinal();
29396
29397 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
29398 ::fidl_next::Wire::zero_padding(&mut out);
29399
29400 let mut preallocated =
29401 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
29402
29403 for i in 1..=max_ord {
29404 match i {
29405 3 => {
29406 if let Some(value_source) = self.value_source.take() {
29407 ::fidl_next::WireEnvelope::encode_value(
29408 value_source,
29409 preallocated.encoder,
29410 &mut out,
29411 )?;
29412 } else {
29413 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29414 }
29415 }
29416
29417 2 => {
29418 if let Some(checksum) = self.checksum.take() {
29419 ::fidl_next::WireEnvelope::encode_value(
29420 checksum,
29421 preallocated.encoder,
29422 &mut out,
29423 )?;
29424 } else {
29425 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29426 }
29427 }
29428
29429 1 => {
29430 if let Some(fields) = self.fields.take() {
29431 ::fidl_next::WireEnvelope::encode_value(
29432 fields,
29433 preallocated.encoder,
29434 &mut out,
29435 )?;
29436 } else {
29437 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29438 }
29439 }
29440
29441 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
29442 }
29443 unsafe {
29444 preallocated.write_next(out.assume_init_ref());
29445 }
29446 }
29447
29448 ::fidl_next::WireTable::encode_len(table, max_ord);
29449
29450 Ok(())
29451 }
29452}
29453
29454unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigSchema
29455where
29456 ___E: ::fidl_next::Encoder + ?Sized,
29457{
29458 #[inline]
29459 fn encode_ref(
29460 &self,
29461 encoder: &mut ___E,
29462 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
29463 ) -> Result<(), ::fidl_next::EncodeError> {
29464 ::fidl_next::munge!(let WireConfigSchema { table } = out);
29465
29466 let max_ord = self.__max_ordinal();
29467
29468 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
29469 ::fidl_next::Wire::zero_padding(&mut out);
29470
29471 let mut preallocated =
29472 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
29473
29474 for i in 1..=max_ord {
29475 match i {
29476 3 => {
29477 if let Some(value_source) = &self.value_source {
29478 ::fidl_next::WireEnvelope::encode_value(
29479 value_source,
29480 preallocated.encoder,
29481 &mut out,
29482 )?;
29483 } else {
29484 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29485 }
29486 }
29487
29488 2 => {
29489 if let Some(checksum) = &self.checksum {
29490 ::fidl_next::WireEnvelope::encode_value(
29491 checksum,
29492 preallocated.encoder,
29493 &mut out,
29494 )?;
29495 } else {
29496 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29497 }
29498 }
29499
29500 1 => {
29501 if let Some(fields) = &self.fields {
29502 ::fidl_next::WireEnvelope::encode_value(
29503 fields,
29504 preallocated.encoder,
29505 &mut out,
29506 )?;
29507 } else {
29508 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29509 }
29510 }
29511
29512 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
29513 }
29514 unsafe {
29515 preallocated.write_next(out.assume_init_ref());
29516 }
29517 }
29518
29519 ::fidl_next::WireTable::encode_len(table, max_ord);
29520
29521 Ok(())
29522 }
29523}
29524
29525impl<'de> ::fidl_next::FromWire<WireConfigSchema<'de>> for ConfigSchema {
29526 #[inline]
29527 fn from_wire(wire: WireConfigSchema<'de>) -> Self {
29528 let wire = ::core::mem::ManuallyDrop::new(wire);
29529
29530 let fields = wire.table.get(1);
29531
29532 let checksum = wire.table.get(2);
29533
29534 let value_source = wire.table.get(3);
29535
29536 Self {
29537
29538
29539 fields: fields.map(|envelope| ::fidl_next::FromWire::from_wire(
29540 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigField<'de>>>() }
29541 )),
29542
29543
29544 checksum: checksum.map(|envelope| ::fidl_next::FromWire::from_wire(
29545 unsafe { envelope.read_unchecked::<crate::WireConfigChecksum<'de>>() }
29546 )),
29547
29548
29549 value_source: value_source.map(|envelope| ::fidl_next::FromWire::from_wire(
29550 unsafe { envelope.read_unchecked::<crate::WireConfigValueSource<'de>>() }
29551 )),
29552
29553 }
29554 }
29555}
29556
29557impl<'de> ::fidl_next::FromWireRef<WireConfigSchema<'de>> for ConfigSchema {
29558 #[inline]
29559 fn from_wire_ref(wire: &WireConfigSchema<'de>) -> Self {
29560 Self {
29561
29562
29563 fields: wire.table.get(1)
29564 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
29565 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigField<'de>>>() }
29566 )),
29567
29568
29569 checksum: wire.table.get(2)
29570 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
29571 unsafe { envelope.deref_unchecked::<crate::WireConfigChecksum<'de>>() }
29572 )),
29573
29574
29575 value_source: wire.table.get(3)
29576 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
29577 unsafe { envelope.deref_unchecked::<crate::WireConfigValueSource<'de>>() }
29578 )),
29579
29580 }
29581 }
29582}
29583
29584#[repr(C)]
29586pub struct WireConfigSchema<'de> {
29587 table: ::fidl_next::WireTable<'de>,
29588}
29589
29590impl<'de> Drop for WireConfigSchema<'de> {
29591 fn drop(&mut self) {
29592 let _ = self.table.get(1).map(|envelope| unsafe {
29593 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigField<'de>>>()
29594 });
29595
29596 let _ = self
29597 .table
29598 .get(2)
29599 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigChecksum<'de>>() });
29600
29601 let _ = self.table.get(3).map(|envelope| unsafe {
29602 envelope.read_unchecked::<crate::WireConfigValueSource<'de>>()
29603 });
29604 }
29605}
29606
29607unsafe impl ::fidl_next::Wire for WireConfigSchema<'static> {
29608 type Decoded<'de> = WireConfigSchema<'de>;
29609
29610 #[inline]
29611 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29612 ::fidl_next::munge!(let Self { table } = out);
29613 ::fidl_next::WireTable::zero_padding(table);
29614 }
29615}
29616
29617unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigSchema<'static>
29618where
29619 ___D: ::fidl_next::Decoder + ?Sized,
29620{
29621 fn decode(
29622 slot: ::fidl_next::Slot<'_, Self>,
29623 decoder: &mut ___D,
29624 ) -> Result<(), ::fidl_next::DecodeError> {
29625 ::fidl_next::munge!(let Self { table } = slot);
29626
29627 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
29628 match ordinal {
29629 0 => unsafe { ::core::hint::unreachable_unchecked() },
29630
29631 1 => {
29632 ::fidl_next::WireEnvelope::decode_as::<
29633 ___D,
29634 ::fidl_next::WireVector<'static, crate::WireConfigField<'static>>,
29635 >(slot.as_mut(), decoder)?;
29636
29637 Ok(())
29638 }
29639
29640 2 => {
29641 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigChecksum<'static>>(
29642 slot.as_mut(),
29643 decoder,
29644 )?;
29645
29646 Ok(())
29647 }
29648
29649 3 => {
29650 ::fidl_next::WireEnvelope::decode_as::<
29651 ___D,
29652 crate::WireConfigValueSource<'static>,
29653 >(slot.as_mut(), decoder)?;
29654
29655 Ok(())
29656 }
29657
29658 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
29659 }
29660 })
29661 }
29662}
29663
29664impl<'de> WireConfigSchema<'de> {
29665 pub fn fields(&self) -> Option<&::fidl_next::WireVector<'de, crate::WireConfigField<'de>>> {
29666 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
29667 }
29668
29669 pub fn checksum(&self) -> Option<&crate::WireConfigChecksum<'de>> {
29670 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
29671 }
29672
29673 pub fn value_source(&self) -> Option<&crate::WireConfigValueSource<'de>> {
29674 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
29675 }
29676}
29677
29678impl<'de> ::core::fmt::Debug for WireConfigSchema<'de> {
29679 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
29680 f.debug_struct("ConfigSchema")
29681 .field("fields", &self.fields())
29682 .field("checksum", &self.checksum())
29683 .field("value_source", &self.value_source())
29684 .finish()
29685 }
29686}
29687
29688#[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"]
29689#[derive(Clone, Debug, Default)]
29690pub struct Component {
29691 pub program: Option<crate::Program>,
29692
29693 pub uses: Option<Vec<crate::Use>>,
29694
29695 pub exposes: Option<Vec<crate::Expose>>,
29696
29697 pub offers: Option<Vec<crate::Offer>>,
29698
29699 pub capabilities: Option<Vec<crate::Capability>>,
29700
29701 pub children: Option<Vec<crate::Child>>,
29702
29703 pub collections: Option<Vec<crate::Collection>>,
29704
29705 pub environments: Option<Vec<crate::Environment>>,
29706
29707 pub facets: Option<::fidl_next_fuchsia_data::Dictionary>,
29708
29709 pub config: Option<crate::ConfigSchema>,
29710}
29711
29712impl Component {
29713 fn __max_ordinal(&self) -> usize {
29714 if self.config.is_some() {
29715 return 10;
29716 }
29717
29718 if self.facets.is_some() {
29719 return 9;
29720 }
29721
29722 if self.environments.is_some() {
29723 return 8;
29724 }
29725
29726 if self.collections.is_some() {
29727 return 7;
29728 }
29729
29730 if self.children.is_some() {
29731 return 6;
29732 }
29733
29734 if self.capabilities.is_some() {
29735 return 5;
29736 }
29737
29738 if self.offers.is_some() {
29739 return 4;
29740 }
29741
29742 if self.exposes.is_some() {
29743 return 3;
29744 }
29745
29746 if self.uses.is_some() {
29747 return 2;
29748 }
29749
29750 if self.program.is_some() {
29751 return 1;
29752 }
29753
29754 0
29755 }
29756}
29757
29758impl ::fidl_next::Encodable for Component {
29759 type Encoded = WireComponent<'static>;
29760}
29761
29762unsafe impl<___E> ::fidl_next::Encode<___E> for Component
29763where
29764 ___E: ::fidl_next::Encoder + ?Sized,
29765{
29766 #[inline]
29767 fn encode(
29768 mut self,
29769 encoder: &mut ___E,
29770 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
29771 ) -> Result<(), ::fidl_next::EncodeError> {
29772 ::fidl_next::munge!(let WireComponent { table } = out);
29773
29774 let max_ord = self.__max_ordinal();
29775
29776 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
29777 ::fidl_next::Wire::zero_padding(&mut out);
29778
29779 let mut preallocated =
29780 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
29781
29782 for i in 1..=max_ord {
29783 match i {
29784 10 => {
29785 if let Some(config) = self.config.take() {
29786 ::fidl_next::WireEnvelope::encode_value(
29787 config,
29788 preallocated.encoder,
29789 &mut out,
29790 )?;
29791 } else {
29792 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29793 }
29794 }
29795
29796 9 => {
29797 if let Some(facets) = self.facets.take() {
29798 ::fidl_next::WireEnvelope::encode_value(
29799 facets,
29800 preallocated.encoder,
29801 &mut out,
29802 )?;
29803 } else {
29804 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29805 }
29806 }
29807
29808 8 => {
29809 if let Some(environments) = self.environments.take() {
29810 ::fidl_next::WireEnvelope::encode_value(
29811 environments,
29812 preallocated.encoder,
29813 &mut out,
29814 )?;
29815 } else {
29816 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29817 }
29818 }
29819
29820 7 => {
29821 if let Some(collections) = self.collections.take() {
29822 ::fidl_next::WireEnvelope::encode_value(
29823 collections,
29824 preallocated.encoder,
29825 &mut out,
29826 )?;
29827 } else {
29828 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29829 }
29830 }
29831
29832 6 => {
29833 if let Some(children) = self.children.take() {
29834 ::fidl_next::WireEnvelope::encode_value(
29835 children,
29836 preallocated.encoder,
29837 &mut out,
29838 )?;
29839 } else {
29840 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29841 }
29842 }
29843
29844 5 => {
29845 if let Some(capabilities) = self.capabilities.take() {
29846 ::fidl_next::WireEnvelope::encode_value(
29847 capabilities,
29848 preallocated.encoder,
29849 &mut out,
29850 )?;
29851 } else {
29852 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29853 }
29854 }
29855
29856 4 => {
29857 if let Some(offers) = self.offers.take() {
29858 ::fidl_next::WireEnvelope::encode_value(
29859 offers,
29860 preallocated.encoder,
29861 &mut out,
29862 )?;
29863 } else {
29864 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29865 }
29866 }
29867
29868 3 => {
29869 if let Some(exposes) = self.exposes.take() {
29870 ::fidl_next::WireEnvelope::encode_value(
29871 exposes,
29872 preallocated.encoder,
29873 &mut out,
29874 )?;
29875 } else {
29876 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29877 }
29878 }
29879
29880 2 => {
29881 if let Some(uses) = self.uses.take() {
29882 ::fidl_next::WireEnvelope::encode_value(
29883 uses,
29884 preallocated.encoder,
29885 &mut out,
29886 )?;
29887 } else {
29888 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29889 }
29890 }
29891
29892 1 => {
29893 if let Some(program) = self.program.take() {
29894 ::fidl_next::WireEnvelope::encode_value(
29895 program,
29896 preallocated.encoder,
29897 &mut out,
29898 )?;
29899 } else {
29900 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29901 }
29902 }
29903
29904 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
29905 }
29906 unsafe {
29907 preallocated.write_next(out.assume_init_ref());
29908 }
29909 }
29910
29911 ::fidl_next::WireTable::encode_len(table, max_ord);
29912
29913 Ok(())
29914 }
29915}
29916
29917unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Component
29918where
29919 ___E: ::fidl_next::Encoder + ?Sized,
29920{
29921 #[inline]
29922 fn encode_ref(
29923 &self,
29924 encoder: &mut ___E,
29925 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
29926 ) -> Result<(), ::fidl_next::EncodeError> {
29927 ::fidl_next::munge!(let WireComponent { table } = out);
29928
29929 let max_ord = self.__max_ordinal();
29930
29931 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
29932 ::fidl_next::Wire::zero_padding(&mut out);
29933
29934 let mut preallocated =
29935 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
29936
29937 for i in 1..=max_ord {
29938 match i {
29939 10 => {
29940 if let Some(config) = &self.config {
29941 ::fidl_next::WireEnvelope::encode_value(
29942 config,
29943 preallocated.encoder,
29944 &mut out,
29945 )?;
29946 } else {
29947 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29948 }
29949 }
29950
29951 9 => {
29952 if let Some(facets) = &self.facets {
29953 ::fidl_next::WireEnvelope::encode_value(
29954 facets,
29955 preallocated.encoder,
29956 &mut out,
29957 )?;
29958 } else {
29959 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29960 }
29961 }
29962
29963 8 => {
29964 if let Some(environments) = &self.environments {
29965 ::fidl_next::WireEnvelope::encode_value(
29966 environments,
29967 preallocated.encoder,
29968 &mut out,
29969 )?;
29970 } else {
29971 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29972 }
29973 }
29974
29975 7 => {
29976 if let Some(collections) = &self.collections {
29977 ::fidl_next::WireEnvelope::encode_value(
29978 collections,
29979 preallocated.encoder,
29980 &mut out,
29981 )?;
29982 } else {
29983 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29984 }
29985 }
29986
29987 6 => {
29988 if let Some(children) = &self.children {
29989 ::fidl_next::WireEnvelope::encode_value(
29990 children,
29991 preallocated.encoder,
29992 &mut out,
29993 )?;
29994 } else {
29995 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29996 }
29997 }
29998
29999 5 => {
30000 if let Some(capabilities) = &self.capabilities {
30001 ::fidl_next::WireEnvelope::encode_value(
30002 capabilities,
30003 preallocated.encoder,
30004 &mut out,
30005 )?;
30006 } else {
30007 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30008 }
30009 }
30010
30011 4 => {
30012 if let Some(offers) = &self.offers {
30013 ::fidl_next::WireEnvelope::encode_value(
30014 offers,
30015 preallocated.encoder,
30016 &mut out,
30017 )?;
30018 } else {
30019 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30020 }
30021 }
30022
30023 3 => {
30024 if let Some(exposes) = &self.exposes {
30025 ::fidl_next::WireEnvelope::encode_value(
30026 exposes,
30027 preallocated.encoder,
30028 &mut out,
30029 )?;
30030 } else {
30031 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30032 }
30033 }
30034
30035 2 => {
30036 if let Some(uses) = &self.uses {
30037 ::fidl_next::WireEnvelope::encode_value(
30038 uses,
30039 preallocated.encoder,
30040 &mut out,
30041 )?;
30042 } else {
30043 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30044 }
30045 }
30046
30047 1 => {
30048 if let Some(program) = &self.program {
30049 ::fidl_next::WireEnvelope::encode_value(
30050 program,
30051 preallocated.encoder,
30052 &mut out,
30053 )?;
30054 } else {
30055 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30056 }
30057 }
30058
30059 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
30060 }
30061 unsafe {
30062 preallocated.write_next(out.assume_init_ref());
30063 }
30064 }
30065
30066 ::fidl_next::WireTable::encode_len(table, max_ord);
30067
30068 Ok(())
30069 }
30070}
30071
30072impl<'de> ::fidl_next::FromWire<WireComponent<'de>> for Component {
30073 #[inline]
30074 fn from_wire(wire: WireComponent<'de>) -> Self {
30075 let wire = ::core::mem::ManuallyDrop::new(wire);
30076
30077 let program = wire.table.get(1);
30078
30079 let uses = wire.table.get(2);
30080
30081 let exposes = wire.table.get(3);
30082
30083 let offers = wire.table.get(4);
30084
30085 let capabilities = wire.table.get(5);
30086
30087 let children = wire.table.get(6);
30088
30089 let collections = wire.table.get(7);
30090
30091 let environments = wire.table.get(8);
30092
30093 let facets = wire.table.get(9);
30094
30095 let config = wire.table.get(10);
30096
30097 Self {
30098
30099
30100 program: program.map(|envelope| ::fidl_next::FromWire::from_wire(
30101 unsafe { envelope.read_unchecked::<crate::WireProgram<'de>>() }
30102 )),
30103
30104
30105 uses: uses.map(|envelope| ::fidl_next::FromWire::from_wire(
30106 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireUse<'de>>>() }
30107 )),
30108
30109
30110 exposes: exposes.map(|envelope| ::fidl_next::FromWire::from_wire(
30111 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireExpose<'de>>>() }
30112 )),
30113
30114
30115 offers: offers.map(|envelope| ::fidl_next::FromWire::from_wire(
30116 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireOffer<'de>>>() }
30117 )),
30118
30119
30120 capabilities: capabilities.map(|envelope| ::fidl_next::FromWire::from_wire(
30121 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireCapability<'de>>>() }
30122 )),
30123
30124
30125 children: children.map(|envelope| ::fidl_next::FromWire::from_wire(
30126 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireChild<'de>>>() }
30127 )),
30128
30129
30130 collections: collections.map(|envelope| ::fidl_next::FromWire::from_wire(
30131 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireCollection<'de>>>() }
30132 )),
30133
30134
30135 environments: environments.map(|envelope| ::fidl_next::FromWire::from_wire(
30136 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireEnvironment<'de>>>() }
30137 )),
30138
30139
30140 facets: facets.map(|envelope| ::fidl_next::FromWire::from_wire(
30141 unsafe { envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>() }
30142 )),
30143
30144
30145 config: config.map(|envelope| ::fidl_next::FromWire::from_wire(
30146 unsafe { envelope.read_unchecked::<crate::WireConfigSchema<'de>>() }
30147 )),
30148
30149 }
30150 }
30151}
30152
30153impl<'de> ::fidl_next::FromWireRef<WireComponent<'de>> for Component {
30154 #[inline]
30155 fn from_wire_ref(wire: &WireComponent<'de>) -> Self {
30156 Self {
30157
30158
30159 program: wire.table.get(1)
30160 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30161 unsafe { envelope.deref_unchecked::<crate::WireProgram<'de>>() }
30162 )),
30163
30164
30165 uses: wire.table.get(2)
30166 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30167 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireUse<'de>>>() }
30168 )),
30169
30170
30171 exposes: wire.table.get(3)
30172 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30173 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireExpose<'de>>>() }
30174 )),
30175
30176
30177 offers: wire.table.get(4)
30178 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30179 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireOffer<'de>>>() }
30180 )),
30181
30182
30183 capabilities: wire.table.get(5)
30184 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30185 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireCapability<'de>>>() }
30186 )),
30187
30188
30189 children: wire.table.get(6)
30190 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30191 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireChild<'de>>>() }
30192 )),
30193
30194
30195 collections: wire.table.get(7)
30196 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30197 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireCollection<'de>>>() }
30198 )),
30199
30200
30201 environments: wire.table.get(8)
30202 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30203 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireEnvironment<'de>>>() }
30204 )),
30205
30206
30207 facets: wire.table.get(9)
30208 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30209 unsafe { envelope.deref_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>() }
30210 )),
30211
30212
30213 config: wire.table.get(10)
30214 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30215 unsafe { envelope.deref_unchecked::<crate::WireConfigSchema<'de>>() }
30216 )),
30217
30218 }
30219 }
30220}
30221
30222#[repr(C)]
30224pub struct WireComponent<'de> {
30225 table: ::fidl_next::WireTable<'de>,
30226}
30227
30228impl<'de> Drop for WireComponent<'de> {
30229 fn drop(&mut self) {
30230 let _ = self
30231 .table
30232 .get(1)
30233 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireProgram<'de>>() });
30234
30235 let _ = self.table.get(2).map(|envelope| unsafe {
30236 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireUse<'de>>>()
30237 });
30238
30239 let _ = self.table.get(3).map(|envelope| unsafe {
30240 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireExpose<'de>>>()
30241 });
30242
30243 let _ = self.table.get(4).map(|envelope| unsafe {
30244 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireOffer<'de>>>()
30245 });
30246
30247 let _ = self.table.get(5).map(|envelope| unsafe {
30248 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireCapability<'de>>>()
30249 });
30250
30251 let _ = self.table.get(6).map(|envelope| unsafe {
30252 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireChild<'de>>>()
30253 });
30254
30255 let _ = self.table.get(7).map(|envelope| unsafe {
30256 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireCollection<'de>>>()
30257 });
30258
30259 let _ = self.table.get(8).map(|envelope| unsafe {
30260 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireEnvironment<'de>>>()
30261 });
30262
30263 let _ = self.table.get(9).map(|envelope| unsafe {
30264 envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
30265 });
30266
30267 let _ = self
30268 .table
30269 .get(10)
30270 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigSchema<'de>>() });
30271 }
30272}
30273
30274unsafe impl ::fidl_next::Wire for WireComponent<'static> {
30275 type Decoded<'de> = WireComponent<'de>;
30276
30277 #[inline]
30278 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30279 ::fidl_next::munge!(let Self { table } = out);
30280 ::fidl_next::WireTable::zero_padding(table);
30281 }
30282}
30283
30284unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponent<'static>
30285where
30286 ___D: ::fidl_next::Decoder + ?Sized,
30287{
30288 fn decode(
30289 slot: ::fidl_next::Slot<'_, Self>,
30290 decoder: &mut ___D,
30291 ) -> Result<(), ::fidl_next::DecodeError> {
30292 ::fidl_next::munge!(let Self { table } = slot);
30293
30294 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30295 match ordinal {
30296 0 => unsafe { ::core::hint::unreachable_unchecked() },
30297
30298 1 => {
30299 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireProgram<'static>>(
30300 slot.as_mut(),
30301 decoder,
30302 )?;
30303
30304 Ok(())
30305 }
30306
30307 2 => {
30308 ::fidl_next::WireEnvelope::decode_as::<
30309 ___D,
30310 ::fidl_next::WireVector<'static, crate::WireUse<'static>>,
30311 >(slot.as_mut(), decoder)?;
30312
30313 Ok(())
30314 }
30315
30316 3 => {
30317 ::fidl_next::WireEnvelope::decode_as::<
30318 ___D,
30319 ::fidl_next::WireVector<'static, crate::WireExpose<'static>>,
30320 >(slot.as_mut(), decoder)?;
30321
30322 Ok(())
30323 }
30324
30325 4 => {
30326 ::fidl_next::WireEnvelope::decode_as::<
30327 ___D,
30328 ::fidl_next::WireVector<'static, crate::WireOffer<'static>>,
30329 >(slot.as_mut(), decoder)?;
30330
30331 Ok(())
30332 }
30333
30334 5 => {
30335 ::fidl_next::WireEnvelope::decode_as::<
30336 ___D,
30337 ::fidl_next::WireVector<'static, crate::WireCapability<'static>>,
30338 >(slot.as_mut(), decoder)?;
30339
30340 Ok(())
30341 }
30342
30343 6 => {
30344 ::fidl_next::WireEnvelope::decode_as::<
30345 ___D,
30346 ::fidl_next::WireVector<'static, crate::WireChild<'static>>,
30347 >(slot.as_mut(), decoder)?;
30348
30349 Ok(())
30350 }
30351
30352 7 => {
30353 ::fidl_next::WireEnvelope::decode_as::<
30354 ___D,
30355 ::fidl_next::WireVector<'static, crate::WireCollection<'static>>,
30356 >(slot.as_mut(), decoder)?;
30357
30358 Ok(())
30359 }
30360
30361 8 => {
30362 ::fidl_next::WireEnvelope::decode_as::<
30363 ___D,
30364 ::fidl_next::WireVector<'static, crate::WireEnvironment<'static>>,
30365 >(slot.as_mut(), decoder)?;
30366
30367 Ok(())
30368 }
30369
30370 9 => {
30371 ::fidl_next::WireEnvelope::decode_as::<
30372 ___D,
30373 ::fidl_next_fuchsia_data::WireDictionary<'static>,
30374 >(slot.as_mut(), decoder)?;
30375
30376 Ok(())
30377 }
30378
30379 10 => {
30380 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigSchema<'static>>(
30381 slot.as_mut(),
30382 decoder,
30383 )?;
30384
30385 Ok(())
30386 }
30387
30388 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
30389 }
30390 })
30391 }
30392}
30393
30394impl<'de> WireComponent<'de> {
30395 pub fn program(&self) -> Option<&crate::WireProgram<'de>> {
30396 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30397 }
30398
30399 pub fn uses(&self) -> Option<&::fidl_next::WireVector<'de, crate::WireUse<'de>>> {
30400 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30401 }
30402
30403 pub fn exposes(&self) -> Option<&::fidl_next::WireVector<'de, crate::WireExpose<'de>>> {
30404 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
30405 }
30406
30407 pub fn offers(&self) -> Option<&::fidl_next::WireVector<'de, crate::WireOffer<'de>>> {
30408 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
30409 }
30410
30411 pub fn capabilities(
30412 &self,
30413 ) -> Option<&::fidl_next::WireVector<'de, crate::WireCapability<'de>>> {
30414 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
30415 }
30416
30417 pub fn children(&self) -> Option<&::fidl_next::WireVector<'de, crate::WireChild<'de>>> {
30418 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
30419 }
30420
30421 pub fn collections(&self) -> Option<&::fidl_next::WireVector<'de, crate::WireCollection<'de>>> {
30422 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
30423 }
30424
30425 pub fn environments(
30426 &self,
30427 ) -> Option<&::fidl_next::WireVector<'de, crate::WireEnvironment<'de>>> {
30428 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
30429 }
30430
30431 pub fn facets(&self) -> Option<&::fidl_next_fuchsia_data::WireDictionary<'de>> {
30432 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
30433 }
30434
30435 pub fn config(&self) -> Option<&crate::WireConfigSchema<'de>> {
30436 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
30437 }
30438}
30439
30440impl<'de> ::core::fmt::Debug for WireComponent<'de> {
30441 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
30442 f.debug_struct("Component")
30443 .field("program", &self.program())
30444 .field("uses", &self.uses())
30445 .field("exposes", &self.exposes())
30446 .field("offers", &self.offers())
30447 .field("capabilities", &self.capabilities())
30448 .field("children", &self.children())
30449 .field("collections", &self.collections())
30450 .field("environments", &self.environments())
30451 .field("facets", &self.facets())
30452 .field("config", &self.config())
30453 .finish()
30454 }
30455}
30456
30457#[doc = " An individual configuration value. It is matched against a specific configuration field based\n on its offset within `ValuesData.values`.\n"]
30458#[derive(Clone, Debug, Default)]
30459pub struct ConfigValueSpec {
30460 pub value: Option<crate::ConfigValue>,
30461}
30462
30463impl ConfigValueSpec {
30464 fn __max_ordinal(&self) -> usize {
30465 if self.value.is_some() {
30466 return 1;
30467 }
30468
30469 0
30470 }
30471}
30472
30473impl ::fidl_next::Encodable for ConfigValueSpec {
30474 type Encoded = WireConfigValueSpec<'static>;
30475}
30476
30477unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigValueSpec
30478where
30479 ___E: ::fidl_next::Encoder + ?Sized,
30480{
30481 #[inline]
30482 fn encode(
30483 mut self,
30484 encoder: &mut ___E,
30485 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
30486 ) -> Result<(), ::fidl_next::EncodeError> {
30487 ::fidl_next::munge!(let WireConfigValueSpec { table } = out);
30488
30489 let max_ord = self.__max_ordinal();
30490
30491 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
30492 ::fidl_next::Wire::zero_padding(&mut out);
30493
30494 let mut preallocated =
30495 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
30496
30497 for i in 1..=max_ord {
30498 match i {
30499 1 => {
30500 if let Some(value) = self.value.take() {
30501 ::fidl_next::WireEnvelope::encode_value(
30502 value,
30503 preallocated.encoder,
30504 &mut out,
30505 )?;
30506 } else {
30507 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30508 }
30509 }
30510
30511 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
30512 }
30513 unsafe {
30514 preallocated.write_next(out.assume_init_ref());
30515 }
30516 }
30517
30518 ::fidl_next::WireTable::encode_len(table, max_ord);
30519
30520 Ok(())
30521 }
30522}
30523
30524unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigValueSpec
30525where
30526 ___E: ::fidl_next::Encoder + ?Sized,
30527{
30528 #[inline]
30529 fn encode_ref(
30530 &self,
30531 encoder: &mut ___E,
30532 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
30533 ) -> Result<(), ::fidl_next::EncodeError> {
30534 ::fidl_next::munge!(let WireConfigValueSpec { table } = out);
30535
30536 let max_ord = self.__max_ordinal();
30537
30538 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
30539 ::fidl_next::Wire::zero_padding(&mut out);
30540
30541 let mut preallocated =
30542 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
30543
30544 for i in 1..=max_ord {
30545 match i {
30546 1 => {
30547 if let Some(value) = &self.value {
30548 ::fidl_next::WireEnvelope::encode_value(
30549 value,
30550 preallocated.encoder,
30551 &mut out,
30552 )?;
30553 } else {
30554 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30555 }
30556 }
30557
30558 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
30559 }
30560 unsafe {
30561 preallocated.write_next(out.assume_init_ref());
30562 }
30563 }
30564
30565 ::fidl_next::WireTable::encode_len(table, max_ord);
30566
30567 Ok(())
30568 }
30569}
30570
30571impl<'de> ::fidl_next::FromWire<WireConfigValueSpec<'de>> for ConfigValueSpec {
30572 #[inline]
30573 fn from_wire(wire: WireConfigValueSpec<'de>) -> Self {
30574 let wire = ::core::mem::ManuallyDrop::new(wire);
30575
30576 let value = wire.table.get(1);
30577
30578 Self {
30579 value: value.map(|envelope| {
30580 ::fidl_next::FromWire::from_wire(unsafe {
30581 envelope.read_unchecked::<crate::WireConfigValue<'de>>()
30582 })
30583 }),
30584 }
30585 }
30586}
30587
30588impl<'de> ::fidl_next::FromWireRef<WireConfigValueSpec<'de>> for ConfigValueSpec {
30589 #[inline]
30590 fn from_wire_ref(wire: &WireConfigValueSpec<'de>) -> Self {
30591 Self {
30592 value: wire.table.get(1).map(|envelope| {
30593 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
30594 envelope.deref_unchecked::<crate::WireConfigValue<'de>>()
30595 })
30596 }),
30597 }
30598 }
30599}
30600
30601#[repr(C)]
30603pub struct WireConfigValueSpec<'de> {
30604 table: ::fidl_next::WireTable<'de>,
30605}
30606
30607impl<'de> Drop for WireConfigValueSpec<'de> {
30608 fn drop(&mut self) {
30609 let _ = self
30610 .table
30611 .get(1)
30612 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigValue<'de>>() });
30613 }
30614}
30615
30616unsafe impl ::fidl_next::Wire for WireConfigValueSpec<'static> {
30617 type Decoded<'de> = WireConfigValueSpec<'de>;
30618
30619 #[inline]
30620 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30621 ::fidl_next::munge!(let Self { table } = out);
30622 ::fidl_next::WireTable::zero_padding(table);
30623 }
30624}
30625
30626unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigValueSpec<'static>
30627where
30628 ___D: ::fidl_next::Decoder + ?Sized,
30629{
30630 fn decode(
30631 slot: ::fidl_next::Slot<'_, Self>,
30632 decoder: &mut ___D,
30633 ) -> Result<(), ::fidl_next::DecodeError> {
30634 ::fidl_next::munge!(let Self { table } = slot);
30635
30636 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30637 match ordinal {
30638 0 => unsafe { ::core::hint::unreachable_unchecked() },
30639
30640 1 => {
30641 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigValue<'static>>(
30642 slot.as_mut(),
30643 decoder,
30644 )?;
30645
30646 Ok(())
30647 }
30648
30649 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
30650 }
30651 })
30652 }
30653}
30654
30655impl<'de> WireConfigValueSpec<'de> {
30656 pub fn value(&self) -> Option<&crate::WireConfigValue<'de>> {
30657 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30658 }
30659}
30660
30661impl<'de> ::core::fmt::Debug for WireConfigValueSpec<'de> {
30662 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
30663 f.debug_struct("ConfigValueSpec").field("value", &self.value()).finish()
30664 }
30665}
30666
30667#[doc = " Contents of the configuration value file. Defines the base values for a component\'s config.\n"]
30668#[derive(Clone, Debug, Default)]
30669pub struct ConfigValuesData {
30670 pub values: Option<Vec<crate::ConfigValueSpec>>,
30671
30672 pub checksum: Option<crate::ConfigChecksum>,
30673}
30674
30675impl ConfigValuesData {
30676 fn __max_ordinal(&self) -> usize {
30677 if self.checksum.is_some() {
30678 return 2;
30679 }
30680
30681 if self.values.is_some() {
30682 return 1;
30683 }
30684
30685 0
30686 }
30687}
30688
30689impl ::fidl_next::Encodable for ConfigValuesData {
30690 type Encoded = WireConfigValuesData<'static>;
30691}
30692
30693unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigValuesData
30694where
30695 ___E: ::fidl_next::Encoder + ?Sized,
30696{
30697 #[inline]
30698 fn encode(
30699 mut self,
30700 encoder: &mut ___E,
30701 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
30702 ) -> Result<(), ::fidl_next::EncodeError> {
30703 ::fidl_next::munge!(let WireConfigValuesData { table } = out);
30704
30705 let max_ord = self.__max_ordinal();
30706
30707 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
30708 ::fidl_next::Wire::zero_padding(&mut out);
30709
30710 let mut preallocated =
30711 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
30712
30713 for i in 1..=max_ord {
30714 match i {
30715 2 => {
30716 if let Some(checksum) = self.checksum.take() {
30717 ::fidl_next::WireEnvelope::encode_value(
30718 checksum,
30719 preallocated.encoder,
30720 &mut out,
30721 )?;
30722 } else {
30723 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30724 }
30725 }
30726
30727 1 => {
30728 if let Some(values) = self.values.take() {
30729 ::fidl_next::WireEnvelope::encode_value(
30730 values,
30731 preallocated.encoder,
30732 &mut out,
30733 )?;
30734 } else {
30735 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30736 }
30737 }
30738
30739 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
30740 }
30741 unsafe {
30742 preallocated.write_next(out.assume_init_ref());
30743 }
30744 }
30745
30746 ::fidl_next::WireTable::encode_len(table, max_ord);
30747
30748 Ok(())
30749 }
30750}
30751
30752unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigValuesData
30753where
30754 ___E: ::fidl_next::Encoder + ?Sized,
30755{
30756 #[inline]
30757 fn encode_ref(
30758 &self,
30759 encoder: &mut ___E,
30760 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
30761 ) -> Result<(), ::fidl_next::EncodeError> {
30762 ::fidl_next::munge!(let WireConfigValuesData { table } = out);
30763
30764 let max_ord = self.__max_ordinal();
30765
30766 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
30767 ::fidl_next::Wire::zero_padding(&mut out);
30768
30769 let mut preallocated =
30770 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
30771
30772 for i in 1..=max_ord {
30773 match i {
30774 2 => {
30775 if let Some(checksum) = &self.checksum {
30776 ::fidl_next::WireEnvelope::encode_value(
30777 checksum,
30778 preallocated.encoder,
30779 &mut out,
30780 )?;
30781 } else {
30782 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30783 }
30784 }
30785
30786 1 => {
30787 if let Some(values) = &self.values {
30788 ::fidl_next::WireEnvelope::encode_value(
30789 values,
30790 preallocated.encoder,
30791 &mut out,
30792 )?;
30793 } else {
30794 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30795 }
30796 }
30797
30798 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
30799 }
30800 unsafe {
30801 preallocated.write_next(out.assume_init_ref());
30802 }
30803 }
30804
30805 ::fidl_next::WireTable::encode_len(table, max_ord);
30806
30807 Ok(())
30808 }
30809}
30810
30811impl<'de> ::fidl_next::FromWire<WireConfigValuesData<'de>> for ConfigValuesData {
30812 #[inline]
30813 fn from_wire(wire: WireConfigValuesData<'de>) -> Self {
30814 let wire = ::core::mem::ManuallyDrop::new(wire);
30815
30816 let values = wire.table.get(1);
30817
30818 let checksum = wire.table.get(2);
30819
30820 Self {
30821
30822
30823 values: values.map(|envelope| ::fidl_next::FromWire::from_wire(
30824 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigValueSpec<'de>>>() }
30825 )),
30826
30827
30828 checksum: checksum.map(|envelope| ::fidl_next::FromWire::from_wire(
30829 unsafe { envelope.read_unchecked::<crate::WireConfigChecksum<'de>>() }
30830 )),
30831
30832 }
30833 }
30834}
30835
30836impl<'de> ::fidl_next::FromWireRef<WireConfigValuesData<'de>> for ConfigValuesData {
30837 #[inline]
30838 fn from_wire_ref(wire: &WireConfigValuesData<'de>) -> Self {
30839 Self {
30840
30841
30842 values: wire.table.get(1)
30843 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30844 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigValueSpec<'de>>>() }
30845 )),
30846
30847
30848 checksum: wire.table.get(2)
30849 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30850 unsafe { envelope.deref_unchecked::<crate::WireConfigChecksum<'de>>() }
30851 )),
30852
30853 }
30854 }
30855}
30856
30857#[repr(C)]
30859pub struct WireConfigValuesData<'de> {
30860 table: ::fidl_next::WireTable<'de>,
30861}
30862
30863impl<'de> Drop for WireConfigValuesData<'de> {
30864 fn drop(&mut self) {
30865 let _ = self.table.get(1)
30866 .map(|envelope| unsafe {
30867 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigValueSpec<'de>>>()
30868 });
30869
30870 let _ = self
30871 .table
30872 .get(2)
30873 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigChecksum<'de>>() });
30874 }
30875}
30876
30877unsafe impl ::fidl_next::Wire for WireConfigValuesData<'static> {
30878 type Decoded<'de> = WireConfigValuesData<'de>;
30879
30880 #[inline]
30881 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30882 ::fidl_next::munge!(let Self { table } = out);
30883 ::fidl_next::WireTable::zero_padding(table);
30884 }
30885}
30886
30887unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigValuesData<'static>
30888where
30889 ___D: ::fidl_next::Decoder + ?Sized,
30890{
30891 fn decode(
30892 slot: ::fidl_next::Slot<'_, Self>,
30893 decoder: &mut ___D,
30894 ) -> Result<(), ::fidl_next::DecodeError> {
30895 ::fidl_next::munge!(let Self { table } = slot);
30896
30897 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30898 match ordinal {
30899 0 => unsafe { ::core::hint::unreachable_unchecked() },
30900
30901 1 => {
30902 ::fidl_next::WireEnvelope::decode_as::<
30903 ___D,
30904 ::fidl_next::WireVector<'static, crate::WireConfigValueSpec<'static>>,
30905 >(slot.as_mut(), decoder)?;
30906
30907 Ok(())
30908 }
30909
30910 2 => {
30911 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigChecksum<'static>>(
30912 slot.as_mut(),
30913 decoder,
30914 )?;
30915
30916 Ok(())
30917 }
30918
30919 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
30920 }
30921 })
30922 }
30923}
30924
30925impl<'de> WireConfigValuesData<'de> {
30926 pub fn values(&self) -> Option<&::fidl_next::WireVector<'de, crate::WireConfigValueSpec<'de>>> {
30927 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30928 }
30929
30930 pub fn checksum(&self) -> Option<&crate::WireConfigChecksum<'de>> {
30931 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30932 }
30933}
30934
30935impl<'de> ::core::fmt::Debug for WireConfigValuesData<'de> {
30936 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
30937 f.debug_struct("ConfigValuesData")
30938 .field("values", &self.values())
30939 .field("checksum", &self.checksum())
30940 .finish()
30941 }
30942}
30943
30944#[doc = " Indicates the event name to subscribe to with a given event mode.\n"]
30945#[derive(Clone, Debug, Default)]
30946pub struct EventSubscription {
30947 pub event_name: Option<String>,
30948}
30949
30950impl EventSubscription {
30951 fn __max_ordinal(&self) -> usize {
30952 if self.event_name.is_some() {
30953 return 1;
30954 }
30955
30956 0
30957 }
30958}
30959
30960impl ::fidl_next::Encodable for EventSubscription {
30961 type Encoded = WireEventSubscription<'static>;
30962}
30963
30964unsafe impl<___E> ::fidl_next::Encode<___E> for EventSubscription
30965where
30966 ___E: ::fidl_next::Encoder + ?Sized,
30967{
30968 #[inline]
30969 fn encode(
30970 mut self,
30971 encoder: &mut ___E,
30972 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
30973 ) -> Result<(), ::fidl_next::EncodeError> {
30974 ::fidl_next::munge!(let WireEventSubscription { table } = out);
30975
30976 let max_ord = self.__max_ordinal();
30977
30978 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
30979 ::fidl_next::Wire::zero_padding(&mut out);
30980
30981 let mut preallocated =
30982 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
30983
30984 for i in 1..=max_ord {
30985 match i {
30986 1 => {
30987 if let Some(event_name) = self.event_name.take() {
30988 ::fidl_next::WireEnvelope::encode_value(
30989 event_name,
30990 preallocated.encoder,
30991 &mut out,
30992 )?;
30993 } else {
30994 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30995 }
30996 }
30997
30998 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
30999 }
31000 unsafe {
31001 preallocated.write_next(out.assume_init_ref());
31002 }
31003 }
31004
31005 ::fidl_next::WireTable::encode_len(table, max_ord);
31006
31007 Ok(())
31008 }
31009}
31010
31011unsafe impl<___E> ::fidl_next::EncodeRef<___E> for EventSubscription
31012where
31013 ___E: ::fidl_next::Encoder + ?Sized,
31014{
31015 #[inline]
31016 fn encode_ref(
31017 &self,
31018 encoder: &mut ___E,
31019 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
31020 ) -> Result<(), ::fidl_next::EncodeError> {
31021 ::fidl_next::munge!(let WireEventSubscription { table } = out);
31022
31023 let max_ord = self.__max_ordinal();
31024
31025 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
31026 ::fidl_next::Wire::zero_padding(&mut out);
31027
31028 let mut preallocated =
31029 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
31030
31031 for i in 1..=max_ord {
31032 match i {
31033 1 => {
31034 if let Some(event_name) = &self.event_name {
31035 ::fidl_next::WireEnvelope::encode_value(
31036 event_name,
31037 preallocated.encoder,
31038 &mut out,
31039 )?;
31040 } else {
31041 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31042 }
31043 }
31044
31045 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
31046 }
31047 unsafe {
31048 preallocated.write_next(out.assume_init_ref());
31049 }
31050 }
31051
31052 ::fidl_next::WireTable::encode_len(table, max_ord);
31053
31054 Ok(())
31055 }
31056}
31057
31058impl<'de> ::fidl_next::FromWire<WireEventSubscription<'de>> for EventSubscription {
31059 #[inline]
31060 fn from_wire(wire: WireEventSubscription<'de>) -> Self {
31061 let wire = ::core::mem::ManuallyDrop::new(wire);
31062
31063 let event_name = wire.table.get(1);
31064
31065 Self {
31066 event_name: event_name.map(|envelope| {
31067 ::fidl_next::FromWire::from_wire(unsafe {
31068 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
31069 })
31070 }),
31071 }
31072 }
31073}
31074
31075impl<'de> ::fidl_next::FromWireRef<WireEventSubscription<'de>> for EventSubscription {
31076 #[inline]
31077 fn from_wire_ref(wire: &WireEventSubscription<'de>) -> Self {
31078 Self {
31079 event_name: wire.table.get(1).map(|envelope| {
31080 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
31081 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
31082 })
31083 }),
31084 }
31085 }
31086}
31087
31088#[repr(C)]
31090pub struct WireEventSubscription<'de> {
31091 table: ::fidl_next::WireTable<'de>,
31092}
31093
31094impl<'de> Drop for WireEventSubscription<'de> {
31095 fn drop(&mut self) {
31096 let _ = self
31097 .table
31098 .get(1)
31099 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
31100 }
31101}
31102
31103unsafe impl ::fidl_next::Wire for WireEventSubscription<'static> {
31104 type Decoded<'de> = WireEventSubscription<'de>;
31105
31106 #[inline]
31107 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31108 ::fidl_next::munge!(let Self { table } = out);
31109 ::fidl_next::WireTable::zero_padding(table);
31110 }
31111}
31112
31113unsafe impl<___D> ::fidl_next::Decode<___D> for WireEventSubscription<'static>
31114where
31115 ___D: ::fidl_next::Decoder + ?Sized,
31116{
31117 fn decode(
31118 slot: ::fidl_next::Slot<'_, Self>,
31119 decoder: &mut ___D,
31120 ) -> Result<(), ::fidl_next::DecodeError> {
31121 ::fidl_next::munge!(let Self { table } = slot);
31122
31123 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
31124 match ordinal {
31125 0 => unsafe { ::core::hint::unreachable_unchecked() },
31126
31127 1 => {
31128 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
31129 slot.as_mut(),
31130 decoder,
31131 )?;
31132
31133 let event_name = unsafe {
31134 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
31135 };
31136
31137 if event_name.len() > 100 {
31138 return Err(::fidl_next::DecodeError::VectorTooLong {
31139 size: event_name.len() as u64,
31140 limit: 100,
31141 });
31142 }
31143
31144 Ok(())
31145 }
31146
31147 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
31148 }
31149 })
31150 }
31151}
31152
31153impl<'de> WireEventSubscription<'de> {
31154 pub fn event_name(&self) -> Option<&::fidl_next::WireString<'de>> {
31155 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
31156 }
31157}
31158
31159impl<'de> ::core::fmt::Debug for WireEventSubscription<'de> {
31160 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
31161 f.debug_struct("EventSubscription").field("event_name", &self.event_name()).finish()
31162 }
31163}
31164
31165#[derive(Clone, Debug)]
31166pub enum LayoutParameter {
31167 NestedType(crate::ConfigType),
31168
31169 UnknownOrdinal_(u64),
31170}
31171
31172impl ::fidl_next::Encodable for LayoutParameter {
31173 type Encoded = WireLayoutParameter<'static>;
31174}
31175
31176unsafe impl<___E> ::fidl_next::Encode<___E> for LayoutParameter
31177where
31178 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
31179 ___E: ::fidl_next::Encoder,
31180{
31181 #[inline]
31182 fn encode(
31183 self,
31184 encoder: &mut ___E,
31185 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
31186 ) -> Result<(), ::fidl_next::EncodeError> {
31187 ::fidl_next::munge!(let WireLayoutParameter { raw, _phantom: _ } = out);
31188
31189 match self {
31190 Self::NestedType(value) => ::fidl_next::RawWireUnion::encode_as::<
31191 ___E,
31192 crate::ConfigType,
31193 >(value, 1, encoder, raw)?,
31194
31195 Self::UnknownOrdinal_(ordinal) => {
31196 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
31197 }
31198 }
31199
31200 Ok(())
31201 }
31202}
31203
31204unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LayoutParameter
31205where
31206 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
31207 ___E: ::fidl_next::Encoder,
31208{
31209 #[inline]
31210 fn encode_ref(
31211 &self,
31212 encoder: &mut ___E,
31213 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
31214 ) -> Result<(), ::fidl_next::EncodeError> {
31215 ::fidl_next::munge!(let WireLayoutParameter { raw, _phantom: _ } = out);
31216
31217 match self {
31218 Self::NestedType(value) => ::fidl_next::RawWireUnion::encode_as::<
31219 ___E,
31220 &crate::ConfigType,
31221 >(value, 1, encoder, raw)?,
31222
31223 Self::UnknownOrdinal_(ordinal) => {
31224 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
31225 }
31226 }
31227
31228 Ok(())
31229 }
31230}
31231
31232impl ::fidl_next::EncodableOption for LayoutParameter {
31233 type EncodedOption = WireOptionalLayoutParameter<'static>;
31234}
31235
31236unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LayoutParameter
31237where
31238 ___E: ?Sized,
31239 LayoutParameter: ::fidl_next::Encode<___E>,
31240{
31241 #[inline]
31242 fn encode_option(
31243 this: Option<Self>,
31244 encoder: &mut ___E,
31245 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
31246 ) -> Result<(), ::fidl_next::EncodeError> {
31247 ::fidl_next::munge!(let WireOptionalLayoutParameter { raw, _phantom: _ } = &mut *out);
31248
31249 if let Some(inner) = this {
31250 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
31251 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
31252 } else {
31253 ::fidl_next::RawWireUnion::encode_absent(raw);
31254 }
31255
31256 Ok(())
31257 }
31258}
31259
31260unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for LayoutParameter
31261where
31262 ___E: ?Sized,
31263 LayoutParameter: ::fidl_next::EncodeRef<___E>,
31264{
31265 #[inline]
31266 fn encode_option_ref(
31267 this: Option<&Self>,
31268 encoder: &mut ___E,
31269 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
31270 ) -> Result<(), ::fidl_next::EncodeError> {
31271 ::fidl_next::munge!(let WireOptionalLayoutParameter { raw, _phantom: _ } = &mut *out);
31272
31273 if let Some(inner) = this {
31274 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
31275 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
31276 } else {
31277 ::fidl_next::RawWireUnion::encode_absent(raw);
31278 }
31279
31280 Ok(())
31281 }
31282}
31283
31284impl<'de> ::fidl_next::FromWire<WireLayoutParameter<'de>> for LayoutParameter {
31285 #[inline]
31286 fn from_wire(wire: WireLayoutParameter<'de>) -> Self {
31287 let wire = ::core::mem::ManuallyDrop::new(wire);
31288 match wire.raw.ordinal() {
31289 1 => Self::NestedType(::fidl_next::FromWire::from_wire(unsafe {
31290 wire.raw.get().read_unchecked::<crate::WireConfigType<'de>>()
31291 })),
31292
31293 _ => unsafe { ::core::hint::unreachable_unchecked() },
31294 }
31295 }
31296}
31297
31298impl<'de> ::fidl_next::FromWireRef<WireLayoutParameter<'de>> for LayoutParameter {
31299 #[inline]
31300 fn from_wire_ref(wire: &WireLayoutParameter<'de>) -> Self {
31301 match wire.raw.ordinal() {
31302 1 => Self::NestedType(::fidl_next::FromWireRef::from_wire_ref(unsafe {
31303 wire.raw.get().deref_unchecked::<crate::WireConfigType<'de>>()
31304 })),
31305
31306 _ => unsafe { ::core::hint::unreachable_unchecked() },
31307 }
31308 }
31309}
31310
31311impl<'de> ::fidl_next::FromWireOption<WireOptionalLayoutParameter<'de>> for Box<LayoutParameter> {
31312 #[inline]
31313 fn from_wire_option(wire: WireOptionalLayoutParameter<'de>) -> Option<Self> {
31314 if let Some(inner) = wire.into_option() {
31315 Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
31316 } else {
31317 None
31318 }
31319 }
31320}
31321
31322impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalLayoutParameter<'de>>
31323 for Box<LayoutParameter>
31324{
31325 #[inline]
31326 fn from_wire_option_ref(wire: &WireOptionalLayoutParameter<'de>) -> Option<Self> {
31327 if let Some(inner) = wire.as_ref() {
31328 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
31329 } else {
31330 None
31331 }
31332 }
31333}
31334
31335#[repr(transparent)]
31337pub struct WireLayoutParameter<'de> {
31338 raw: ::fidl_next::RawWireUnion,
31339 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
31340}
31341
31342impl<'de> Drop for WireLayoutParameter<'de> {
31343 fn drop(&mut self) {
31344 match self.raw.ordinal() {
31345 1 => {
31346 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireConfigType<'de>>() };
31347 }
31348
31349 _ => (),
31350 }
31351 }
31352}
31353
31354unsafe impl ::fidl_next::Wire for WireLayoutParameter<'static> {
31355 type Decoded<'de> = WireLayoutParameter<'de>;
31356
31357 #[inline]
31358 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31359 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
31360 ::fidl_next::RawWireUnion::zero_padding(raw);
31361 }
31362}
31363
31364pub mod layout_parameter {
31365 pub enum Ref<'de> {
31366 NestedType(&'de crate::WireConfigType<'de>),
31367
31368 UnknownOrdinal_(u64),
31369 }
31370}
31371
31372impl<'de> WireLayoutParameter<'de> {
31373 pub fn as_ref(&self) -> crate::layout_parameter::Ref<'_> {
31374 match self.raw.ordinal() {
31375 1 => crate::layout_parameter::Ref::NestedType(unsafe {
31376 self.raw.get().deref_unchecked::<crate::WireConfigType<'_>>()
31377 }),
31378
31379 unknown => crate::layout_parameter::Ref::UnknownOrdinal_(unknown),
31380 }
31381 }
31382}
31383
31384unsafe impl<___D> ::fidl_next::Decode<___D> for WireLayoutParameter<'static>
31385where
31386 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
31387 ___D: ::fidl_next::Decoder,
31388{
31389 fn decode(
31390 mut slot: ::fidl_next::Slot<'_, Self>,
31391 decoder: &mut ___D,
31392 ) -> Result<(), ::fidl_next::DecodeError> {
31393 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
31394 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
31395 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigType<'static>>(
31396 raw, decoder,
31397 )?,
31398
31399 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
31400 }
31401
31402 Ok(())
31403 }
31404}
31405
31406impl<'de> ::core::fmt::Debug for WireLayoutParameter<'de> {
31407 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
31408 match self.raw.ordinal() {
31409 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireConfigType<'_>>().fmt(f) },
31410 _ => unsafe { ::core::hint::unreachable_unchecked() },
31411 }
31412 }
31413}
31414
31415#[repr(transparent)]
31416pub struct WireOptionalLayoutParameter<'de> {
31417 raw: ::fidl_next::RawWireUnion,
31418 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
31419}
31420
31421unsafe impl ::fidl_next::Wire for WireOptionalLayoutParameter<'static> {
31422 type Decoded<'de> = WireOptionalLayoutParameter<'de>;
31423
31424 #[inline]
31425 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31426 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
31427 ::fidl_next::RawWireUnion::zero_padding(raw);
31428 }
31429}
31430
31431impl<'de> WireOptionalLayoutParameter<'de> {
31432 pub fn is_some(&self) -> bool {
31433 self.raw.is_some()
31434 }
31435
31436 pub fn is_none(&self) -> bool {
31437 self.raw.is_none()
31438 }
31439
31440 pub fn as_ref(&self) -> Option<&WireLayoutParameter<'de>> {
31441 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
31442 }
31443
31444 pub fn into_option(self) -> Option<WireLayoutParameter<'de>> {
31445 if self.is_some() {
31446 Some(WireLayoutParameter { raw: self.raw, _phantom: ::core::marker::PhantomData })
31447 } else {
31448 None
31449 }
31450 }
31451}
31452
31453unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalLayoutParameter<'static>
31454where
31455 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
31456 ___D: ::fidl_next::Decoder,
31457{
31458 fn decode(
31459 mut slot: ::fidl_next::Slot<'_, Self>,
31460 decoder: &mut ___D,
31461 ) -> Result<(), ::fidl_next::DecodeError> {
31462 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
31463 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
31464 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigType<'static>>(
31465 raw, decoder,
31466 )?,
31467
31468 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
31469 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
31470 }
31471
31472 Ok(())
31473 }
31474}
31475
31476impl<'de> ::core::fmt::Debug for WireOptionalLayoutParameter<'de> {
31477 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
31478 self.as_ref().fmt(f)
31479 }
31480}
31481
31482pub const MAX_MONIKER_LENGTH: u32 = 4096;
31483
31484#[doc = " The maximum number of EventSubscriptions in an EventStream.\n"]
31485pub const MAX_NUM_EVENT_STREAM_SUBSCRIPTIONS: u64 = 100;
31486
31487#[derive(Clone, Debug)]
31488pub struct ResolvedConfigField {
31489 pub key: String,
31490
31491 pub value: crate::ConfigValue,
31492}
31493
31494impl ::fidl_next::Encodable for ResolvedConfigField {
31495 type Encoded = WireResolvedConfigField<'static>;
31496}
31497
31498unsafe impl<___E> ::fidl_next::Encode<___E> for ResolvedConfigField
31499where
31500 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
31501 ___E: ::fidl_next::Encoder,
31502{
31503 #[inline]
31504 fn encode(
31505 self,
31506 encoder: &mut ___E,
31507 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
31508 ) -> Result<(), ::fidl_next::EncodeError> {
31509 ::fidl_next::munge! {
31510 let Self::Encoded {
31511 key,
31512 value,
31513
31514 } = out;
31515 }
31516
31517 ::fidl_next::Encode::encode(self.key, encoder, key)?;
31518
31519 ::fidl_next::Encode::encode(self.value, encoder, value)?;
31520
31521 Ok(())
31522 }
31523}
31524
31525unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ResolvedConfigField
31526where
31527 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
31528 ___E: ::fidl_next::Encoder,
31529{
31530 #[inline]
31531 fn encode_ref(
31532 &self,
31533 encoder: &mut ___E,
31534 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
31535 ) -> Result<(), ::fidl_next::EncodeError> {
31536 ::fidl_next::munge! {
31537 let Self::Encoded {
31538 key,
31539 value,
31540
31541 } = out;
31542 }
31543
31544 ::fidl_next::EncodeRef::encode_ref(&self.key, encoder, key)?;
31545
31546 ::fidl_next::EncodeRef::encode_ref(&self.value, encoder, value)?;
31547
31548 Ok(())
31549 }
31550}
31551
31552impl ::fidl_next::EncodableOption for ResolvedConfigField {
31553 type EncodedOption = ::fidl_next::WireBox<'static, WireResolvedConfigField<'static>>;
31554}
31555
31556unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ResolvedConfigField
31557where
31558 ___E: ::fidl_next::Encoder + ?Sized,
31559 ResolvedConfigField: ::fidl_next::Encode<___E>,
31560{
31561 #[inline]
31562 fn encode_option(
31563 this: Option<Self>,
31564 encoder: &mut ___E,
31565 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
31566 ) -> Result<(), ::fidl_next::EncodeError> {
31567 if let Some(inner) = this {
31568 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
31569 ::fidl_next::WireBox::encode_present(out);
31570 } else {
31571 ::fidl_next::WireBox::encode_absent(out);
31572 }
31573
31574 Ok(())
31575 }
31576}
31577
31578unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ResolvedConfigField
31579where
31580 ___E: ::fidl_next::Encoder + ?Sized,
31581 ResolvedConfigField: ::fidl_next::EncodeRef<___E>,
31582{
31583 #[inline]
31584 fn encode_option_ref(
31585 this: Option<&Self>,
31586 encoder: &mut ___E,
31587 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
31588 ) -> Result<(), ::fidl_next::EncodeError> {
31589 if let Some(inner) = this {
31590 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
31591 ::fidl_next::WireBox::encode_present(out);
31592 } else {
31593 ::fidl_next::WireBox::encode_absent(out);
31594 }
31595
31596 Ok(())
31597 }
31598}
31599
31600impl<'de> ::fidl_next::FromWire<WireResolvedConfigField<'de>> for ResolvedConfigField {
31601 #[inline]
31602 fn from_wire(wire: WireResolvedConfigField<'de>) -> Self {
31603 Self {
31604 key: ::fidl_next::FromWire::from_wire(wire.key),
31605
31606 value: ::fidl_next::FromWire::from_wire(wire.value),
31607 }
31608 }
31609}
31610
31611impl<'de> ::fidl_next::FromWireRef<WireResolvedConfigField<'de>> for ResolvedConfigField {
31612 #[inline]
31613 fn from_wire_ref(wire: &WireResolvedConfigField<'de>) -> Self {
31614 Self {
31615 key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
31616
31617 value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value),
31618 }
31619 }
31620}
31621
31622#[derive(Debug)]
31624#[repr(C)]
31625pub struct WireResolvedConfigField<'de> {
31626 pub key: ::fidl_next::WireString<'de>,
31627
31628 pub value: crate::WireConfigValue<'de>,
31629}
31630
31631unsafe impl ::fidl_next::Wire for WireResolvedConfigField<'static> {
31632 type Decoded<'de> = WireResolvedConfigField<'de>;
31633
31634 #[inline]
31635 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
31636}
31637
31638unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolvedConfigField<'static>
31639where
31640 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
31641 ___D: ::fidl_next::Decoder,
31642{
31643 fn decode(
31644 slot: ::fidl_next::Slot<'_, Self>,
31645 decoder: &mut ___D,
31646 ) -> Result<(), ::fidl_next::DecodeError> {
31647 ::fidl_next::munge! {
31648 let Self {
31649 mut key,
31650 mut value,
31651
31652 } = slot;
31653 }
31654
31655 ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
31656
31657 ::fidl_next::Decode::decode(value.as_mut(), decoder)?;
31658
31659 Ok(())
31660 }
31661}
31662
31663#[doc = " A configuration that has been completely resolved by component manager.\n"]
31664#[derive(Clone, Debug)]
31665pub struct ResolvedConfig {
31666 pub fields: Vec<crate::ResolvedConfigField>,
31667
31668 pub checksum: crate::ConfigChecksum,
31669}
31670
31671impl ::fidl_next::Encodable for ResolvedConfig {
31672 type Encoded = WireResolvedConfig<'static>;
31673}
31674
31675unsafe impl<___E> ::fidl_next::Encode<___E> for ResolvedConfig
31676where
31677 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
31678 ___E: ::fidl_next::Encoder,
31679{
31680 #[inline]
31681 fn encode(
31682 self,
31683 encoder: &mut ___E,
31684 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
31685 ) -> Result<(), ::fidl_next::EncodeError> {
31686 ::fidl_next::munge! {
31687 let Self::Encoded {
31688 fields,
31689 checksum,
31690
31691 } = out;
31692 }
31693
31694 ::fidl_next::Encode::encode(self.fields, encoder, fields)?;
31695
31696 ::fidl_next::Encode::encode(self.checksum, encoder, checksum)?;
31697
31698 Ok(())
31699 }
31700}
31701
31702unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ResolvedConfig
31703where
31704 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
31705 ___E: ::fidl_next::Encoder,
31706{
31707 #[inline]
31708 fn encode_ref(
31709 &self,
31710 encoder: &mut ___E,
31711 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
31712 ) -> Result<(), ::fidl_next::EncodeError> {
31713 ::fidl_next::munge! {
31714 let Self::Encoded {
31715 fields,
31716 checksum,
31717
31718 } = out;
31719 }
31720
31721 ::fidl_next::EncodeRef::encode_ref(&self.fields, encoder, fields)?;
31722
31723 ::fidl_next::EncodeRef::encode_ref(&self.checksum, encoder, checksum)?;
31724
31725 Ok(())
31726 }
31727}
31728
31729impl ::fidl_next::EncodableOption for ResolvedConfig {
31730 type EncodedOption = ::fidl_next::WireBox<'static, WireResolvedConfig<'static>>;
31731}
31732
31733unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ResolvedConfig
31734where
31735 ___E: ::fidl_next::Encoder + ?Sized,
31736 ResolvedConfig: ::fidl_next::Encode<___E>,
31737{
31738 #[inline]
31739 fn encode_option(
31740 this: Option<Self>,
31741 encoder: &mut ___E,
31742 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
31743 ) -> Result<(), ::fidl_next::EncodeError> {
31744 if let Some(inner) = this {
31745 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
31746 ::fidl_next::WireBox::encode_present(out);
31747 } else {
31748 ::fidl_next::WireBox::encode_absent(out);
31749 }
31750
31751 Ok(())
31752 }
31753}
31754
31755unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ResolvedConfig
31756where
31757 ___E: ::fidl_next::Encoder + ?Sized,
31758 ResolvedConfig: ::fidl_next::EncodeRef<___E>,
31759{
31760 #[inline]
31761 fn encode_option_ref(
31762 this: Option<&Self>,
31763 encoder: &mut ___E,
31764 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
31765 ) -> Result<(), ::fidl_next::EncodeError> {
31766 if let Some(inner) = this {
31767 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
31768 ::fidl_next::WireBox::encode_present(out);
31769 } else {
31770 ::fidl_next::WireBox::encode_absent(out);
31771 }
31772
31773 Ok(())
31774 }
31775}
31776
31777impl<'de> ::fidl_next::FromWire<WireResolvedConfig<'de>> for ResolvedConfig {
31778 #[inline]
31779 fn from_wire(wire: WireResolvedConfig<'de>) -> Self {
31780 Self {
31781 fields: ::fidl_next::FromWire::from_wire(wire.fields),
31782
31783 checksum: ::fidl_next::FromWire::from_wire(wire.checksum),
31784 }
31785 }
31786}
31787
31788impl<'de> ::fidl_next::FromWireRef<WireResolvedConfig<'de>> for ResolvedConfig {
31789 #[inline]
31790 fn from_wire_ref(wire: &WireResolvedConfig<'de>) -> Self {
31791 Self {
31792 fields: ::fidl_next::FromWireRef::from_wire_ref(&wire.fields),
31793
31794 checksum: ::fidl_next::FromWireRef::from_wire_ref(&wire.checksum),
31795 }
31796 }
31797}
31798
31799#[derive(Debug)]
31801#[repr(C)]
31802pub struct WireResolvedConfig<'de> {
31803 pub fields: ::fidl_next::WireVector<'de, crate::WireResolvedConfigField<'de>>,
31804
31805 pub checksum: crate::WireConfigChecksum<'de>,
31806}
31807
31808unsafe impl ::fidl_next::Wire for WireResolvedConfig<'static> {
31809 type Decoded<'de> = WireResolvedConfig<'de>;
31810
31811 #[inline]
31812 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
31813}
31814
31815unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolvedConfig<'static>
31816where
31817 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
31818 ___D: ::fidl_next::Decoder,
31819{
31820 fn decode(
31821 slot: ::fidl_next::Slot<'_, Self>,
31822 decoder: &mut ___D,
31823 ) -> Result<(), ::fidl_next::DecodeError> {
31824 ::fidl_next::munge! {
31825 let Self {
31826 mut fields,
31827 mut checksum,
31828
31829 } = slot;
31830 }
31831
31832 ::fidl_next::Decode::decode(fields.as_mut(), decoder)?;
31833
31834 ::fidl_next::Decode::decode(checksum.as_mut(), decoder)?;
31835
31836 Ok(())
31837 }
31838}
31839
31840pub mod compat {
31842
31843 impl ::fidl_next::CompatFrom<crate::AllowedOffers>
31844 for ::fidl_fuchsia_component_decl::AllowedOffers
31845 {
31846 fn compat_from(value: crate::AllowedOffers) -> Self {
31847 match value {
31848 crate::AllowedOffers::StaticOnly => Self::StaticOnly,
31849
31850 crate::AllowedOffers::StaticAndDynamic => Self::StaticAndDynamic,
31851 }
31852 }
31853 }
31854
31855 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::AllowedOffers>
31856 for crate::AllowedOffers
31857 {
31858 fn compat_from(value: ::fidl_fuchsia_component_decl::AllowedOffers) -> Self {
31859 match value {
31860 ::fidl_fuchsia_component_decl::AllowedOffers::StaticOnly => Self::StaticOnly,
31861
31862 ::fidl_fuchsia_component_decl::AllowedOffers::StaticAndDynamic => {
31863 Self::StaticAndDynamic
31864 }
31865 }
31866 }
31867 }
31868
31869 impl ::fidl_next::CompatFrom<crate::Availability> for ::fidl_fuchsia_component_decl::Availability {
31870 fn compat_from(value: crate::Availability) -> Self {
31871 match value {
31872 crate::Availability::Required => Self::Required,
31873
31874 crate::Availability::Optional => Self::Optional,
31875
31876 crate::Availability::SameAsTarget => Self::SameAsTarget,
31877
31878 crate::Availability::Transitional => Self::Transitional,
31879 }
31880 }
31881 }
31882
31883 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Availability> for crate::Availability {
31884 fn compat_from(value: ::fidl_fuchsia_component_decl::Availability) -> Self {
31885 match value {
31886 ::fidl_fuchsia_component_decl::Availability::Required => Self::Required,
31887
31888 ::fidl_fuchsia_component_decl::Availability::Optional => Self::Optional,
31889
31890 ::fidl_fuchsia_component_decl::Availability::SameAsTarget => Self::SameAsTarget,
31891
31892 ::fidl_fuchsia_component_decl::Availability::Transitional => Self::Transitional,
31893 }
31894 }
31895 }
31896
31897 impl ::fidl_next::CompatFrom<crate::Service> for ::fidl_fuchsia_component_decl::Service {
31898 fn compat_from(value: crate::Service) -> Self {
31899 Self {
31900 name: ::fidl_next::CompatFrom::compat_from(value.name),
31901
31902 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
31903
31904 __source_breaking: ::fidl::marker::SourceBreaking,
31905 }
31906 }
31907 }
31908
31909 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Service> for crate::Service {
31910 fn compat_from(value: ::fidl_fuchsia_component_decl::Service) -> Self {
31911 Self {
31912 name: ::fidl_next::CompatFrom::compat_from(value.name),
31913
31914 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
31915 }
31916 }
31917 }
31918
31919 impl ::fidl_next::CompatFrom<crate::Directory> for ::fidl_fuchsia_component_decl::Directory {
31920 fn compat_from(value: crate::Directory) -> Self {
31921 Self {
31922 name: ::fidl_next::CompatFrom::compat_from(value.name),
31923
31924 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
31925
31926 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
31927
31928 __source_breaking: ::fidl::marker::SourceBreaking,
31929 }
31930 }
31931 }
31932
31933 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Directory> for crate::Directory {
31934 fn compat_from(value: ::fidl_fuchsia_component_decl::Directory) -> Self {
31935 Self {
31936 name: ::fidl_next::CompatFrom::compat_from(value.name),
31937
31938 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
31939
31940 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
31941 }
31942 }
31943 }
31944
31945 impl ::fidl_next::CompatFrom<crate::ParentRef> for ::fidl_fuchsia_component_decl::ParentRef {
31946 #[inline]
31947 fn compat_from(value: crate::ParentRef) -> Self {
31948 Self {}
31949 }
31950 }
31951
31952 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ParentRef> for crate::ParentRef {
31953 #[inline]
31954 fn compat_from(value: ::fidl_fuchsia_component_decl::ParentRef) -> Self {
31955 Self {}
31956 }
31957 }
31958
31959 impl ::fidl_next::CompatFrom<crate::SelfRef> for ::fidl_fuchsia_component_decl::SelfRef {
31960 #[inline]
31961 fn compat_from(value: crate::SelfRef) -> Self {
31962 Self {}
31963 }
31964 }
31965
31966 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::SelfRef> for crate::SelfRef {
31967 #[inline]
31968 fn compat_from(value: ::fidl_fuchsia_component_decl::SelfRef) -> Self {
31969 Self {}
31970 }
31971 }
31972
31973 impl ::fidl_next::CompatFrom<crate::ChildRef> for ::fidl_fuchsia_component_decl::ChildRef {
31974 #[inline]
31975 fn compat_from(value: crate::ChildRef) -> Self {
31976 Self {
31977 name: ::fidl_next::CompatFrom::compat_from(value.name),
31978
31979 collection: ::fidl_next::CompatFrom::compat_from(value.collection),
31980 }
31981 }
31982 }
31983
31984 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ChildRef> for crate::ChildRef {
31985 #[inline]
31986 fn compat_from(value: ::fidl_fuchsia_component_decl::ChildRef) -> Self {
31987 Self {
31988 name: ::fidl_next::CompatFrom::compat_from(value.name),
31989
31990 collection: ::fidl_next::CompatFrom::compat_from(value.collection),
31991 }
31992 }
31993 }
31994
31995 impl ::fidl_next::CompatFrom<crate::CollectionRef>
31996 for ::fidl_fuchsia_component_decl::CollectionRef
31997 {
31998 #[inline]
31999 fn compat_from(value: crate::CollectionRef) -> Self {
32000 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
32001 }
32002 }
32003
32004 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::CollectionRef>
32005 for crate::CollectionRef
32006 {
32007 #[inline]
32008 fn compat_from(value: ::fidl_fuchsia_component_decl::CollectionRef) -> Self {
32009 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
32010 }
32011 }
32012
32013 impl ::fidl_next::CompatFrom<crate::FrameworkRef> for ::fidl_fuchsia_component_decl::FrameworkRef {
32014 #[inline]
32015 fn compat_from(value: crate::FrameworkRef) -> Self {
32016 Self {}
32017 }
32018 }
32019
32020 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::FrameworkRef> for crate::FrameworkRef {
32021 #[inline]
32022 fn compat_from(value: ::fidl_fuchsia_component_decl::FrameworkRef) -> Self {
32023 Self {}
32024 }
32025 }
32026
32027 impl ::fidl_next::CompatFrom<crate::CapabilityRef>
32028 for ::fidl_fuchsia_component_decl::CapabilityRef
32029 {
32030 #[inline]
32031 fn compat_from(value: crate::CapabilityRef) -> Self {
32032 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
32033 }
32034 }
32035
32036 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::CapabilityRef>
32037 for crate::CapabilityRef
32038 {
32039 #[inline]
32040 fn compat_from(value: ::fidl_fuchsia_component_decl::CapabilityRef) -> Self {
32041 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
32042 }
32043 }
32044
32045 impl ::fidl_next::CompatFrom<crate::DebugRef> for ::fidl_fuchsia_component_decl::DebugRef {
32046 #[inline]
32047 fn compat_from(value: crate::DebugRef) -> Self {
32048 Self {}
32049 }
32050 }
32051
32052 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DebugRef> for crate::DebugRef {
32053 #[inline]
32054 fn compat_from(value: ::fidl_fuchsia_component_decl::DebugRef) -> Self {
32055 Self {}
32056 }
32057 }
32058
32059 impl ::fidl_next::CompatFrom<crate::VoidRef> for ::fidl_fuchsia_component_decl::VoidRef {
32060 #[inline]
32061 fn compat_from(value: crate::VoidRef) -> Self {
32062 Self {}
32063 }
32064 }
32065
32066 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::VoidRef> for crate::VoidRef {
32067 #[inline]
32068 fn compat_from(value: ::fidl_fuchsia_component_decl::VoidRef) -> Self {
32069 Self {}
32070 }
32071 }
32072
32073 impl ::fidl_next::CompatFrom<crate::StorageId> for ::fidl_fuchsia_component_decl::StorageId {
32074 fn compat_from(value: crate::StorageId) -> Self {
32075 match value {
32076 crate::StorageId::StaticInstanceId => Self::StaticInstanceId,
32077
32078 crate::StorageId::StaticInstanceIdOrMoniker => Self::StaticInstanceIdOrMoniker,
32079 }
32080 }
32081 }
32082
32083 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::StorageId> for crate::StorageId {
32084 fn compat_from(value: ::fidl_fuchsia_component_decl::StorageId) -> Self {
32085 match value {
32086 ::fidl_fuchsia_component_decl::StorageId::StaticInstanceId => {
32087 Self::StaticInstanceId
32088 }
32089
32090 ::fidl_fuchsia_component_decl::StorageId::StaticInstanceIdOrMoniker => {
32091 Self::StaticInstanceIdOrMoniker
32092 }
32093 }
32094 }
32095 }
32096
32097 impl ::fidl_next::CompatFrom<crate::Runner> for ::fidl_fuchsia_component_decl::Runner {
32098 fn compat_from(value: crate::Runner) -> Self {
32099 Self {
32100 name: ::fidl_next::CompatFrom::compat_from(value.name),
32101
32102 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
32103
32104 __source_breaking: ::fidl::marker::SourceBreaking,
32105 }
32106 }
32107 }
32108
32109 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Runner> for crate::Runner {
32110 fn compat_from(value: ::fidl_fuchsia_component_decl::Runner) -> Self {
32111 Self {
32112 name: ::fidl_next::CompatFrom::compat_from(value.name),
32113
32114 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
32115 }
32116 }
32117 }
32118
32119 impl ::fidl_next::CompatFrom<crate::Resolver> for ::fidl_fuchsia_component_decl::Resolver {
32120 fn compat_from(value: crate::Resolver) -> Self {
32121 Self {
32122 name: ::fidl_next::CompatFrom::compat_from(value.name),
32123
32124 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
32125
32126 __source_breaking: ::fidl::marker::SourceBreaking,
32127 }
32128 }
32129 }
32130
32131 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Resolver> for crate::Resolver {
32132 fn compat_from(value: ::fidl_fuchsia_component_decl::Resolver) -> Self {
32133 Self {
32134 name: ::fidl_next::CompatFrom::compat_from(value.name),
32135
32136 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
32137 }
32138 }
32139 }
32140
32141 impl ::fidl_next::CompatFrom<crate::EventStream> for ::fidl_fuchsia_component_decl::EventStream {
32142 fn compat_from(value: crate::EventStream) -> Self {
32143 Self {
32144 name: ::fidl_next::CompatFrom::compat_from(value.name),
32145
32146 __source_breaking: ::fidl::marker::SourceBreaking,
32147 }
32148 }
32149 }
32150
32151 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EventStream> for crate::EventStream {
32152 fn compat_from(value: ::fidl_fuchsia_component_decl::EventStream) -> Self {
32153 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
32154 }
32155 }
32156
32157 impl ::fidl_next::CompatFrom<crate::ConfigSingleValue>
32158 for ::fidl_fuchsia_component_decl::ConfigSingleValue
32159 {
32160 fn compat_from(value: crate::ConfigSingleValue) -> Self {
32161 match value {
32162 crate::ConfigSingleValue::Bool(value) => {
32163 Self::Bool(::fidl_next::CompatFrom::compat_from(value))
32164 }
32165
32166 crate::ConfigSingleValue::Uint8(value) => {
32167 Self::Uint8(::fidl_next::CompatFrom::compat_from(value))
32168 }
32169
32170 crate::ConfigSingleValue::Uint16(value) => {
32171 Self::Uint16(::fidl_next::CompatFrom::compat_from(value))
32172 }
32173
32174 crate::ConfigSingleValue::Uint32(value) => {
32175 Self::Uint32(::fidl_next::CompatFrom::compat_from(value))
32176 }
32177
32178 crate::ConfigSingleValue::Uint64(value) => {
32179 Self::Uint64(::fidl_next::CompatFrom::compat_from(value))
32180 }
32181
32182 crate::ConfigSingleValue::Int8(value) => {
32183 Self::Int8(::fidl_next::CompatFrom::compat_from(value))
32184 }
32185
32186 crate::ConfigSingleValue::Int16(value) => {
32187 Self::Int16(::fidl_next::CompatFrom::compat_from(value))
32188 }
32189
32190 crate::ConfigSingleValue::Int32(value) => {
32191 Self::Int32(::fidl_next::CompatFrom::compat_from(value))
32192 }
32193
32194 crate::ConfigSingleValue::Int64(value) => {
32195 Self::Int64(::fidl_next::CompatFrom::compat_from(value))
32196 }
32197
32198 crate::ConfigSingleValue::String(value) => {
32199 Self::String(::fidl_next::CompatFrom::compat_from(value))
32200 }
32201
32202 crate::ConfigSingleValue::UnknownOrdinal_(unknown_ordinal) => {
32203 Self::__SourceBreaking { unknown_ordinal }
32204 }
32205 }
32206 }
32207 }
32208
32209 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigSingleValue>
32210 for crate::ConfigSingleValue
32211 {
32212 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigSingleValue) -> Self {
32213 match value {
32214 ::fidl_fuchsia_component_decl::ConfigSingleValue::Bool(value) => {
32215 Self::Bool(::fidl_next::CompatFrom::compat_from(value))
32216 }
32217
32218 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint8(value) => {
32219 Self::Uint8(::fidl_next::CompatFrom::compat_from(value))
32220 }
32221
32222 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint16(value) => {
32223 Self::Uint16(::fidl_next::CompatFrom::compat_from(value))
32224 }
32225
32226 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint32(value) => {
32227 Self::Uint32(::fidl_next::CompatFrom::compat_from(value))
32228 }
32229
32230 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint64(value) => {
32231 Self::Uint64(::fidl_next::CompatFrom::compat_from(value))
32232 }
32233
32234 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int8(value) => {
32235 Self::Int8(::fidl_next::CompatFrom::compat_from(value))
32236 }
32237
32238 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int16(value) => {
32239 Self::Int16(::fidl_next::CompatFrom::compat_from(value))
32240 }
32241
32242 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int32(value) => {
32243 Self::Int32(::fidl_next::CompatFrom::compat_from(value))
32244 }
32245
32246 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int64(value) => {
32247 Self::Int64(::fidl_next::CompatFrom::compat_from(value))
32248 }
32249
32250 ::fidl_fuchsia_component_decl::ConfigSingleValue::String(value) => {
32251 Self::String(::fidl_next::CompatFrom::compat_from(value))
32252 }
32253
32254 ::fidl_fuchsia_component_decl::ConfigSingleValue::__SourceBreaking {
32255 unknown_ordinal,
32256 } => Self::UnknownOrdinal_(unknown_ordinal),
32257 }
32258 }
32259 }
32260
32261 impl ::fidl_next::CompatFrom<crate::ConfigVectorValue>
32262 for ::fidl_fuchsia_component_decl::ConfigVectorValue
32263 {
32264 fn compat_from(value: crate::ConfigVectorValue) -> Self {
32265 match value {
32266 crate::ConfigVectorValue::BoolVector(value) => {
32267 Self::BoolVector(::fidl_next::CompatFrom::compat_from(value))
32268 }
32269
32270 crate::ConfigVectorValue::Uint8Vector(value) => {
32271 Self::Uint8Vector(::fidl_next::CompatFrom::compat_from(value))
32272 }
32273
32274 crate::ConfigVectorValue::Uint16Vector(value) => {
32275 Self::Uint16Vector(::fidl_next::CompatFrom::compat_from(value))
32276 }
32277
32278 crate::ConfigVectorValue::Uint32Vector(value) => {
32279 Self::Uint32Vector(::fidl_next::CompatFrom::compat_from(value))
32280 }
32281
32282 crate::ConfigVectorValue::Uint64Vector(value) => {
32283 Self::Uint64Vector(::fidl_next::CompatFrom::compat_from(value))
32284 }
32285
32286 crate::ConfigVectorValue::Int8Vector(value) => {
32287 Self::Int8Vector(::fidl_next::CompatFrom::compat_from(value))
32288 }
32289
32290 crate::ConfigVectorValue::Int16Vector(value) => {
32291 Self::Int16Vector(::fidl_next::CompatFrom::compat_from(value))
32292 }
32293
32294 crate::ConfigVectorValue::Int32Vector(value) => {
32295 Self::Int32Vector(::fidl_next::CompatFrom::compat_from(value))
32296 }
32297
32298 crate::ConfigVectorValue::Int64Vector(value) => {
32299 Self::Int64Vector(::fidl_next::CompatFrom::compat_from(value))
32300 }
32301
32302 crate::ConfigVectorValue::StringVector(value) => {
32303 Self::StringVector(::fidl_next::CompatFrom::compat_from(value))
32304 }
32305
32306 crate::ConfigVectorValue::UnknownOrdinal_(unknown_ordinal) => {
32307 Self::__SourceBreaking { unknown_ordinal }
32308 }
32309 }
32310 }
32311 }
32312
32313 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigVectorValue>
32314 for crate::ConfigVectorValue
32315 {
32316 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigVectorValue) -> Self {
32317 match value {
32318 ::fidl_fuchsia_component_decl::ConfigVectorValue::BoolVector(value) => {
32319 Self::BoolVector(::fidl_next::CompatFrom::compat_from(value))
32320 }
32321
32322 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint8Vector(value) => {
32323 Self::Uint8Vector(::fidl_next::CompatFrom::compat_from(value))
32324 }
32325
32326 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint16Vector(value) => {
32327 Self::Uint16Vector(::fidl_next::CompatFrom::compat_from(value))
32328 }
32329
32330 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint32Vector(value) => {
32331 Self::Uint32Vector(::fidl_next::CompatFrom::compat_from(value))
32332 }
32333
32334 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint64Vector(value) => {
32335 Self::Uint64Vector(::fidl_next::CompatFrom::compat_from(value))
32336 }
32337
32338 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int8Vector(value) => {
32339 Self::Int8Vector(::fidl_next::CompatFrom::compat_from(value))
32340 }
32341
32342 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int16Vector(value) => {
32343 Self::Int16Vector(::fidl_next::CompatFrom::compat_from(value))
32344 }
32345
32346 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int32Vector(value) => {
32347 Self::Int32Vector(::fidl_next::CompatFrom::compat_from(value))
32348 }
32349
32350 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int64Vector(value) => {
32351 Self::Int64Vector(::fidl_next::CompatFrom::compat_from(value))
32352 }
32353
32354 ::fidl_fuchsia_component_decl::ConfigVectorValue::StringVector(value) => {
32355 Self::StringVector(::fidl_next::CompatFrom::compat_from(value))
32356 }
32357
32358 ::fidl_fuchsia_component_decl::ConfigVectorValue::__SourceBreaking {
32359 unknown_ordinal,
32360 } => Self::UnknownOrdinal_(unknown_ordinal),
32361 }
32362 }
32363 }
32364
32365 impl ::fidl_next::CompatFrom<crate::ConfigValue> for ::fidl_fuchsia_component_decl::ConfigValue {
32366 fn compat_from(value: crate::ConfigValue) -> Self {
32367 match value {
32368 crate::ConfigValue::Single(value) => {
32369 Self::Single(::fidl_next::CompatFrom::compat_from(value))
32370 }
32371
32372 crate::ConfigValue::Vector(value) => {
32373 Self::Vector(::fidl_next::CompatFrom::compat_from(value))
32374 }
32375
32376 crate::ConfigValue::UnknownOrdinal_(unknown_ordinal) => {
32377 Self::__SourceBreaking { unknown_ordinal }
32378 }
32379 }
32380 }
32381 }
32382
32383 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValue> for crate::ConfigValue {
32384 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValue) -> Self {
32385 match value {
32386 ::fidl_fuchsia_component_decl::ConfigValue::Single(value) => {
32387 Self::Single(::fidl_next::CompatFrom::compat_from(value))
32388 }
32389
32390 ::fidl_fuchsia_component_decl::ConfigValue::Vector(value) => {
32391 Self::Vector(::fidl_next::CompatFrom::compat_from(value))
32392 }
32393
32394 ::fidl_fuchsia_component_decl::ConfigValue::__SourceBreaking {
32395 unknown_ordinal,
32396 } => Self::UnknownOrdinal_(unknown_ordinal),
32397 }
32398 }
32399 }
32400
32401 impl ::fidl_next::CompatFrom<crate::Configuration>
32402 for ::fidl_fuchsia_component_decl::Configuration
32403 {
32404 fn compat_from(value: crate::Configuration) -> Self {
32405 Self {
32406 name: ::fidl_next::CompatFrom::compat_from(value.name),
32407
32408 value: ::fidl_next::CompatFrom::compat_from(value.value),
32409
32410 __source_breaking: ::fidl::marker::SourceBreaking,
32411 }
32412 }
32413 }
32414
32415 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Configuration>
32416 for crate::Configuration
32417 {
32418 fn compat_from(value: ::fidl_fuchsia_component_decl::Configuration) -> Self {
32419 Self {
32420 name: ::fidl_next::CompatFrom::compat_from(value.name),
32421
32422 value: ::fidl_next::CompatFrom::compat_from(value.value),
32423 }
32424 }
32425 }
32426
32427 impl ::fidl_next::CompatFrom<crate::DeliveryType> for ::fidl_fuchsia_component_decl::DeliveryType {
32428 fn compat_from(value: crate::DeliveryType) -> Self {
32429 match value {
32430 crate::DeliveryType::Immediate => Self::Immediate,
32431
32432 crate::DeliveryType::OnReadable => Self::OnReadable,
32433
32434 crate::DeliveryType::UnknownOrdinal_(unknown_ordinal) => {
32435 Self::__SourceBreaking { unknown_ordinal }
32436 }
32437 }
32438 }
32439 }
32440
32441 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DeliveryType> for crate::DeliveryType {
32442 fn compat_from(value: ::fidl_fuchsia_component_decl::DeliveryType) -> Self {
32443 match value {
32444 ::fidl_fuchsia_component_decl::DeliveryType::Immediate => Self::Immediate,
32445
32446 ::fidl_fuchsia_component_decl::DeliveryType::OnReadable => Self::OnReadable,
32447
32448 ::fidl_fuchsia_component_decl::DeliveryType::__SourceBreaking {
32449 unknown_ordinal: value,
32450 } => Self::UnknownOrdinal_(value),
32451 }
32452 }
32453 }
32454
32455 impl ::fidl_next::CompatFrom<crate::Protocol> for ::fidl_fuchsia_component_decl::Protocol {
32456 fn compat_from(value: crate::Protocol) -> Self {
32457 Self {
32458 name: ::fidl_next::CompatFrom::compat_from(value.name),
32459
32460 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
32461
32462 delivery: ::fidl_next::CompatFrom::compat_from(value.delivery),
32463
32464 __source_breaking: ::fidl::marker::SourceBreaking,
32465 }
32466 }
32467 }
32468
32469 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Protocol> for crate::Protocol {
32470 fn compat_from(value: ::fidl_fuchsia_component_decl::Protocol) -> Self {
32471 Self {
32472 name: ::fidl_next::CompatFrom::compat_from(value.name),
32473
32474 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
32475
32476 delivery: ::fidl_next::CompatFrom::compat_from(value.delivery),
32477 }
32478 }
32479 }
32480
32481 impl ::fidl_next::CompatFrom<crate::EnvironmentRef>
32482 for ::fidl_fuchsia_component_decl::EnvironmentRef
32483 {
32484 #[inline]
32485 fn compat_from(value: crate::EnvironmentRef) -> Self {
32486 Self {}
32487 }
32488 }
32489
32490 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EnvironmentRef>
32491 for crate::EnvironmentRef
32492 {
32493 #[inline]
32494 fn compat_from(value: ::fidl_fuchsia_component_decl::EnvironmentRef) -> Self {
32495 Self {}
32496 }
32497 }
32498
32499 impl ::fidl_next::CompatFrom<crate::Ref> for ::fidl_fuchsia_component_decl::Ref {
32500 fn compat_from(value: crate::Ref) -> Self {
32501 match value {
32502 crate::Ref::Parent(value) => {
32503 Self::Parent(::fidl_next::CompatFrom::compat_from(value))
32504 }
32505
32506 crate::Ref::Self_(value) => {
32507 Self::Self_(::fidl_next::CompatFrom::compat_from(value))
32508 }
32509
32510 crate::Ref::Child(value) => {
32511 Self::Child(::fidl_next::CompatFrom::compat_from(value))
32512 }
32513
32514 crate::Ref::Collection(value) => {
32515 Self::Collection(::fidl_next::CompatFrom::compat_from(value))
32516 }
32517
32518 crate::Ref::Framework(value) => {
32519 Self::Framework(::fidl_next::CompatFrom::compat_from(value))
32520 }
32521
32522 crate::Ref::Capability(value) => {
32523 Self::Capability(::fidl_next::CompatFrom::compat_from(value))
32524 }
32525
32526 crate::Ref::Debug(value) => {
32527 Self::Debug(::fidl_next::CompatFrom::compat_from(value))
32528 }
32529
32530 crate::Ref::VoidType(value) => {
32531 Self::VoidType(::fidl_next::CompatFrom::compat_from(value))
32532 }
32533
32534 crate::Ref::Environment(value) => {
32535 Self::Environment(::fidl_next::CompatFrom::compat_from(value))
32536 }
32537
32538 crate::Ref::UnknownOrdinal_(unknown_ordinal) => {
32539 Self::__SourceBreaking { unknown_ordinal }
32540 }
32541 }
32542 }
32543 }
32544
32545 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Ref> for crate::Ref {
32546 fn compat_from(value: ::fidl_fuchsia_component_decl::Ref) -> Self {
32547 match value {
32548 ::fidl_fuchsia_component_decl::Ref::Parent(value) => {
32549 Self::Parent(::fidl_next::CompatFrom::compat_from(value))
32550 }
32551
32552 ::fidl_fuchsia_component_decl::Ref::Self_(value) => {
32553 Self::Self_(::fidl_next::CompatFrom::compat_from(value))
32554 }
32555
32556 ::fidl_fuchsia_component_decl::Ref::Child(value) => {
32557 Self::Child(::fidl_next::CompatFrom::compat_from(value))
32558 }
32559
32560 ::fidl_fuchsia_component_decl::Ref::Collection(value) => {
32561 Self::Collection(::fidl_next::CompatFrom::compat_from(value))
32562 }
32563
32564 ::fidl_fuchsia_component_decl::Ref::Framework(value) => {
32565 Self::Framework(::fidl_next::CompatFrom::compat_from(value))
32566 }
32567
32568 ::fidl_fuchsia_component_decl::Ref::Capability(value) => {
32569 Self::Capability(::fidl_next::CompatFrom::compat_from(value))
32570 }
32571
32572 ::fidl_fuchsia_component_decl::Ref::Debug(value) => {
32573 Self::Debug(::fidl_next::CompatFrom::compat_from(value))
32574 }
32575
32576 ::fidl_fuchsia_component_decl::Ref::VoidType(value) => {
32577 Self::VoidType(::fidl_next::CompatFrom::compat_from(value))
32578 }
32579
32580 ::fidl_fuchsia_component_decl::Ref::Environment(value) => {
32581 Self::Environment(::fidl_next::CompatFrom::compat_from(value))
32582 }
32583
32584 ::fidl_fuchsia_component_decl::Ref::__SourceBreaking { unknown_ordinal } => {
32585 Self::UnknownOrdinal_(unknown_ordinal)
32586 }
32587 }
32588 }
32589 }
32590
32591 impl ::fidl_next::CompatFrom<crate::Storage> for ::fidl_fuchsia_component_decl::Storage {
32592 fn compat_from(value: crate::Storage) -> Self {
32593 Self {
32594 name: ::fidl_next::CompatFrom::compat_from(value.name),
32595
32596 source: ::fidl_next::CompatFrom::compat_from(value.source),
32597
32598 backing_dir: ::fidl_next::CompatFrom::compat_from(value.backing_dir),
32599
32600 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
32601
32602 storage_id: ::fidl_next::CompatFrom::compat_from(value.storage_id),
32603
32604 __source_breaking: ::fidl::marker::SourceBreaking,
32605 }
32606 }
32607 }
32608
32609 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Storage> for crate::Storage {
32610 fn compat_from(value: ::fidl_fuchsia_component_decl::Storage) -> Self {
32611 Self {
32612 name: ::fidl_next::CompatFrom::compat_from(value.name),
32613
32614 source: ::fidl_next::CompatFrom::compat_from(value.source),
32615
32616 backing_dir: ::fidl_next::CompatFrom::compat_from(value.backing_dir),
32617
32618 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
32619
32620 storage_id: ::fidl_next::CompatFrom::compat_from(value.storage_id),
32621 }
32622 }
32623 }
32624
32625 impl ::fidl_next::CompatFrom<crate::Dictionary> for ::fidl_fuchsia_component_decl::Dictionary {
32626 fn compat_from(value: crate::Dictionary) -> Self {
32627 Self {
32628 name: ::fidl_next::CompatFrom::compat_from(value.name),
32629
32630 source: ::fidl_next::CompatFrom::compat_from(value.source),
32631
32632 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
32633
32634 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
32635
32636 __source_breaking: ::fidl::marker::SourceBreaking,
32637 }
32638 }
32639 }
32640
32641 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Dictionary> for crate::Dictionary {
32642 fn compat_from(value: ::fidl_fuchsia_component_decl::Dictionary) -> Self {
32643 Self {
32644 name: ::fidl_next::CompatFrom::compat_from(value.name),
32645
32646 source: ::fidl_next::CompatFrom::compat_from(value.source),
32647
32648 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
32649
32650 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
32651 }
32652 }
32653 }
32654
32655 impl ::fidl_next::CompatFrom<crate::Capability> for ::fidl_fuchsia_component_decl::Capability {
32656 fn compat_from(value: crate::Capability) -> Self {
32657 match value {
32658 crate::Capability::Service(value) => {
32659 Self::Service(::fidl_next::CompatFrom::compat_from(value))
32660 }
32661
32662 crate::Capability::Protocol(value) => {
32663 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
32664 }
32665
32666 crate::Capability::Directory(value) => {
32667 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
32668 }
32669
32670 crate::Capability::Storage(value) => {
32671 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
32672 }
32673
32674 crate::Capability::Runner(value) => {
32675 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
32676 }
32677
32678 crate::Capability::Resolver(value) => {
32679 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
32680 }
32681
32682 crate::Capability::EventStream(value) => {
32683 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
32684 }
32685
32686 crate::Capability::Dictionary(value) => {
32687 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
32688 }
32689
32690 crate::Capability::Config(value) => {
32691 Self::Config(::fidl_next::CompatFrom::compat_from(value))
32692 }
32693
32694 crate::Capability::UnknownOrdinal_(unknown_ordinal) => {
32695 Self::__SourceBreaking { unknown_ordinal }
32696 }
32697 }
32698 }
32699 }
32700
32701 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Capability> for crate::Capability {
32702 fn compat_from(value: ::fidl_fuchsia_component_decl::Capability) -> Self {
32703 match value {
32704 ::fidl_fuchsia_component_decl::Capability::Service(value) => {
32705 Self::Service(::fidl_next::CompatFrom::compat_from(value))
32706 }
32707
32708 ::fidl_fuchsia_component_decl::Capability::Protocol(value) => {
32709 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
32710 }
32711
32712 ::fidl_fuchsia_component_decl::Capability::Directory(value) => {
32713 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
32714 }
32715
32716 ::fidl_fuchsia_component_decl::Capability::Storage(value) => {
32717 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
32718 }
32719
32720 ::fidl_fuchsia_component_decl::Capability::Runner(value) => {
32721 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
32722 }
32723
32724 ::fidl_fuchsia_component_decl::Capability::Resolver(value) => {
32725 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
32726 }
32727
32728 ::fidl_fuchsia_component_decl::Capability::EventStream(value) => {
32729 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
32730 }
32731
32732 ::fidl_fuchsia_component_decl::Capability::Dictionary(value) => {
32733 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
32734 }
32735
32736 ::fidl_fuchsia_component_decl::Capability::Config(value) => {
32737 Self::Config(::fidl_next::CompatFrom::compat_from(value))
32738 }
32739
32740 ::fidl_fuchsia_component_decl::Capability::__SourceBreaking { unknown_ordinal } => {
32741 Self::UnknownOrdinal_(unknown_ordinal)
32742 }
32743 }
32744 }
32745 }
32746
32747 impl ::fidl_next::CompatFrom<crate::StartupMode> for ::fidl_fuchsia_component_decl::StartupMode {
32748 fn compat_from(value: crate::StartupMode) -> Self {
32749 match value {
32750 crate::StartupMode::Lazy => Self::Lazy,
32751
32752 crate::StartupMode::Eager => Self::Eager,
32753 }
32754 }
32755 }
32756
32757 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::StartupMode> for crate::StartupMode {
32758 fn compat_from(value: ::fidl_fuchsia_component_decl::StartupMode) -> Self {
32759 match value {
32760 ::fidl_fuchsia_component_decl::StartupMode::Lazy => Self::Lazy,
32761
32762 ::fidl_fuchsia_component_decl::StartupMode::Eager => Self::Eager,
32763 }
32764 }
32765 }
32766
32767 impl ::fidl_next::CompatFrom<crate::OnTerminate> for ::fidl_fuchsia_component_decl::OnTerminate {
32768 fn compat_from(value: crate::OnTerminate) -> Self {
32769 match value {
32770 crate::OnTerminate::None => Self::None,
32771
32772 crate::OnTerminate::Reboot => Self::Reboot,
32773 }
32774 }
32775 }
32776
32777 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OnTerminate> for crate::OnTerminate {
32778 fn compat_from(value: ::fidl_fuchsia_component_decl::OnTerminate) -> Self {
32779 match value {
32780 ::fidl_fuchsia_component_decl::OnTerminate::None => Self::None,
32781
32782 ::fidl_fuchsia_component_decl::OnTerminate::Reboot => Self::Reboot,
32783 }
32784 }
32785 }
32786
32787 impl ::fidl_next::CompatFrom<crate::ConfigOverride>
32788 for ::fidl_fuchsia_component_decl::ConfigOverride
32789 {
32790 fn compat_from(value: crate::ConfigOverride) -> Self {
32791 Self {
32792 key: ::fidl_next::CompatFrom::compat_from(value.key),
32793
32794 value: ::fidl_next::CompatFrom::compat_from(value.value),
32795
32796 __source_breaking: ::fidl::marker::SourceBreaking,
32797 }
32798 }
32799 }
32800
32801 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigOverride>
32802 for crate::ConfigOverride
32803 {
32804 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigOverride) -> Self {
32805 Self {
32806 key: ::fidl_next::CompatFrom::compat_from(value.key),
32807
32808 value: ::fidl_next::CompatFrom::compat_from(value.value),
32809 }
32810 }
32811 }
32812
32813 impl ::fidl_next::CompatFrom<crate::Child> for ::fidl_fuchsia_component_decl::Child {
32814 fn compat_from(value: crate::Child) -> Self {
32815 Self {
32816 name: ::fidl_next::CompatFrom::compat_from(value.name),
32817
32818 url: ::fidl_next::CompatFrom::compat_from(value.url),
32819
32820 startup: ::fidl_next::CompatFrom::compat_from(value.startup),
32821
32822 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
32823
32824 on_terminate: ::fidl_next::CompatFrom::compat_from(value.on_terminate),
32825
32826 config_overrides: ::fidl_next::CompatFrom::compat_from(value.config_overrides),
32827
32828 __source_breaking: ::fidl::marker::SourceBreaking,
32829 }
32830 }
32831 }
32832
32833 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Child> for crate::Child {
32834 fn compat_from(value: ::fidl_fuchsia_component_decl::Child) -> Self {
32835 Self {
32836 name: ::fidl_next::CompatFrom::compat_from(value.name),
32837
32838 url: ::fidl_next::CompatFrom::compat_from(value.url),
32839
32840 startup: ::fidl_next::CompatFrom::compat_from(value.startup),
32841
32842 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
32843
32844 on_terminate: ::fidl_next::CompatFrom::compat_from(value.on_terminate),
32845
32846 config_overrides: ::fidl_next::CompatFrom::compat_from(value.config_overrides),
32847 }
32848 }
32849 }
32850
32851 impl ::fidl_next::CompatFrom<crate::Durability> for ::fidl_fuchsia_component_decl::Durability {
32852 fn compat_from(value: crate::Durability) -> Self {
32853 match value {
32854 crate::Durability::Transient => Self::Transient,
32855
32856 crate::Durability::SingleRun => Self::SingleRun,
32857 }
32858 }
32859 }
32860
32861 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Durability> for crate::Durability {
32862 fn compat_from(value: ::fidl_fuchsia_component_decl::Durability) -> Self {
32863 match value {
32864 ::fidl_fuchsia_component_decl::Durability::Transient => Self::Transient,
32865
32866 ::fidl_fuchsia_component_decl::Durability::SingleRun => Self::SingleRun,
32867 }
32868 }
32869 }
32870
32871 impl ::fidl_next::CompatFrom<crate::Collection> for ::fidl_fuchsia_component_decl::Collection {
32872 fn compat_from(value: crate::Collection) -> Self {
32873 Self {
32874 name: ::fidl_next::CompatFrom::compat_from(value.name),
32875
32876 durability: ::fidl_next::CompatFrom::compat_from(value.durability),
32877
32878 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
32879
32880 allowed_offers: ::fidl_next::CompatFrom::compat_from(value.allowed_offers),
32881
32882 allow_long_names: ::fidl_next::CompatFrom::compat_from(value.allow_long_names),
32883
32884 persistent_storage: ::fidl_next::CompatFrom::compat_from(value.persistent_storage),
32885
32886 __source_breaking: ::fidl::marker::SourceBreaking,
32887 }
32888 }
32889 }
32890
32891 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Collection> for crate::Collection {
32892 fn compat_from(value: ::fidl_fuchsia_component_decl::Collection) -> Self {
32893 Self {
32894 name: ::fidl_next::CompatFrom::compat_from(value.name),
32895
32896 durability: ::fidl_next::CompatFrom::compat_from(value.durability),
32897
32898 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
32899
32900 allowed_offers: ::fidl_next::CompatFrom::compat_from(value.allowed_offers),
32901
32902 allow_long_names: ::fidl_next::CompatFrom::compat_from(value.allow_long_names),
32903
32904 persistent_storage: ::fidl_next::CompatFrom::compat_from(value.persistent_storage),
32905 }
32906 }
32907 }
32908
32909 impl ::fidl_next::CompatFrom<crate::DependencyType>
32910 for ::fidl_fuchsia_component_decl::DependencyType
32911 {
32912 fn compat_from(value: crate::DependencyType) -> Self {
32913 match value {
32914 crate::DependencyType::Strong => Self::Strong,
32915
32916 crate::DependencyType::Weak => Self::Weak,
32917 }
32918 }
32919 }
32920
32921 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DependencyType>
32922 for crate::DependencyType
32923 {
32924 fn compat_from(value: ::fidl_fuchsia_component_decl::DependencyType) -> Self {
32925 match value {
32926 ::fidl_fuchsia_component_decl::DependencyType::Strong => Self::Strong,
32927
32928 ::fidl_fuchsia_component_decl::DependencyType::Weak => Self::Weak,
32929 }
32930 }
32931 }
32932
32933 impl ::fidl_next::CompatFrom<crate::NameMapping> for ::fidl_fuchsia_component_decl::NameMapping {
32934 #[inline]
32935 fn compat_from(value: crate::NameMapping) -> Self {
32936 Self {
32937 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
32938
32939 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
32940 }
32941 }
32942 }
32943
32944 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::NameMapping> for crate::NameMapping {
32945 #[inline]
32946 fn compat_from(value: ::fidl_fuchsia_component_decl::NameMapping) -> Self {
32947 Self {
32948 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
32949
32950 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
32951 }
32952 }
32953 }
32954
32955 impl ::fidl_next::CompatFrom<crate::EnvironmentExtends>
32956 for ::fidl_fuchsia_component_decl::EnvironmentExtends
32957 {
32958 fn compat_from(value: crate::EnvironmentExtends) -> Self {
32959 match value {
32960 crate::EnvironmentExtends::None => Self::None,
32961
32962 crate::EnvironmentExtends::Realm => Self::Realm,
32963 }
32964 }
32965 }
32966
32967 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EnvironmentExtends>
32968 for crate::EnvironmentExtends
32969 {
32970 fn compat_from(value: ::fidl_fuchsia_component_decl::EnvironmentExtends) -> Self {
32971 match value {
32972 ::fidl_fuchsia_component_decl::EnvironmentExtends::None => Self::None,
32973
32974 ::fidl_fuchsia_component_decl::EnvironmentExtends::Realm => Self::Realm,
32975 }
32976 }
32977 }
32978
32979 impl ::fidl_next::CompatFrom<crate::ConfigTypeLayout>
32980 for ::fidl_fuchsia_component_decl::ConfigTypeLayout
32981 {
32982 fn compat_from(value: crate::ConfigTypeLayout) -> Self {
32983 match value {
32984 crate::ConfigTypeLayout::Bool => Self::Bool,
32985
32986 crate::ConfigTypeLayout::Uint8 => Self::Uint8,
32987
32988 crate::ConfigTypeLayout::Uint16 => Self::Uint16,
32989
32990 crate::ConfigTypeLayout::Uint32 => Self::Uint32,
32991
32992 crate::ConfigTypeLayout::Uint64 => Self::Uint64,
32993
32994 crate::ConfigTypeLayout::Int8 => Self::Int8,
32995
32996 crate::ConfigTypeLayout::Int16 => Self::Int16,
32997
32998 crate::ConfigTypeLayout::Int32 => Self::Int32,
32999
33000 crate::ConfigTypeLayout::Int64 => Self::Int64,
33001
33002 crate::ConfigTypeLayout::String => Self::String,
33003
33004 crate::ConfigTypeLayout::Vector => Self::Vector,
33005
33006 crate::ConfigTypeLayout::UnknownOrdinal_(unknown_ordinal) => {
33007 Self::__SourceBreaking { unknown_ordinal }
33008 }
33009 }
33010 }
33011 }
33012
33013 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigTypeLayout>
33014 for crate::ConfigTypeLayout
33015 {
33016 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigTypeLayout) -> Self {
33017 match value {
33018 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Bool => Self::Bool,
33019
33020 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint8 => Self::Uint8,
33021
33022 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint16 => Self::Uint16,
33023
33024 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint32 => Self::Uint32,
33025
33026 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint64 => Self::Uint64,
33027
33028 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int8 => Self::Int8,
33029
33030 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int16 => Self::Int16,
33031
33032 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int32 => Self::Int32,
33033
33034 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int64 => Self::Int64,
33035
33036 ::fidl_fuchsia_component_decl::ConfigTypeLayout::String => Self::String,
33037
33038 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Vector => Self::Vector,
33039
33040 ::fidl_fuchsia_component_decl::ConfigTypeLayout::__SourceBreaking {
33041 unknown_ordinal: value,
33042 } => Self::UnknownOrdinal_(value),
33043 }
33044 }
33045 }
33046
33047 impl ::fidl_next::CompatFrom<crate::LayoutConstraint>
33048 for ::fidl_fuchsia_component_decl::LayoutConstraint
33049 {
33050 fn compat_from(value: crate::LayoutConstraint) -> Self {
33051 match value {
33052 crate::LayoutConstraint::MaxSize(value) => {
33053 Self::MaxSize(::fidl_next::CompatFrom::compat_from(value))
33054 }
33055
33056 crate::LayoutConstraint::UnknownOrdinal_(unknown_ordinal) => {
33057 Self::__SourceBreaking { unknown_ordinal }
33058 }
33059 }
33060 }
33061 }
33062
33063 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::LayoutConstraint>
33064 for crate::LayoutConstraint
33065 {
33066 fn compat_from(value: ::fidl_fuchsia_component_decl::LayoutConstraint) -> Self {
33067 match value {
33068 ::fidl_fuchsia_component_decl::LayoutConstraint::MaxSize(value) => {
33069 Self::MaxSize(::fidl_next::CompatFrom::compat_from(value))
33070 }
33071
33072 ::fidl_fuchsia_component_decl::LayoutConstraint::__SourceBreaking {
33073 unknown_ordinal,
33074 } => Self::UnknownOrdinal_(unknown_ordinal),
33075 }
33076 }
33077 }
33078
33079 impl ::fidl_next::CompatFrom<crate::ConfigType> for ::fidl_fuchsia_component_decl::ConfigType {
33080 #[inline]
33081 fn compat_from(value: crate::ConfigType) -> Self {
33082 Self {
33083 layout: ::fidl_next::CompatFrom::compat_from(value.layout),
33084
33085 parameters: ::fidl_next::CompatFrom::compat_from(value.parameters),
33086
33087 constraints: ::fidl_next::CompatFrom::compat_from(value.constraints),
33088 }
33089 }
33090 }
33091
33092 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigType> for crate::ConfigType {
33093 #[inline]
33094 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigType) -> Self {
33095 Self {
33096 layout: ::fidl_next::CompatFrom::compat_from(value.layout),
33097
33098 parameters: ::fidl_next::CompatFrom::compat_from(value.parameters),
33099
33100 constraints: ::fidl_next::CompatFrom::compat_from(value.constraints),
33101 }
33102 }
33103 }
33104
33105 impl ::fidl_next::CompatFrom<crate::ConfigChecksum>
33106 for ::fidl_fuchsia_component_decl::ConfigChecksum
33107 {
33108 fn compat_from(value: crate::ConfigChecksum) -> Self {
33109 match value {
33110 crate::ConfigChecksum::Sha256(value) => {
33111 Self::Sha256(::fidl_next::CompatFrom::compat_from(value))
33112 }
33113
33114 crate::ConfigChecksum::UnknownOrdinal_(unknown_ordinal) => {
33115 Self::__SourceBreaking { unknown_ordinal }
33116 }
33117 }
33118 }
33119 }
33120
33121 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigChecksum>
33122 for crate::ConfigChecksum
33123 {
33124 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigChecksum) -> Self {
33125 match value {
33126 ::fidl_fuchsia_component_decl::ConfigChecksum::Sha256(value) => {
33127 Self::Sha256(::fidl_next::CompatFrom::compat_from(value))
33128 }
33129
33130 ::fidl_fuchsia_component_decl::ConfigChecksum::__SourceBreaking {
33131 unknown_ordinal,
33132 } => Self::UnknownOrdinal_(unknown_ordinal),
33133 }
33134 }
33135 }
33136
33137 impl ::fidl_next::CompatFrom<crate::UseStorage> for ::fidl_fuchsia_component_decl::UseStorage {
33138 fn compat_from(value: crate::UseStorage) -> Self {
33139 Self {
33140 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33141
33142 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
33143
33144 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33145
33146 __source_breaking: ::fidl::marker::SourceBreaking,
33147 }
33148 }
33149 }
33150
33151 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseStorage> for crate::UseStorage {
33152 fn compat_from(value: ::fidl_fuchsia_component_decl::UseStorage) -> Self {
33153 Self {
33154 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33155
33156 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
33157
33158 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33159 }
33160 }
33161 }
33162
33163 impl ::fidl_next::CompatFrom<crate::ConfigMutability>
33164 for ::fidl_fuchsia_component_decl::ConfigMutability
33165 {
33166 fn compat_from(value: crate::ConfigMutability) -> Self {
33167 Self::from_bits_retain(value.bits())
33168 }
33169 }
33170
33171 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigMutability>
33172 for crate::ConfigMutability
33173 {
33174 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigMutability) -> Self {
33175 Self::from_bits_retain(value.bits())
33176 }
33177 }
33178
33179 impl ::fidl_next::CompatFrom<crate::ConfigField> for ::fidl_fuchsia_component_decl::ConfigField {
33180 fn compat_from(value: crate::ConfigField) -> Self {
33181 Self {
33182 key: ::fidl_next::CompatFrom::compat_from(value.key),
33183
33184 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
33185
33186 mutability: ::fidl_next::CompatFrom::compat_from(value.mutability),
33187
33188 __source_breaking: ::fidl::marker::SourceBreaking,
33189 }
33190 }
33191 }
33192
33193 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigField> for crate::ConfigField {
33194 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigField) -> Self {
33195 Self {
33196 key: ::fidl_next::CompatFrom::compat_from(value.key),
33197
33198 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
33199
33200 mutability: ::fidl_next::CompatFrom::compat_from(value.mutability),
33201 }
33202 }
33203 }
33204
33205 impl ::fidl_next::CompatFrom<crate::Program> for ::fidl_fuchsia_component_decl::Program {
33206 fn compat_from(value: crate::Program) -> Self {
33207 Self {
33208 runner: ::fidl_next::CompatFrom::compat_from(value.runner),
33209
33210 info: ::fidl_next::CompatFrom::compat_from(value.info),
33211
33212 __source_breaking: ::fidl::marker::SourceBreaking,
33213 }
33214 }
33215 }
33216
33217 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Program> for crate::Program {
33218 fn compat_from(value: ::fidl_fuchsia_component_decl::Program) -> Self {
33219 Self {
33220 runner: ::fidl_next::CompatFrom::compat_from(value.runner),
33221
33222 info: ::fidl_next::CompatFrom::compat_from(value.info),
33223 }
33224 }
33225 }
33226
33227 impl ::fidl_next::CompatFrom<crate::UseService> for ::fidl_fuchsia_component_decl::UseService {
33228 fn compat_from(value: crate::UseService) -> Self {
33229 Self {
33230 source: ::fidl_next::CompatFrom::compat_from(value.source),
33231
33232 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33233
33234 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
33235
33236 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
33237
33238 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33239
33240 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33241
33242 __source_breaking: ::fidl::marker::SourceBreaking,
33243 }
33244 }
33245 }
33246
33247 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseService> for crate::UseService {
33248 fn compat_from(value: ::fidl_fuchsia_component_decl::UseService) -> Self {
33249 Self {
33250 source: ::fidl_next::CompatFrom::compat_from(value.source),
33251
33252 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33253
33254 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
33255
33256 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
33257
33258 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33259
33260 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33261 }
33262 }
33263 }
33264
33265 impl ::fidl_next::CompatFrom<crate::UseProtocol> for ::fidl_fuchsia_component_decl::UseProtocol {
33266 fn compat_from(value: crate::UseProtocol) -> Self {
33267 Self {
33268 source: ::fidl_next::CompatFrom::compat_from(value.source),
33269
33270 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33271
33272 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
33273
33274 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
33275
33276 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33277
33278 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33279
33280 __source_breaking: ::fidl::marker::SourceBreaking,
33281 }
33282 }
33283 }
33284
33285 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseProtocol> for crate::UseProtocol {
33286 fn compat_from(value: ::fidl_fuchsia_component_decl::UseProtocol) -> Self {
33287 Self {
33288 source: ::fidl_next::CompatFrom::compat_from(value.source),
33289
33290 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33291
33292 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
33293
33294 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
33295
33296 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33297
33298 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33299 }
33300 }
33301 }
33302
33303 impl ::fidl_next::CompatFrom<crate::UseDirectory> for ::fidl_fuchsia_component_decl::UseDirectory {
33304 fn compat_from(value: crate::UseDirectory) -> Self {
33305 Self {
33306 source: ::fidl_next::CompatFrom::compat_from(value.source),
33307
33308 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33309
33310 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
33311
33312 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
33313
33314 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
33315
33316 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
33317
33318 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33319
33320 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33321
33322 __source_breaking: ::fidl::marker::SourceBreaking,
33323 }
33324 }
33325 }
33326
33327 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseDirectory> for crate::UseDirectory {
33328 fn compat_from(value: ::fidl_fuchsia_component_decl::UseDirectory) -> Self {
33329 Self {
33330 source: ::fidl_next::CompatFrom::compat_from(value.source),
33331
33332 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33333
33334 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
33335
33336 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
33337
33338 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
33339
33340 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
33341
33342 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33343
33344 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33345 }
33346 }
33347 }
33348
33349 impl ::fidl_next::CompatFrom<crate::UseEventStream>
33350 for ::fidl_fuchsia_component_decl::UseEventStream
33351 {
33352 fn compat_from(value: crate::UseEventStream) -> Self {
33353 Self {
33354 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33355
33356 source: ::fidl_next::CompatFrom::compat_from(value.source),
33357
33358 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
33359
33360 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
33361
33362 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33363
33364 filter: ::fidl_next::CompatFrom::compat_from(value.filter),
33365
33366 __source_breaking: ::fidl::marker::SourceBreaking,
33367 }
33368 }
33369 }
33370
33371 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseEventStream>
33372 for crate::UseEventStream
33373 {
33374 fn compat_from(value: ::fidl_fuchsia_component_decl::UseEventStream) -> Self {
33375 Self {
33376 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33377
33378 source: ::fidl_next::CompatFrom::compat_from(value.source),
33379
33380 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
33381
33382 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
33383
33384 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33385
33386 filter: ::fidl_next::CompatFrom::compat_from(value.filter),
33387 }
33388 }
33389 }
33390
33391 impl ::fidl_next::CompatFrom<crate::UseRunner> for ::fidl_fuchsia_component_decl::UseRunner {
33392 fn compat_from(value: crate::UseRunner) -> Self {
33393 Self {
33394 source: ::fidl_next::CompatFrom::compat_from(value.source),
33395
33396 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33397
33398 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33399
33400 __source_breaking: ::fidl::marker::SourceBreaking,
33401 }
33402 }
33403 }
33404
33405 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseRunner> for crate::UseRunner {
33406 fn compat_from(value: ::fidl_fuchsia_component_decl::UseRunner) -> Self {
33407 Self {
33408 source: ::fidl_next::CompatFrom::compat_from(value.source),
33409
33410 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33411
33412 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33413 }
33414 }
33415 }
33416
33417 impl ::fidl_next::CompatFrom<crate::UseConfiguration>
33418 for ::fidl_fuchsia_component_decl::UseConfiguration
33419 {
33420 fn compat_from(value: crate::UseConfiguration) -> Self {
33421 Self {
33422 source: ::fidl_next::CompatFrom::compat_from(value.source),
33423
33424 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33425
33426 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33427
33428 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33429
33430 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
33431
33432 default: ::fidl_next::CompatFrom::compat_from(value.default),
33433
33434 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33435
33436 __source_breaking: ::fidl::marker::SourceBreaking,
33437 }
33438 }
33439 }
33440
33441 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseConfiguration>
33442 for crate::UseConfiguration
33443 {
33444 fn compat_from(value: ::fidl_fuchsia_component_decl::UseConfiguration) -> Self {
33445 Self {
33446 source: ::fidl_next::CompatFrom::compat_from(value.source),
33447
33448 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33449
33450 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33451
33452 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33453
33454 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
33455
33456 default: ::fidl_next::CompatFrom::compat_from(value.default),
33457
33458 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33459 }
33460 }
33461 }
33462
33463 impl ::fidl_next::CompatFrom<crate::Use> for ::fidl_fuchsia_component_decl::Use {
33464 fn compat_from(value: crate::Use) -> Self {
33465 match value {
33466 crate::Use::Service(value) => {
33467 Self::Service(::fidl_next::CompatFrom::compat_from(value))
33468 }
33469
33470 crate::Use::Protocol(value) => {
33471 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
33472 }
33473
33474 crate::Use::Directory(value) => {
33475 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
33476 }
33477
33478 crate::Use::Storage(value) => {
33479 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
33480 }
33481
33482 crate::Use::EventStream(value) => {
33483 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
33484 }
33485
33486 crate::Use::Runner(value) => {
33487 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
33488 }
33489
33490 crate::Use::Config(value) => {
33491 Self::Config(::fidl_next::CompatFrom::compat_from(value))
33492 }
33493
33494 crate::Use::UnknownOrdinal_(unknown_ordinal) => {
33495 Self::__SourceBreaking { unknown_ordinal }
33496 }
33497 }
33498 }
33499 }
33500
33501 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Use> for crate::Use {
33502 fn compat_from(value: ::fidl_fuchsia_component_decl::Use) -> Self {
33503 match value {
33504 ::fidl_fuchsia_component_decl::Use::Service(value) => {
33505 Self::Service(::fidl_next::CompatFrom::compat_from(value))
33506 }
33507
33508 ::fidl_fuchsia_component_decl::Use::Protocol(value) => {
33509 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
33510 }
33511
33512 ::fidl_fuchsia_component_decl::Use::Directory(value) => {
33513 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
33514 }
33515
33516 ::fidl_fuchsia_component_decl::Use::Storage(value) => {
33517 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
33518 }
33519
33520 ::fidl_fuchsia_component_decl::Use::EventStream(value) => {
33521 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
33522 }
33523
33524 ::fidl_fuchsia_component_decl::Use::Runner(value) => {
33525 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
33526 }
33527
33528 ::fidl_fuchsia_component_decl::Use::Config(value) => {
33529 Self::Config(::fidl_next::CompatFrom::compat_from(value))
33530 }
33531
33532 ::fidl_fuchsia_component_decl::Use::__SourceBreaking { unknown_ordinal } => {
33533 Self::UnknownOrdinal_(unknown_ordinal)
33534 }
33535 }
33536 }
33537 }
33538
33539 impl ::fidl_next::CompatFrom<crate::ExposeService>
33540 for ::fidl_fuchsia_component_decl::ExposeService
33541 {
33542 fn compat_from(value: crate::ExposeService) -> Self {
33543 Self {
33544 source: ::fidl_next::CompatFrom::compat_from(value.source),
33545
33546 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33547
33548 target: ::fidl_next::CompatFrom::compat_from(value.target),
33549
33550 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33551
33552 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33553
33554 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33555
33556 __source_breaking: ::fidl::marker::SourceBreaking,
33557 }
33558 }
33559 }
33560
33561 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeService>
33562 for crate::ExposeService
33563 {
33564 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeService) -> Self {
33565 Self {
33566 source: ::fidl_next::CompatFrom::compat_from(value.source),
33567
33568 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33569
33570 target: ::fidl_next::CompatFrom::compat_from(value.target),
33571
33572 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33573
33574 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33575
33576 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33577 }
33578 }
33579 }
33580
33581 impl ::fidl_next::CompatFrom<crate::ExposeProtocol>
33582 for ::fidl_fuchsia_component_decl::ExposeProtocol
33583 {
33584 fn compat_from(value: crate::ExposeProtocol) -> Self {
33585 Self {
33586 source: ::fidl_next::CompatFrom::compat_from(value.source),
33587
33588 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33589
33590 target: ::fidl_next::CompatFrom::compat_from(value.target),
33591
33592 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33593
33594 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33595
33596 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33597
33598 __source_breaking: ::fidl::marker::SourceBreaking,
33599 }
33600 }
33601 }
33602
33603 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeProtocol>
33604 for crate::ExposeProtocol
33605 {
33606 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeProtocol) -> Self {
33607 Self {
33608 source: ::fidl_next::CompatFrom::compat_from(value.source),
33609
33610 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33611
33612 target: ::fidl_next::CompatFrom::compat_from(value.target),
33613
33614 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33615
33616 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33617
33618 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33619 }
33620 }
33621 }
33622
33623 impl ::fidl_next::CompatFrom<crate::ExposeDirectory>
33624 for ::fidl_fuchsia_component_decl::ExposeDirectory
33625 {
33626 fn compat_from(value: crate::ExposeDirectory) -> Self {
33627 Self {
33628 source: ::fidl_next::CompatFrom::compat_from(value.source),
33629
33630 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33631
33632 target: ::fidl_next::CompatFrom::compat_from(value.target),
33633
33634 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33635
33636 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
33637
33638 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
33639
33640 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33641
33642 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33643
33644 __source_breaking: ::fidl::marker::SourceBreaking,
33645 }
33646 }
33647 }
33648
33649 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeDirectory>
33650 for crate::ExposeDirectory
33651 {
33652 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeDirectory) -> Self {
33653 Self {
33654 source: ::fidl_next::CompatFrom::compat_from(value.source),
33655
33656 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33657
33658 target: ::fidl_next::CompatFrom::compat_from(value.target),
33659
33660 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33661
33662 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
33663
33664 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
33665
33666 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33667
33668 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33669 }
33670 }
33671 }
33672
33673 impl ::fidl_next::CompatFrom<crate::ExposeRunner> for ::fidl_fuchsia_component_decl::ExposeRunner {
33674 fn compat_from(value: crate::ExposeRunner) -> Self {
33675 Self {
33676 source: ::fidl_next::CompatFrom::compat_from(value.source),
33677
33678 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33679
33680 target: ::fidl_next::CompatFrom::compat_from(value.target),
33681
33682 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33683
33684 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33685
33686 __source_breaking: ::fidl::marker::SourceBreaking,
33687 }
33688 }
33689 }
33690
33691 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeRunner> for crate::ExposeRunner {
33692 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeRunner) -> Self {
33693 Self {
33694 source: ::fidl_next::CompatFrom::compat_from(value.source),
33695
33696 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33697
33698 target: ::fidl_next::CompatFrom::compat_from(value.target),
33699
33700 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33701
33702 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33703 }
33704 }
33705 }
33706
33707 impl ::fidl_next::CompatFrom<crate::ExposeResolver>
33708 for ::fidl_fuchsia_component_decl::ExposeResolver
33709 {
33710 fn compat_from(value: crate::ExposeResolver) -> Self {
33711 Self {
33712 source: ::fidl_next::CompatFrom::compat_from(value.source),
33713
33714 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33715
33716 target: ::fidl_next::CompatFrom::compat_from(value.target),
33717
33718 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33719
33720 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33721
33722 __source_breaking: ::fidl::marker::SourceBreaking,
33723 }
33724 }
33725 }
33726
33727 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeResolver>
33728 for crate::ExposeResolver
33729 {
33730 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeResolver) -> Self {
33731 Self {
33732 source: ::fidl_next::CompatFrom::compat_from(value.source),
33733
33734 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33735
33736 target: ::fidl_next::CompatFrom::compat_from(value.target),
33737
33738 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33739
33740 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33741 }
33742 }
33743 }
33744
33745 impl ::fidl_next::CompatFrom<crate::ExposeDictionary>
33746 for ::fidl_fuchsia_component_decl::ExposeDictionary
33747 {
33748 fn compat_from(value: crate::ExposeDictionary) -> Self {
33749 Self {
33750 source: ::fidl_next::CompatFrom::compat_from(value.source),
33751
33752 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33753
33754 target: ::fidl_next::CompatFrom::compat_from(value.target),
33755
33756 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33757
33758 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33759
33760 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33761
33762 __source_breaking: ::fidl::marker::SourceBreaking,
33763 }
33764 }
33765 }
33766
33767 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeDictionary>
33768 for crate::ExposeDictionary
33769 {
33770 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeDictionary) -> Self {
33771 Self {
33772 source: ::fidl_next::CompatFrom::compat_from(value.source),
33773
33774 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33775
33776 target: ::fidl_next::CompatFrom::compat_from(value.target),
33777
33778 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33779
33780 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33781
33782 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33783 }
33784 }
33785 }
33786
33787 impl ::fidl_next::CompatFrom<crate::ExposeConfiguration>
33788 for ::fidl_fuchsia_component_decl::ExposeConfiguration
33789 {
33790 fn compat_from(value: crate::ExposeConfiguration) -> Self {
33791 Self {
33792 source: ::fidl_next::CompatFrom::compat_from(value.source),
33793
33794 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33795
33796 target: ::fidl_next::CompatFrom::compat_from(value.target),
33797
33798 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33799
33800 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33801
33802 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33803
33804 __source_breaking: ::fidl::marker::SourceBreaking,
33805 }
33806 }
33807 }
33808
33809 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeConfiguration>
33810 for crate::ExposeConfiguration
33811 {
33812 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeConfiguration) -> Self {
33813 Self {
33814 source: ::fidl_next::CompatFrom::compat_from(value.source),
33815
33816 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33817
33818 target: ::fidl_next::CompatFrom::compat_from(value.target),
33819
33820 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33821
33822 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33823
33824 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33825 }
33826 }
33827 }
33828
33829 impl ::fidl_next::CompatFrom<crate::Expose> for ::fidl_fuchsia_component_decl::Expose {
33830 fn compat_from(value: crate::Expose) -> Self {
33831 match value {
33832 crate::Expose::Service(value) => {
33833 Self::Service(::fidl_next::CompatFrom::compat_from(value))
33834 }
33835
33836 crate::Expose::Protocol(value) => {
33837 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
33838 }
33839
33840 crate::Expose::Directory(value) => {
33841 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
33842 }
33843
33844 crate::Expose::Runner(value) => {
33845 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
33846 }
33847
33848 crate::Expose::Resolver(value) => {
33849 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
33850 }
33851
33852 crate::Expose::Dictionary(value) => {
33853 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
33854 }
33855
33856 crate::Expose::Config(value) => {
33857 Self::Config(::fidl_next::CompatFrom::compat_from(value))
33858 }
33859
33860 crate::Expose::UnknownOrdinal_(unknown_ordinal) => {
33861 Self::__SourceBreaking { unknown_ordinal }
33862 }
33863 }
33864 }
33865 }
33866
33867 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Expose> for crate::Expose {
33868 fn compat_from(value: ::fidl_fuchsia_component_decl::Expose) -> Self {
33869 match value {
33870 ::fidl_fuchsia_component_decl::Expose::Service(value) => {
33871 Self::Service(::fidl_next::CompatFrom::compat_from(value))
33872 }
33873
33874 ::fidl_fuchsia_component_decl::Expose::Protocol(value) => {
33875 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
33876 }
33877
33878 ::fidl_fuchsia_component_decl::Expose::Directory(value) => {
33879 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
33880 }
33881
33882 ::fidl_fuchsia_component_decl::Expose::Runner(value) => {
33883 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
33884 }
33885
33886 ::fidl_fuchsia_component_decl::Expose::Resolver(value) => {
33887 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
33888 }
33889
33890 ::fidl_fuchsia_component_decl::Expose::Dictionary(value) => {
33891 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
33892 }
33893
33894 ::fidl_fuchsia_component_decl::Expose::Config(value) => {
33895 Self::Config(::fidl_next::CompatFrom::compat_from(value))
33896 }
33897
33898 ::fidl_fuchsia_component_decl::Expose::__SourceBreaking { unknown_ordinal } => {
33899 Self::UnknownOrdinal_(unknown_ordinal)
33900 }
33901 }
33902 }
33903 }
33904
33905 impl ::fidl_next::CompatFrom<crate::OfferService> for ::fidl_fuchsia_component_decl::OfferService {
33906 fn compat_from(value: crate::OfferService) -> Self {
33907 Self {
33908 source: ::fidl_next::CompatFrom::compat_from(value.source),
33909
33910 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33911
33912 target: ::fidl_next::CompatFrom::compat_from(value.target),
33913
33914 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33915
33916 source_instance_filter: ::fidl_next::CompatFrom::compat_from(
33917 value.source_instance_filter,
33918 ),
33919
33920 renamed_instances: ::fidl_next::CompatFrom::compat_from(value.renamed_instances),
33921
33922 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33923
33924 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33925
33926 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
33927
33928 __source_breaking: ::fidl::marker::SourceBreaking,
33929 }
33930 }
33931 }
33932
33933 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferService> for crate::OfferService {
33934 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferService) -> Self {
33935 Self {
33936 source: ::fidl_next::CompatFrom::compat_from(value.source),
33937
33938 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33939
33940 target: ::fidl_next::CompatFrom::compat_from(value.target),
33941
33942 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33943
33944 source_instance_filter: ::fidl_next::CompatFrom::compat_from(
33945 value.source_instance_filter,
33946 ),
33947
33948 renamed_instances: ::fidl_next::CompatFrom::compat_from(value.renamed_instances),
33949
33950 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33951
33952 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33953
33954 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
33955 }
33956 }
33957 }
33958
33959 impl ::fidl_next::CompatFrom<crate::OfferProtocol>
33960 for ::fidl_fuchsia_component_decl::OfferProtocol
33961 {
33962 fn compat_from(value: crate::OfferProtocol) -> Self {
33963 Self {
33964 source: ::fidl_next::CompatFrom::compat_from(value.source),
33965
33966 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33967
33968 target: ::fidl_next::CompatFrom::compat_from(value.target),
33969
33970 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33971
33972 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
33973
33974 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33975
33976 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
33977
33978 __source_breaking: ::fidl::marker::SourceBreaking,
33979 }
33980 }
33981 }
33982
33983 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferProtocol>
33984 for crate::OfferProtocol
33985 {
33986 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferProtocol) -> Self {
33987 Self {
33988 source: ::fidl_next::CompatFrom::compat_from(value.source),
33989
33990 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
33991
33992 target: ::fidl_next::CompatFrom::compat_from(value.target),
33993
33994 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
33995
33996 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
33997
33998 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
33999
34000 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34001 }
34002 }
34003 }
34004
34005 impl ::fidl_next::CompatFrom<crate::OfferDirectory>
34006 for ::fidl_fuchsia_component_decl::OfferDirectory
34007 {
34008 fn compat_from(value: crate::OfferDirectory) -> Self {
34009 Self {
34010 source: ::fidl_next::CompatFrom::compat_from(value.source),
34011
34012 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34013
34014 target: ::fidl_next::CompatFrom::compat_from(value.target),
34015
34016 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34017
34018 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
34019
34020 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
34021
34022 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
34023
34024 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34025
34026 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34027
34028 __source_breaking: ::fidl::marker::SourceBreaking,
34029 }
34030 }
34031 }
34032
34033 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferDirectory>
34034 for crate::OfferDirectory
34035 {
34036 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferDirectory) -> Self {
34037 Self {
34038 source: ::fidl_next::CompatFrom::compat_from(value.source),
34039
34040 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34041
34042 target: ::fidl_next::CompatFrom::compat_from(value.target),
34043
34044 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34045
34046 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
34047
34048 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
34049
34050 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
34051
34052 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34053
34054 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34055 }
34056 }
34057 }
34058
34059 impl ::fidl_next::CompatFrom<crate::OfferStorage> for ::fidl_fuchsia_component_decl::OfferStorage {
34060 fn compat_from(value: crate::OfferStorage) -> Self {
34061 Self {
34062 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34063
34064 source: ::fidl_next::CompatFrom::compat_from(value.source),
34065
34066 target: ::fidl_next::CompatFrom::compat_from(value.target),
34067
34068 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34069
34070 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34071
34072 __source_breaking: ::fidl::marker::SourceBreaking,
34073 }
34074 }
34075 }
34076
34077 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferStorage> for crate::OfferStorage {
34078 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferStorage) -> Self {
34079 Self {
34080 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34081
34082 source: ::fidl_next::CompatFrom::compat_from(value.source),
34083
34084 target: ::fidl_next::CompatFrom::compat_from(value.target),
34085
34086 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34087
34088 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34089 }
34090 }
34091 }
34092
34093 impl ::fidl_next::CompatFrom<crate::OfferRunner> for ::fidl_fuchsia_component_decl::OfferRunner {
34094 fn compat_from(value: crate::OfferRunner) -> Self {
34095 Self {
34096 source: ::fidl_next::CompatFrom::compat_from(value.source),
34097
34098 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34099
34100 target: ::fidl_next::CompatFrom::compat_from(value.target),
34101
34102 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34103
34104 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34105
34106 __source_breaking: ::fidl::marker::SourceBreaking,
34107 }
34108 }
34109 }
34110
34111 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferRunner> for crate::OfferRunner {
34112 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferRunner) -> Self {
34113 Self {
34114 source: ::fidl_next::CompatFrom::compat_from(value.source),
34115
34116 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34117
34118 target: ::fidl_next::CompatFrom::compat_from(value.target),
34119
34120 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34121
34122 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34123 }
34124 }
34125 }
34126
34127 impl ::fidl_next::CompatFrom<crate::OfferResolver>
34128 for ::fidl_fuchsia_component_decl::OfferResolver
34129 {
34130 fn compat_from(value: crate::OfferResolver) -> Self {
34131 Self {
34132 source: ::fidl_next::CompatFrom::compat_from(value.source),
34133
34134 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34135
34136 target: ::fidl_next::CompatFrom::compat_from(value.target),
34137
34138 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34139
34140 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34141
34142 __source_breaking: ::fidl::marker::SourceBreaking,
34143 }
34144 }
34145 }
34146
34147 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferResolver>
34148 for crate::OfferResolver
34149 {
34150 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferResolver) -> Self {
34151 Self {
34152 source: ::fidl_next::CompatFrom::compat_from(value.source),
34153
34154 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34155
34156 target: ::fidl_next::CompatFrom::compat_from(value.target),
34157
34158 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34159
34160 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34161 }
34162 }
34163 }
34164
34165 impl ::fidl_next::CompatFrom<crate::OfferEventStream>
34166 for ::fidl_fuchsia_component_decl::OfferEventStream
34167 {
34168 fn compat_from(value: crate::OfferEventStream) -> Self {
34169 Self {
34170 source: ::fidl_next::CompatFrom::compat_from(value.source),
34171
34172 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34173
34174 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
34175
34176 target: ::fidl_next::CompatFrom::compat_from(value.target),
34177
34178 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34179
34180 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34181
34182 __source_breaking: ::fidl::marker::SourceBreaking,
34183 }
34184 }
34185 }
34186
34187 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferEventStream>
34188 for crate::OfferEventStream
34189 {
34190 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferEventStream) -> Self {
34191 Self {
34192 source: ::fidl_next::CompatFrom::compat_from(value.source),
34193
34194 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34195
34196 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
34197
34198 target: ::fidl_next::CompatFrom::compat_from(value.target),
34199
34200 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34201
34202 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34203 }
34204 }
34205 }
34206
34207 impl ::fidl_next::CompatFrom<crate::OfferDictionary>
34208 for ::fidl_fuchsia_component_decl::OfferDictionary
34209 {
34210 fn compat_from(value: crate::OfferDictionary) -> Self {
34211 Self {
34212 source: ::fidl_next::CompatFrom::compat_from(value.source),
34213
34214 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34215
34216 target: ::fidl_next::CompatFrom::compat_from(value.target),
34217
34218 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34219
34220 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
34221
34222 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34223
34224 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34225
34226 __source_breaking: ::fidl::marker::SourceBreaking,
34227 }
34228 }
34229 }
34230
34231 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferDictionary>
34232 for crate::OfferDictionary
34233 {
34234 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferDictionary) -> Self {
34235 Self {
34236 source: ::fidl_next::CompatFrom::compat_from(value.source),
34237
34238 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34239
34240 target: ::fidl_next::CompatFrom::compat_from(value.target),
34241
34242 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34243
34244 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
34245
34246 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34247
34248 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34249 }
34250 }
34251 }
34252
34253 impl ::fidl_next::CompatFrom<crate::OfferConfiguration>
34254 for ::fidl_fuchsia_component_decl::OfferConfiguration
34255 {
34256 fn compat_from(value: crate::OfferConfiguration) -> Self {
34257 Self {
34258 source: ::fidl_next::CompatFrom::compat_from(value.source),
34259
34260 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34261
34262 target: ::fidl_next::CompatFrom::compat_from(value.target),
34263
34264 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34265
34266 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34267
34268 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34269
34270 __source_breaking: ::fidl::marker::SourceBreaking,
34271 }
34272 }
34273 }
34274
34275 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferConfiguration>
34276 for crate::OfferConfiguration
34277 {
34278 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferConfiguration) -> Self {
34279 Self {
34280 source: ::fidl_next::CompatFrom::compat_from(value.source),
34281
34282 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34283
34284 target: ::fidl_next::CompatFrom::compat_from(value.target),
34285
34286 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34287
34288 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34289
34290 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34291 }
34292 }
34293 }
34294
34295 impl ::fidl_next::CompatFrom<crate::Offer> for ::fidl_fuchsia_component_decl::Offer {
34296 fn compat_from(value: crate::Offer) -> Self {
34297 match value {
34298 crate::Offer::Service(value) => {
34299 Self::Service(::fidl_next::CompatFrom::compat_from(value))
34300 }
34301
34302 crate::Offer::Protocol(value) => {
34303 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
34304 }
34305
34306 crate::Offer::Directory(value) => {
34307 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
34308 }
34309
34310 crate::Offer::Storage(value) => {
34311 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
34312 }
34313
34314 crate::Offer::Runner(value) => {
34315 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
34316 }
34317
34318 crate::Offer::Resolver(value) => {
34319 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
34320 }
34321
34322 crate::Offer::EventStream(value) => {
34323 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
34324 }
34325
34326 crate::Offer::Dictionary(value) => {
34327 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
34328 }
34329
34330 crate::Offer::Config(value) => {
34331 Self::Config(::fidl_next::CompatFrom::compat_from(value))
34332 }
34333
34334 crate::Offer::UnknownOrdinal_(unknown_ordinal) => {
34335 Self::__SourceBreaking { unknown_ordinal }
34336 }
34337 }
34338 }
34339 }
34340
34341 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Offer> for crate::Offer {
34342 fn compat_from(value: ::fidl_fuchsia_component_decl::Offer) -> Self {
34343 match value {
34344 ::fidl_fuchsia_component_decl::Offer::Service(value) => {
34345 Self::Service(::fidl_next::CompatFrom::compat_from(value))
34346 }
34347
34348 ::fidl_fuchsia_component_decl::Offer::Protocol(value) => {
34349 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
34350 }
34351
34352 ::fidl_fuchsia_component_decl::Offer::Directory(value) => {
34353 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
34354 }
34355
34356 ::fidl_fuchsia_component_decl::Offer::Storage(value) => {
34357 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
34358 }
34359
34360 ::fidl_fuchsia_component_decl::Offer::Runner(value) => {
34361 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
34362 }
34363
34364 ::fidl_fuchsia_component_decl::Offer::Resolver(value) => {
34365 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
34366 }
34367
34368 ::fidl_fuchsia_component_decl::Offer::EventStream(value) => {
34369 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
34370 }
34371
34372 ::fidl_fuchsia_component_decl::Offer::Dictionary(value) => {
34373 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
34374 }
34375
34376 ::fidl_fuchsia_component_decl::Offer::Config(value) => {
34377 Self::Config(::fidl_next::CompatFrom::compat_from(value))
34378 }
34379
34380 ::fidl_fuchsia_component_decl::Offer::__SourceBreaking { unknown_ordinal } => {
34381 Self::UnknownOrdinal_(unknown_ordinal)
34382 }
34383 }
34384 }
34385 }
34386
34387 impl ::fidl_next::CompatFrom<crate::RunnerRegistration>
34388 for ::fidl_fuchsia_component_decl::RunnerRegistration
34389 {
34390 fn compat_from(value: crate::RunnerRegistration) -> Self {
34391 Self {
34392 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34393
34394 source: ::fidl_next::CompatFrom::compat_from(value.source),
34395
34396 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34397
34398 __source_breaking: ::fidl::marker::SourceBreaking,
34399 }
34400 }
34401 }
34402
34403 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::RunnerRegistration>
34404 for crate::RunnerRegistration
34405 {
34406 fn compat_from(value: ::fidl_fuchsia_component_decl::RunnerRegistration) -> Self {
34407 Self {
34408 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34409
34410 source: ::fidl_next::CompatFrom::compat_from(value.source),
34411
34412 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34413 }
34414 }
34415 }
34416
34417 impl ::fidl_next::CompatFrom<crate::ResolverRegistration>
34418 for ::fidl_fuchsia_component_decl::ResolverRegistration
34419 {
34420 fn compat_from(value: crate::ResolverRegistration) -> Self {
34421 Self {
34422 resolver: ::fidl_next::CompatFrom::compat_from(value.resolver),
34423
34424 source: ::fidl_next::CompatFrom::compat_from(value.source),
34425
34426 scheme: ::fidl_next::CompatFrom::compat_from(value.scheme),
34427
34428 __source_breaking: ::fidl::marker::SourceBreaking,
34429 }
34430 }
34431 }
34432
34433 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ResolverRegistration>
34434 for crate::ResolverRegistration
34435 {
34436 fn compat_from(value: ::fidl_fuchsia_component_decl::ResolverRegistration) -> Self {
34437 Self {
34438 resolver: ::fidl_next::CompatFrom::compat_from(value.resolver),
34439
34440 source: ::fidl_next::CompatFrom::compat_from(value.source),
34441
34442 scheme: ::fidl_next::CompatFrom::compat_from(value.scheme),
34443 }
34444 }
34445 }
34446
34447 impl ::fidl_next::CompatFrom<crate::DebugProtocolRegistration>
34448 for ::fidl_fuchsia_component_decl::DebugProtocolRegistration
34449 {
34450 fn compat_from(value: crate::DebugProtocolRegistration) -> Self {
34451 Self {
34452 source: ::fidl_next::CompatFrom::compat_from(value.source),
34453
34454 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34455
34456 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34457
34458 __source_breaking: ::fidl::marker::SourceBreaking,
34459 }
34460 }
34461 }
34462
34463 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DebugProtocolRegistration>
34464 for crate::DebugProtocolRegistration
34465 {
34466 fn compat_from(value: ::fidl_fuchsia_component_decl::DebugProtocolRegistration) -> Self {
34467 Self {
34468 source: ::fidl_next::CompatFrom::compat_from(value.source),
34469
34470 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34471
34472 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34473 }
34474 }
34475 }
34476
34477 impl ::fidl_next::CompatFrom<crate::DebugRegistration>
34478 for ::fidl_fuchsia_component_decl::DebugRegistration
34479 {
34480 fn compat_from(value: crate::DebugRegistration) -> Self {
34481 match value {
34482 crate::DebugRegistration::Protocol(value) => {
34483 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
34484 }
34485
34486 crate::DebugRegistration::UnknownOrdinal_(unknown_ordinal) => {
34487 Self::__SourceBreaking { unknown_ordinal }
34488 }
34489 }
34490 }
34491 }
34492
34493 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DebugRegistration>
34494 for crate::DebugRegistration
34495 {
34496 fn compat_from(value: ::fidl_fuchsia_component_decl::DebugRegistration) -> Self {
34497 match value {
34498 ::fidl_fuchsia_component_decl::DebugRegistration::Protocol(value) => {
34499 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
34500 }
34501
34502 ::fidl_fuchsia_component_decl::DebugRegistration::__SourceBreaking {
34503 unknown_ordinal,
34504 } => Self::UnknownOrdinal_(unknown_ordinal),
34505 }
34506 }
34507 }
34508
34509 impl ::fidl_next::CompatFrom<crate::Environment> for ::fidl_fuchsia_component_decl::Environment {
34510 fn compat_from(value: crate::Environment) -> Self {
34511 Self {
34512 name: ::fidl_next::CompatFrom::compat_from(value.name),
34513
34514 extends: ::fidl_next::CompatFrom::compat_from(value.extends),
34515
34516 runners: ::fidl_next::CompatFrom::compat_from(value.runners),
34517
34518 resolvers: ::fidl_next::CompatFrom::compat_from(value.resolvers),
34519
34520 debug_capabilities: ::fidl_next::CompatFrom::compat_from(value.debug_capabilities),
34521
34522 stop_timeout_ms: ::fidl_next::CompatFrom::compat_from(value.stop_timeout_ms),
34523
34524 __source_breaking: ::fidl::marker::SourceBreaking,
34525 }
34526 }
34527 }
34528
34529 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Environment> for crate::Environment {
34530 fn compat_from(value: ::fidl_fuchsia_component_decl::Environment) -> Self {
34531 Self {
34532 name: ::fidl_next::CompatFrom::compat_from(value.name),
34533
34534 extends: ::fidl_next::CompatFrom::compat_from(value.extends),
34535
34536 runners: ::fidl_next::CompatFrom::compat_from(value.runners),
34537
34538 resolvers: ::fidl_next::CompatFrom::compat_from(value.resolvers),
34539
34540 debug_capabilities: ::fidl_next::CompatFrom::compat_from(value.debug_capabilities),
34541
34542 stop_timeout_ms: ::fidl_next::CompatFrom::compat_from(value.stop_timeout_ms),
34543 }
34544 }
34545 }
34546
34547 impl ::fidl_next::CompatFrom<crate::ConfigSourceCapabilities>
34548 for ::fidl_fuchsia_component_decl::ConfigSourceCapabilities
34549 {
34550 fn compat_from(value: crate::ConfigSourceCapabilities) -> Self {
34551 Self { __source_breaking: ::fidl::marker::SourceBreaking }
34552 }
34553 }
34554
34555 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigSourceCapabilities>
34556 for crate::ConfigSourceCapabilities
34557 {
34558 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigSourceCapabilities) -> Self {
34559 Self {}
34560 }
34561 }
34562
34563 impl ::fidl_next::CompatFrom<crate::ConfigValueSource>
34564 for ::fidl_fuchsia_component_decl::ConfigValueSource
34565 {
34566 fn compat_from(value: crate::ConfigValueSource) -> Self {
34567 match value {
34568 crate::ConfigValueSource::PackagePath(value) => {
34569 Self::PackagePath(::fidl_next::CompatFrom::compat_from(value))
34570 }
34571
34572 crate::ConfigValueSource::Capabilities(value) => {
34573 Self::Capabilities(::fidl_next::CompatFrom::compat_from(value))
34574 }
34575
34576 crate::ConfigValueSource::UnknownOrdinal_(unknown_ordinal) => {
34577 Self::__SourceBreaking { unknown_ordinal }
34578 }
34579 }
34580 }
34581 }
34582
34583 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValueSource>
34584 for crate::ConfigValueSource
34585 {
34586 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValueSource) -> Self {
34587 match value {
34588 ::fidl_fuchsia_component_decl::ConfigValueSource::PackagePath(value) => {
34589 Self::PackagePath(::fidl_next::CompatFrom::compat_from(value))
34590 }
34591
34592 ::fidl_fuchsia_component_decl::ConfigValueSource::Capabilities(value) => {
34593 Self::Capabilities(::fidl_next::CompatFrom::compat_from(value))
34594 }
34595
34596 ::fidl_fuchsia_component_decl::ConfigValueSource::__SourceBreaking {
34597 unknown_ordinal,
34598 } => Self::UnknownOrdinal_(unknown_ordinal),
34599 }
34600 }
34601 }
34602
34603 impl ::fidl_next::CompatFrom<crate::ConfigSchema> for ::fidl_fuchsia_component_decl::ConfigSchema {
34604 fn compat_from(value: crate::ConfigSchema) -> Self {
34605 Self {
34606 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
34607
34608 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
34609
34610 value_source: ::fidl_next::CompatFrom::compat_from(value.value_source),
34611
34612 __source_breaking: ::fidl::marker::SourceBreaking,
34613 }
34614 }
34615 }
34616
34617 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigSchema> for crate::ConfigSchema {
34618 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigSchema) -> Self {
34619 Self {
34620 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
34621
34622 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
34623
34624 value_source: ::fidl_next::CompatFrom::compat_from(value.value_source),
34625 }
34626 }
34627 }
34628
34629 impl ::fidl_next::CompatFrom<crate::Component> for ::fidl_fuchsia_component_decl::Component {
34630 fn compat_from(value: crate::Component) -> Self {
34631 Self {
34632 program: ::fidl_next::CompatFrom::compat_from(value.program),
34633
34634 uses: ::fidl_next::CompatFrom::compat_from(value.uses),
34635
34636 exposes: ::fidl_next::CompatFrom::compat_from(value.exposes),
34637
34638 offers: ::fidl_next::CompatFrom::compat_from(value.offers),
34639
34640 capabilities: ::fidl_next::CompatFrom::compat_from(value.capabilities),
34641
34642 children: ::fidl_next::CompatFrom::compat_from(value.children),
34643
34644 collections: ::fidl_next::CompatFrom::compat_from(value.collections),
34645
34646 environments: ::fidl_next::CompatFrom::compat_from(value.environments),
34647
34648 facets: ::fidl_next::CompatFrom::compat_from(value.facets),
34649
34650 config: ::fidl_next::CompatFrom::compat_from(value.config),
34651
34652 __source_breaking: ::fidl::marker::SourceBreaking,
34653 }
34654 }
34655 }
34656
34657 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Component> for crate::Component {
34658 fn compat_from(value: ::fidl_fuchsia_component_decl::Component) -> Self {
34659 Self {
34660 program: ::fidl_next::CompatFrom::compat_from(value.program),
34661
34662 uses: ::fidl_next::CompatFrom::compat_from(value.uses),
34663
34664 exposes: ::fidl_next::CompatFrom::compat_from(value.exposes),
34665
34666 offers: ::fidl_next::CompatFrom::compat_from(value.offers),
34667
34668 capabilities: ::fidl_next::CompatFrom::compat_from(value.capabilities),
34669
34670 children: ::fidl_next::CompatFrom::compat_from(value.children),
34671
34672 collections: ::fidl_next::CompatFrom::compat_from(value.collections),
34673
34674 environments: ::fidl_next::CompatFrom::compat_from(value.environments),
34675
34676 facets: ::fidl_next::CompatFrom::compat_from(value.facets),
34677
34678 config: ::fidl_next::CompatFrom::compat_from(value.config),
34679 }
34680 }
34681 }
34682
34683 impl ::fidl_next::CompatFrom<crate::ConfigValueSpec>
34684 for ::fidl_fuchsia_component_decl::ConfigValueSpec
34685 {
34686 fn compat_from(value: crate::ConfigValueSpec) -> Self {
34687 Self {
34688 value: ::fidl_next::CompatFrom::compat_from(value.value),
34689
34690 __source_breaking: ::fidl::marker::SourceBreaking,
34691 }
34692 }
34693 }
34694
34695 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValueSpec>
34696 for crate::ConfigValueSpec
34697 {
34698 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValueSpec) -> Self {
34699 Self { value: ::fidl_next::CompatFrom::compat_from(value.value) }
34700 }
34701 }
34702
34703 impl ::fidl_next::CompatFrom<crate::ConfigValuesData>
34704 for ::fidl_fuchsia_component_decl::ConfigValuesData
34705 {
34706 fn compat_from(value: crate::ConfigValuesData) -> Self {
34707 Self {
34708 values: ::fidl_next::CompatFrom::compat_from(value.values),
34709
34710 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
34711
34712 __source_breaking: ::fidl::marker::SourceBreaking,
34713 }
34714 }
34715 }
34716
34717 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValuesData>
34718 for crate::ConfigValuesData
34719 {
34720 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValuesData) -> Self {
34721 Self {
34722 values: ::fidl_next::CompatFrom::compat_from(value.values),
34723
34724 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
34725 }
34726 }
34727 }
34728
34729 impl ::fidl_next::CompatFrom<crate::EventSubscription>
34730 for ::fidl_fuchsia_component_decl::EventSubscription
34731 {
34732 fn compat_from(value: crate::EventSubscription) -> Self {
34733 Self {
34734 event_name: ::fidl_next::CompatFrom::compat_from(value.event_name),
34735
34736 __source_breaking: ::fidl::marker::SourceBreaking,
34737 }
34738 }
34739 }
34740
34741 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EventSubscription>
34742 for crate::EventSubscription
34743 {
34744 fn compat_from(value: ::fidl_fuchsia_component_decl::EventSubscription) -> Self {
34745 Self { event_name: ::fidl_next::CompatFrom::compat_from(value.event_name) }
34746 }
34747 }
34748
34749 impl ::fidl_next::CompatFrom<crate::LayoutParameter>
34750 for ::fidl_fuchsia_component_decl::LayoutParameter
34751 {
34752 fn compat_from(value: crate::LayoutParameter) -> Self {
34753 match value {
34754 crate::LayoutParameter::NestedType(value) => {
34755 Self::NestedType(::fidl_next::CompatFrom::compat_from(value))
34756 }
34757
34758 crate::LayoutParameter::UnknownOrdinal_(unknown_ordinal) => {
34759 Self::__SourceBreaking { unknown_ordinal }
34760 }
34761 }
34762 }
34763 }
34764
34765 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::LayoutParameter>
34766 for crate::LayoutParameter
34767 {
34768 fn compat_from(value: ::fidl_fuchsia_component_decl::LayoutParameter) -> Self {
34769 match value {
34770 ::fidl_fuchsia_component_decl::LayoutParameter::NestedType(value) => {
34771 Self::NestedType(::fidl_next::CompatFrom::compat_from(value))
34772 }
34773
34774 ::fidl_fuchsia_component_decl::LayoutParameter::__SourceBreaking {
34775 unknown_ordinal,
34776 } => Self::UnknownOrdinal_(unknown_ordinal),
34777 }
34778 }
34779 }
34780
34781 impl ::fidl_next::CompatFrom<crate::ResolvedConfigField>
34782 for ::fidl_fuchsia_component_decl::ResolvedConfigField
34783 {
34784 #[inline]
34785 fn compat_from(value: crate::ResolvedConfigField) -> Self {
34786 Self {
34787 key: ::fidl_next::CompatFrom::compat_from(value.key),
34788
34789 value: ::fidl_next::CompatFrom::compat_from(value.value),
34790 }
34791 }
34792 }
34793
34794 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ResolvedConfigField>
34795 for crate::ResolvedConfigField
34796 {
34797 #[inline]
34798 fn compat_from(value: ::fidl_fuchsia_component_decl::ResolvedConfigField) -> Self {
34799 Self {
34800 key: ::fidl_next::CompatFrom::compat_from(value.key),
34801
34802 value: ::fidl_next::CompatFrom::compat_from(value.value),
34803 }
34804 }
34805 }
34806
34807 impl ::fidl_next::CompatFrom<crate::ResolvedConfig>
34808 for ::fidl_fuchsia_component_decl::ResolvedConfig
34809 {
34810 #[inline]
34811 fn compat_from(value: crate::ResolvedConfig) -> Self {
34812 Self {
34813 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
34814
34815 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
34816 }
34817 }
34818 }
34819
34820 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ResolvedConfig>
34821 for crate::ResolvedConfig
34822 {
34823 #[inline]
34824 fn compat_from(value: ::fidl_fuchsia_component_decl::ResolvedConfig) -> Self {
34825 Self {
34826 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
34827
34828 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
34829 }
34830 }
34831 }
34832}