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 ::core::convert::TryFrom<u32> for AllowedOffers {
17 type Error = ::fidl_next::UnknownStrictEnumMemberError;
18 fn try_from(
19 value: u32,
20 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
21 match value {
22 1 => Ok(Self::StaticOnly),
23 2 => Ok(Self::StaticAndDynamic),
24
25 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
26 }
27 }
28}
29
30unsafe impl<___E> ::fidl_next::Encode<___E> for AllowedOffers
31where
32 ___E: ?Sized,
33{
34 #[inline]
35 fn encode(
36 self,
37 encoder: &mut ___E,
38 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
39 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
40 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
41 }
42}
43
44unsafe impl<___E> ::fidl_next::EncodeRef<___E> for AllowedOffers
45where
46 ___E: ?Sized,
47{
48 #[inline]
49 fn encode_ref(
50 &self,
51 encoder: &mut ___E,
52 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
53 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
54 ::fidl_next::munge!(let WireAllowedOffers { value } = out);
55 let _ = value.write(::fidl_next::WireU32::from(match *self {
56 Self::StaticOnly => 1,
57
58 Self::StaticAndDynamic => 2,
59 }));
60
61 Ok(())
62 }
63}
64
65impl ::core::convert::From<WireAllowedOffers> for AllowedOffers {
66 fn from(wire: WireAllowedOffers) -> Self {
67 match u32::from(wire.value) {
68 1 => Self::StaticOnly,
69
70 2 => Self::StaticAndDynamic,
71
72 _ => unsafe { ::core::hint::unreachable_unchecked() },
73 }
74 }
75}
76
77impl ::fidl_next::FromWire<WireAllowedOffers> for AllowedOffers {
78 #[inline]
79 fn from_wire(wire: WireAllowedOffers) -> Self {
80 Self::from(wire)
81 }
82}
83
84impl ::fidl_next::IntoNatural for WireAllowedOffers {
85 type Natural = AllowedOffers;
86}
87
88impl ::fidl_next::FromWireRef<WireAllowedOffers> for AllowedOffers {
89 #[inline]
90 fn from_wire_ref(wire: &WireAllowedOffers) -> Self {
91 Self::from(*wire)
92 }
93}
94
95#[derive(Clone, Copy, Debug, PartialEq, Eq)]
97#[repr(transparent)]
98pub struct WireAllowedOffers {
99 value: ::fidl_next::WireU32,
100}
101
102unsafe impl ::fidl_next::Wire for WireAllowedOffers {
103 type Decoded<'de> = Self;
104
105 #[inline]
106 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
107 }
109}
110
111impl WireAllowedOffers {
112 pub const STATIC_ONLY: WireAllowedOffers = WireAllowedOffers { value: ::fidl_next::WireU32(1) };
113
114 pub const STATIC_AND_DYNAMIC: WireAllowedOffers =
115 WireAllowedOffers { value: ::fidl_next::WireU32(2) };
116}
117
118unsafe impl<___D> ::fidl_next::Decode<___D> for WireAllowedOffers
119where
120 ___D: ?Sized,
121{
122 fn decode(
123 slot: ::fidl_next::Slot<'_, Self>,
124 _: &mut ___D,
125 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
126 ::fidl_next::munge!(let Self { value } = slot);
127
128 match u32::from(*value) {
129 1 | 2 => (),
130 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
131 }
132
133 Ok(())
134 }
135}
136
137impl ::core::convert::From<AllowedOffers> for WireAllowedOffers {
138 fn from(natural: AllowedOffers) -> Self {
139 match natural {
140 AllowedOffers::StaticOnly => WireAllowedOffers::STATIC_ONLY,
141
142 AllowedOffers::StaticAndDynamic => WireAllowedOffers::STATIC_AND_DYNAMIC,
143 }
144 }
145}
146
147#[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"]
148#[derive(Clone, Copy, Debug, PartialEq, Eq)]
149#[repr(u32)]
150pub enum Availability {
151 Required = 1,
152 Optional = 2,
153 SameAsTarget = 3,
154 Transitional = 4,
155}
156
157impl ::fidl_next::Encodable for Availability {
158 type Encoded = WireAvailability;
159}
160impl ::core::convert::TryFrom<u32> for Availability {
161 type Error = ::fidl_next::UnknownStrictEnumMemberError;
162 fn try_from(
163 value: u32,
164 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
165 match value {
166 1 => Ok(Self::Required),
167 2 => Ok(Self::Optional),
168 3 => Ok(Self::SameAsTarget),
169 4 => Ok(Self::Transitional),
170
171 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
172 }
173 }
174}
175
176unsafe impl<___E> ::fidl_next::Encode<___E> for Availability
177where
178 ___E: ?Sized,
179{
180 #[inline]
181 fn encode(
182 self,
183 encoder: &mut ___E,
184 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
185 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
186 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
187 }
188}
189
190unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Availability
191where
192 ___E: ?Sized,
193{
194 #[inline]
195 fn encode_ref(
196 &self,
197 encoder: &mut ___E,
198 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
199 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
200 ::fidl_next::munge!(let WireAvailability { value } = out);
201 let _ = value.write(::fidl_next::WireU32::from(match *self {
202 Self::Required => 1,
203
204 Self::Optional => 2,
205
206 Self::SameAsTarget => 3,
207
208 Self::Transitional => 4,
209 }));
210
211 Ok(())
212 }
213}
214
215impl ::core::convert::From<WireAvailability> for Availability {
216 fn from(wire: WireAvailability) -> Self {
217 match u32::from(wire.value) {
218 1 => Self::Required,
219
220 2 => Self::Optional,
221
222 3 => Self::SameAsTarget,
223
224 4 => Self::Transitional,
225
226 _ => unsafe { ::core::hint::unreachable_unchecked() },
227 }
228 }
229}
230
231impl ::fidl_next::FromWire<WireAvailability> for Availability {
232 #[inline]
233 fn from_wire(wire: WireAvailability) -> Self {
234 Self::from(wire)
235 }
236}
237
238impl ::fidl_next::IntoNatural for WireAvailability {
239 type Natural = Availability;
240}
241
242impl ::fidl_next::FromWireRef<WireAvailability> for Availability {
243 #[inline]
244 fn from_wire_ref(wire: &WireAvailability) -> Self {
245 Self::from(*wire)
246 }
247}
248
249#[derive(Clone, Copy, Debug, PartialEq, Eq)]
251#[repr(transparent)]
252pub struct WireAvailability {
253 value: ::fidl_next::WireU32,
254}
255
256unsafe impl ::fidl_next::Wire for WireAvailability {
257 type Decoded<'de> = Self;
258
259 #[inline]
260 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
261 }
263}
264
265impl WireAvailability {
266 pub const REQUIRED: WireAvailability = WireAvailability { value: ::fidl_next::WireU32(1) };
267
268 pub const OPTIONAL: WireAvailability = WireAvailability { value: ::fidl_next::WireU32(2) };
269
270 pub const SAME_AS_TARGET: WireAvailability =
271 WireAvailability { value: ::fidl_next::WireU32(3) };
272
273 pub const TRANSITIONAL: WireAvailability = WireAvailability { value: ::fidl_next::WireU32(4) };
274}
275
276unsafe impl<___D> ::fidl_next::Decode<___D> for WireAvailability
277where
278 ___D: ?Sized,
279{
280 fn decode(
281 slot: ::fidl_next::Slot<'_, Self>,
282 _: &mut ___D,
283 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
284 ::fidl_next::munge!(let Self { value } = slot);
285
286 match u32::from(*value) {
287 1 | 2 | 3 | 4 => (),
288 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
289 }
290
291 Ok(())
292 }
293}
294
295impl ::core::convert::From<Availability> for WireAvailability {
296 fn from(natural: Availability) -> Self {
297 match natural {
298 Availability::Required => WireAvailability::REQUIRED,
299
300 Availability::Optional => WireAvailability::OPTIONAL,
301
302 Availability::SameAsTarget => WireAvailability::SAME_AS_TARGET,
303
304 Availability::Transitional => WireAvailability::TRANSITIONAL,
305 }
306 }
307}
308
309#[doc = " Config keys can only consist of these many bytes\n"]
310pub const CONFIG_KEY_MAX_SIZE: u32 = 64 as u32;
311
312pub const MAX_NAME_LENGTH: u32 = 100 as u32;
313
314pub type Name = ::std::string::String;
315
316pub type WireName<'de> = ::fidl_next::WireString<'de>;
318
319pub const MAX_PATH_LENGTH: u32 = 1024 as u32;
320
321#[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"]
322#[derive(PartialEq, Clone, Debug, Default)]
323pub struct Service {
324 pub name: ::core::option::Option<::std::string::String>,
325
326 pub source_path: ::core::option::Option<::std::string::String>,
327}
328
329impl Service {
330 fn __max_ordinal(&self) -> usize {
331 if self.source_path.is_some() {
332 return 2;
333 }
334
335 if self.name.is_some() {
336 return 1;
337 }
338
339 0
340 }
341}
342
343impl ::fidl_next::Encodable for Service {
344 type Encoded = WireService<'static>;
345}
346
347unsafe impl<___E> ::fidl_next::Encode<___E> for Service
348where
349 ___E: ::fidl_next::Encoder + ?Sized,
350{
351 #[inline]
352 fn encode(
353 mut self,
354 encoder: &mut ___E,
355 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
356 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
357 ::fidl_next::munge!(let WireService { table } = out);
358
359 let max_ord = self.__max_ordinal();
360
361 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
362 ::fidl_next::Wire::zero_padding(&mut out);
363
364 let mut preallocated =
365 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
366
367 for i in 1..=max_ord {
368 match i {
369 2 => {
370 if let Some(value) = self.source_path.take() {
371 ::fidl_next::WireEnvelope::encode_value(
372 value,
373 preallocated.encoder,
374 &mut out,
375 )?;
376 } else {
377 ::fidl_next::WireEnvelope::encode_zero(&mut out)
378 }
379 }
380
381 1 => {
382 if let Some(value) = self.name.take() {
383 ::fidl_next::WireEnvelope::encode_value(
384 value,
385 preallocated.encoder,
386 &mut out,
387 )?;
388 } else {
389 ::fidl_next::WireEnvelope::encode_zero(&mut out)
390 }
391 }
392
393 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
394 }
395 unsafe {
396 preallocated.write_next(out.assume_init_ref());
397 }
398 }
399
400 ::fidl_next::WireTable::encode_len(table, max_ord);
401
402 Ok(())
403 }
404}
405
406unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Service
407where
408 ___E: ::fidl_next::Encoder + ?Sized,
409{
410 #[inline]
411 fn encode_ref(
412 &self,
413 encoder: &mut ___E,
414 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
415 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
416 ::fidl_next::munge!(let WireService { table } = out);
417
418 let max_ord = self.__max_ordinal();
419
420 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
421 ::fidl_next::Wire::zero_padding(&mut out);
422
423 let mut preallocated =
424 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
425
426 for i in 1..=max_ord {
427 match i {
428 2 => {
429 if let Some(value) = &self.source_path {
430 ::fidl_next::WireEnvelope::encode_value(
431 value,
432 preallocated.encoder,
433 &mut out,
434 )?;
435 } else {
436 ::fidl_next::WireEnvelope::encode_zero(&mut out)
437 }
438 }
439
440 1 => {
441 if let Some(value) = &self.name {
442 ::fidl_next::WireEnvelope::encode_value(
443 value,
444 preallocated.encoder,
445 &mut out,
446 )?;
447 } else {
448 ::fidl_next::WireEnvelope::encode_zero(&mut out)
449 }
450 }
451
452 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
453 }
454 unsafe {
455 preallocated.write_next(out.assume_init_ref());
456 }
457 }
458
459 ::fidl_next::WireTable::encode_len(table, max_ord);
460
461 Ok(())
462 }
463}
464
465impl<'de> ::fidl_next::FromWire<WireService<'de>> for Service {
466 #[inline]
467 fn from_wire(wire_: WireService<'de>) -> Self {
468 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
469
470 let name = wire_.table.get(1);
471
472 let source_path = wire_.table.get(2);
473
474 Self {
475 name: name.map(|envelope| {
476 ::fidl_next::FromWire::from_wire(unsafe {
477 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
478 })
479 }),
480
481 source_path: source_path.map(|envelope| {
482 ::fidl_next::FromWire::from_wire(unsafe {
483 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
484 })
485 }),
486 }
487 }
488}
489
490impl<'de> ::fidl_next::IntoNatural for WireService<'de> {
491 type Natural = Service;
492}
493
494impl<'de> ::fidl_next::FromWireRef<WireService<'de>> for Service {
495 #[inline]
496 fn from_wire_ref(wire: &WireService<'de>) -> Self {
497 Self {
498 name: wire.table.get(1).map(|envelope| {
499 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
500 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
501 })
502 }),
503
504 source_path: wire.table.get(2).map(|envelope| {
505 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
506 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
507 })
508 }),
509 }
510 }
511}
512
513#[repr(C)]
515pub struct WireService<'de> {
516 table: ::fidl_next::WireTable<'de>,
517}
518
519impl<'de> Drop for WireService<'de> {
520 fn drop(&mut self) {
521 let _ = self
522 .table
523 .get(1)
524 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
525
526 let _ = self
527 .table
528 .get(2)
529 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
530 }
531}
532
533unsafe impl ::fidl_next::Wire for WireService<'static> {
534 type Decoded<'de> = WireService<'de>;
535
536 #[inline]
537 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
538 ::fidl_next::munge!(let Self { table } = out);
539 ::fidl_next::WireTable::zero_padding(table);
540 }
541}
542
543unsafe impl<___D> ::fidl_next::Decode<___D> for WireService<'static>
544where
545 ___D: ::fidl_next::Decoder + ?Sized,
546{
547 fn decode(
548 slot: ::fidl_next::Slot<'_, Self>,
549 decoder: &mut ___D,
550 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
551 ::fidl_next::munge!(let Self { table } = slot);
552
553 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
554 match ordinal {
555 0 => unsafe { ::core::hint::unreachable_unchecked() },
556
557 1 => {
558 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
559 slot.as_mut(),
560 decoder,
561 )?;
562
563 let value = unsafe {
564 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
565 };
566
567 if value.len() > 100 {
568 return Err(::fidl_next::DecodeError::VectorTooLong {
569 size: value.len() as u64,
570 limit: 100,
571 });
572 }
573
574 Ok(())
575 }
576
577 2 => {
578 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
579 slot.as_mut(),
580 decoder,
581 )?;
582
583 let value = unsafe {
584 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
585 };
586
587 if value.len() > 1024 {
588 return Err(::fidl_next::DecodeError::VectorTooLong {
589 size: value.len() as u64,
590 limit: 1024,
591 });
592 }
593
594 Ok(())
595 }
596
597 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
598 }
599 })
600 }
601}
602
603impl<'de> WireService<'de> {
604 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
605 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
606 }
607
608 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
609 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
610 }
611}
612
613impl<'de> ::core::fmt::Debug for WireService<'de> {
614 fn fmt(
615 &self,
616 f: &mut ::core::fmt::Formatter<'_>,
617 ) -> ::core::result::Result<(), ::core::fmt::Error> {
618 f.debug_struct("Service")
619 .field("name", &self.name())
620 .field("source_path", &self.source_path())
621 .finish()
622 }
623}
624
625#[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"]
626#[derive(PartialEq, Clone, Debug, Default)]
627pub struct Directory {
628 pub name: ::core::option::Option<::std::string::String>,
629
630 pub source_path: ::core::option::Option<::std::string::String>,
631
632 pub rights: ::core::option::Option<::fidl_next_fuchsia_io::Operations>,
633}
634
635impl Directory {
636 fn __max_ordinal(&self) -> usize {
637 if self.rights.is_some() {
638 return 3;
639 }
640
641 if self.source_path.is_some() {
642 return 2;
643 }
644
645 if self.name.is_some() {
646 return 1;
647 }
648
649 0
650 }
651}
652
653impl ::fidl_next::Encodable for Directory {
654 type Encoded = WireDirectory<'static>;
655}
656
657unsafe impl<___E> ::fidl_next::Encode<___E> for Directory
658where
659 ___E: ::fidl_next::Encoder + ?Sized,
660{
661 #[inline]
662 fn encode(
663 mut self,
664 encoder: &mut ___E,
665 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
666 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
667 ::fidl_next::munge!(let WireDirectory { table } = out);
668
669 let max_ord = self.__max_ordinal();
670
671 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
672 ::fidl_next::Wire::zero_padding(&mut out);
673
674 let mut preallocated =
675 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
676
677 for i in 1..=max_ord {
678 match i {
679 3 => {
680 if let Some(value) = self.rights.take() {
681 ::fidl_next::WireEnvelope::encode_value(
682 value,
683 preallocated.encoder,
684 &mut out,
685 )?;
686 } else {
687 ::fidl_next::WireEnvelope::encode_zero(&mut out)
688 }
689 }
690
691 2 => {
692 if let Some(value) = self.source_path.take() {
693 ::fidl_next::WireEnvelope::encode_value(
694 value,
695 preallocated.encoder,
696 &mut out,
697 )?;
698 } else {
699 ::fidl_next::WireEnvelope::encode_zero(&mut out)
700 }
701 }
702
703 1 => {
704 if let Some(value) = self.name.take() {
705 ::fidl_next::WireEnvelope::encode_value(
706 value,
707 preallocated.encoder,
708 &mut out,
709 )?;
710 } else {
711 ::fidl_next::WireEnvelope::encode_zero(&mut out)
712 }
713 }
714
715 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
716 }
717 unsafe {
718 preallocated.write_next(out.assume_init_ref());
719 }
720 }
721
722 ::fidl_next::WireTable::encode_len(table, max_ord);
723
724 Ok(())
725 }
726}
727
728unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Directory
729where
730 ___E: ::fidl_next::Encoder + ?Sized,
731{
732 #[inline]
733 fn encode_ref(
734 &self,
735 encoder: &mut ___E,
736 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
737 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
738 ::fidl_next::munge!(let WireDirectory { table } = out);
739
740 let max_ord = self.__max_ordinal();
741
742 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
743 ::fidl_next::Wire::zero_padding(&mut out);
744
745 let mut preallocated =
746 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
747
748 for i in 1..=max_ord {
749 match i {
750 3 => {
751 if let Some(value) = &self.rights {
752 ::fidl_next::WireEnvelope::encode_value(
753 value,
754 preallocated.encoder,
755 &mut out,
756 )?;
757 } else {
758 ::fidl_next::WireEnvelope::encode_zero(&mut out)
759 }
760 }
761
762 2 => {
763 if let Some(value) = &self.source_path {
764 ::fidl_next::WireEnvelope::encode_value(
765 value,
766 preallocated.encoder,
767 &mut out,
768 )?;
769 } else {
770 ::fidl_next::WireEnvelope::encode_zero(&mut out)
771 }
772 }
773
774 1 => {
775 if let Some(value) = &self.name {
776 ::fidl_next::WireEnvelope::encode_value(
777 value,
778 preallocated.encoder,
779 &mut out,
780 )?;
781 } else {
782 ::fidl_next::WireEnvelope::encode_zero(&mut out)
783 }
784 }
785
786 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
787 }
788 unsafe {
789 preallocated.write_next(out.assume_init_ref());
790 }
791 }
792
793 ::fidl_next::WireTable::encode_len(table, max_ord);
794
795 Ok(())
796 }
797}
798
799impl<'de> ::fidl_next::FromWire<WireDirectory<'de>> for Directory {
800 #[inline]
801 fn from_wire(wire_: WireDirectory<'de>) -> Self {
802 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
803
804 let name = wire_.table.get(1);
805
806 let source_path = wire_.table.get(2);
807
808 let rights = wire_.table.get(3);
809
810 Self {
811 name: name.map(|envelope| {
812 ::fidl_next::FromWire::from_wire(unsafe {
813 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
814 })
815 }),
816
817 source_path: source_path.map(|envelope| {
818 ::fidl_next::FromWire::from_wire(unsafe {
819 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
820 })
821 }),
822
823 rights: rights.map(|envelope| {
824 ::fidl_next::FromWire::from_wire(unsafe {
825 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
826 })
827 }),
828 }
829 }
830}
831
832impl<'de> ::fidl_next::IntoNatural for WireDirectory<'de> {
833 type Natural = Directory;
834}
835
836impl<'de> ::fidl_next::FromWireRef<WireDirectory<'de>> for Directory {
837 #[inline]
838 fn from_wire_ref(wire: &WireDirectory<'de>) -> Self {
839 Self {
840 name: wire.table.get(1).map(|envelope| {
841 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
842 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
843 })
844 }),
845
846 source_path: wire.table.get(2).map(|envelope| {
847 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
848 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
849 })
850 }),
851
852 rights: wire.table.get(3).map(|envelope| {
853 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
854 envelope.deref_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
855 })
856 }),
857 }
858 }
859}
860
861#[repr(C)]
863pub struct WireDirectory<'de> {
864 table: ::fidl_next::WireTable<'de>,
865}
866
867impl<'de> Drop for WireDirectory<'de> {
868 fn drop(&mut self) {
869 let _ = self
870 .table
871 .get(1)
872 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
873
874 let _ = self
875 .table
876 .get(2)
877 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
878
879 let _ = self.table.get(3).map(|envelope| unsafe {
880 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
881 });
882 }
883}
884
885unsafe impl ::fidl_next::Wire for WireDirectory<'static> {
886 type Decoded<'de> = WireDirectory<'de>;
887
888 #[inline]
889 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
890 ::fidl_next::munge!(let Self { table } = out);
891 ::fidl_next::WireTable::zero_padding(table);
892 }
893}
894
895unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectory<'static>
896where
897 ___D: ::fidl_next::Decoder + ?Sized,
898{
899 fn decode(
900 slot: ::fidl_next::Slot<'_, Self>,
901 decoder: &mut ___D,
902 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
903 ::fidl_next::munge!(let Self { table } = slot);
904
905 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
906 match ordinal {
907 0 => unsafe { ::core::hint::unreachable_unchecked() },
908
909 1 => {
910 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
911 slot.as_mut(),
912 decoder,
913 )?;
914
915 let value = unsafe {
916 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
917 };
918
919 if value.len() > 100 {
920 return Err(::fidl_next::DecodeError::VectorTooLong {
921 size: value.len() as u64,
922 limit: 100,
923 });
924 }
925
926 Ok(())
927 }
928
929 2 => {
930 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
931 slot.as_mut(),
932 decoder,
933 )?;
934
935 let value = unsafe {
936 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
937 };
938
939 if value.len() > 1024 {
940 return Err(::fidl_next::DecodeError::VectorTooLong {
941 size: value.len() as u64,
942 limit: 1024,
943 });
944 }
945
946 Ok(())
947 }
948
949 3 => {
950 ::fidl_next::WireEnvelope::decode_as::<
951 ___D,
952 ::fidl_next_fuchsia_io::WireOperations,
953 >(slot.as_mut(), decoder)?;
954
955 Ok(())
956 }
957
958 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
959 }
960 })
961 }
962}
963
964impl<'de> WireDirectory<'de> {
965 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
966 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
967 }
968
969 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
970 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
971 }
972
973 pub fn rights(&self) -> ::core::option::Option<&::fidl_next_fuchsia_io::WireOperations> {
974 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
975 }
976}
977
978impl<'de> ::core::fmt::Debug for WireDirectory<'de> {
979 fn fmt(
980 &self,
981 f: &mut ::core::fmt::Formatter<'_>,
982 ) -> ::core::result::Result<(), ::core::fmt::Error> {
983 f.debug_struct("Directory")
984 .field("name", &self.name())
985 .field("source_path", &self.source_path())
986 .field("rights", &self.rights())
987 .finish()
988 }
989}
990
991#[doc = " A reference to a component\'s parent instance.\n"]
992#[derive(PartialEq, Clone, Debug)]
993#[repr(C)]
994pub struct ParentRef {}
995
996impl ::fidl_next::Encodable for ParentRef {
997 type Encoded = WireParentRef;
998}
999
1000unsafe impl<___E> ::fidl_next::Encode<___E> for ParentRef
1001where
1002 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1003{
1004 #[inline]
1005 fn encode(
1006 self,
1007 encoder_: &mut ___E,
1008 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1009 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1010 *out_ = ::core::mem::MaybeUninit::zeroed();
1011
1012 Ok(())
1013 }
1014}
1015
1016unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ParentRef
1017where
1018 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1019{
1020 #[inline]
1021 fn encode_ref(
1022 &self,
1023 encoder_: &mut ___E,
1024 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1025 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1026 ::fidl_next::munge! {
1027 let Self::Encoded {
1028
1029 _empty,
1030
1031
1032 } = out_;
1033 }
1034
1035 Ok(())
1036 }
1037}
1038
1039impl ::fidl_next::EncodableOption for ParentRef {
1040 type EncodedOption = ::fidl_next::WireBox<'static, WireParentRef>;
1041}
1042
1043unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ParentRef
1044where
1045 ___E: ::fidl_next::Encoder + ?Sized,
1046 ParentRef: ::fidl_next::Encode<___E>,
1047{
1048 #[inline]
1049 fn encode_option(
1050 this: ::core::option::Option<Self>,
1051 encoder: &mut ___E,
1052 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1053 ) -> ::core::result::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
1065unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ParentRef
1066where
1067 ___E: ::fidl_next::Encoder + ?Sized,
1068 ParentRef: ::fidl_next::EncodeRef<___E>,
1069{
1070 #[inline]
1071 fn encode_option_ref(
1072 this: ::core::option::Option<&Self>,
1073 encoder: &mut ___E,
1074 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1075 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1076 if let Some(inner) = this {
1077 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1078 ::fidl_next::WireBox::encode_present(out);
1079 } else {
1080 ::fidl_next::WireBox::encode_absent(out);
1081 }
1082
1083 Ok(())
1084 }
1085}
1086
1087impl ::fidl_next::FromWire<WireParentRef> for ParentRef {
1088 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireParentRef, Self> =
1089 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1090
1091 #[inline]
1092 fn from_wire(wire: WireParentRef) -> Self {
1093 Self {}
1094 }
1095}
1096
1097impl ::fidl_next::IntoNatural for WireParentRef {
1098 type Natural = ParentRef;
1099}
1100
1101impl ::fidl_next::FromWireRef<WireParentRef> for ParentRef {
1102 #[inline]
1103 fn from_wire_ref(wire: &WireParentRef) -> Self {
1104 Self {}
1105 }
1106}
1107
1108#[derive(Clone, Debug)]
1110#[repr(C)]
1111pub struct WireParentRef {
1112 _empty: fidl_next::WireEmptyStructPlaceholder,
1113}
1114static_assertions::const_assert_eq!(std::mem::size_of::<WireParentRef>(), 1);
1115static_assertions::const_assert_eq!(std::mem::align_of::<WireParentRef>(), 1);
1116
1117unsafe impl ::fidl_next::Wire for WireParentRef {
1118 type Decoded<'de> = WireParentRef;
1119
1120 #[inline]
1121 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1122 ::fidl_next::munge! {
1123 let Self {
1124
1125 _empty,
1126
1127
1128 } = &mut *out_;
1129 }
1130 }
1131}
1132
1133unsafe impl<___D> ::fidl_next::Decode<___D> for WireParentRef
1134where
1135 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1136{
1137 fn decode(
1138 slot_: ::fidl_next::Slot<'_, Self>,
1139 decoder_: &mut ___D,
1140 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1141 ::fidl_next::munge! {
1142 let Self {
1143
1144 mut _empty,
1145
1146
1147 } = slot_;
1148 }
1149
1150 if _empty.as_bytes() != &[0u8] {
1151 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
1152 }
1153
1154 Ok(())
1155 }
1156}
1157
1158#[doc = " A reference to the component itself.\n"]
1159#[derive(PartialEq, Clone, Debug)]
1160#[repr(C)]
1161pub struct SelfRef {}
1162
1163impl ::fidl_next::Encodable for SelfRef {
1164 type Encoded = WireSelfRef;
1165}
1166
1167unsafe impl<___E> ::fidl_next::Encode<___E> for SelfRef
1168where
1169 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1170{
1171 #[inline]
1172 fn encode(
1173 self,
1174 encoder_: &mut ___E,
1175 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1176 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1177 *out_ = ::core::mem::MaybeUninit::zeroed();
1178
1179 Ok(())
1180 }
1181}
1182
1183unsafe impl<___E> ::fidl_next::EncodeRef<___E> for SelfRef
1184where
1185 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1186{
1187 #[inline]
1188 fn encode_ref(
1189 &self,
1190 encoder_: &mut ___E,
1191 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1192 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1193 ::fidl_next::munge! {
1194 let Self::Encoded {
1195
1196 _empty,
1197
1198
1199 } = out_;
1200 }
1201
1202 Ok(())
1203 }
1204}
1205
1206impl ::fidl_next::EncodableOption for SelfRef {
1207 type EncodedOption = ::fidl_next::WireBox<'static, WireSelfRef>;
1208}
1209
1210unsafe impl<___E> ::fidl_next::EncodeOption<___E> for SelfRef
1211where
1212 ___E: ::fidl_next::Encoder + ?Sized,
1213 SelfRef: ::fidl_next::Encode<___E>,
1214{
1215 #[inline]
1216 fn encode_option(
1217 this: ::core::option::Option<Self>,
1218 encoder: &mut ___E,
1219 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1220 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1221 if let Some(inner) = this {
1222 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1223 ::fidl_next::WireBox::encode_present(out);
1224 } else {
1225 ::fidl_next::WireBox::encode_absent(out);
1226 }
1227
1228 Ok(())
1229 }
1230}
1231
1232unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for SelfRef
1233where
1234 ___E: ::fidl_next::Encoder + ?Sized,
1235 SelfRef: ::fidl_next::EncodeRef<___E>,
1236{
1237 #[inline]
1238 fn encode_option_ref(
1239 this: ::core::option::Option<&Self>,
1240 encoder: &mut ___E,
1241 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1242 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1243 if let Some(inner) = this {
1244 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1245 ::fidl_next::WireBox::encode_present(out);
1246 } else {
1247 ::fidl_next::WireBox::encode_absent(out);
1248 }
1249
1250 Ok(())
1251 }
1252}
1253
1254impl ::fidl_next::FromWire<WireSelfRef> for SelfRef {
1255 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireSelfRef, Self> =
1256 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1257
1258 #[inline]
1259 fn from_wire(wire: WireSelfRef) -> Self {
1260 Self {}
1261 }
1262}
1263
1264impl ::fidl_next::IntoNatural for WireSelfRef {
1265 type Natural = SelfRef;
1266}
1267
1268impl ::fidl_next::FromWireRef<WireSelfRef> for SelfRef {
1269 #[inline]
1270 fn from_wire_ref(wire: &WireSelfRef) -> Self {
1271 Self {}
1272 }
1273}
1274
1275#[derive(Clone, Debug)]
1277#[repr(C)]
1278pub struct WireSelfRef {
1279 _empty: fidl_next::WireEmptyStructPlaceholder,
1280}
1281static_assertions::const_assert_eq!(std::mem::size_of::<WireSelfRef>(), 1);
1282static_assertions::const_assert_eq!(std::mem::align_of::<WireSelfRef>(), 1);
1283
1284unsafe impl ::fidl_next::Wire for WireSelfRef {
1285 type Decoded<'de> = WireSelfRef;
1286
1287 #[inline]
1288 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1289 ::fidl_next::munge! {
1290 let Self {
1291
1292 _empty,
1293
1294
1295 } = &mut *out_;
1296 }
1297 }
1298}
1299
1300unsafe impl<___D> ::fidl_next::Decode<___D> for WireSelfRef
1301where
1302 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1303{
1304 fn decode(
1305 slot_: ::fidl_next::Slot<'_, Self>,
1306 decoder_: &mut ___D,
1307 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1308 ::fidl_next::munge! {
1309 let Self {
1310
1311 mut _empty,
1312
1313
1314 } = slot_;
1315 }
1316
1317 if _empty.as_bytes() != &[0u8] {
1318 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
1319 }
1320
1321 Ok(())
1322 }
1323}
1324
1325pub const MAX_CHILD_NAME_LENGTH: u32 = 1024 as u32;
1326
1327pub type ChildName = ::std::string::String;
1328
1329pub type WireChildName<'de> = ::fidl_next::WireString<'de>;
1331
1332#[doc = " A reference to one of the component\'s child instances.\n"]
1333#[derive(PartialEq, Clone, Debug)]
1334pub struct ChildRef {
1335 pub name: ::std::string::String,
1336
1337 pub collection: ::core::option::Option<::std::string::String>,
1338}
1339
1340impl ::fidl_next::Encodable for ChildRef {
1341 type Encoded = WireChildRef<'static>;
1342}
1343
1344unsafe impl<___E> ::fidl_next::Encode<___E> for ChildRef
1345where
1346 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1347 ___E: ::fidl_next::Encoder,
1348{
1349 #[inline]
1350 fn encode(
1351 self,
1352 encoder_: &mut ___E,
1353 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1354 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1355 ::fidl_next::munge! {
1356 let Self::Encoded {
1357 name,
1358 collection,
1359
1360 } = out_;
1361 }
1362
1363 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
1364
1365 ::fidl_next::Encode::encode(self.collection, encoder_, collection)?;
1366
1367 Ok(())
1368 }
1369}
1370
1371unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ChildRef
1372where
1373 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1374 ___E: ::fidl_next::Encoder,
1375{
1376 #[inline]
1377 fn encode_ref(
1378 &self,
1379 encoder_: &mut ___E,
1380 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1381 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1382 ::fidl_next::munge! {
1383 let Self::Encoded {
1384
1385 name,
1386 collection,
1387
1388 } = out_;
1389 }
1390
1391 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder_, name)?;
1392
1393 ::fidl_next::EncodeRef::encode_ref(&self.collection, encoder_, collection)?;
1394
1395 Ok(())
1396 }
1397}
1398
1399impl ::fidl_next::EncodableOption for ChildRef {
1400 type EncodedOption = ::fidl_next::WireBox<'static, WireChildRef<'static>>;
1401}
1402
1403unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ChildRef
1404where
1405 ___E: ::fidl_next::Encoder + ?Sized,
1406 ChildRef: ::fidl_next::Encode<___E>,
1407{
1408 #[inline]
1409 fn encode_option(
1410 this: ::core::option::Option<Self>,
1411 encoder: &mut ___E,
1412 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1413 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1414 if let Some(inner) = this {
1415 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1416 ::fidl_next::WireBox::encode_present(out);
1417 } else {
1418 ::fidl_next::WireBox::encode_absent(out);
1419 }
1420
1421 Ok(())
1422 }
1423}
1424
1425unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ChildRef
1426where
1427 ___E: ::fidl_next::Encoder + ?Sized,
1428 ChildRef: ::fidl_next::EncodeRef<___E>,
1429{
1430 #[inline]
1431 fn encode_option_ref(
1432 this: ::core::option::Option<&Self>,
1433 encoder: &mut ___E,
1434 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1435 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1436 if let Some(inner) = this {
1437 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1438 ::fidl_next::WireBox::encode_present(out);
1439 } else {
1440 ::fidl_next::WireBox::encode_absent(out);
1441 }
1442
1443 Ok(())
1444 }
1445}
1446
1447impl<'de> ::fidl_next::FromWire<WireChildRef<'de>> for ChildRef {
1448 #[inline]
1449 fn from_wire(wire: WireChildRef<'de>) -> Self {
1450 Self {
1451 name: ::fidl_next::FromWire::from_wire(wire.name),
1452
1453 collection: ::fidl_next::FromWire::from_wire(wire.collection),
1454 }
1455 }
1456}
1457
1458impl<'de> ::fidl_next::IntoNatural for WireChildRef<'de> {
1459 type Natural = ChildRef;
1460}
1461
1462impl<'de> ::fidl_next::FromWireRef<WireChildRef<'de>> for ChildRef {
1463 #[inline]
1464 fn from_wire_ref(wire: &WireChildRef<'de>) -> Self {
1465 Self {
1466 name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
1467
1468 collection: ::fidl_next::FromWireRef::from_wire_ref(&wire.collection),
1469 }
1470 }
1471}
1472
1473#[derive(Debug)]
1475#[repr(C)]
1476pub struct WireChildRef<'de> {
1477 pub name: ::fidl_next::WireString<'de>,
1478
1479 pub collection: ::fidl_next::WireOptionalString<'de>,
1480}
1481static_assertions::const_assert_eq!(std::mem::size_of::<WireChildRef<'_>>(), 32);
1482static_assertions::const_assert_eq!(std::mem::align_of::<WireChildRef<'_>>(), 8);
1483
1484static_assertions::const_assert_eq!(std::mem::offset_of!(WireChildRef<'_>, name), 0);
1485
1486static_assertions::const_assert_eq!(std::mem::offset_of!(WireChildRef<'_>, collection), 16);
1487
1488unsafe impl ::fidl_next::Wire for WireChildRef<'static> {
1489 type Decoded<'de> = WireChildRef<'de>;
1490
1491 #[inline]
1492 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1493 ::fidl_next::munge! {
1494 let Self {
1495
1496 name,
1497 collection,
1498
1499 } = &mut *out_;
1500 }
1501
1502 ::fidl_next::Wire::zero_padding(name);
1503
1504 ::fidl_next::Wire::zero_padding(collection);
1505 }
1506}
1507
1508unsafe impl<___D> ::fidl_next::Decode<___D> for WireChildRef<'static>
1509where
1510 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1511 ___D: ::fidl_next::Decoder,
1512{
1513 fn decode(
1514 slot_: ::fidl_next::Slot<'_, Self>,
1515 decoder_: &mut ___D,
1516 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1517 ::fidl_next::munge! {
1518 let Self {
1519
1520 mut name,
1521 mut collection,
1522
1523 } = slot_;
1524 }
1525
1526 ::fidl_next::Decode::decode(name.as_mut(), decoder_)?;
1527
1528 let name = unsafe { name.deref_unchecked() };
1529
1530 if name.len() > 1024 {
1531 return Err(::fidl_next::DecodeError::VectorTooLong {
1532 size: name.len() as u64,
1533 limit: 1024,
1534 });
1535 }
1536
1537 ::fidl_next::Decode::decode(collection.as_mut(), decoder_)?;
1538
1539 let collection = unsafe { collection.deref_unchecked() };
1540
1541 if let Some(collection) = collection.as_ref() {
1542 if collection.len() > 100 {
1543 return Err(::fidl_next::DecodeError::VectorTooLong {
1544 size: collection.len() as u64,
1545 limit: 100,
1546 });
1547 }
1548 }
1549
1550 Ok(())
1551 }
1552}
1553
1554#[doc = " A reference to one of the component\'s collections.\n"]
1555#[derive(PartialEq, Clone, Debug)]
1556pub struct CollectionRef {
1557 pub name: ::std::string::String,
1558}
1559
1560impl ::fidl_next::Encodable for CollectionRef {
1561 type Encoded = WireCollectionRef<'static>;
1562}
1563
1564unsafe impl<___E> ::fidl_next::Encode<___E> for CollectionRef
1565where
1566 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1567 ___E: ::fidl_next::Encoder,
1568{
1569 #[inline]
1570 fn encode(
1571 self,
1572 encoder_: &mut ___E,
1573 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1574 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1575 ::fidl_next::munge! {
1576 let Self::Encoded {
1577 name,
1578
1579 } = out_;
1580 }
1581
1582 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
1583
1584 Ok(())
1585 }
1586}
1587
1588unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CollectionRef
1589where
1590 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1591 ___E: ::fidl_next::Encoder,
1592{
1593 #[inline]
1594 fn encode_ref(
1595 &self,
1596 encoder_: &mut ___E,
1597 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1598 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1599 ::fidl_next::munge! {
1600 let Self::Encoded {
1601
1602 name,
1603
1604 } = out_;
1605 }
1606
1607 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder_, name)?;
1608
1609 Ok(())
1610 }
1611}
1612
1613impl ::fidl_next::EncodableOption for CollectionRef {
1614 type EncodedOption = ::fidl_next::WireBox<'static, WireCollectionRef<'static>>;
1615}
1616
1617unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CollectionRef
1618where
1619 ___E: ::fidl_next::Encoder + ?Sized,
1620 CollectionRef: ::fidl_next::Encode<___E>,
1621{
1622 #[inline]
1623 fn encode_option(
1624 this: ::core::option::Option<Self>,
1625 encoder: &mut ___E,
1626 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1627 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1628 if let Some(inner) = this {
1629 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1630 ::fidl_next::WireBox::encode_present(out);
1631 } else {
1632 ::fidl_next::WireBox::encode_absent(out);
1633 }
1634
1635 Ok(())
1636 }
1637}
1638
1639unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CollectionRef
1640where
1641 ___E: ::fidl_next::Encoder + ?Sized,
1642 CollectionRef: ::fidl_next::EncodeRef<___E>,
1643{
1644 #[inline]
1645 fn encode_option_ref(
1646 this: ::core::option::Option<&Self>,
1647 encoder: &mut ___E,
1648 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1649 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1650 if let Some(inner) = this {
1651 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1652 ::fidl_next::WireBox::encode_present(out);
1653 } else {
1654 ::fidl_next::WireBox::encode_absent(out);
1655 }
1656
1657 Ok(())
1658 }
1659}
1660
1661impl<'de> ::fidl_next::FromWire<WireCollectionRef<'de>> for CollectionRef {
1662 #[inline]
1663 fn from_wire(wire: WireCollectionRef<'de>) -> Self {
1664 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
1665 }
1666}
1667
1668impl<'de> ::fidl_next::IntoNatural for WireCollectionRef<'de> {
1669 type Natural = CollectionRef;
1670}
1671
1672impl<'de> ::fidl_next::FromWireRef<WireCollectionRef<'de>> for CollectionRef {
1673 #[inline]
1674 fn from_wire_ref(wire: &WireCollectionRef<'de>) -> Self {
1675 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
1676 }
1677}
1678
1679#[derive(Debug)]
1681#[repr(C)]
1682pub struct WireCollectionRef<'de> {
1683 pub name: ::fidl_next::WireString<'de>,
1684}
1685static_assertions::const_assert_eq!(std::mem::size_of::<WireCollectionRef<'_>>(), 16);
1686static_assertions::const_assert_eq!(std::mem::align_of::<WireCollectionRef<'_>>(), 8);
1687
1688static_assertions::const_assert_eq!(std::mem::offset_of!(WireCollectionRef<'_>, name), 0);
1689
1690unsafe impl ::fidl_next::Wire for WireCollectionRef<'static> {
1691 type Decoded<'de> = WireCollectionRef<'de>;
1692
1693 #[inline]
1694 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1695 ::fidl_next::munge! {
1696 let Self {
1697
1698 name,
1699
1700 } = &mut *out_;
1701 }
1702
1703 ::fidl_next::Wire::zero_padding(name);
1704 }
1705}
1706
1707unsafe impl<___D> ::fidl_next::Decode<___D> for WireCollectionRef<'static>
1708where
1709 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1710 ___D: ::fidl_next::Decoder,
1711{
1712 fn decode(
1713 slot_: ::fidl_next::Slot<'_, Self>,
1714 decoder_: &mut ___D,
1715 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1716 ::fidl_next::munge! {
1717 let Self {
1718
1719 mut name,
1720
1721 } = slot_;
1722 }
1723
1724 ::fidl_next::Decode::decode(name.as_mut(), decoder_)?;
1725
1726 let name = unsafe { name.deref_unchecked() };
1727
1728 if name.len() > 100 {
1729 return Err(::fidl_next::DecodeError::VectorTooLong {
1730 size: name.len() as u64,
1731 limit: 100,
1732 });
1733 }
1734
1735 Ok(())
1736 }
1737}
1738
1739#[doc = " A reference to the component framework itself.\n"]
1740#[derive(PartialEq, Clone, Debug)]
1741#[repr(C)]
1742pub struct FrameworkRef {}
1743
1744impl ::fidl_next::Encodable for FrameworkRef {
1745 type Encoded = WireFrameworkRef;
1746}
1747
1748unsafe impl<___E> ::fidl_next::Encode<___E> for FrameworkRef
1749where
1750 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1751{
1752 #[inline]
1753 fn encode(
1754 self,
1755 encoder_: &mut ___E,
1756 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1757 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1758 *out_ = ::core::mem::MaybeUninit::zeroed();
1759
1760 Ok(())
1761 }
1762}
1763
1764unsafe impl<___E> ::fidl_next::EncodeRef<___E> for FrameworkRef
1765where
1766 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1767{
1768 #[inline]
1769 fn encode_ref(
1770 &self,
1771 encoder_: &mut ___E,
1772 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1773 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1774 ::fidl_next::munge! {
1775 let Self::Encoded {
1776
1777 _empty,
1778
1779
1780 } = out_;
1781 }
1782
1783 Ok(())
1784 }
1785}
1786
1787impl ::fidl_next::EncodableOption for FrameworkRef {
1788 type EncodedOption = ::fidl_next::WireBox<'static, WireFrameworkRef>;
1789}
1790
1791unsafe impl<___E> ::fidl_next::EncodeOption<___E> for FrameworkRef
1792where
1793 ___E: ::fidl_next::Encoder + ?Sized,
1794 FrameworkRef: ::fidl_next::Encode<___E>,
1795{
1796 #[inline]
1797 fn encode_option(
1798 this: ::core::option::Option<Self>,
1799 encoder: &mut ___E,
1800 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1801 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1802 if let Some(inner) = this {
1803 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1804 ::fidl_next::WireBox::encode_present(out);
1805 } else {
1806 ::fidl_next::WireBox::encode_absent(out);
1807 }
1808
1809 Ok(())
1810 }
1811}
1812
1813unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for FrameworkRef
1814where
1815 ___E: ::fidl_next::Encoder + ?Sized,
1816 FrameworkRef: ::fidl_next::EncodeRef<___E>,
1817{
1818 #[inline]
1819 fn encode_option_ref(
1820 this: ::core::option::Option<&Self>,
1821 encoder: &mut ___E,
1822 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1823 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1824 if let Some(inner) = this {
1825 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1826 ::fidl_next::WireBox::encode_present(out);
1827 } else {
1828 ::fidl_next::WireBox::encode_absent(out);
1829 }
1830
1831 Ok(())
1832 }
1833}
1834
1835impl ::fidl_next::FromWire<WireFrameworkRef> for FrameworkRef {
1836 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireFrameworkRef, Self> =
1837 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1838
1839 #[inline]
1840 fn from_wire(wire: WireFrameworkRef) -> Self {
1841 Self {}
1842 }
1843}
1844
1845impl ::fidl_next::IntoNatural for WireFrameworkRef {
1846 type Natural = FrameworkRef;
1847}
1848
1849impl ::fidl_next::FromWireRef<WireFrameworkRef> for FrameworkRef {
1850 #[inline]
1851 fn from_wire_ref(wire: &WireFrameworkRef) -> Self {
1852 Self {}
1853 }
1854}
1855
1856#[derive(Clone, Debug)]
1858#[repr(C)]
1859pub struct WireFrameworkRef {
1860 _empty: fidl_next::WireEmptyStructPlaceholder,
1861}
1862static_assertions::const_assert_eq!(std::mem::size_of::<WireFrameworkRef>(), 1);
1863static_assertions::const_assert_eq!(std::mem::align_of::<WireFrameworkRef>(), 1);
1864
1865unsafe impl ::fidl_next::Wire for WireFrameworkRef {
1866 type Decoded<'de> = WireFrameworkRef;
1867
1868 #[inline]
1869 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1870 ::fidl_next::munge! {
1871 let Self {
1872
1873 _empty,
1874
1875
1876 } = &mut *out_;
1877 }
1878 }
1879}
1880
1881unsafe impl<___D> ::fidl_next::Decode<___D> for WireFrameworkRef
1882where
1883 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1884{
1885 fn decode(
1886 slot_: ::fidl_next::Slot<'_, Self>,
1887 decoder_: &mut ___D,
1888 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1889 ::fidl_next::munge! {
1890 let Self {
1891
1892 mut _empty,
1893
1894
1895 } = slot_;
1896 }
1897
1898 if _empty.as_bytes() != &[0u8] {
1899 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
1900 }
1901
1902 Ok(())
1903 }
1904}
1905
1906#[doc = " A reference to a capability declared in this component.\n"]
1907#[derive(PartialEq, Clone, Debug)]
1908pub struct CapabilityRef {
1909 pub name: ::std::string::String,
1910}
1911
1912impl ::fidl_next::Encodable for CapabilityRef {
1913 type Encoded = WireCapabilityRef<'static>;
1914}
1915
1916unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityRef
1917where
1918 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1919 ___E: ::fidl_next::Encoder,
1920{
1921 #[inline]
1922 fn encode(
1923 self,
1924 encoder_: &mut ___E,
1925 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1926 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1927 ::fidl_next::munge! {
1928 let Self::Encoded {
1929 name,
1930
1931 } = out_;
1932 }
1933
1934 ::fidl_next::Encode::encode(self.name, encoder_, name)?;
1935
1936 Ok(())
1937 }
1938}
1939
1940unsafe impl<___E> ::fidl_next::EncodeRef<___E> for CapabilityRef
1941where
1942 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1943 ___E: ::fidl_next::Encoder,
1944{
1945 #[inline]
1946 fn encode_ref(
1947 &self,
1948 encoder_: &mut ___E,
1949 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1950 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1951 ::fidl_next::munge! {
1952 let Self::Encoded {
1953
1954 name,
1955
1956 } = out_;
1957 }
1958
1959 ::fidl_next::EncodeRef::encode_ref(&self.name, encoder_, name)?;
1960
1961 Ok(())
1962 }
1963}
1964
1965impl ::fidl_next::EncodableOption for CapabilityRef {
1966 type EncodedOption = ::fidl_next::WireBox<'static, WireCapabilityRef<'static>>;
1967}
1968
1969unsafe impl<___E> ::fidl_next::EncodeOption<___E> for CapabilityRef
1970where
1971 ___E: ::fidl_next::Encoder + ?Sized,
1972 CapabilityRef: ::fidl_next::Encode<___E>,
1973{
1974 #[inline]
1975 fn encode_option(
1976 this: ::core::option::Option<Self>,
1977 encoder: &mut ___E,
1978 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1979 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1980 if let Some(inner) = this {
1981 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1982 ::fidl_next::WireBox::encode_present(out);
1983 } else {
1984 ::fidl_next::WireBox::encode_absent(out);
1985 }
1986
1987 Ok(())
1988 }
1989}
1990
1991unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for CapabilityRef
1992where
1993 ___E: ::fidl_next::Encoder + ?Sized,
1994 CapabilityRef: ::fidl_next::EncodeRef<___E>,
1995{
1996 #[inline]
1997 fn encode_option_ref(
1998 this: ::core::option::Option<&Self>,
1999 encoder: &mut ___E,
2000 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2001 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2002 if let Some(inner) = this {
2003 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2004 ::fidl_next::WireBox::encode_present(out);
2005 } else {
2006 ::fidl_next::WireBox::encode_absent(out);
2007 }
2008
2009 Ok(())
2010 }
2011}
2012
2013impl<'de> ::fidl_next::FromWire<WireCapabilityRef<'de>> for CapabilityRef {
2014 #[inline]
2015 fn from_wire(wire: WireCapabilityRef<'de>) -> Self {
2016 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
2017 }
2018}
2019
2020impl<'de> ::fidl_next::IntoNatural for WireCapabilityRef<'de> {
2021 type Natural = CapabilityRef;
2022}
2023
2024impl<'de> ::fidl_next::FromWireRef<WireCapabilityRef<'de>> for CapabilityRef {
2025 #[inline]
2026 fn from_wire_ref(wire: &WireCapabilityRef<'de>) -> Self {
2027 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
2028 }
2029}
2030
2031#[derive(Debug)]
2033#[repr(C)]
2034pub struct WireCapabilityRef<'de> {
2035 pub name: ::fidl_next::WireString<'de>,
2036}
2037static_assertions::const_assert_eq!(std::mem::size_of::<WireCapabilityRef<'_>>(), 16);
2038static_assertions::const_assert_eq!(std::mem::align_of::<WireCapabilityRef<'_>>(), 8);
2039
2040static_assertions::const_assert_eq!(std::mem::offset_of!(WireCapabilityRef<'_>, name), 0);
2041
2042unsafe impl ::fidl_next::Wire for WireCapabilityRef<'static> {
2043 type Decoded<'de> = WireCapabilityRef<'de>;
2044
2045 #[inline]
2046 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2047 ::fidl_next::munge! {
2048 let Self {
2049
2050 name,
2051
2052 } = &mut *out_;
2053 }
2054
2055 ::fidl_next::Wire::zero_padding(name);
2056 }
2057}
2058
2059unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityRef<'static>
2060where
2061 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2062 ___D: ::fidl_next::Decoder,
2063{
2064 fn decode(
2065 slot_: ::fidl_next::Slot<'_, Self>,
2066 decoder_: &mut ___D,
2067 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2068 ::fidl_next::munge! {
2069 let Self {
2070
2071 mut name,
2072
2073 } = slot_;
2074 }
2075
2076 ::fidl_next::Decode::decode(name.as_mut(), decoder_)?;
2077
2078 let name = unsafe { name.deref_unchecked() };
2079
2080 if name.len() > 100 {
2081 return Err(::fidl_next::DecodeError::VectorTooLong {
2082 size: name.len() as u64,
2083 limit: 100,
2084 });
2085 }
2086
2087 Ok(())
2088 }
2089}
2090
2091#[doc = " A reference to the environment\'s debug capabilities.\n"]
2092#[derive(PartialEq, Clone, Debug)]
2093#[repr(C)]
2094pub struct DebugRef {}
2095
2096impl ::fidl_next::Encodable for DebugRef {
2097 type Encoded = WireDebugRef;
2098}
2099
2100unsafe impl<___E> ::fidl_next::Encode<___E> for DebugRef
2101where
2102 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2103{
2104 #[inline]
2105 fn encode(
2106 self,
2107 encoder_: &mut ___E,
2108 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2109 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2110 *out_ = ::core::mem::MaybeUninit::zeroed();
2111
2112 Ok(())
2113 }
2114}
2115
2116unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DebugRef
2117where
2118 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2119{
2120 #[inline]
2121 fn encode_ref(
2122 &self,
2123 encoder_: &mut ___E,
2124 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2125 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2126 ::fidl_next::munge! {
2127 let Self::Encoded {
2128
2129 _empty,
2130
2131
2132 } = out_;
2133 }
2134
2135 Ok(())
2136 }
2137}
2138
2139impl ::fidl_next::EncodableOption for DebugRef {
2140 type EncodedOption = ::fidl_next::WireBox<'static, WireDebugRef>;
2141}
2142
2143unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DebugRef
2144where
2145 ___E: ::fidl_next::Encoder + ?Sized,
2146 DebugRef: ::fidl_next::Encode<___E>,
2147{
2148 #[inline]
2149 fn encode_option(
2150 this: ::core::option::Option<Self>,
2151 encoder: &mut ___E,
2152 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2153 ) -> ::core::result::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 DebugRef
2166where
2167 ___E: ::fidl_next::Encoder + ?Sized,
2168 DebugRef: ::fidl_next::EncodeRef<___E>,
2169{
2170 #[inline]
2171 fn encode_option_ref(
2172 this: ::core::option::Option<&Self>,
2173 encoder: &mut ___E,
2174 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2175 ) -> ::core::result::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<WireDebugRef> for DebugRef {
2188 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireDebugRef, Self> =
2189 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
2190
2191 #[inline]
2192 fn from_wire(wire: WireDebugRef) -> Self {
2193 Self {}
2194 }
2195}
2196
2197impl ::fidl_next::IntoNatural for WireDebugRef {
2198 type Natural = DebugRef;
2199}
2200
2201impl ::fidl_next::FromWireRef<WireDebugRef> for DebugRef {
2202 #[inline]
2203 fn from_wire_ref(wire: &WireDebugRef) -> Self {
2204 Self {}
2205 }
2206}
2207
2208#[derive(Clone, Debug)]
2210#[repr(C)]
2211pub struct WireDebugRef {
2212 _empty: fidl_next::WireEmptyStructPlaceholder,
2213}
2214static_assertions::const_assert_eq!(std::mem::size_of::<WireDebugRef>(), 1);
2215static_assertions::const_assert_eq!(std::mem::align_of::<WireDebugRef>(), 1);
2216
2217unsafe impl ::fidl_next::Wire for WireDebugRef {
2218 type Decoded<'de> = WireDebugRef;
2219
2220 #[inline]
2221 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2222 ::fidl_next::munge! {
2223 let Self {
2224
2225 _empty,
2226
2227
2228 } = &mut *out_;
2229 }
2230 }
2231}
2232
2233unsafe impl<___D> ::fidl_next::Decode<___D> for WireDebugRef
2234where
2235 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2236{
2237 fn decode(
2238 slot_: ::fidl_next::Slot<'_, Self>,
2239 decoder_: &mut ___D,
2240 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2241 ::fidl_next::munge! {
2242 let Self {
2243
2244 mut _empty,
2245
2246
2247 } = slot_;
2248 }
2249
2250 if _empty.as_bytes() != &[0u8] {
2251 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
2252 }
2253
2254 Ok(())
2255 }
2256}
2257
2258#[doc = " A reference to an intentionally missing offer source.\n"]
2259#[derive(PartialEq, Clone, Debug)]
2260#[repr(C)]
2261pub struct VoidRef {}
2262
2263impl ::fidl_next::Encodable for VoidRef {
2264 type Encoded = WireVoidRef;
2265}
2266
2267unsafe impl<___E> ::fidl_next::Encode<___E> for VoidRef
2268where
2269 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2270{
2271 #[inline]
2272 fn encode(
2273 self,
2274 encoder_: &mut ___E,
2275 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2276 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2277 *out_ = ::core::mem::MaybeUninit::zeroed();
2278
2279 Ok(())
2280 }
2281}
2282
2283unsafe impl<___E> ::fidl_next::EncodeRef<___E> for VoidRef
2284where
2285 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2286{
2287 #[inline]
2288 fn encode_ref(
2289 &self,
2290 encoder_: &mut ___E,
2291 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2292 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2293 ::fidl_next::munge! {
2294 let Self::Encoded {
2295
2296 _empty,
2297
2298
2299 } = out_;
2300 }
2301
2302 Ok(())
2303 }
2304}
2305
2306impl ::fidl_next::EncodableOption for VoidRef {
2307 type EncodedOption = ::fidl_next::WireBox<'static, WireVoidRef>;
2308}
2309
2310unsafe impl<___E> ::fidl_next::EncodeOption<___E> for VoidRef
2311where
2312 ___E: ::fidl_next::Encoder + ?Sized,
2313 VoidRef: ::fidl_next::Encode<___E>,
2314{
2315 #[inline]
2316 fn encode_option(
2317 this: ::core::option::Option<Self>,
2318 encoder: &mut ___E,
2319 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2320 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2321 if let Some(inner) = this {
2322 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2323 ::fidl_next::WireBox::encode_present(out);
2324 } else {
2325 ::fidl_next::WireBox::encode_absent(out);
2326 }
2327
2328 Ok(())
2329 }
2330}
2331
2332unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for VoidRef
2333where
2334 ___E: ::fidl_next::Encoder + ?Sized,
2335 VoidRef: ::fidl_next::EncodeRef<___E>,
2336{
2337 #[inline]
2338 fn encode_option_ref(
2339 this: ::core::option::Option<&Self>,
2340 encoder: &mut ___E,
2341 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2342 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2343 if let Some(inner) = this {
2344 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2345 ::fidl_next::WireBox::encode_present(out);
2346 } else {
2347 ::fidl_next::WireBox::encode_absent(out);
2348 }
2349
2350 Ok(())
2351 }
2352}
2353
2354impl ::fidl_next::FromWire<WireVoidRef> for VoidRef {
2355 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireVoidRef, Self> =
2356 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
2357
2358 #[inline]
2359 fn from_wire(wire: WireVoidRef) -> Self {
2360 Self {}
2361 }
2362}
2363
2364impl ::fidl_next::IntoNatural for WireVoidRef {
2365 type Natural = VoidRef;
2366}
2367
2368impl ::fidl_next::FromWireRef<WireVoidRef> for VoidRef {
2369 #[inline]
2370 fn from_wire_ref(wire: &WireVoidRef) -> Self {
2371 Self {}
2372 }
2373}
2374
2375#[derive(Clone, Debug)]
2377#[repr(C)]
2378pub struct WireVoidRef {
2379 _empty: fidl_next::WireEmptyStructPlaceholder,
2380}
2381static_assertions::const_assert_eq!(std::mem::size_of::<WireVoidRef>(), 1);
2382static_assertions::const_assert_eq!(std::mem::align_of::<WireVoidRef>(), 1);
2383
2384unsafe impl ::fidl_next::Wire for WireVoidRef {
2385 type Decoded<'de> = WireVoidRef;
2386
2387 #[inline]
2388 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2389 ::fidl_next::munge! {
2390 let Self {
2391
2392 _empty,
2393
2394
2395 } = &mut *out_;
2396 }
2397 }
2398}
2399
2400unsafe impl<___D> ::fidl_next::Decode<___D> for WireVoidRef
2401where
2402 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2403{
2404 fn decode(
2405 slot_: ::fidl_next::Slot<'_, Self>,
2406 decoder_: &mut ___D,
2407 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2408 ::fidl_next::munge! {
2409 let Self {
2410
2411 mut _empty,
2412
2413
2414 } = slot_;
2415 }
2416
2417 if _empty.as_bytes() != &[0u8] {
2418 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
2419 }
2420
2421 Ok(())
2422 }
2423}
2424
2425#[doc = " Declares which identifier to use to key a component\'s isolated storage\n directory.\n"]
2426#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2427#[repr(u32)]
2428pub enum StorageId {
2429 StaticInstanceId = 1,
2430 StaticInstanceIdOrMoniker = 2,
2431}
2432
2433impl ::fidl_next::Encodable for StorageId {
2434 type Encoded = WireStorageId;
2435}
2436impl ::core::convert::TryFrom<u32> for StorageId {
2437 type Error = ::fidl_next::UnknownStrictEnumMemberError;
2438 fn try_from(
2439 value: u32,
2440 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
2441 match value {
2442 1 => Ok(Self::StaticInstanceId),
2443 2 => Ok(Self::StaticInstanceIdOrMoniker),
2444
2445 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
2446 }
2447 }
2448}
2449
2450unsafe impl<___E> ::fidl_next::Encode<___E> for StorageId
2451where
2452 ___E: ?Sized,
2453{
2454 #[inline]
2455 fn encode(
2456 self,
2457 encoder: &mut ___E,
2458 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2459 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2460 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
2461 }
2462}
2463
2464unsafe impl<___E> ::fidl_next::EncodeRef<___E> for StorageId
2465where
2466 ___E: ?Sized,
2467{
2468 #[inline]
2469 fn encode_ref(
2470 &self,
2471 encoder: &mut ___E,
2472 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2473 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2474 ::fidl_next::munge!(let WireStorageId { value } = out);
2475 let _ = value.write(::fidl_next::WireU32::from(match *self {
2476 Self::StaticInstanceId => 1,
2477
2478 Self::StaticInstanceIdOrMoniker => 2,
2479 }));
2480
2481 Ok(())
2482 }
2483}
2484
2485impl ::core::convert::From<WireStorageId> for StorageId {
2486 fn from(wire: WireStorageId) -> Self {
2487 match u32::from(wire.value) {
2488 1 => Self::StaticInstanceId,
2489
2490 2 => Self::StaticInstanceIdOrMoniker,
2491
2492 _ => unsafe { ::core::hint::unreachable_unchecked() },
2493 }
2494 }
2495}
2496
2497impl ::fidl_next::FromWire<WireStorageId> for StorageId {
2498 #[inline]
2499 fn from_wire(wire: WireStorageId) -> Self {
2500 Self::from(wire)
2501 }
2502}
2503
2504impl ::fidl_next::IntoNatural for WireStorageId {
2505 type Natural = StorageId;
2506}
2507
2508impl ::fidl_next::FromWireRef<WireStorageId> for StorageId {
2509 #[inline]
2510 fn from_wire_ref(wire: &WireStorageId) -> Self {
2511 Self::from(*wire)
2512 }
2513}
2514
2515#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2517#[repr(transparent)]
2518pub struct WireStorageId {
2519 value: ::fidl_next::WireU32,
2520}
2521
2522unsafe impl ::fidl_next::Wire for WireStorageId {
2523 type Decoded<'de> = Self;
2524
2525 #[inline]
2526 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2527 }
2529}
2530
2531impl WireStorageId {
2532 pub const STATIC_INSTANCE_ID: WireStorageId = WireStorageId { value: ::fidl_next::WireU32(1) };
2533
2534 pub const STATIC_INSTANCE_ID_OR_MONIKER: WireStorageId =
2535 WireStorageId { value: ::fidl_next::WireU32(2) };
2536}
2537
2538unsafe impl<___D> ::fidl_next::Decode<___D> for WireStorageId
2539where
2540 ___D: ?Sized,
2541{
2542 fn decode(
2543 slot: ::fidl_next::Slot<'_, Self>,
2544 _: &mut ___D,
2545 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2546 ::fidl_next::munge!(let Self { value } = slot);
2547
2548 match u32::from(*value) {
2549 1 | 2 => (),
2550 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
2551 }
2552
2553 Ok(())
2554 }
2555}
2556
2557impl ::core::convert::From<StorageId> for WireStorageId {
2558 fn from(natural: StorageId) -> Self {
2559 match natural {
2560 StorageId::StaticInstanceId => WireStorageId::STATIC_INSTANCE_ID,
2561
2562 StorageId::StaticInstanceIdOrMoniker => WireStorageId::STATIC_INSTANCE_ID_OR_MONIKER,
2563 }
2564 }
2565}
2566
2567#[doc = " Declares a runner capability backed by a service.\n"]
2568#[derive(PartialEq, Clone, Debug, Default)]
2569pub struct Runner {
2570 pub name: ::core::option::Option<::std::string::String>,
2571
2572 pub source_path: ::core::option::Option<::std::string::String>,
2573}
2574
2575impl Runner {
2576 fn __max_ordinal(&self) -> usize {
2577 if self.source_path.is_some() {
2578 return 2;
2579 }
2580
2581 if self.name.is_some() {
2582 return 1;
2583 }
2584
2585 0
2586 }
2587}
2588
2589impl ::fidl_next::Encodable for Runner {
2590 type Encoded = WireRunner<'static>;
2591}
2592
2593unsafe impl<___E> ::fidl_next::Encode<___E> for Runner
2594where
2595 ___E: ::fidl_next::Encoder + ?Sized,
2596{
2597 #[inline]
2598 fn encode(
2599 mut self,
2600 encoder: &mut ___E,
2601 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2602 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2603 ::fidl_next::munge!(let WireRunner { table } = out);
2604
2605 let max_ord = self.__max_ordinal();
2606
2607 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2608 ::fidl_next::Wire::zero_padding(&mut out);
2609
2610 let mut preallocated =
2611 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2612
2613 for i in 1..=max_ord {
2614 match i {
2615 2 => {
2616 if let Some(value) = self.source_path.take() {
2617 ::fidl_next::WireEnvelope::encode_value(
2618 value,
2619 preallocated.encoder,
2620 &mut out,
2621 )?;
2622 } else {
2623 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2624 }
2625 }
2626
2627 1 => {
2628 if let Some(value) = self.name.take() {
2629 ::fidl_next::WireEnvelope::encode_value(
2630 value,
2631 preallocated.encoder,
2632 &mut out,
2633 )?;
2634 } else {
2635 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2636 }
2637 }
2638
2639 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2640 }
2641 unsafe {
2642 preallocated.write_next(out.assume_init_ref());
2643 }
2644 }
2645
2646 ::fidl_next::WireTable::encode_len(table, max_ord);
2647
2648 Ok(())
2649 }
2650}
2651
2652unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Runner
2653where
2654 ___E: ::fidl_next::Encoder + ?Sized,
2655{
2656 #[inline]
2657 fn encode_ref(
2658 &self,
2659 encoder: &mut ___E,
2660 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2661 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2662 ::fidl_next::munge!(let WireRunner { table } = out);
2663
2664 let max_ord = self.__max_ordinal();
2665
2666 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2667 ::fidl_next::Wire::zero_padding(&mut out);
2668
2669 let mut preallocated =
2670 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2671
2672 for i in 1..=max_ord {
2673 match i {
2674 2 => {
2675 if let Some(value) = &self.source_path {
2676 ::fidl_next::WireEnvelope::encode_value(
2677 value,
2678 preallocated.encoder,
2679 &mut out,
2680 )?;
2681 } else {
2682 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2683 }
2684 }
2685
2686 1 => {
2687 if let Some(value) = &self.name {
2688 ::fidl_next::WireEnvelope::encode_value(
2689 value,
2690 preallocated.encoder,
2691 &mut out,
2692 )?;
2693 } else {
2694 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2695 }
2696 }
2697
2698 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2699 }
2700 unsafe {
2701 preallocated.write_next(out.assume_init_ref());
2702 }
2703 }
2704
2705 ::fidl_next::WireTable::encode_len(table, max_ord);
2706
2707 Ok(())
2708 }
2709}
2710
2711impl<'de> ::fidl_next::FromWire<WireRunner<'de>> for Runner {
2712 #[inline]
2713 fn from_wire(wire_: WireRunner<'de>) -> Self {
2714 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2715
2716 let name = wire_.table.get(1);
2717
2718 let source_path = wire_.table.get(2);
2719
2720 Self {
2721 name: name.map(|envelope| {
2722 ::fidl_next::FromWire::from_wire(unsafe {
2723 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
2724 })
2725 }),
2726
2727 source_path: source_path.map(|envelope| {
2728 ::fidl_next::FromWire::from_wire(unsafe {
2729 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
2730 })
2731 }),
2732 }
2733 }
2734}
2735
2736impl<'de> ::fidl_next::IntoNatural for WireRunner<'de> {
2737 type Natural = Runner;
2738}
2739
2740impl<'de> ::fidl_next::FromWireRef<WireRunner<'de>> for Runner {
2741 #[inline]
2742 fn from_wire_ref(wire: &WireRunner<'de>) -> Self {
2743 Self {
2744 name: wire.table.get(1).map(|envelope| {
2745 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2746 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
2747 })
2748 }),
2749
2750 source_path: wire.table.get(2).map(|envelope| {
2751 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2752 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
2753 })
2754 }),
2755 }
2756 }
2757}
2758
2759#[repr(C)]
2761pub struct WireRunner<'de> {
2762 table: ::fidl_next::WireTable<'de>,
2763}
2764
2765impl<'de> Drop for WireRunner<'de> {
2766 fn drop(&mut self) {
2767 let _ = self
2768 .table
2769 .get(1)
2770 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
2771
2772 let _ = self
2773 .table
2774 .get(2)
2775 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
2776 }
2777}
2778
2779unsafe impl ::fidl_next::Wire for WireRunner<'static> {
2780 type Decoded<'de> = WireRunner<'de>;
2781
2782 #[inline]
2783 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2784 ::fidl_next::munge!(let Self { table } = out);
2785 ::fidl_next::WireTable::zero_padding(table);
2786 }
2787}
2788
2789unsafe impl<___D> ::fidl_next::Decode<___D> for WireRunner<'static>
2790where
2791 ___D: ::fidl_next::Decoder + ?Sized,
2792{
2793 fn decode(
2794 slot: ::fidl_next::Slot<'_, Self>,
2795 decoder: &mut ___D,
2796 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2797 ::fidl_next::munge!(let Self { table } = slot);
2798
2799 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2800 match ordinal {
2801 0 => unsafe { ::core::hint::unreachable_unchecked() },
2802
2803 1 => {
2804 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
2805 slot.as_mut(),
2806 decoder,
2807 )?;
2808
2809 let value = unsafe {
2810 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
2811 };
2812
2813 if value.len() > 100 {
2814 return Err(::fidl_next::DecodeError::VectorTooLong {
2815 size: value.len() as u64,
2816 limit: 100,
2817 });
2818 }
2819
2820 Ok(())
2821 }
2822
2823 2 => {
2824 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
2825 slot.as_mut(),
2826 decoder,
2827 )?;
2828
2829 let value = unsafe {
2830 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
2831 };
2832
2833 if value.len() > 1024 {
2834 return Err(::fidl_next::DecodeError::VectorTooLong {
2835 size: value.len() as u64,
2836 limit: 1024,
2837 });
2838 }
2839
2840 Ok(())
2841 }
2842
2843 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2844 }
2845 })
2846 }
2847}
2848
2849impl<'de> WireRunner<'de> {
2850 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
2851 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2852 }
2853
2854 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
2855 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2856 }
2857}
2858
2859impl<'de> ::core::fmt::Debug for WireRunner<'de> {
2860 fn fmt(
2861 &self,
2862 f: &mut ::core::fmt::Formatter<'_>,
2863 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2864 f.debug_struct("Runner")
2865 .field("name", &self.name())
2866 .field("source_path", &self.source_path())
2867 .finish()
2868 }
2869}
2870
2871#[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"]
2872#[derive(PartialEq, Clone, Debug, Default)]
2873pub struct Resolver {
2874 pub name: ::core::option::Option<::std::string::String>,
2875
2876 pub source_path: ::core::option::Option<::std::string::String>,
2877}
2878
2879impl Resolver {
2880 fn __max_ordinal(&self) -> usize {
2881 if self.source_path.is_some() {
2882 return 2;
2883 }
2884
2885 if self.name.is_some() {
2886 return 1;
2887 }
2888
2889 0
2890 }
2891}
2892
2893impl ::fidl_next::Encodable for Resolver {
2894 type Encoded = WireResolver<'static>;
2895}
2896
2897unsafe impl<___E> ::fidl_next::Encode<___E> for Resolver
2898where
2899 ___E: ::fidl_next::Encoder + ?Sized,
2900{
2901 #[inline]
2902 fn encode(
2903 mut self,
2904 encoder: &mut ___E,
2905 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2906 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2907 ::fidl_next::munge!(let WireResolver { table } = out);
2908
2909 let max_ord = self.__max_ordinal();
2910
2911 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2912 ::fidl_next::Wire::zero_padding(&mut out);
2913
2914 let mut preallocated =
2915 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2916
2917 for i in 1..=max_ord {
2918 match i {
2919 2 => {
2920 if let Some(value) = self.source_path.take() {
2921 ::fidl_next::WireEnvelope::encode_value(
2922 value,
2923 preallocated.encoder,
2924 &mut out,
2925 )?;
2926 } else {
2927 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2928 }
2929 }
2930
2931 1 => {
2932 if let Some(value) = self.name.take() {
2933 ::fidl_next::WireEnvelope::encode_value(
2934 value,
2935 preallocated.encoder,
2936 &mut out,
2937 )?;
2938 } else {
2939 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2940 }
2941 }
2942
2943 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2944 }
2945 unsafe {
2946 preallocated.write_next(out.assume_init_ref());
2947 }
2948 }
2949
2950 ::fidl_next::WireTable::encode_len(table, max_ord);
2951
2952 Ok(())
2953 }
2954}
2955
2956unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Resolver
2957where
2958 ___E: ::fidl_next::Encoder + ?Sized,
2959{
2960 #[inline]
2961 fn encode_ref(
2962 &self,
2963 encoder: &mut ___E,
2964 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2965 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2966 ::fidl_next::munge!(let WireResolver { table } = out);
2967
2968 let max_ord = self.__max_ordinal();
2969
2970 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2971 ::fidl_next::Wire::zero_padding(&mut out);
2972
2973 let mut preallocated =
2974 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2975
2976 for i in 1..=max_ord {
2977 match i {
2978 2 => {
2979 if let Some(value) = &self.source_path {
2980 ::fidl_next::WireEnvelope::encode_value(
2981 value,
2982 preallocated.encoder,
2983 &mut out,
2984 )?;
2985 } else {
2986 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2987 }
2988 }
2989
2990 1 => {
2991 if let Some(value) = &self.name {
2992 ::fidl_next::WireEnvelope::encode_value(
2993 value,
2994 preallocated.encoder,
2995 &mut out,
2996 )?;
2997 } else {
2998 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2999 }
3000 }
3001
3002 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3003 }
3004 unsafe {
3005 preallocated.write_next(out.assume_init_ref());
3006 }
3007 }
3008
3009 ::fidl_next::WireTable::encode_len(table, max_ord);
3010
3011 Ok(())
3012 }
3013}
3014
3015impl<'de> ::fidl_next::FromWire<WireResolver<'de>> for Resolver {
3016 #[inline]
3017 fn from_wire(wire_: WireResolver<'de>) -> Self {
3018 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3019
3020 let name = wire_.table.get(1);
3021
3022 let source_path = wire_.table.get(2);
3023
3024 Self {
3025 name: name.map(|envelope| {
3026 ::fidl_next::FromWire::from_wire(unsafe {
3027 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
3028 })
3029 }),
3030
3031 source_path: source_path.map(|envelope| {
3032 ::fidl_next::FromWire::from_wire(unsafe {
3033 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
3034 })
3035 }),
3036 }
3037 }
3038}
3039
3040impl<'de> ::fidl_next::IntoNatural for WireResolver<'de> {
3041 type Natural = Resolver;
3042}
3043
3044impl<'de> ::fidl_next::FromWireRef<WireResolver<'de>> for Resolver {
3045 #[inline]
3046 fn from_wire_ref(wire: &WireResolver<'de>) -> Self {
3047 Self {
3048 name: wire.table.get(1).map(|envelope| {
3049 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3050 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
3051 })
3052 }),
3053
3054 source_path: wire.table.get(2).map(|envelope| {
3055 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3056 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
3057 })
3058 }),
3059 }
3060 }
3061}
3062
3063#[repr(C)]
3065pub struct WireResolver<'de> {
3066 table: ::fidl_next::WireTable<'de>,
3067}
3068
3069impl<'de> Drop for WireResolver<'de> {
3070 fn drop(&mut self) {
3071 let _ = self
3072 .table
3073 .get(1)
3074 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
3075
3076 let _ = self
3077 .table
3078 .get(2)
3079 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
3080 }
3081}
3082
3083unsafe impl ::fidl_next::Wire for WireResolver<'static> {
3084 type Decoded<'de> = WireResolver<'de>;
3085
3086 #[inline]
3087 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3088 ::fidl_next::munge!(let Self { table } = out);
3089 ::fidl_next::WireTable::zero_padding(table);
3090 }
3091}
3092
3093unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolver<'static>
3094where
3095 ___D: ::fidl_next::Decoder + ?Sized,
3096{
3097 fn decode(
3098 slot: ::fidl_next::Slot<'_, Self>,
3099 decoder: &mut ___D,
3100 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3101 ::fidl_next::munge!(let Self { table } = slot);
3102
3103 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3104 match ordinal {
3105 0 => unsafe { ::core::hint::unreachable_unchecked() },
3106
3107 1 => {
3108 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
3109 slot.as_mut(),
3110 decoder,
3111 )?;
3112
3113 let value = unsafe {
3114 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
3115 };
3116
3117 if value.len() > 100 {
3118 return Err(::fidl_next::DecodeError::VectorTooLong {
3119 size: value.len() as u64,
3120 limit: 100,
3121 });
3122 }
3123
3124 Ok(())
3125 }
3126
3127 2 => {
3128 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
3129 slot.as_mut(),
3130 decoder,
3131 )?;
3132
3133 let value = unsafe {
3134 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
3135 };
3136
3137 if value.len() > 1024 {
3138 return Err(::fidl_next::DecodeError::VectorTooLong {
3139 size: value.len() as u64,
3140 limit: 1024,
3141 });
3142 }
3143
3144 Ok(())
3145 }
3146
3147 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3148 }
3149 })
3150 }
3151}
3152
3153impl<'de> WireResolver<'de> {
3154 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
3155 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3156 }
3157
3158 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
3159 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3160 }
3161}
3162
3163impl<'de> ::core::fmt::Debug for WireResolver<'de> {
3164 fn fmt(
3165 &self,
3166 f: &mut ::core::fmt::Formatter<'_>,
3167 ) -> ::core::result::Result<(), ::core::fmt::Error> {
3168 f.debug_struct("Resolver")
3169 .field("name", &self.name())
3170 .field("source_path", &self.source_path())
3171 .finish()
3172 }
3173}
3174
3175#[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"]
3176#[derive(PartialEq, Clone, Debug, Default)]
3177pub struct EventStream {
3178 pub name: ::core::option::Option<::std::string::String>,
3179}
3180
3181impl EventStream {
3182 fn __max_ordinal(&self) -> usize {
3183 if self.name.is_some() {
3184 return 1;
3185 }
3186
3187 0
3188 }
3189}
3190
3191impl ::fidl_next::Encodable for EventStream {
3192 type Encoded = WireEventStream<'static>;
3193}
3194
3195unsafe impl<___E> ::fidl_next::Encode<___E> for EventStream
3196where
3197 ___E: ::fidl_next::Encoder + ?Sized,
3198{
3199 #[inline]
3200 fn encode(
3201 mut self,
3202 encoder: &mut ___E,
3203 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3204 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3205 ::fidl_next::munge!(let WireEventStream { table } = out);
3206
3207 let max_ord = self.__max_ordinal();
3208
3209 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3210 ::fidl_next::Wire::zero_padding(&mut out);
3211
3212 let mut preallocated =
3213 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3214
3215 for i in 1..=max_ord {
3216 match i {
3217 1 => {
3218 if let Some(value) = self.name.take() {
3219 ::fidl_next::WireEnvelope::encode_value(
3220 value,
3221 preallocated.encoder,
3222 &mut out,
3223 )?;
3224 } else {
3225 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3226 }
3227 }
3228
3229 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3230 }
3231 unsafe {
3232 preallocated.write_next(out.assume_init_ref());
3233 }
3234 }
3235
3236 ::fidl_next::WireTable::encode_len(table, max_ord);
3237
3238 Ok(())
3239 }
3240}
3241
3242unsafe impl<___E> ::fidl_next::EncodeRef<___E> for EventStream
3243where
3244 ___E: ::fidl_next::Encoder + ?Sized,
3245{
3246 #[inline]
3247 fn encode_ref(
3248 &self,
3249 encoder: &mut ___E,
3250 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3251 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3252 ::fidl_next::munge!(let WireEventStream { table } = out);
3253
3254 let max_ord = self.__max_ordinal();
3255
3256 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3257 ::fidl_next::Wire::zero_padding(&mut out);
3258
3259 let mut preallocated =
3260 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3261
3262 for i in 1..=max_ord {
3263 match i {
3264 1 => {
3265 if let Some(value) = &self.name {
3266 ::fidl_next::WireEnvelope::encode_value(
3267 value,
3268 preallocated.encoder,
3269 &mut out,
3270 )?;
3271 } else {
3272 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3273 }
3274 }
3275
3276 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3277 }
3278 unsafe {
3279 preallocated.write_next(out.assume_init_ref());
3280 }
3281 }
3282
3283 ::fidl_next::WireTable::encode_len(table, max_ord);
3284
3285 Ok(())
3286 }
3287}
3288
3289impl<'de> ::fidl_next::FromWire<WireEventStream<'de>> for EventStream {
3290 #[inline]
3291 fn from_wire(wire_: WireEventStream<'de>) -> Self {
3292 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3293
3294 let name = wire_.table.get(1);
3295
3296 Self {
3297 name: name.map(|envelope| {
3298 ::fidl_next::FromWire::from_wire(unsafe {
3299 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
3300 })
3301 }),
3302 }
3303 }
3304}
3305
3306impl<'de> ::fidl_next::IntoNatural for WireEventStream<'de> {
3307 type Natural = EventStream;
3308}
3309
3310impl<'de> ::fidl_next::FromWireRef<WireEventStream<'de>> for EventStream {
3311 #[inline]
3312 fn from_wire_ref(wire: &WireEventStream<'de>) -> Self {
3313 Self {
3314 name: wire.table.get(1).map(|envelope| {
3315 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3316 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
3317 })
3318 }),
3319 }
3320 }
3321}
3322
3323#[repr(C)]
3325pub struct WireEventStream<'de> {
3326 table: ::fidl_next::WireTable<'de>,
3327}
3328
3329impl<'de> Drop for WireEventStream<'de> {
3330 fn drop(&mut self) {
3331 let _ = self
3332 .table
3333 .get(1)
3334 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
3335 }
3336}
3337
3338unsafe impl ::fidl_next::Wire for WireEventStream<'static> {
3339 type Decoded<'de> = WireEventStream<'de>;
3340
3341 #[inline]
3342 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3343 ::fidl_next::munge!(let Self { table } = out);
3344 ::fidl_next::WireTable::zero_padding(table);
3345 }
3346}
3347
3348unsafe impl<___D> ::fidl_next::Decode<___D> for WireEventStream<'static>
3349where
3350 ___D: ::fidl_next::Decoder + ?Sized,
3351{
3352 fn decode(
3353 slot: ::fidl_next::Slot<'_, Self>,
3354 decoder: &mut ___D,
3355 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3356 ::fidl_next::munge!(let Self { table } = slot);
3357
3358 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3359 match ordinal {
3360 0 => unsafe { ::core::hint::unreachable_unchecked() },
3361
3362 1 => {
3363 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
3364 slot.as_mut(),
3365 decoder,
3366 )?;
3367
3368 let value = unsafe {
3369 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
3370 };
3371
3372 if value.len() > 100 {
3373 return Err(::fidl_next::DecodeError::VectorTooLong {
3374 size: value.len() as u64,
3375 limit: 100,
3376 });
3377 }
3378
3379 Ok(())
3380 }
3381
3382 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3383 }
3384 })
3385 }
3386}
3387
3388impl<'de> WireEventStream<'de> {
3389 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
3390 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3391 }
3392}
3393
3394impl<'de> ::core::fmt::Debug for WireEventStream<'de> {
3395 fn fmt(
3396 &self,
3397 f: &mut ::core::fmt::Formatter<'_>,
3398 ) -> ::core::result::Result<(), ::core::fmt::Error> {
3399 f.debug_struct("EventStream").field("name", &self.name()).finish()
3400 }
3401}
3402
3403#[doc = " A single configuration value.\n"]
3404#[derive(PartialEq, Clone, Debug)]
3405pub enum ConfigSingleValue {
3406 Bool(bool),
3407
3408 Uint8(u8),
3409
3410 Uint16(u16),
3411
3412 Uint32(u32),
3413
3414 Uint64(u64),
3415
3416 Int8(i8),
3417
3418 Int16(i16),
3419
3420 Int32(i32),
3421
3422 Int64(i64),
3423
3424 String(::std::string::String),
3425
3426 UnknownOrdinal_(u64),
3427}
3428
3429impl ::fidl_next::Encodable for ConfigSingleValue {
3430 type Encoded = WireConfigSingleValue<'static>;
3431}
3432
3433unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigSingleValue
3434where
3435 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3436 ___E: ::fidl_next::Encoder,
3437{
3438 #[inline]
3439 fn encode(
3440 self,
3441 encoder: &mut ___E,
3442 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3443 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3444 ::fidl_next::munge!(let WireConfigSingleValue { raw, _phantom: _ } = out);
3445
3446 match self {
3447 Self::Bool(value) => {
3448 ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw)?
3449 }
3450
3451 Self::Uint8(value) => {
3452 ::fidl_next::RawWireUnion::encode_as::<___E, u8>(value, 2, encoder, raw)?
3453 }
3454
3455 Self::Uint16(value) => {
3456 ::fidl_next::RawWireUnion::encode_as::<___E, u16>(value, 3, encoder, raw)?
3457 }
3458
3459 Self::Uint32(value) => {
3460 ::fidl_next::RawWireUnion::encode_as::<___E, u32>(value, 4, encoder, raw)?
3461 }
3462
3463 Self::Uint64(value) => {
3464 ::fidl_next::RawWireUnion::encode_as::<___E, u64>(value, 5, encoder, raw)?
3465 }
3466
3467 Self::Int8(value) => {
3468 ::fidl_next::RawWireUnion::encode_as::<___E, i8>(value, 6, encoder, raw)?
3469 }
3470
3471 Self::Int16(value) => {
3472 ::fidl_next::RawWireUnion::encode_as::<___E, i16>(value, 7, encoder, raw)?
3473 }
3474
3475 Self::Int32(value) => {
3476 ::fidl_next::RawWireUnion::encode_as::<___E, i32>(value, 8, encoder, raw)?
3477 }
3478
3479 Self::Int64(value) => {
3480 ::fidl_next::RawWireUnion::encode_as::<___E, i64>(value, 9, encoder, raw)?
3481 }
3482
3483 Self::String(value) => ::fidl_next::RawWireUnion::encode_as::<
3484 ___E,
3485 ::std::string::String,
3486 >(value, 10, encoder, raw)?,
3487
3488 Self::UnknownOrdinal_(ordinal) => {
3489 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
3490 }
3491 }
3492
3493 Ok(())
3494 }
3495}
3496
3497unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigSingleValue
3498where
3499 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3500 ___E: ::fidl_next::Encoder,
3501{
3502 #[inline]
3503 fn encode_ref(
3504 &self,
3505 encoder: &mut ___E,
3506 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3507 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3508 ::fidl_next::munge!(let WireConfigSingleValue { raw, _phantom: _ } = out);
3509
3510 match self {
3511 Self::Bool(value) => {
3512 ::fidl_next::RawWireUnion::encode_as::<___E, &bool>(value, 1, encoder, raw)?
3513 }
3514
3515 Self::Uint8(value) => {
3516 ::fidl_next::RawWireUnion::encode_as::<___E, &u8>(value, 2, encoder, raw)?
3517 }
3518
3519 Self::Uint16(value) => {
3520 ::fidl_next::RawWireUnion::encode_as::<___E, &u16>(value, 3, encoder, raw)?
3521 }
3522
3523 Self::Uint32(value) => {
3524 ::fidl_next::RawWireUnion::encode_as::<___E, &u32>(value, 4, encoder, raw)?
3525 }
3526
3527 Self::Uint64(value) => {
3528 ::fidl_next::RawWireUnion::encode_as::<___E, &u64>(value, 5, encoder, raw)?
3529 }
3530
3531 Self::Int8(value) => {
3532 ::fidl_next::RawWireUnion::encode_as::<___E, &i8>(value, 6, encoder, raw)?
3533 }
3534
3535 Self::Int16(value) => {
3536 ::fidl_next::RawWireUnion::encode_as::<___E, &i16>(value, 7, encoder, raw)?
3537 }
3538
3539 Self::Int32(value) => {
3540 ::fidl_next::RawWireUnion::encode_as::<___E, &i32>(value, 8, encoder, raw)?
3541 }
3542
3543 Self::Int64(value) => {
3544 ::fidl_next::RawWireUnion::encode_as::<___E, &i64>(value, 9, encoder, raw)?
3545 }
3546
3547 Self::String(value) => ::fidl_next::RawWireUnion::encode_as::<
3548 ___E,
3549 &::std::string::String,
3550 >(value, 10, encoder, raw)?,
3551
3552 Self::UnknownOrdinal_(ordinal) => {
3553 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
3554 }
3555 }
3556
3557 Ok(())
3558 }
3559}
3560
3561impl ::fidl_next::EncodableOption for ConfigSingleValue {
3562 type EncodedOption = WireOptionalConfigSingleValue<'static>;
3563}
3564
3565unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ConfigSingleValue
3566where
3567 ___E: ?Sized,
3568 ConfigSingleValue: ::fidl_next::Encode<___E>,
3569{
3570 #[inline]
3571 fn encode_option(
3572 this: ::core::option::Option<Self>,
3573 encoder: &mut ___E,
3574 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3575 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3576 ::fidl_next::munge!(let WireOptionalConfigSingleValue { raw, _phantom: _ } = &mut *out);
3577
3578 if let Some(inner) = this {
3579 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
3580 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
3581 } else {
3582 ::fidl_next::RawWireUnion::encode_absent(raw);
3583 }
3584
3585 Ok(())
3586 }
3587}
3588
3589unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ConfigSingleValue
3590where
3591 ___E: ?Sized,
3592 ConfigSingleValue: ::fidl_next::EncodeRef<___E>,
3593{
3594 #[inline]
3595 fn encode_option_ref(
3596 this: ::core::option::Option<&Self>,
3597 encoder: &mut ___E,
3598 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3599 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3600 ::fidl_next::munge!(let WireOptionalConfigSingleValue { raw, _phantom: _ } = &mut *out);
3601
3602 if let Some(inner) = this {
3603 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
3604 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
3605 } else {
3606 ::fidl_next::RawWireUnion::encode_absent(raw);
3607 }
3608
3609 Ok(())
3610 }
3611}
3612
3613impl<'de> ::fidl_next::FromWire<WireConfigSingleValue<'de>> for ConfigSingleValue {
3614 #[inline]
3615 fn from_wire(wire: WireConfigSingleValue<'de>) -> Self {
3616 let wire = ::core::mem::ManuallyDrop::new(wire);
3617 match wire.raw.ordinal() {
3618 1 => Self::Bool(::fidl_next::FromWire::from_wire(unsafe {
3619 wire.raw.get().read_unchecked::<bool>()
3620 })),
3621
3622 2 => Self::Uint8(::fidl_next::FromWire::from_wire(unsafe {
3623 wire.raw.get().read_unchecked::<u8>()
3624 })),
3625
3626 3 => Self::Uint16(::fidl_next::FromWire::from_wire(unsafe {
3627 wire.raw.get().read_unchecked::<::fidl_next::WireU16>()
3628 })),
3629
3630 4 => Self::Uint32(::fidl_next::FromWire::from_wire(unsafe {
3631 wire.raw.get().read_unchecked::<::fidl_next::WireU32>()
3632 })),
3633
3634 5 => Self::Uint64(::fidl_next::FromWire::from_wire(unsafe {
3635 wire.raw.get().read_unchecked::<::fidl_next::WireU64>()
3636 })),
3637
3638 6 => Self::Int8(::fidl_next::FromWire::from_wire(unsafe {
3639 wire.raw.get().read_unchecked::<i8>()
3640 })),
3641
3642 7 => Self::Int16(::fidl_next::FromWire::from_wire(unsafe {
3643 wire.raw.get().read_unchecked::<::fidl_next::WireI16>()
3644 })),
3645
3646 8 => Self::Int32(::fidl_next::FromWire::from_wire(unsafe {
3647 wire.raw.get().read_unchecked::<::fidl_next::WireI32>()
3648 })),
3649
3650 9 => Self::Int64(::fidl_next::FromWire::from_wire(unsafe {
3651 wire.raw.get().read_unchecked::<::fidl_next::WireI64>()
3652 })),
3653
3654 10 => Self::String(::fidl_next::FromWire::from_wire(unsafe {
3655 wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
3656 })),
3657
3658 _ => unsafe { ::core::hint::unreachable_unchecked() },
3659 }
3660 }
3661}
3662
3663impl<'de> ::fidl_next::IntoNatural for WireConfigSingleValue<'de> {
3664 type Natural = ConfigSingleValue;
3665}
3666
3667impl<'de> ::fidl_next::FromWireRef<WireConfigSingleValue<'de>> for ConfigSingleValue {
3668 #[inline]
3669 fn from_wire_ref(wire: &WireConfigSingleValue<'de>) -> Self {
3670 match wire.raw.ordinal() {
3671 1 => Self::Bool(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3672 wire.raw.get().deref_unchecked::<bool>()
3673 })),
3674
3675 2 => Self::Uint8(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3676 wire.raw.get().deref_unchecked::<u8>()
3677 })),
3678
3679 3 => Self::Uint16(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3680 wire.raw.get().deref_unchecked::<::fidl_next::WireU16>()
3681 })),
3682
3683 4 => Self::Uint32(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3684 wire.raw.get().deref_unchecked::<::fidl_next::WireU32>()
3685 })),
3686
3687 5 => Self::Uint64(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3688 wire.raw.get().deref_unchecked::<::fidl_next::WireU64>()
3689 })),
3690
3691 6 => Self::Int8(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3692 wire.raw.get().deref_unchecked::<i8>()
3693 })),
3694
3695 7 => Self::Int16(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3696 wire.raw.get().deref_unchecked::<::fidl_next::WireI16>()
3697 })),
3698
3699 8 => Self::Int32(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3700 wire.raw.get().deref_unchecked::<::fidl_next::WireI32>()
3701 })),
3702
3703 9 => Self::Int64(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3704 wire.raw.get().deref_unchecked::<::fidl_next::WireI64>()
3705 })),
3706
3707 10 => Self::String(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3708 wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
3709 })),
3710
3711 _ => unsafe { ::core::hint::unreachable_unchecked() },
3712 }
3713 }
3714}
3715
3716impl<'de> ::fidl_next::FromWireOption<WireOptionalConfigSingleValue<'de>> for ConfigSingleValue {
3717 #[inline]
3718 fn from_wire_option(wire: WireOptionalConfigSingleValue<'de>) -> ::core::option::Option<Self> {
3719 if let Some(inner) = wire.into_option() {
3720 Some(::fidl_next::FromWire::from_wire(inner))
3721 } else {
3722 None
3723 }
3724 }
3725}
3726
3727impl<'de> ::fidl_next::IntoNatural for WireOptionalConfigSingleValue<'de> {
3728 type Natural = ::core::option::Option<ConfigSingleValue>;
3729}
3730
3731impl<'de> ::fidl_next::FromWireOption<WireOptionalConfigSingleValue<'de>>
3732 for Box<ConfigSingleValue>
3733{
3734 #[inline]
3735 fn from_wire_option(wire: WireOptionalConfigSingleValue<'de>) -> ::core::option::Option<Self> {
3736 <
3737 ConfigSingleValue as ::fidl_next::FromWireOption<WireOptionalConfigSingleValue<'de>>
3738 >::from_wire_option(wire).map(Box::new)
3739 }
3740}
3741
3742impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalConfigSingleValue<'de>>
3743 for Box<ConfigSingleValue>
3744{
3745 #[inline]
3746 fn from_wire_option_ref(
3747 wire: &WireOptionalConfigSingleValue<'de>,
3748 ) -> ::core::option::Option<Self> {
3749 if let Some(inner) = wire.as_ref() {
3750 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
3751 } else {
3752 None
3753 }
3754 }
3755}
3756
3757#[repr(transparent)]
3759pub struct WireConfigSingleValue<'de> {
3760 raw: ::fidl_next::RawWireUnion,
3761 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
3762}
3763
3764impl<'de> Drop for WireConfigSingleValue<'de> {
3765 fn drop(&mut self) {
3766 match self.raw.ordinal() {
3767 1 => {
3768 let _ = unsafe { self.raw.get().read_unchecked::<bool>() };
3769 }
3770
3771 2 => {
3772 let _ = unsafe { self.raw.get().read_unchecked::<u8>() };
3773 }
3774
3775 3 => {
3776 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU16>() };
3777 }
3778
3779 4 => {
3780 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU32>() };
3781 }
3782
3783 5 => {
3784 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU64>() };
3785 }
3786
3787 6 => {
3788 let _ = unsafe { self.raw.get().read_unchecked::<i8>() };
3789 }
3790
3791 7 => {
3792 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireI16>() };
3793 }
3794
3795 8 => {
3796 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireI32>() };
3797 }
3798
3799 9 => {
3800 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireI64>() };
3801 }
3802
3803 10 => {
3804 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
3805 }
3806
3807 _ => (),
3808 }
3809 }
3810}
3811
3812unsafe impl ::fidl_next::Wire for WireConfigSingleValue<'static> {
3813 type Decoded<'de> = WireConfigSingleValue<'de>;
3814
3815 #[inline]
3816 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3817 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
3818 ::fidl_next::RawWireUnion::zero_padding(raw);
3819 }
3820}
3821
3822pub mod config_single_value {
3823 pub enum Ref<'de> {
3824 Bool(&'de bool),
3825
3826 Uint8(&'de u8),
3827
3828 Uint16(&'de ::fidl_next::WireU16),
3829
3830 Uint32(&'de ::fidl_next::WireU32),
3831
3832 Uint64(&'de ::fidl_next::WireU64),
3833
3834 Int8(&'de i8),
3835
3836 Int16(&'de ::fidl_next::WireI16),
3837
3838 Int32(&'de ::fidl_next::WireI32),
3839
3840 Int64(&'de ::fidl_next::WireI64),
3841
3842 String(&'de ::fidl_next::WireString<'de>),
3843
3844 UnknownOrdinal_(u64),
3845 }
3846}
3847
3848impl<'de> WireConfigSingleValue<'de> {
3849 pub fn as_ref(&self) -> crate::config_single_value::Ref<'_> {
3850 match self.raw.ordinal() {
3851 1 => crate::config_single_value::Ref::Bool(unsafe {
3852 self.raw.get().deref_unchecked::<bool>()
3853 }),
3854
3855 2 => crate::config_single_value::Ref::Uint8(unsafe {
3856 self.raw.get().deref_unchecked::<u8>()
3857 }),
3858
3859 3 => crate::config_single_value::Ref::Uint16(unsafe {
3860 self.raw.get().deref_unchecked::<::fidl_next::WireU16>()
3861 }),
3862
3863 4 => crate::config_single_value::Ref::Uint32(unsafe {
3864 self.raw.get().deref_unchecked::<::fidl_next::WireU32>()
3865 }),
3866
3867 5 => crate::config_single_value::Ref::Uint64(unsafe {
3868 self.raw.get().deref_unchecked::<::fidl_next::WireU64>()
3869 }),
3870
3871 6 => crate::config_single_value::Ref::Int8(unsafe {
3872 self.raw.get().deref_unchecked::<i8>()
3873 }),
3874
3875 7 => crate::config_single_value::Ref::Int16(unsafe {
3876 self.raw.get().deref_unchecked::<::fidl_next::WireI16>()
3877 }),
3878
3879 8 => crate::config_single_value::Ref::Int32(unsafe {
3880 self.raw.get().deref_unchecked::<::fidl_next::WireI32>()
3881 }),
3882
3883 9 => crate::config_single_value::Ref::Int64(unsafe {
3884 self.raw.get().deref_unchecked::<::fidl_next::WireI64>()
3885 }),
3886
3887 10 => crate::config_single_value::Ref::String(unsafe {
3888 self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
3889 }),
3890
3891 unknown => crate::config_single_value::Ref::UnknownOrdinal_(unknown),
3892 }
3893 }
3894}
3895
3896unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigSingleValue<'static>
3897where
3898 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3899 ___D: ::fidl_next::Decoder,
3900{
3901 fn decode(
3902 mut slot: ::fidl_next::Slot<'_, Self>,
3903 decoder: &mut ___D,
3904 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3905 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
3906 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
3907 1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder)?,
3908
3909 2 => ::fidl_next::RawWireUnion::decode_as::<___D, u8>(raw, decoder)?,
3910
3911 3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU16>(raw, decoder)?,
3912
3913 4 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
3914
3915 5 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU64>(raw, decoder)?,
3916
3917 6 => ::fidl_next::RawWireUnion::decode_as::<___D, i8>(raw, decoder)?,
3918
3919 7 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI16>(raw, decoder)?,
3920
3921 8 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI32>(raw, decoder)?,
3922
3923 9 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI64>(raw, decoder)?,
3924
3925 10 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
3926 raw, decoder,
3927 )?,
3928
3929 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
3930 }
3931
3932 Ok(())
3933 }
3934}
3935
3936impl<'de> ::core::fmt::Debug for WireConfigSingleValue<'de> {
3937 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3938 match self.raw.ordinal() {
3939 1 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) },
3940 2 => unsafe { self.raw.get().deref_unchecked::<u8>().fmt(f) },
3941 3 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU16>().fmt(f) },
3942 4 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU32>().fmt(f) },
3943 5 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU64>().fmt(f) },
3944 6 => unsafe { self.raw.get().deref_unchecked::<i8>().fmt(f) },
3945 7 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI16>().fmt(f) },
3946 8 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI32>().fmt(f) },
3947 9 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI64>().fmt(f) },
3948 10 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f) },
3949 _ => unsafe { ::core::hint::unreachable_unchecked() },
3950 }
3951 }
3952}
3953
3954#[repr(transparent)]
3955pub struct WireOptionalConfigSingleValue<'de> {
3956 raw: ::fidl_next::RawWireUnion,
3957 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
3958}
3959
3960unsafe impl ::fidl_next::Wire for WireOptionalConfigSingleValue<'static> {
3961 type Decoded<'de> = WireOptionalConfigSingleValue<'de>;
3962
3963 #[inline]
3964 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3965 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
3966 ::fidl_next::RawWireUnion::zero_padding(raw);
3967 }
3968}
3969
3970impl<'de> WireOptionalConfigSingleValue<'de> {
3971 pub fn is_some(&self) -> bool {
3972 self.raw.is_some()
3973 }
3974
3975 pub fn is_none(&self) -> bool {
3976 self.raw.is_none()
3977 }
3978
3979 pub fn as_ref(&self) -> ::core::option::Option<&WireConfigSingleValue<'de>> {
3980 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
3981 }
3982
3983 pub fn into_option(self) -> ::core::option::Option<WireConfigSingleValue<'de>> {
3984 if self.is_some() {
3985 Some(WireConfigSingleValue { raw: self.raw, _phantom: ::core::marker::PhantomData })
3986 } else {
3987 None
3988 }
3989 }
3990}
3991
3992unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConfigSingleValue<'static>
3993where
3994 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3995 ___D: ::fidl_next::Decoder,
3996{
3997 fn decode(
3998 mut slot: ::fidl_next::Slot<'_, Self>,
3999 decoder: &mut ___D,
4000 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4001 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
4002 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
4003 1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder)?,
4004
4005 2 => ::fidl_next::RawWireUnion::decode_as::<___D, u8>(raw, decoder)?,
4006
4007 3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU16>(raw, decoder)?,
4008
4009 4 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
4010
4011 5 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU64>(raw, decoder)?,
4012
4013 6 => ::fidl_next::RawWireUnion::decode_as::<___D, i8>(raw, decoder)?,
4014
4015 7 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI16>(raw, decoder)?,
4016
4017 8 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI32>(raw, decoder)?,
4018
4019 9 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI64>(raw, decoder)?,
4020
4021 10 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
4022 raw, decoder,
4023 )?,
4024
4025 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
4026 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
4027 }
4028
4029 Ok(())
4030 }
4031}
4032
4033impl<'de> ::core::fmt::Debug for WireOptionalConfigSingleValue<'de> {
4034 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4035 self.as_ref().fmt(f)
4036 }
4037}
4038
4039#[doc = " A vector configuration value.\n"]
4040#[derive(PartialEq, Clone, Debug)]
4041pub enum ConfigVectorValue {
4042 BoolVector(::std::vec::Vec<bool>),
4043
4044 Uint8Vector(::std::vec::Vec<u8>),
4045
4046 Uint16Vector(::std::vec::Vec<u16>),
4047
4048 Uint32Vector(::std::vec::Vec<u32>),
4049
4050 Uint64Vector(::std::vec::Vec<u64>),
4051
4052 Int8Vector(::std::vec::Vec<i8>),
4053
4054 Int16Vector(::std::vec::Vec<i16>),
4055
4056 Int32Vector(::std::vec::Vec<i32>),
4057
4058 Int64Vector(::std::vec::Vec<i64>),
4059
4060 StringVector(::std::vec::Vec<::std::string::String>),
4061
4062 UnknownOrdinal_(u64),
4063}
4064
4065impl ::fidl_next::Encodable for ConfigVectorValue {
4066 type Encoded = WireConfigVectorValue<'static>;
4067}
4068
4069unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigVectorValue
4070where
4071 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4072 ___E: ::fidl_next::Encoder,
4073{
4074 #[inline]
4075 fn encode(
4076 self,
4077 encoder: &mut ___E,
4078 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4079 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4080 ::fidl_next::munge!(let WireConfigVectorValue { raw, _phantom: _ } = out);
4081
4082 match self {
4083 Self::BoolVector(value) => ::fidl_next::RawWireUnion::encode_as::<
4084 ___E,
4085 ::std::vec::Vec<bool>,
4086 >(value, 1, encoder, raw)?,
4087
4088 Self::Uint8Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4089 ___E,
4090 ::std::vec::Vec<u8>,
4091 >(value, 2, encoder, raw)?,
4092
4093 Self::Uint16Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4094 ___E,
4095 ::std::vec::Vec<u16>,
4096 >(value, 3, encoder, raw)?,
4097
4098 Self::Uint32Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4099 ___E,
4100 ::std::vec::Vec<u32>,
4101 >(value, 4, encoder, raw)?,
4102
4103 Self::Uint64Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4104 ___E,
4105 ::std::vec::Vec<u64>,
4106 >(value, 5, encoder, raw)?,
4107
4108 Self::Int8Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4109 ___E,
4110 ::std::vec::Vec<i8>,
4111 >(value, 6, encoder, raw)?,
4112
4113 Self::Int16Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4114 ___E,
4115 ::std::vec::Vec<i16>,
4116 >(value, 7, encoder, raw)?,
4117
4118 Self::Int32Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4119 ___E,
4120 ::std::vec::Vec<i32>,
4121 >(value, 8, encoder, raw)?,
4122
4123 Self::Int64Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4124 ___E,
4125 ::std::vec::Vec<i64>,
4126 >(value, 9, encoder, raw)?,
4127
4128 Self::StringVector(value) => ::fidl_next::RawWireUnion::encode_as::<
4129 ___E,
4130 ::std::vec::Vec<::std::string::String>,
4131 >(value, 10, encoder, raw)?,
4132
4133 Self::UnknownOrdinal_(ordinal) => {
4134 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
4135 }
4136 }
4137
4138 Ok(())
4139 }
4140}
4141
4142unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigVectorValue
4143where
4144 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4145 ___E: ::fidl_next::Encoder,
4146{
4147 #[inline]
4148 fn encode_ref(
4149 &self,
4150 encoder: &mut ___E,
4151 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4152 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4153 ::fidl_next::munge!(let WireConfigVectorValue { raw, _phantom: _ } = out);
4154
4155 match self {
4156 Self::BoolVector(value) => ::fidl_next::RawWireUnion::encode_as::<
4157 ___E,
4158 &::std::vec::Vec<bool>,
4159 >(value, 1, encoder, raw)?,
4160
4161 Self::Uint8Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4162 ___E,
4163 &::std::vec::Vec<u8>,
4164 >(value, 2, encoder, raw)?,
4165
4166 Self::Uint16Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4167 ___E,
4168 &::std::vec::Vec<u16>,
4169 >(value, 3, encoder, raw)?,
4170
4171 Self::Uint32Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4172 ___E,
4173 &::std::vec::Vec<u32>,
4174 >(value, 4, encoder, raw)?,
4175
4176 Self::Uint64Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4177 ___E,
4178 &::std::vec::Vec<u64>,
4179 >(value, 5, encoder, raw)?,
4180
4181 Self::Int8Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4182 ___E,
4183 &::std::vec::Vec<i8>,
4184 >(value, 6, encoder, raw)?,
4185
4186 Self::Int16Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4187 ___E,
4188 &::std::vec::Vec<i16>,
4189 >(value, 7, encoder, raw)?,
4190
4191 Self::Int32Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4192 ___E,
4193 &::std::vec::Vec<i32>,
4194 >(value, 8, encoder, raw)?,
4195
4196 Self::Int64Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4197 ___E,
4198 &::std::vec::Vec<i64>,
4199 >(value, 9, encoder, raw)?,
4200
4201 Self::StringVector(value) => ::fidl_next::RawWireUnion::encode_as::<
4202 ___E,
4203 &::std::vec::Vec<::std::string::String>,
4204 >(value, 10, encoder, raw)?,
4205
4206 Self::UnknownOrdinal_(ordinal) => {
4207 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
4208 }
4209 }
4210
4211 Ok(())
4212 }
4213}
4214
4215impl ::fidl_next::EncodableOption for ConfigVectorValue {
4216 type EncodedOption = WireOptionalConfigVectorValue<'static>;
4217}
4218
4219unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ConfigVectorValue
4220where
4221 ___E: ?Sized,
4222 ConfigVectorValue: ::fidl_next::Encode<___E>,
4223{
4224 #[inline]
4225 fn encode_option(
4226 this: ::core::option::Option<Self>,
4227 encoder: &mut ___E,
4228 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4229 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4230 ::fidl_next::munge!(let WireOptionalConfigVectorValue { raw, _phantom: _ } = &mut *out);
4231
4232 if let Some(inner) = this {
4233 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4234 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
4235 } else {
4236 ::fidl_next::RawWireUnion::encode_absent(raw);
4237 }
4238
4239 Ok(())
4240 }
4241}
4242
4243unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ConfigVectorValue
4244where
4245 ___E: ?Sized,
4246 ConfigVectorValue: ::fidl_next::EncodeRef<___E>,
4247{
4248 #[inline]
4249 fn encode_option_ref(
4250 this: ::core::option::Option<&Self>,
4251 encoder: &mut ___E,
4252 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4253 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4254 ::fidl_next::munge!(let WireOptionalConfigVectorValue { raw, _phantom: _ } = &mut *out);
4255
4256 if let Some(inner) = this {
4257 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4258 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
4259 } else {
4260 ::fidl_next::RawWireUnion::encode_absent(raw);
4261 }
4262
4263 Ok(())
4264 }
4265}
4266
4267impl<'de> ::fidl_next::FromWire<WireConfigVectorValue<'de>> for ConfigVectorValue {
4268 #[inline]
4269 fn from_wire(wire: WireConfigVectorValue<'de>) -> Self {
4270 let wire = ::core::mem::ManuallyDrop::new(wire);
4271 match wire.raw.ordinal() {
4272 1 => Self::BoolVector(::fidl_next::FromWire::from_wire(unsafe {
4273 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, bool>>()
4274 })),
4275
4276 2 => Self::Uint8Vector(::fidl_next::FromWire::from_wire(unsafe {
4277 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>()
4278 })),
4279
4280 3 => Self::Uint16Vector(::fidl_next::FromWire::from_wire(unsafe {
4281 wire.raw
4282 .get()
4283 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU16>>()
4284 })),
4285
4286 4 => Self::Uint32Vector(::fidl_next::FromWire::from_wire(unsafe {
4287 wire.raw
4288 .get()
4289 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU32>>()
4290 })),
4291
4292 5 => Self::Uint64Vector(::fidl_next::FromWire::from_wire(unsafe {
4293 wire.raw
4294 .get()
4295 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU64>>()
4296 })),
4297
4298 6 => Self::Int8Vector(::fidl_next::FromWire::from_wire(unsafe {
4299 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, i8>>()
4300 })),
4301
4302 7 => Self::Int16Vector(::fidl_next::FromWire::from_wire(unsafe {
4303 wire.raw
4304 .get()
4305 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI16>>()
4306 })),
4307
4308 8 => Self::Int32Vector(::fidl_next::FromWire::from_wire(unsafe {
4309 wire.raw
4310 .get()
4311 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI32>>()
4312 })),
4313
4314 9 => Self::Int64Vector(::fidl_next::FromWire::from_wire(unsafe {
4315 wire.raw
4316 .get()
4317 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI64>>()
4318 })),
4319
4320 10 => {
4321 Self::StringVector(::fidl_next::FromWire::from_wire(unsafe {
4322 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
4323 }))
4324 }
4325
4326 _ => unsafe { ::core::hint::unreachable_unchecked() },
4327 }
4328 }
4329}
4330
4331impl<'de> ::fidl_next::IntoNatural for WireConfigVectorValue<'de> {
4332 type Natural = ConfigVectorValue;
4333}
4334
4335impl<'de> ::fidl_next::FromWireRef<WireConfigVectorValue<'de>> for ConfigVectorValue {
4336 #[inline]
4337 fn from_wire_ref(wire: &WireConfigVectorValue<'de>) -> Self {
4338 match wire.raw.ordinal() {
4339 1 => Self::BoolVector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4340 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, bool>>()
4341 })),
4342
4343 2 => Self::Uint8Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4344 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
4345 })),
4346
4347 3 => Self::Uint16Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4348 wire.raw
4349 .get()
4350 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU16>>()
4351 })),
4352
4353 4 => Self::Uint32Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4354 wire.raw
4355 .get()
4356 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU32>>()
4357 })),
4358
4359 5 => Self::Uint64Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4360 wire.raw
4361 .get()
4362 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU64>>()
4363 })),
4364
4365 6 => Self::Int8Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4366 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, i8>>()
4367 })),
4368
4369 7 => Self::Int16Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4370 wire.raw
4371 .get()
4372 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI16>>()
4373 })),
4374
4375 8 => Self::Int32Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4376 wire.raw
4377 .get()
4378 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI32>>()
4379 })),
4380
4381 9 => Self::Int64Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4382 wire.raw
4383 .get()
4384 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI64>>()
4385 })),
4386
4387 10 => {
4388 Self::StringVector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4389 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
4390 }))
4391 }
4392
4393 _ => unsafe { ::core::hint::unreachable_unchecked() },
4394 }
4395 }
4396}
4397
4398impl<'de> ::fidl_next::FromWireOption<WireOptionalConfigVectorValue<'de>> for ConfigVectorValue {
4399 #[inline]
4400 fn from_wire_option(wire: WireOptionalConfigVectorValue<'de>) -> ::core::option::Option<Self> {
4401 if let Some(inner) = wire.into_option() {
4402 Some(::fidl_next::FromWire::from_wire(inner))
4403 } else {
4404 None
4405 }
4406 }
4407}
4408
4409impl<'de> ::fidl_next::IntoNatural for WireOptionalConfigVectorValue<'de> {
4410 type Natural = ::core::option::Option<ConfigVectorValue>;
4411}
4412
4413impl<'de> ::fidl_next::FromWireOption<WireOptionalConfigVectorValue<'de>>
4414 for Box<ConfigVectorValue>
4415{
4416 #[inline]
4417 fn from_wire_option(wire: WireOptionalConfigVectorValue<'de>) -> ::core::option::Option<Self> {
4418 <
4419 ConfigVectorValue as ::fidl_next::FromWireOption<WireOptionalConfigVectorValue<'de>>
4420 >::from_wire_option(wire).map(Box::new)
4421 }
4422}
4423
4424impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalConfigVectorValue<'de>>
4425 for Box<ConfigVectorValue>
4426{
4427 #[inline]
4428 fn from_wire_option_ref(
4429 wire: &WireOptionalConfigVectorValue<'de>,
4430 ) -> ::core::option::Option<Self> {
4431 if let Some(inner) = wire.as_ref() {
4432 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
4433 } else {
4434 None
4435 }
4436 }
4437}
4438
4439#[repr(transparent)]
4441pub struct WireConfigVectorValue<'de> {
4442 raw: ::fidl_next::RawWireUnion,
4443 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
4444}
4445
4446impl<'de> Drop for WireConfigVectorValue<'de> {
4447 fn drop(&mut self) {
4448 match self.raw.ordinal() {
4449 1 => {
4450 let _ = unsafe {
4451 self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, bool>>()
4452 };
4453 }
4454
4455 2 => {
4456 let _ =
4457 unsafe { self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>() };
4458 }
4459
4460 3 => {
4461 let _ = unsafe {
4462 self.raw
4463 .get()
4464 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU16>>()
4465 };
4466 }
4467
4468 4 => {
4469 let _ = unsafe {
4470 self.raw
4471 .get()
4472 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU32>>()
4473 };
4474 }
4475
4476 5 => {
4477 let _ = unsafe {
4478 self.raw
4479 .get()
4480 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU64>>()
4481 };
4482 }
4483
4484 6 => {
4485 let _ =
4486 unsafe { self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, i8>>() };
4487 }
4488
4489 7 => {
4490 let _ = unsafe {
4491 self.raw
4492 .get()
4493 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI16>>()
4494 };
4495 }
4496
4497 8 => {
4498 let _ = unsafe {
4499 self.raw
4500 .get()
4501 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI32>>()
4502 };
4503 }
4504
4505 9 => {
4506 let _ = unsafe {
4507 self.raw
4508 .get()
4509 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI64>>()
4510 };
4511 }
4512
4513 10 => {
4514 let _ = unsafe {
4515 self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
4516 };
4517 }
4518
4519 _ => (),
4520 }
4521 }
4522}
4523
4524unsafe impl ::fidl_next::Wire for WireConfigVectorValue<'static> {
4525 type Decoded<'de> = WireConfigVectorValue<'de>;
4526
4527 #[inline]
4528 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4529 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
4530 ::fidl_next::RawWireUnion::zero_padding(raw);
4531 }
4532}
4533
4534pub mod config_vector_value {
4535 pub enum Ref<'de> {
4536 BoolVector(&'de ::fidl_next::WireVector<'de, bool>),
4537
4538 Uint8Vector(&'de ::fidl_next::WireVector<'de, u8>),
4539
4540 Uint16Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireU16>),
4541
4542 Uint32Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireU32>),
4543
4544 Uint64Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireU64>),
4545
4546 Int8Vector(&'de ::fidl_next::WireVector<'de, i8>),
4547
4548 Int16Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireI16>),
4549
4550 Int32Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireI32>),
4551
4552 Int64Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireI64>),
4553
4554 StringVector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>),
4555
4556 UnknownOrdinal_(u64),
4557 }
4558}
4559
4560impl<'de> WireConfigVectorValue<'de> {
4561 pub fn as_ref(&self) -> crate::config_vector_value::Ref<'_> {
4562 match self.raw.ordinal() {
4563 1 => crate::config_vector_value::Ref::BoolVector(unsafe {
4564 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, bool>>()
4565 }),
4566
4567 2 => crate::config_vector_value::Ref::Uint8Vector(unsafe {
4568 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
4569 }),
4570
4571 3 => crate::config_vector_value::Ref::Uint16Vector(unsafe {
4572 self.raw
4573 .get()
4574 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU16>>()
4575 }),
4576
4577 4 => crate::config_vector_value::Ref::Uint32Vector(unsafe {
4578 self.raw
4579 .get()
4580 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU32>>()
4581 }),
4582
4583 5 => crate::config_vector_value::Ref::Uint64Vector(unsafe {
4584 self.raw
4585 .get()
4586 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU64>>()
4587 }),
4588
4589 6 => crate::config_vector_value::Ref::Int8Vector(unsafe {
4590 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, i8>>()
4591 }),
4592
4593 7 => crate::config_vector_value::Ref::Int16Vector(unsafe {
4594 self.raw
4595 .get()
4596 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI16>>()
4597 }),
4598
4599 8 => crate::config_vector_value::Ref::Int32Vector(unsafe {
4600 self.raw
4601 .get()
4602 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI32>>()
4603 }),
4604
4605 9 => crate::config_vector_value::Ref::Int64Vector(unsafe {
4606 self.raw
4607 .get()
4608 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI64>>()
4609 }),
4610
4611 10 => {
4612 crate::config_vector_value::Ref::StringVector(unsafe {
4613 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireString<'_>>>()
4614 })
4615 }
4616
4617 unknown => crate::config_vector_value::Ref::UnknownOrdinal_(unknown),
4618 }
4619 }
4620}
4621
4622unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigVectorValue<'static>
4623where
4624 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4625 ___D: ::fidl_next::Decoder,
4626{
4627 fn decode(
4628 mut slot: ::fidl_next::Slot<'_, Self>,
4629 decoder: &mut ___D,
4630 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4631 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
4632 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
4633 1 => ::fidl_next::RawWireUnion::decode_as::<
4634 ___D,
4635 ::fidl_next::WireVector<'static, bool>,
4636 >(raw, decoder)?,
4637
4638 2 => {
4639 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
4640 raw, decoder,
4641 )?
4642 }
4643
4644 3 => ::fidl_next::RawWireUnion::decode_as::<
4645 ___D,
4646 ::fidl_next::WireVector<'static, ::fidl_next::WireU16>,
4647 >(raw, decoder)?,
4648
4649 4 => ::fidl_next::RawWireUnion::decode_as::<
4650 ___D,
4651 ::fidl_next::WireVector<'static, ::fidl_next::WireU32>,
4652 >(raw, decoder)?,
4653
4654 5 => ::fidl_next::RawWireUnion::decode_as::<
4655 ___D,
4656 ::fidl_next::WireVector<'static, ::fidl_next::WireU64>,
4657 >(raw, decoder)?,
4658
4659 6 => {
4660 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, i8>>(
4661 raw, decoder,
4662 )?
4663 }
4664
4665 7 => ::fidl_next::RawWireUnion::decode_as::<
4666 ___D,
4667 ::fidl_next::WireVector<'static, ::fidl_next::WireI16>,
4668 >(raw, decoder)?,
4669
4670 8 => ::fidl_next::RawWireUnion::decode_as::<
4671 ___D,
4672 ::fidl_next::WireVector<'static, ::fidl_next::WireI32>,
4673 >(raw, decoder)?,
4674
4675 9 => ::fidl_next::RawWireUnion::decode_as::<
4676 ___D,
4677 ::fidl_next::WireVector<'static, ::fidl_next::WireI64>,
4678 >(raw, decoder)?,
4679
4680 10 => ::fidl_next::RawWireUnion::decode_as::<
4681 ___D,
4682 ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
4683 >(raw, decoder)?,
4684
4685 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
4686 }
4687
4688 Ok(())
4689 }
4690}
4691
4692impl<'de> ::core::fmt::Debug for WireConfigVectorValue<'de> {
4693 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4694 match self.raw.ordinal() {
4695 1 => unsafe {
4696 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, bool>>().fmt(f)
4697 },
4698 2 => unsafe {
4699 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>().fmt(f)
4700 },
4701 3 => unsafe {
4702 self.raw
4703 .get()
4704 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU16>>()
4705 .fmt(f)
4706 },
4707 4 => unsafe {
4708 self.raw
4709 .get()
4710 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU32>>()
4711 .fmt(f)
4712 },
4713 5 => unsafe {
4714 self.raw
4715 .get()
4716 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU64>>()
4717 .fmt(f)
4718 },
4719 6 => unsafe {
4720 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, i8>>().fmt(f)
4721 },
4722 7 => unsafe {
4723 self.raw
4724 .get()
4725 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI16>>()
4726 .fmt(f)
4727 },
4728 8 => unsafe {
4729 self.raw
4730 .get()
4731 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI32>>()
4732 .fmt(f)
4733 },
4734 9 => unsafe {
4735 self.raw
4736 .get()
4737 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI64>>()
4738 .fmt(f)
4739 },
4740 10 => unsafe {
4741 self.raw
4742 .get()
4743 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireString<'_>>>()
4744 .fmt(f)
4745 },
4746 _ => unsafe { ::core::hint::unreachable_unchecked() },
4747 }
4748 }
4749}
4750
4751#[repr(transparent)]
4752pub struct WireOptionalConfigVectorValue<'de> {
4753 raw: ::fidl_next::RawWireUnion,
4754 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
4755}
4756
4757unsafe impl ::fidl_next::Wire for WireOptionalConfigVectorValue<'static> {
4758 type Decoded<'de> = WireOptionalConfigVectorValue<'de>;
4759
4760 #[inline]
4761 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4762 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
4763 ::fidl_next::RawWireUnion::zero_padding(raw);
4764 }
4765}
4766
4767impl<'de> WireOptionalConfigVectorValue<'de> {
4768 pub fn is_some(&self) -> bool {
4769 self.raw.is_some()
4770 }
4771
4772 pub fn is_none(&self) -> bool {
4773 self.raw.is_none()
4774 }
4775
4776 pub fn as_ref(&self) -> ::core::option::Option<&WireConfigVectorValue<'de>> {
4777 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
4778 }
4779
4780 pub fn into_option(self) -> ::core::option::Option<WireConfigVectorValue<'de>> {
4781 if self.is_some() {
4782 Some(WireConfigVectorValue { raw: self.raw, _phantom: ::core::marker::PhantomData })
4783 } else {
4784 None
4785 }
4786 }
4787}
4788
4789unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConfigVectorValue<'static>
4790where
4791 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4792 ___D: ::fidl_next::Decoder,
4793{
4794 fn decode(
4795 mut slot: ::fidl_next::Slot<'_, Self>,
4796 decoder: &mut ___D,
4797 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
4798 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
4799 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
4800 1 => ::fidl_next::RawWireUnion::decode_as::<
4801 ___D,
4802 ::fidl_next::WireVector<'static, bool>,
4803 >(raw, decoder)?,
4804
4805 2 => {
4806 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, u8>>(
4807 raw, decoder,
4808 )?
4809 }
4810
4811 3 => ::fidl_next::RawWireUnion::decode_as::<
4812 ___D,
4813 ::fidl_next::WireVector<'static, ::fidl_next::WireU16>,
4814 >(raw, decoder)?,
4815
4816 4 => ::fidl_next::RawWireUnion::decode_as::<
4817 ___D,
4818 ::fidl_next::WireVector<'static, ::fidl_next::WireU32>,
4819 >(raw, decoder)?,
4820
4821 5 => ::fidl_next::RawWireUnion::decode_as::<
4822 ___D,
4823 ::fidl_next::WireVector<'static, ::fidl_next::WireU64>,
4824 >(raw, decoder)?,
4825
4826 6 => {
4827 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<'static, i8>>(
4828 raw, decoder,
4829 )?
4830 }
4831
4832 7 => ::fidl_next::RawWireUnion::decode_as::<
4833 ___D,
4834 ::fidl_next::WireVector<'static, ::fidl_next::WireI16>,
4835 >(raw, decoder)?,
4836
4837 8 => ::fidl_next::RawWireUnion::decode_as::<
4838 ___D,
4839 ::fidl_next::WireVector<'static, ::fidl_next::WireI32>,
4840 >(raw, decoder)?,
4841
4842 9 => ::fidl_next::RawWireUnion::decode_as::<
4843 ___D,
4844 ::fidl_next::WireVector<'static, ::fidl_next::WireI64>,
4845 >(raw, decoder)?,
4846
4847 10 => ::fidl_next::RawWireUnion::decode_as::<
4848 ___D,
4849 ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
4850 >(raw, decoder)?,
4851
4852 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
4853 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
4854 }
4855
4856 Ok(())
4857 }
4858}
4859
4860impl<'de> ::core::fmt::Debug for WireOptionalConfigVectorValue<'de> {
4861 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4862 self.as_ref().fmt(f)
4863 }
4864}
4865
4866#[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"]
4867#[derive(PartialEq, Clone, Debug)]
4868pub enum ConfigValue {
4869 Single(crate::ConfigSingleValue),
4870
4871 Vector(crate::ConfigVectorValue),
4872
4873 UnknownOrdinal_(u64),
4874}
4875
4876impl ::fidl_next::Encodable for ConfigValue {
4877 type Encoded = WireConfigValue<'static>;
4878}
4879
4880unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigValue
4881where
4882 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4883 ___E: ::fidl_next::Encoder,
4884{
4885 #[inline]
4886 fn encode(
4887 self,
4888 encoder: &mut ___E,
4889 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4890 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4891 ::fidl_next::munge!(let WireConfigValue { raw, _phantom: _ } = out);
4892
4893 match self {
4894 Self::Single(value) => ::fidl_next::RawWireUnion::encode_as::<
4895 ___E,
4896 crate::ConfigSingleValue,
4897 >(value, 1, encoder, raw)?,
4898
4899 Self::Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4900 ___E,
4901 crate::ConfigVectorValue,
4902 >(value, 2, encoder, raw)?,
4903
4904 Self::UnknownOrdinal_(ordinal) => {
4905 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
4906 }
4907 }
4908
4909 Ok(())
4910 }
4911}
4912
4913unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigValue
4914where
4915 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4916 ___E: ::fidl_next::Encoder,
4917{
4918 #[inline]
4919 fn encode_ref(
4920 &self,
4921 encoder: &mut ___E,
4922 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4923 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4924 ::fidl_next::munge!(let WireConfigValue { raw, _phantom: _ } = out);
4925
4926 match self {
4927 Self::Single(value) => ::fidl_next::RawWireUnion::encode_as::<
4928 ___E,
4929 &crate::ConfigSingleValue,
4930 >(value, 1, encoder, raw)?,
4931
4932 Self::Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
4933 ___E,
4934 &crate::ConfigVectorValue,
4935 >(value, 2, encoder, raw)?,
4936
4937 Self::UnknownOrdinal_(ordinal) => {
4938 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
4939 }
4940 }
4941
4942 Ok(())
4943 }
4944}
4945
4946impl ::fidl_next::EncodableOption for ConfigValue {
4947 type EncodedOption = WireOptionalConfigValue<'static>;
4948}
4949
4950unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ConfigValue
4951where
4952 ___E: ?Sized,
4953 ConfigValue: ::fidl_next::Encode<___E>,
4954{
4955 #[inline]
4956 fn encode_option(
4957 this: ::core::option::Option<Self>,
4958 encoder: &mut ___E,
4959 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4960 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4961 ::fidl_next::munge!(let WireOptionalConfigValue { raw, _phantom: _ } = &mut *out);
4962
4963 if let Some(inner) = this {
4964 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4965 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
4966 } else {
4967 ::fidl_next::RawWireUnion::encode_absent(raw);
4968 }
4969
4970 Ok(())
4971 }
4972}
4973
4974unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ConfigValue
4975where
4976 ___E: ?Sized,
4977 ConfigValue: ::fidl_next::EncodeRef<___E>,
4978{
4979 #[inline]
4980 fn encode_option_ref(
4981 this: ::core::option::Option<&Self>,
4982 encoder: &mut ___E,
4983 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4984 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4985 ::fidl_next::munge!(let WireOptionalConfigValue { raw, _phantom: _ } = &mut *out);
4986
4987 if let Some(inner) = this {
4988 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4989 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
4990 } else {
4991 ::fidl_next::RawWireUnion::encode_absent(raw);
4992 }
4993
4994 Ok(())
4995 }
4996}
4997
4998impl<'de> ::fidl_next::FromWire<WireConfigValue<'de>> for ConfigValue {
4999 #[inline]
5000 fn from_wire(wire: WireConfigValue<'de>) -> Self {
5001 let wire = ::core::mem::ManuallyDrop::new(wire);
5002 match wire.raw.ordinal() {
5003 1 => Self::Single(::fidl_next::FromWire::from_wire(unsafe {
5004 wire.raw.get().read_unchecked::<crate::WireConfigSingleValue<'de>>()
5005 })),
5006
5007 2 => Self::Vector(::fidl_next::FromWire::from_wire(unsafe {
5008 wire.raw.get().read_unchecked::<crate::WireConfigVectorValue<'de>>()
5009 })),
5010
5011 _ => unsafe { ::core::hint::unreachable_unchecked() },
5012 }
5013 }
5014}
5015
5016impl<'de> ::fidl_next::IntoNatural for WireConfigValue<'de> {
5017 type Natural = ConfigValue;
5018}
5019
5020impl<'de> ::fidl_next::FromWireRef<WireConfigValue<'de>> for ConfigValue {
5021 #[inline]
5022 fn from_wire_ref(wire: &WireConfigValue<'de>) -> Self {
5023 match wire.raw.ordinal() {
5024 1 => Self::Single(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5025 wire.raw.get().deref_unchecked::<crate::WireConfigSingleValue<'de>>()
5026 })),
5027
5028 2 => Self::Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5029 wire.raw.get().deref_unchecked::<crate::WireConfigVectorValue<'de>>()
5030 })),
5031
5032 _ => unsafe { ::core::hint::unreachable_unchecked() },
5033 }
5034 }
5035}
5036
5037impl<'de> ::fidl_next::FromWireOption<WireOptionalConfigValue<'de>> for ConfigValue {
5038 #[inline]
5039 fn from_wire_option(wire: WireOptionalConfigValue<'de>) -> ::core::option::Option<Self> {
5040 if let Some(inner) = wire.into_option() {
5041 Some(::fidl_next::FromWire::from_wire(inner))
5042 } else {
5043 None
5044 }
5045 }
5046}
5047
5048impl<'de> ::fidl_next::IntoNatural for WireOptionalConfigValue<'de> {
5049 type Natural = ::core::option::Option<ConfigValue>;
5050}
5051
5052impl<'de> ::fidl_next::FromWireOption<WireOptionalConfigValue<'de>> for Box<ConfigValue> {
5053 #[inline]
5054 fn from_wire_option(wire: WireOptionalConfigValue<'de>) -> ::core::option::Option<Self> {
5055 <
5056 ConfigValue as ::fidl_next::FromWireOption<WireOptionalConfigValue<'de>>
5057 >::from_wire_option(wire).map(Box::new)
5058 }
5059}
5060
5061impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalConfigValue<'de>> for Box<ConfigValue> {
5062 #[inline]
5063 fn from_wire_option_ref(wire: &WireOptionalConfigValue<'de>) -> ::core::option::Option<Self> {
5064 if let Some(inner) = wire.as_ref() {
5065 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
5066 } else {
5067 None
5068 }
5069 }
5070}
5071
5072#[repr(transparent)]
5074pub struct WireConfigValue<'de> {
5075 raw: ::fidl_next::RawWireUnion,
5076 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
5077}
5078
5079impl<'de> Drop for WireConfigValue<'de> {
5080 fn drop(&mut self) {
5081 match self.raw.ordinal() {
5082 1 => {
5083 let _ =
5084 unsafe { self.raw.get().read_unchecked::<crate::WireConfigSingleValue<'de>>() };
5085 }
5086
5087 2 => {
5088 let _ =
5089 unsafe { self.raw.get().read_unchecked::<crate::WireConfigVectorValue<'de>>() };
5090 }
5091
5092 _ => (),
5093 }
5094 }
5095}
5096
5097unsafe impl ::fidl_next::Wire for WireConfigValue<'static> {
5098 type Decoded<'de> = WireConfigValue<'de>;
5099
5100 #[inline]
5101 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5102 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
5103 ::fidl_next::RawWireUnion::zero_padding(raw);
5104 }
5105}
5106
5107pub mod config_value {
5108 pub enum Ref<'de> {
5109 Single(&'de crate::WireConfigSingleValue<'de>),
5110
5111 Vector(&'de crate::WireConfigVectorValue<'de>),
5112
5113 UnknownOrdinal_(u64),
5114 }
5115}
5116
5117impl<'de> WireConfigValue<'de> {
5118 pub fn as_ref(&self) -> crate::config_value::Ref<'_> {
5119 match self.raw.ordinal() {
5120 1 => crate::config_value::Ref::Single(unsafe {
5121 self.raw.get().deref_unchecked::<crate::WireConfigSingleValue<'_>>()
5122 }),
5123
5124 2 => crate::config_value::Ref::Vector(unsafe {
5125 self.raw.get().deref_unchecked::<crate::WireConfigVectorValue<'_>>()
5126 }),
5127
5128 unknown => crate::config_value::Ref::UnknownOrdinal_(unknown),
5129 }
5130 }
5131}
5132
5133unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigValue<'static>
5134where
5135 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5136 ___D: ::fidl_next::Decoder,
5137{
5138 fn decode(
5139 mut slot: ::fidl_next::Slot<'_, Self>,
5140 decoder: &mut ___D,
5141 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5142 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
5143 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5144 1 => {
5145 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigSingleValue<'static>>(
5146 raw, decoder,
5147 )?
5148 }
5149
5150 2 => {
5151 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigVectorValue<'static>>(
5152 raw, decoder,
5153 )?
5154 }
5155
5156 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5157 }
5158
5159 Ok(())
5160 }
5161}
5162
5163impl<'de> ::core::fmt::Debug for WireConfigValue<'de> {
5164 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5165 match self.raw.ordinal() {
5166 1 => unsafe {
5167 self.raw.get().deref_unchecked::<crate::WireConfigSingleValue<'_>>().fmt(f)
5168 },
5169 2 => unsafe {
5170 self.raw.get().deref_unchecked::<crate::WireConfigVectorValue<'_>>().fmt(f)
5171 },
5172 _ => unsafe { ::core::hint::unreachable_unchecked() },
5173 }
5174 }
5175}
5176
5177#[repr(transparent)]
5178pub struct WireOptionalConfigValue<'de> {
5179 raw: ::fidl_next::RawWireUnion,
5180 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
5181}
5182
5183unsafe impl ::fidl_next::Wire for WireOptionalConfigValue<'static> {
5184 type Decoded<'de> = WireOptionalConfigValue<'de>;
5185
5186 #[inline]
5187 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5188 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
5189 ::fidl_next::RawWireUnion::zero_padding(raw);
5190 }
5191}
5192
5193impl<'de> WireOptionalConfigValue<'de> {
5194 pub fn is_some(&self) -> bool {
5195 self.raw.is_some()
5196 }
5197
5198 pub fn is_none(&self) -> bool {
5199 self.raw.is_none()
5200 }
5201
5202 pub fn as_ref(&self) -> ::core::option::Option<&WireConfigValue<'de>> {
5203 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
5204 }
5205
5206 pub fn into_option(self) -> ::core::option::Option<WireConfigValue<'de>> {
5207 if self.is_some() {
5208 Some(WireConfigValue { raw: self.raw, _phantom: ::core::marker::PhantomData })
5209 } else {
5210 None
5211 }
5212 }
5213}
5214
5215unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConfigValue<'static>
5216where
5217 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5218 ___D: ::fidl_next::Decoder,
5219{
5220 fn decode(
5221 mut slot: ::fidl_next::Slot<'_, Self>,
5222 decoder: &mut ___D,
5223 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5224 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
5225 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5226 1 => {
5227 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigSingleValue<'static>>(
5228 raw, decoder,
5229 )?
5230 }
5231
5232 2 => {
5233 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigVectorValue<'static>>(
5234 raw, decoder,
5235 )?
5236 }
5237
5238 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
5239 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5240 }
5241
5242 Ok(())
5243 }
5244}
5245
5246impl<'de> ::core::fmt::Debug for WireOptionalConfigValue<'de> {
5247 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5248 self.as_ref().fmt(f)
5249 }
5250}
5251
5252#[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"]
5253#[derive(PartialEq, Clone, Debug, Default)]
5254pub struct Configuration {
5255 pub name: ::core::option::Option<::std::string::String>,
5256
5257 pub value: ::core::option::Option<crate::ConfigValue>,
5258}
5259
5260impl Configuration {
5261 fn __max_ordinal(&self) -> usize {
5262 if self.value.is_some() {
5263 return 2;
5264 }
5265
5266 if self.name.is_some() {
5267 return 1;
5268 }
5269
5270 0
5271 }
5272}
5273
5274impl ::fidl_next::Encodable for Configuration {
5275 type Encoded = WireConfiguration<'static>;
5276}
5277
5278unsafe impl<___E> ::fidl_next::Encode<___E> for Configuration
5279where
5280 ___E: ::fidl_next::Encoder + ?Sized,
5281{
5282 #[inline]
5283 fn encode(
5284 mut self,
5285 encoder: &mut ___E,
5286 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5287 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5288 ::fidl_next::munge!(let WireConfiguration { table } = out);
5289
5290 let max_ord = self.__max_ordinal();
5291
5292 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5293 ::fidl_next::Wire::zero_padding(&mut out);
5294
5295 let mut preallocated =
5296 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5297
5298 for i in 1..=max_ord {
5299 match i {
5300 2 => {
5301 if let Some(value) = self.value.take() {
5302 ::fidl_next::WireEnvelope::encode_value(
5303 value,
5304 preallocated.encoder,
5305 &mut out,
5306 )?;
5307 } else {
5308 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5309 }
5310 }
5311
5312 1 => {
5313 if let Some(value) = self.name.take() {
5314 ::fidl_next::WireEnvelope::encode_value(
5315 value,
5316 preallocated.encoder,
5317 &mut out,
5318 )?;
5319 } else {
5320 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5321 }
5322 }
5323
5324 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5325 }
5326 unsafe {
5327 preallocated.write_next(out.assume_init_ref());
5328 }
5329 }
5330
5331 ::fidl_next::WireTable::encode_len(table, max_ord);
5332
5333 Ok(())
5334 }
5335}
5336
5337unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Configuration
5338where
5339 ___E: ::fidl_next::Encoder + ?Sized,
5340{
5341 #[inline]
5342 fn encode_ref(
5343 &self,
5344 encoder: &mut ___E,
5345 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5346 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5347 ::fidl_next::munge!(let WireConfiguration { table } = out);
5348
5349 let max_ord = self.__max_ordinal();
5350
5351 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5352 ::fidl_next::Wire::zero_padding(&mut out);
5353
5354 let mut preallocated =
5355 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5356
5357 for i in 1..=max_ord {
5358 match i {
5359 2 => {
5360 if let Some(value) = &self.value {
5361 ::fidl_next::WireEnvelope::encode_value(
5362 value,
5363 preallocated.encoder,
5364 &mut out,
5365 )?;
5366 } else {
5367 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5368 }
5369 }
5370
5371 1 => {
5372 if let Some(value) = &self.name {
5373 ::fidl_next::WireEnvelope::encode_value(
5374 value,
5375 preallocated.encoder,
5376 &mut out,
5377 )?;
5378 } else {
5379 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5380 }
5381 }
5382
5383 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5384 }
5385 unsafe {
5386 preallocated.write_next(out.assume_init_ref());
5387 }
5388 }
5389
5390 ::fidl_next::WireTable::encode_len(table, max_ord);
5391
5392 Ok(())
5393 }
5394}
5395
5396impl<'de> ::fidl_next::FromWire<WireConfiguration<'de>> for Configuration {
5397 #[inline]
5398 fn from_wire(wire_: WireConfiguration<'de>) -> Self {
5399 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5400
5401 let name = wire_.table.get(1);
5402
5403 let value = wire_.table.get(2);
5404
5405 Self {
5406 name: name.map(|envelope| {
5407 ::fidl_next::FromWire::from_wire(unsafe {
5408 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
5409 })
5410 }),
5411
5412 value: value.map(|envelope| {
5413 ::fidl_next::FromWire::from_wire(unsafe {
5414 envelope.read_unchecked::<crate::WireConfigValue<'de>>()
5415 })
5416 }),
5417 }
5418 }
5419}
5420
5421impl<'de> ::fidl_next::IntoNatural for WireConfiguration<'de> {
5422 type Natural = Configuration;
5423}
5424
5425impl<'de> ::fidl_next::FromWireRef<WireConfiguration<'de>> for Configuration {
5426 #[inline]
5427 fn from_wire_ref(wire: &WireConfiguration<'de>) -> Self {
5428 Self {
5429 name: wire.table.get(1).map(|envelope| {
5430 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5431 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
5432 })
5433 }),
5434
5435 value: wire.table.get(2).map(|envelope| {
5436 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5437 envelope.deref_unchecked::<crate::WireConfigValue<'de>>()
5438 })
5439 }),
5440 }
5441 }
5442}
5443
5444#[repr(C)]
5446pub struct WireConfiguration<'de> {
5447 table: ::fidl_next::WireTable<'de>,
5448}
5449
5450impl<'de> Drop for WireConfiguration<'de> {
5451 fn drop(&mut self) {
5452 let _ = self
5453 .table
5454 .get(1)
5455 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
5456
5457 let _ = self
5458 .table
5459 .get(2)
5460 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigValue<'de>>() });
5461 }
5462}
5463
5464unsafe impl ::fidl_next::Wire for WireConfiguration<'static> {
5465 type Decoded<'de> = WireConfiguration<'de>;
5466
5467 #[inline]
5468 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5469 ::fidl_next::munge!(let Self { table } = out);
5470 ::fidl_next::WireTable::zero_padding(table);
5471 }
5472}
5473
5474unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfiguration<'static>
5475where
5476 ___D: ::fidl_next::Decoder + ?Sized,
5477{
5478 fn decode(
5479 slot: ::fidl_next::Slot<'_, Self>,
5480 decoder: &mut ___D,
5481 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5482 ::fidl_next::munge!(let Self { table } = slot);
5483
5484 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5485 match ordinal {
5486 0 => unsafe { ::core::hint::unreachable_unchecked() },
5487
5488 1 => {
5489 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
5490 slot.as_mut(),
5491 decoder,
5492 )?;
5493
5494 let value = unsafe {
5495 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
5496 };
5497
5498 if value.len() > 100 {
5499 return Err(::fidl_next::DecodeError::VectorTooLong {
5500 size: value.len() as u64,
5501 limit: 100,
5502 });
5503 }
5504
5505 Ok(())
5506 }
5507
5508 2 => {
5509 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigValue<'static>>(
5510 slot.as_mut(),
5511 decoder,
5512 )?;
5513
5514 Ok(())
5515 }
5516
5517 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
5518 }
5519 })
5520 }
5521}
5522
5523impl<'de> WireConfiguration<'de> {
5524 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
5525 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5526 }
5527
5528 pub fn value(&self) -> ::core::option::Option<&crate::WireConfigValue<'de>> {
5529 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5530 }
5531}
5532
5533impl<'de> ::core::fmt::Debug for WireConfiguration<'de> {
5534 fn fmt(
5535 &self,
5536 f: &mut ::core::fmt::Formatter<'_>,
5537 ) -> ::core::result::Result<(), ::core::fmt::Error> {
5538 f.debug_struct("Configuration")
5539 .field("name", &self.name())
5540 .field("value", &self.value())
5541 .finish()
5542 }
5543}
5544
5545#[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"]
5546pub type DictionaryPath = ::std::string::String;
5547
5548pub type WireDictionaryPath<'de> = ::fidl_next::WireString<'de>;
5550
5551#[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"]
5552#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5553#[repr(u32)]
5554pub enum DeliveryType {
5555 Immediate = 0,
5556 OnReadable = 1,
5557 UnknownOrdinal_(u32) = 2,
5558}
5559
5560impl ::fidl_next::Encodable for DeliveryType {
5561 type Encoded = WireDeliveryType;
5562}
5563impl ::std::convert::From<u32> for DeliveryType {
5564 fn from(value: u32) -> Self {
5565 match value {
5566 0 => Self::Immediate,
5567 1 => Self::OnReadable,
5568
5569 _ => Self::UnknownOrdinal_(value),
5570 }
5571 }
5572}
5573
5574unsafe impl<___E> ::fidl_next::Encode<___E> for DeliveryType
5575where
5576 ___E: ?Sized,
5577{
5578 #[inline]
5579 fn encode(
5580 self,
5581 encoder: &mut ___E,
5582 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5583 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5584 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
5585 }
5586}
5587
5588unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DeliveryType
5589where
5590 ___E: ?Sized,
5591{
5592 #[inline]
5593 fn encode_ref(
5594 &self,
5595 encoder: &mut ___E,
5596 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5597 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5598 ::fidl_next::munge!(let WireDeliveryType { value } = out);
5599 let _ = value.write(::fidl_next::WireU32::from(match *self {
5600 Self::Immediate => 0,
5601
5602 Self::OnReadable => 1,
5603
5604 Self::UnknownOrdinal_(value) => value,
5605 }));
5606
5607 Ok(())
5608 }
5609}
5610
5611impl ::core::convert::From<WireDeliveryType> for DeliveryType {
5612 fn from(wire: WireDeliveryType) -> Self {
5613 match u32::from(wire.value) {
5614 0 => Self::Immediate,
5615
5616 1 => Self::OnReadable,
5617
5618 value => Self::UnknownOrdinal_(value),
5619 }
5620 }
5621}
5622
5623impl ::fidl_next::FromWire<WireDeliveryType> for DeliveryType {
5624 #[inline]
5625 fn from_wire(wire: WireDeliveryType) -> Self {
5626 Self::from(wire)
5627 }
5628}
5629
5630impl ::fidl_next::IntoNatural for WireDeliveryType {
5631 type Natural = DeliveryType;
5632}
5633
5634impl ::fidl_next::FromWireRef<WireDeliveryType> for DeliveryType {
5635 #[inline]
5636 fn from_wire_ref(wire: &WireDeliveryType) -> Self {
5637 Self::from(*wire)
5638 }
5639}
5640
5641#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5643#[repr(transparent)]
5644pub struct WireDeliveryType {
5645 value: ::fidl_next::WireU32,
5646}
5647
5648unsafe impl ::fidl_next::Wire for WireDeliveryType {
5649 type Decoded<'de> = Self;
5650
5651 #[inline]
5652 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5653 }
5655}
5656
5657impl WireDeliveryType {
5658 pub const IMMEDIATE: WireDeliveryType = WireDeliveryType { value: ::fidl_next::WireU32(0) };
5659
5660 pub const ON_READABLE: WireDeliveryType = WireDeliveryType { value: ::fidl_next::WireU32(1) };
5661}
5662
5663unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeliveryType
5664where
5665 ___D: ?Sized,
5666{
5667 fn decode(
5668 slot: ::fidl_next::Slot<'_, Self>,
5669 _: &mut ___D,
5670 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5671 Ok(())
5672 }
5673}
5674
5675impl ::core::convert::From<DeliveryType> for WireDeliveryType {
5676 fn from(natural: DeliveryType) -> Self {
5677 match natural {
5678 DeliveryType::Immediate => WireDeliveryType::IMMEDIATE,
5679
5680 DeliveryType::OnReadable => WireDeliveryType::ON_READABLE,
5681
5682 DeliveryType::UnknownOrdinal_(value) => {
5683 WireDeliveryType { value: ::fidl_next::WireU32::from(value) }
5684 }
5685 }
5686 }
5687}
5688
5689#[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"]
5690#[derive(PartialEq, Clone, Debug, Default)]
5691pub struct Protocol {
5692 pub name: ::core::option::Option<::std::string::String>,
5693
5694 pub source_path: ::core::option::Option<::std::string::String>,
5695
5696 pub delivery: ::core::option::Option<crate::DeliveryType>,
5697}
5698
5699impl Protocol {
5700 fn __max_ordinal(&self) -> usize {
5701 if self.delivery.is_some() {
5702 return 3;
5703 }
5704
5705 if self.source_path.is_some() {
5706 return 2;
5707 }
5708
5709 if self.name.is_some() {
5710 return 1;
5711 }
5712
5713 0
5714 }
5715}
5716
5717impl ::fidl_next::Encodable for Protocol {
5718 type Encoded = WireProtocol<'static>;
5719}
5720
5721unsafe impl<___E> ::fidl_next::Encode<___E> for Protocol
5722where
5723 ___E: ::fidl_next::Encoder + ?Sized,
5724{
5725 #[inline]
5726 fn encode(
5727 mut self,
5728 encoder: &mut ___E,
5729 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5730 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5731 ::fidl_next::munge!(let WireProtocol { table } = out);
5732
5733 let max_ord = self.__max_ordinal();
5734
5735 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5736 ::fidl_next::Wire::zero_padding(&mut out);
5737
5738 let mut preallocated =
5739 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5740
5741 for i in 1..=max_ord {
5742 match i {
5743 3 => {
5744 if let Some(value) = self.delivery.take() {
5745 ::fidl_next::WireEnvelope::encode_value(
5746 value,
5747 preallocated.encoder,
5748 &mut out,
5749 )?;
5750 } else {
5751 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5752 }
5753 }
5754
5755 2 => {
5756 if let Some(value) = self.source_path.take() {
5757 ::fidl_next::WireEnvelope::encode_value(
5758 value,
5759 preallocated.encoder,
5760 &mut out,
5761 )?;
5762 } else {
5763 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5764 }
5765 }
5766
5767 1 => {
5768 if let Some(value) = self.name.take() {
5769 ::fidl_next::WireEnvelope::encode_value(
5770 value,
5771 preallocated.encoder,
5772 &mut out,
5773 )?;
5774 } else {
5775 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5776 }
5777 }
5778
5779 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5780 }
5781 unsafe {
5782 preallocated.write_next(out.assume_init_ref());
5783 }
5784 }
5785
5786 ::fidl_next::WireTable::encode_len(table, max_ord);
5787
5788 Ok(())
5789 }
5790}
5791
5792unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Protocol
5793where
5794 ___E: ::fidl_next::Encoder + ?Sized,
5795{
5796 #[inline]
5797 fn encode_ref(
5798 &self,
5799 encoder: &mut ___E,
5800 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5801 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5802 ::fidl_next::munge!(let WireProtocol { table } = out);
5803
5804 let max_ord = self.__max_ordinal();
5805
5806 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5807 ::fidl_next::Wire::zero_padding(&mut out);
5808
5809 let mut preallocated =
5810 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5811
5812 for i in 1..=max_ord {
5813 match i {
5814 3 => {
5815 if let Some(value) = &self.delivery {
5816 ::fidl_next::WireEnvelope::encode_value(
5817 value,
5818 preallocated.encoder,
5819 &mut out,
5820 )?;
5821 } else {
5822 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5823 }
5824 }
5825
5826 2 => {
5827 if let Some(value) = &self.source_path {
5828 ::fidl_next::WireEnvelope::encode_value(
5829 value,
5830 preallocated.encoder,
5831 &mut out,
5832 )?;
5833 } else {
5834 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5835 }
5836 }
5837
5838 1 => {
5839 if let Some(value) = &self.name {
5840 ::fidl_next::WireEnvelope::encode_value(
5841 value,
5842 preallocated.encoder,
5843 &mut out,
5844 )?;
5845 } else {
5846 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5847 }
5848 }
5849
5850 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5851 }
5852 unsafe {
5853 preallocated.write_next(out.assume_init_ref());
5854 }
5855 }
5856
5857 ::fidl_next::WireTable::encode_len(table, max_ord);
5858
5859 Ok(())
5860 }
5861}
5862
5863impl<'de> ::fidl_next::FromWire<WireProtocol<'de>> for Protocol {
5864 #[inline]
5865 fn from_wire(wire_: WireProtocol<'de>) -> Self {
5866 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5867
5868 let name = wire_.table.get(1);
5869
5870 let source_path = wire_.table.get(2);
5871
5872 let delivery = wire_.table.get(3);
5873
5874 Self {
5875 name: name.map(|envelope| {
5876 ::fidl_next::FromWire::from_wire(unsafe {
5877 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
5878 })
5879 }),
5880
5881 source_path: source_path.map(|envelope| {
5882 ::fidl_next::FromWire::from_wire(unsafe {
5883 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
5884 })
5885 }),
5886
5887 delivery: delivery.map(|envelope| {
5888 ::fidl_next::FromWire::from_wire(unsafe {
5889 envelope.read_unchecked::<crate::WireDeliveryType>()
5890 })
5891 }),
5892 }
5893 }
5894}
5895
5896impl<'de> ::fidl_next::IntoNatural for WireProtocol<'de> {
5897 type Natural = Protocol;
5898}
5899
5900impl<'de> ::fidl_next::FromWireRef<WireProtocol<'de>> for Protocol {
5901 #[inline]
5902 fn from_wire_ref(wire: &WireProtocol<'de>) -> Self {
5903 Self {
5904 name: wire.table.get(1).map(|envelope| {
5905 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5906 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
5907 })
5908 }),
5909
5910 source_path: wire.table.get(2).map(|envelope| {
5911 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5912 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
5913 })
5914 }),
5915
5916 delivery: wire.table.get(3).map(|envelope| {
5917 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5918 envelope.deref_unchecked::<crate::WireDeliveryType>()
5919 })
5920 }),
5921 }
5922 }
5923}
5924
5925#[repr(C)]
5927pub struct WireProtocol<'de> {
5928 table: ::fidl_next::WireTable<'de>,
5929}
5930
5931impl<'de> Drop for WireProtocol<'de> {
5932 fn drop(&mut self) {
5933 let _ = self
5934 .table
5935 .get(1)
5936 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
5937
5938 let _ = self
5939 .table
5940 .get(2)
5941 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
5942
5943 let _ = self
5944 .table
5945 .get(3)
5946 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDeliveryType>() });
5947 }
5948}
5949
5950unsafe impl ::fidl_next::Wire for WireProtocol<'static> {
5951 type Decoded<'de> = WireProtocol<'de>;
5952
5953 #[inline]
5954 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5955 ::fidl_next::munge!(let Self { table } = out);
5956 ::fidl_next::WireTable::zero_padding(table);
5957 }
5958}
5959
5960unsafe impl<___D> ::fidl_next::Decode<___D> for WireProtocol<'static>
5961where
5962 ___D: ::fidl_next::Decoder + ?Sized,
5963{
5964 fn decode(
5965 slot: ::fidl_next::Slot<'_, Self>,
5966 decoder: &mut ___D,
5967 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
5968 ::fidl_next::munge!(let Self { table } = slot);
5969
5970 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5971 match ordinal {
5972 0 => unsafe { ::core::hint::unreachable_unchecked() },
5973
5974 1 => {
5975 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
5976 slot.as_mut(),
5977 decoder,
5978 )?;
5979
5980 let value = unsafe {
5981 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
5982 };
5983
5984 if value.len() > 100 {
5985 return Err(::fidl_next::DecodeError::VectorTooLong {
5986 size: value.len() as u64,
5987 limit: 100,
5988 });
5989 }
5990
5991 Ok(())
5992 }
5993
5994 2 => {
5995 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
5996 slot.as_mut(),
5997 decoder,
5998 )?;
5999
6000 let value = unsafe {
6001 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
6002 };
6003
6004 if value.len() > 1024 {
6005 return Err(::fidl_next::DecodeError::VectorTooLong {
6006 size: value.len() as u64,
6007 limit: 1024,
6008 });
6009 }
6010
6011 Ok(())
6012 }
6013
6014 3 => {
6015 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDeliveryType>(
6016 slot.as_mut(),
6017 decoder,
6018 )?;
6019
6020 Ok(())
6021 }
6022
6023 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
6024 }
6025 })
6026 }
6027}
6028
6029impl<'de> WireProtocol<'de> {
6030 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
6031 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6032 }
6033
6034 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
6035 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
6036 }
6037
6038 pub fn delivery(&self) -> ::core::option::Option<&crate::WireDeliveryType> {
6039 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
6040 }
6041}
6042
6043impl<'de> ::core::fmt::Debug for WireProtocol<'de> {
6044 fn fmt(
6045 &self,
6046 f: &mut ::core::fmt::Formatter<'_>,
6047 ) -> ::core::result::Result<(), ::core::fmt::Error> {
6048 f.debug_struct("Protocol")
6049 .field("name", &self.name())
6050 .field("source_path", &self.source_path())
6051 .field("delivery", &self.delivery())
6052 .finish()
6053 }
6054}
6055
6056#[doc = " A reference to the environment.\n"]
6057#[derive(PartialEq, Clone, Debug)]
6058#[repr(C)]
6059pub struct EnvironmentRef {}
6060
6061impl ::fidl_next::Encodable for EnvironmentRef {
6062 type Encoded = WireEnvironmentRef;
6063}
6064
6065unsafe impl<___E> ::fidl_next::Encode<___E> for EnvironmentRef
6066where
6067 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6068{
6069 #[inline]
6070 fn encode(
6071 self,
6072 encoder_: &mut ___E,
6073 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6074 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6075 *out_ = ::core::mem::MaybeUninit::zeroed();
6076
6077 Ok(())
6078 }
6079}
6080
6081unsafe impl<___E> ::fidl_next::EncodeRef<___E> for EnvironmentRef
6082where
6083 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6084{
6085 #[inline]
6086 fn encode_ref(
6087 &self,
6088 encoder_: &mut ___E,
6089 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6090 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6091 ::fidl_next::munge! {
6092 let Self::Encoded {
6093
6094 _empty,
6095
6096
6097 } = out_;
6098 }
6099
6100 Ok(())
6101 }
6102}
6103
6104impl ::fidl_next::EncodableOption for EnvironmentRef {
6105 type EncodedOption = ::fidl_next::WireBox<'static, WireEnvironmentRef>;
6106}
6107
6108unsafe impl<___E> ::fidl_next::EncodeOption<___E> for EnvironmentRef
6109where
6110 ___E: ::fidl_next::Encoder + ?Sized,
6111 EnvironmentRef: ::fidl_next::Encode<___E>,
6112{
6113 #[inline]
6114 fn encode_option(
6115 this: ::core::option::Option<Self>,
6116 encoder: &mut ___E,
6117 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6118 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6119 if let Some(inner) = this {
6120 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6121 ::fidl_next::WireBox::encode_present(out);
6122 } else {
6123 ::fidl_next::WireBox::encode_absent(out);
6124 }
6125
6126 Ok(())
6127 }
6128}
6129
6130unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for EnvironmentRef
6131where
6132 ___E: ::fidl_next::Encoder + ?Sized,
6133 EnvironmentRef: ::fidl_next::EncodeRef<___E>,
6134{
6135 #[inline]
6136 fn encode_option_ref(
6137 this: ::core::option::Option<&Self>,
6138 encoder: &mut ___E,
6139 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6140 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6141 if let Some(inner) = this {
6142 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6143 ::fidl_next::WireBox::encode_present(out);
6144 } else {
6145 ::fidl_next::WireBox::encode_absent(out);
6146 }
6147
6148 Ok(())
6149 }
6150}
6151
6152impl ::fidl_next::FromWire<WireEnvironmentRef> for EnvironmentRef {
6153 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireEnvironmentRef, Self> =
6154 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
6155
6156 #[inline]
6157 fn from_wire(wire: WireEnvironmentRef) -> Self {
6158 Self {}
6159 }
6160}
6161
6162impl ::fidl_next::IntoNatural for WireEnvironmentRef {
6163 type Natural = EnvironmentRef;
6164}
6165
6166impl ::fidl_next::FromWireRef<WireEnvironmentRef> for EnvironmentRef {
6167 #[inline]
6168 fn from_wire_ref(wire: &WireEnvironmentRef) -> Self {
6169 Self {}
6170 }
6171}
6172
6173#[derive(Clone, Debug)]
6175#[repr(C)]
6176pub struct WireEnvironmentRef {
6177 _empty: fidl_next::WireEmptyStructPlaceholder,
6178}
6179static_assertions::const_assert_eq!(std::mem::size_of::<WireEnvironmentRef>(), 1);
6180static_assertions::const_assert_eq!(std::mem::align_of::<WireEnvironmentRef>(), 1);
6181
6182unsafe impl ::fidl_next::Wire for WireEnvironmentRef {
6183 type Decoded<'de> = WireEnvironmentRef;
6184
6185 #[inline]
6186 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
6187 ::fidl_next::munge! {
6188 let Self {
6189
6190 _empty,
6191
6192
6193 } = &mut *out_;
6194 }
6195 }
6196}
6197
6198unsafe impl<___D> ::fidl_next::Decode<___D> for WireEnvironmentRef
6199where
6200 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6201{
6202 fn decode(
6203 slot_: ::fidl_next::Slot<'_, Self>,
6204 decoder_: &mut ___D,
6205 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6206 ::fidl_next::munge! {
6207 let Self {
6208
6209 mut _empty,
6210
6211
6212 } = slot_;
6213 }
6214
6215 if _empty.as_bytes() != &[0u8] {
6216 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
6217 }
6218
6219 Ok(())
6220 }
6221}
6222
6223#[doc = " A reference to a capability source or destination relative to this\n component.\n"]
6224#[derive(PartialEq, Clone, Debug)]
6225pub enum Ref {
6226 Parent(crate::ParentRef),
6227
6228 Self_(crate::SelfRef),
6229
6230 Child(crate::ChildRef),
6231
6232 Collection(crate::CollectionRef),
6233
6234 Framework(crate::FrameworkRef),
6235
6236 Capability(crate::CapabilityRef),
6237
6238 Debug(crate::DebugRef),
6239
6240 VoidType(crate::VoidRef),
6241
6242 Environment(crate::EnvironmentRef),
6243
6244 UnknownOrdinal_(u64),
6245}
6246
6247impl ::fidl_next::Encodable for Ref {
6248 type Encoded = WireRef<'static>;
6249}
6250
6251unsafe impl<___E> ::fidl_next::Encode<___E> for Ref
6252where
6253 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6254 ___E: ::fidl_next::Encoder,
6255{
6256 #[inline]
6257 fn encode(
6258 self,
6259 encoder: &mut ___E,
6260 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6261 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6262 ::fidl_next::munge!(let WireRef { raw, _phantom: _ } = out);
6263
6264 match self {
6265 Self::Parent(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::ParentRef>(
6266 value, 1, encoder, raw,
6267 )?,
6268
6269 Self::Self_(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::SelfRef>(
6270 value, 2, encoder, raw,
6271 )?,
6272
6273 Self::Child(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::ChildRef>(
6274 value, 3, encoder, raw,
6275 )?,
6276
6277 Self::Collection(value) => ::fidl_next::RawWireUnion::encode_as::<
6278 ___E,
6279 crate::CollectionRef,
6280 >(value, 4, encoder, raw)?,
6281
6282 Self::Framework(value) => ::fidl_next::RawWireUnion::encode_as::<
6283 ___E,
6284 crate::FrameworkRef,
6285 >(value, 5, encoder, raw)?,
6286
6287 Self::Capability(value) => ::fidl_next::RawWireUnion::encode_as::<
6288 ___E,
6289 crate::CapabilityRef,
6290 >(value, 6, encoder, raw)?,
6291
6292 Self::Debug(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::DebugRef>(
6293 value, 7, encoder, raw,
6294 )?,
6295
6296 Self::VoidType(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::VoidRef>(
6297 value, 8, encoder, raw,
6298 )?,
6299
6300 Self::Environment(value) => ::fidl_next::RawWireUnion::encode_as::<
6301 ___E,
6302 crate::EnvironmentRef,
6303 >(value, 9, encoder, raw)?,
6304
6305 Self::UnknownOrdinal_(ordinal) => {
6306 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
6307 }
6308 }
6309
6310 Ok(())
6311 }
6312}
6313
6314unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Ref
6315where
6316 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6317 ___E: ::fidl_next::Encoder,
6318{
6319 #[inline]
6320 fn encode_ref(
6321 &self,
6322 encoder: &mut ___E,
6323 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6324 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6325 ::fidl_next::munge!(let WireRef { raw, _phantom: _ } = out);
6326
6327 match self {
6328 Self::Parent(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::ParentRef>(
6329 value, 1, encoder, raw,
6330 )?,
6331
6332 Self::Self_(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::SelfRef>(
6333 value, 2, encoder, raw,
6334 )?,
6335
6336 Self::Child(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::ChildRef>(
6337 value, 3, encoder, raw,
6338 )?,
6339
6340 Self::Collection(value) => ::fidl_next::RawWireUnion::encode_as::<
6341 ___E,
6342 &crate::CollectionRef,
6343 >(value, 4, encoder, raw)?,
6344
6345 Self::Framework(value) => ::fidl_next::RawWireUnion::encode_as::<
6346 ___E,
6347 &crate::FrameworkRef,
6348 >(value, 5, encoder, raw)?,
6349
6350 Self::Capability(value) => ::fidl_next::RawWireUnion::encode_as::<
6351 ___E,
6352 &crate::CapabilityRef,
6353 >(value, 6, encoder, raw)?,
6354
6355 Self::Debug(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::DebugRef>(
6356 value, 7, encoder, raw,
6357 )?,
6358
6359 Self::VoidType(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::VoidRef>(
6360 value, 8, encoder, raw,
6361 )?,
6362
6363 Self::Environment(value) => ::fidl_next::RawWireUnion::encode_as::<
6364 ___E,
6365 &crate::EnvironmentRef,
6366 >(value, 9, encoder, raw)?,
6367
6368 Self::UnknownOrdinal_(ordinal) => {
6369 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
6370 }
6371 }
6372
6373 Ok(())
6374 }
6375}
6376
6377impl ::fidl_next::EncodableOption for Ref {
6378 type EncodedOption = WireOptionalRef<'static>;
6379}
6380
6381unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Ref
6382where
6383 ___E: ?Sized,
6384 Ref: ::fidl_next::Encode<___E>,
6385{
6386 #[inline]
6387 fn encode_option(
6388 this: ::core::option::Option<Self>,
6389 encoder: &mut ___E,
6390 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6391 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6392 ::fidl_next::munge!(let WireOptionalRef { raw, _phantom: _ } = &mut *out);
6393
6394 if let Some(inner) = this {
6395 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
6396 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
6397 } else {
6398 ::fidl_next::RawWireUnion::encode_absent(raw);
6399 }
6400
6401 Ok(())
6402 }
6403}
6404
6405unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Ref
6406where
6407 ___E: ?Sized,
6408 Ref: ::fidl_next::EncodeRef<___E>,
6409{
6410 #[inline]
6411 fn encode_option_ref(
6412 this: ::core::option::Option<&Self>,
6413 encoder: &mut ___E,
6414 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6415 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6416 ::fidl_next::munge!(let WireOptionalRef { raw, _phantom: _ } = &mut *out);
6417
6418 if let Some(inner) = this {
6419 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
6420 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
6421 } else {
6422 ::fidl_next::RawWireUnion::encode_absent(raw);
6423 }
6424
6425 Ok(())
6426 }
6427}
6428
6429impl<'de> ::fidl_next::FromWire<WireRef<'de>> for Ref {
6430 #[inline]
6431 fn from_wire(wire: WireRef<'de>) -> Self {
6432 let wire = ::core::mem::ManuallyDrop::new(wire);
6433 match wire.raw.ordinal() {
6434 1 => Self::Parent(::fidl_next::FromWire::from_wire(unsafe {
6435 wire.raw.get().read_unchecked::<crate::WireParentRef>()
6436 })),
6437
6438 2 => Self::Self_(::fidl_next::FromWire::from_wire(unsafe {
6439 wire.raw.get().read_unchecked::<crate::WireSelfRef>()
6440 })),
6441
6442 3 => Self::Child(::fidl_next::FromWire::from_wire(unsafe {
6443 wire.raw.get().read_unchecked::<crate::WireChildRef<'de>>()
6444 })),
6445
6446 4 => Self::Collection(::fidl_next::FromWire::from_wire(unsafe {
6447 wire.raw.get().read_unchecked::<crate::WireCollectionRef<'de>>()
6448 })),
6449
6450 5 => Self::Framework(::fidl_next::FromWire::from_wire(unsafe {
6451 wire.raw.get().read_unchecked::<crate::WireFrameworkRef>()
6452 })),
6453
6454 6 => Self::Capability(::fidl_next::FromWire::from_wire(unsafe {
6455 wire.raw.get().read_unchecked::<crate::WireCapabilityRef<'de>>()
6456 })),
6457
6458 7 => Self::Debug(::fidl_next::FromWire::from_wire(unsafe {
6459 wire.raw.get().read_unchecked::<crate::WireDebugRef>()
6460 })),
6461
6462 8 => Self::VoidType(::fidl_next::FromWire::from_wire(unsafe {
6463 wire.raw.get().read_unchecked::<crate::WireVoidRef>()
6464 })),
6465
6466 9 => Self::Environment(::fidl_next::FromWire::from_wire(unsafe {
6467 wire.raw.get().read_unchecked::<crate::WireEnvironmentRef>()
6468 })),
6469
6470 _ => unsafe { ::core::hint::unreachable_unchecked() },
6471 }
6472 }
6473}
6474
6475impl<'de> ::fidl_next::IntoNatural for WireRef<'de> {
6476 type Natural = Ref;
6477}
6478
6479impl<'de> ::fidl_next::FromWireRef<WireRef<'de>> for Ref {
6480 #[inline]
6481 fn from_wire_ref(wire: &WireRef<'de>) -> Self {
6482 match wire.raw.ordinal() {
6483 1 => Self::Parent(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6484 wire.raw.get().deref_unchecked::<crate::WireParentRef>()
6485 })),
6486
6487 2 => Self::Self_(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6488 wire.raw.get().deref_unchecked::<crate::WireSelfRef>()
6489 })),
6490
6491 3 => Self::Child(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6492 wire.raw.get().deref_unchecked::<crate::WireChildRef<'de>>()
6493 })),
6494
6495 4 => Self::Collection(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6496 wire.raw.get().deref_unchecked::<crate::WireCollectionRef<'de>>()
6497 })),
6498
6499 5 => Self::Framework(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6500 wire.raw.get().deref_unchecked::<crate::WireFrameworkRef>()
6501 })),
6502
6503 6 => Self::Capability(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6504 wire.raw.get().deref_unchecked::<crate::WireCapabilityRef<'de>>()
6505 })),
6506
6507 7 => Self::Debug(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6508 wire.raw.get().deref_unchecked::<crate::WireDebugRef>()
6509 })),
6510
6511 8 => Self::VoidType(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6512 wire.raw.get().deref_unchecked::<crate::WireVoidRef>()
6513 })),
6514
6515 9 => Self::Environment(::fidl_next::FromWireRef::from_wire_ref(unsafe {
6516 wire.raw.get().deref_unchecked::<crate::WireEnvironmentRef>()
6517 })),
6518
6519 _ => unsafe { ::core::hint::unreachable_unchecked() },
6520 }
6521 }
6522}
6523
6524impl<'de> ::fidl_next::FromWireOption<WireOptionalRef<'de>> for Ref {
6525 #[inline]
6526 fn from_wire_option(wire: WireOptionalRef<'de>) -> ::core::option::Option<Self> {
6527 if let Some(inner) = wire.into_option() {
6528 Some(::fidl_next::FromWire::from_wire(inner))
6529 } else {
6530 None
6531 }
6532 }
6533}
6534
6535impl<'de> ::fidl_next::IntoNatural for WireOptionalRef<'de> {
6536 type Natural = ::core::option::Option<Ref>;
6537}
6538
6539impl<'de> ::fidl_next::FromWireOption<WireOptionalRef<'de>> for Box<Ref> {
6540 #[inline]
6541 fn from_wire_option(wire: WireOptionalRef<'de>) -> ::core::option::Option<Self> {
6542 <Ref as ::fidl_next::FromWireOption<WireOptionalRef<'de>>>::from_wire_option(wire)
6543 .map(Box::new)
6544 }
6545}
6546
6547impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalRef<'de>> for Box<Ref> {
6548 #[inline]
6549 fn from_wire_option_ref(wire: &WireOptionalRef<'de>) -> ::core::option::Option<Self> {
6550 if let Some(inner) = wire.as_ref() {
6551 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
6552 } else {
6553 None
6554 }
6555 }
6556}
6557
6558#[repr(transparent)]
6560pub struct WireRef<'de> {
6561 raw: ::fidl_next::RawWireUnion,
6562 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
6563}
6564
6565impl<'de> Drop for WireRef<'de> {
6566 fn drop(&mut self) {
6567 match self.raw.ordinal() {
6568 1 => {
6569 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireParentRef>() };
6570 }
6571
6572 2 => {
6573 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireSelfRef>() };
6574 }
6575
6576 3 => {
6577 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireChildRef<'de>>() };
6578 }
6579
6580 4 => {
6581 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireCollectionRef<'de>>() };
6582 }
6583
6584 5 => {
6585 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireFrameworkRef>() };
6586 }
6587
6588 6 => {
6589 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireCapabilityRef<'de>>() };
6590 }
6591
6592 7 => {
6593 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDebugRef>() };
6594 }
6595
6596 8 => {
6597 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireVoidRef>() };
6598 }
6599
6600 9 => {
6601 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireEnvironmentRef>() };
6602 }
6603
6604 _ => (),
6605 }
6606 }
6607}
6608
6609unsafe impl ::fidl_next::Wire for WireRef<'static> {
6610 type Decoded<'de> = WireRef<'de>;
6611
6612 #[inline]
6613 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6614 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
6615 ::fidl_next::RawWireUnion::zero_padding(raw);
6616 }
6617}
6618
6619pub mod ref_ {
6620 pub enum Ref<'de> {
6621 Parent(&'de crate::WireParentRef),
6622
6623 Self_(&'de crate::WireSelfRef),
6624
6625 Child(&'de crate::WireChildRef<'de>),
6626
6627 Collection(&'de crate::WireCollectionRef<'de>),
6628
6629 Framework(&'de crate::WireFrameworkRef),
6630
6631 Capability(&'de crate::WireCapabilityRef<'de>),
6632
6633 Debug(&'de crate::WireDebugRef),
6634
6635 VoidType(&'de crate::WireVoidRef),
6636
6637 Environment(&'de crate::WireEnvironmentRef),
6638
6639 UnknownOrdinal_(u64),
6640 }
6641}
6642
6643impl<'de> WireRef<'de> {
6644 pub fn as_ref(&self) -> crate::ref_::Ref<'_> {
6645 match self.raw.ordinal() {
6646 1 => crate::ref_::Ref::Parent(unsafe {
6647 self.raw.get().deref_unchecked::<crate::WireParentRef>()
6648 }),
6649
6650 2 => crate::ref_::Ref::Self_(unsafe {
6651 self.raw.get().deref_unchecked::<crate::WireSelfRef>()
6652 }),
6653
6654 3 => crate::ref_::Ref::Child(unsafe {
6655 self.raw.get().deref_unchecked::<crate::WireChildRef<'_>>()
6656 }),
6657
6658 4 => crate::ref_::Ref::Collection(unsafe {
6659 self.raw.get().deref_unchecked::<crate::WireCollectionRef<'_>>()
6660 }),
6661
6662 5 => crate::ref_::Ref::Framework(unsafe {
6663 self.raw.get().deref_unchecked::<crate::WireFrameworkRef>()
6664 }),
6665
6666 6 => crate::ref_::Ref::Capability(unsafe {
6667 self.raw.get().deref_unchecked::<crate::WireCapabilityRef<'_>>()
6668 }),
6669
6670 7 => crate::ref_::Ref::Debug(unsafe {
6671 self.raw.get().deref_unchecked::<crate::WireDebugRef>()
6672 }),
6673
6674 8 => crate::ref_::Ref::VoidType(unsafe {
6675 self.raw.get().deref_unchecked::<crate::WireVoidRef>()
6676 }),
6677
6678 9 => crate::ref_::Ref::Environment(unsafe {
6679 self.raw.get().deref_unchecked::<crate::WireEnvironmentRef>()
6680 }),
6681
6682 unknown => crate::ref_::Ref::UnknownOrdinal_(unknown),
6683 }
6684 }
6685}
6686
6687unsafe impl<___D> ::fidl_next::Decode<___D> for WireRef<'static>
6688where
6689 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6690 ___D: ::fidl_next::Decoder,
6691{
6692 fn decode(
6693 mut slot: ::fidl_next::Slot<'_, Self>,
6694 decoder: &mut ___D,
6695 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6696 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
6697 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
6698 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireParentRef>(raw, decoder)?,
6699
6700 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSelfRef>(raw, decoder)?,
6701
6702 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireChildRef<'static>>(
6703 raw, decoder,
6704 )?,
6705
6706 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireCollectionRef<'static>>(
6707 raw, decoder,
6708 )?,
6709
6710 5 => {
6711 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFrameworkRef>(raw, decoder)?
6712 }
6713
6714 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireCapabilityRef<'static>>(
6715 raw, decoder,
6716 )?,
6717
6718 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDebugRef>(raw, decoder)?,
6719
6720 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireVoidRef>(raw, decoder)?,
6721
6722 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEnvironmentRef>(
6723 raw, decoder,
6724 )?,
6725
6726 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
6727 }
6728
6729 Ok(())
6730 }
6731}
6732
6733impl<'de> ::core::fmt::Debug for WireRef<'de> {
6734 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6735 match self.raw.ordinal() {
6736 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireParentRef>().fmt(f) },
6737 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireSelfRef>().fmt(f) },
6738 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireChildRef<'_>>().fmt(f) },
6739 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireCollectionRef<'_>>().fmt(f) },
6740 5 => unsafe { self.raw.get().deref_unchecked::<crate::WireFrameworkRef>().fmt(f) },
6741 6 => unsafe { self.raw.get().deref_unchecked::<crate::WireCapabilityRef<'_>>().fmt(f) },
6742 7 => unsafe { self.raw.get().deref_unchecked::<crate::WireDebugRef>().fmt(f) },
6743 8 => unsafe { self.raw.get().deref_unchecked::<crate::WireVoidRef>().fmt(f) },
6744 9 => unsafe { self.raw.get().deref_unchecked::<crate::WireEnvironmentRef>().fmt(f) },
6745 _ => unsafe { ::core::hint::unreachable_unchecked() },
6746 }
6747 }
6748}
6749
6750#[repr(transparent)]
6751pub struct WireOptionalRef<'de> {
6752 raw: ::fidl_next::RawWireUnion,
6753 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
6754}
6755
6756unsafe impl ::fidl_next::Wire for WireOptionalRef<'static> {
6757 type Decoded<'de> = WireOptionalRef<'de>;
6758
6759 #[inline]
6760 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6761 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
6762 ::fidl_next::RawWireUnion::zero_padding(raw);
6763 }
6764}
6765
6766impl<'de> WireOptionalRef<'de> {
6767 pub fn is_some(&self) -> bool {
6768 self.raw.is_some()
6769 }
6770
6771 pub fn is_none(&self) -> bool {
6772 self.raw.is_none()
6773 }
6774
6775 pub fn as_ref(&self) -> ::core::option::Option<&WireRef<'de>> {
6776 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
6777 }
6778
6779 pub fn into_option(self) -> ::core::option::Option<WireRef<'de>> {
6780 if self.is_some() {
6781 Some(WireRef { raw: self.raw, _phantom: ::core::marker::PhantomData })
6782 } else {
6783 None
6784 }
6785 }
6786}
6787
6788unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalRef<'static>
6789where
6790 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6791 ___D: ::fidl_next::Decoder,
6792{
6793 fn decode(
6794 mut slot: ::fidl_next::Slot<'_, Self>,
6795 decoder: &mut ___D,
6796 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
6797 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
6798 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
6799 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireParentRef>(raw, decoder)?,
6800
6801 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSelfRef>(raw, decoder)?,
6802
6803 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireChildRef<'static>>(
6804 raw, decoder,
6805 )?,
6806
6807 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireCollectionRef<'static>>(
6808 raw, decoder,
6809 )?,
6810
6811 5 => {
6812 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFrameworkRef>(raw, decoder)?
6813 }
6814
6815 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireCapabilityRef<'static>>(
6816 raw, decoder,
6817 )?,
6818
6819 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDebugRef>(raw, decoder)?,
6820
6821 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireVoidRef>(raw, decoder)?,
6822
6823 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEnvironmentRef>(
6824 raw, decoder,
6825 )?,
6826
6827 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
6828 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
6829 }
6830
6831 Ok(())
6832 }
6833}
6834
6835impl<'de> ::core::fmt::Debug for WireOptionalRef<'de> {
6836 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
6837 self.as_ref().fmt(f)
6838 }
6839}
6840
6841#[doc = " Declares a storage capability backed by a directory from which data, cache,\n or meta storage can be offered.\n"]
6842#[derive(PartialEq, Clone, Debug, Default)]
6843pub struct Storage {
6844 pub name: ::core::option::Option<::std::string::String>,
6845
6846 pub source: ::core::option::Option<crate::Ref>,
6847
6848 pub backing_dir: ::core::option::Option<::std::string::String>,
6849
6850 pub subdir: ::core::option::Option<::std::string::String>,
6851
6852 pub storage_id: ::core::option::Option<crate::StorageId>,
6853}
6854
6855impl Storage {
6856 fn __max_ordinal(&self) -> usize {
6857 if self.storage_id.is_some() {
6858 return 5;
6859 }
6860
6861 if self.subdir.is_some() {
6862 return 4;
6863 }
6864
6865 if self.backing_dir.is_some() {
6866 return 3;
6867 }
6868
6869 if self.source.is_some() {
6870 return 2;
6871 }
6872
6873 if self.name.is_some() {
6874 return 1;
6875 }
6876
6877 0
6878 }
6879}
6880
6881impl ::fidl_next::Encodable for Storage {
6882 type Encoded = WireStorage<'static>;
6883}
6884
6885unsafe impl<___E> ::fidl_next::Encode<___E> for Storage
6886where
6887 ___E: ::fidl_next::Encoder + ?Sized,
6888{
6889 #[inline]
6890 fn encode(
6891 mut self,
6892 encoder: &mut ___E,
6893 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6894 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6895 ::fidl_next::munge!(let WireStorage { table } = out);
6896
6897 let max_ord = self.__max_ordinal();
6898
6899 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
6900 ::fidl_next::Wire::zero_padding(&mut out);
6901
6902 let mut preallocated =
6903 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
6904
6905 for i in 1..=max_ord {
6906 match i {
6907 5 => {
6908 if let Some(value) = self.storage_id.take() {
6909 ::fidl_next::WireEnvelope::encode_value(
6910 value,
6911 preallocated.encoder,
6912 &mut out,
6913 )?;
6914 } else {
6915 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6916 }
6917 }
6918
6919 4 => {
6920 if let Some(value) = self.subdir.take() {
6921 ::fidl_next::WireEnvelope::encode_value(
6922 value,
6923 preallocated.encoder,
6924 &mut out,
6925 )?;
6926 } else {
6927 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6928 }
6929 }
6930
6931 3 => {
6932 if let Some(value) = self.backing_dir.take() {
6933 ::fidl_next::WireEnvelope::encode_value(
6934 value,
6935 preallocated.encoder,
6936 &mut out,
6937 )?;
6938 } else {
6939 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6940 }
6941 }
6942
6943 2 => {
6944 if let Some(value) = self.source.take() {
6945 ::fidl_next::WireEnvelope::encode_value(
6946 value,
6947 preallocated.encoder,
6948 &mut out,
6949 )?;
6950 } else {
6951 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6952 }
6953 }
6954
6955 1 => {
6956 if let Some(value) = self.name.take() {
6957 ::fidl_next::WireEnvelope::encode_value(
6958 value,
6959 preallocated.encoder,
6960 &mut out,
6961 )?;
6962 } else {
6963 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6964 }
6965 }
6966
6967 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
6968 }
6969 unsafe {
6970 preallocated.write_next(out.assume_init_ref());
6971 }
6972 }
6973
6974 ::fidl_next::WireTable::encode_len(table, max_ord);
6975
6976 Ok(())
6977 }
6978}
6979
6980unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Storage
6981where
6982 ___E: ::fidl_next::Encoder + ?Sized,
6983{
6984 #[inline]
6985 fn encode_ref(
6986 &self,
6987 encoder: &mut ___E,
6988 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6989 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6990 ::fidl_next::munge!(let WireStorage { table } = out);
6991
6992 let max_ord = self.__max_ordinal();
6993
6994 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
6995 ::fidl_next::Wire::zero_padding(&mut out);
6996
6997 let mut preallocated =
6998 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
6999
7000 for i in 1..=max_ord {
7001 match i {
7002 5 => {
7003 if let Some(value) = &self.storage_id {
7004 ::fidl_next::WireEnvelope::encode_value(
7005 value,
7006 preallocated.encoder,
7007 &mut out,
7008 )?;
7009 } else {
7010 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7011 }
7012 }
7013
7014 4 => {
7015 if let Some(value) = &self.subdir {
7016 ::fidl_next::WireEnvelope::encode_value(
7017 value,
7018 preallocated.encoder,
7019 &mut out,
7020 )?;
7021 } else {
7022 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7023 }
7024 }
7025
7026 3 => {
7027 if let Some(value) = &self.backing_dir {
7028 ::fidl_next::WireEnvelope::encode_value(
7029 value,
7030 preallocated.encoder,
7031 &mut out,
7032 )?;
7033 } else {
7034 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7035 }
7036 }
7037
7038 2 => {
7039 if let Some(value) = &self.source {
7040 ::fidl_next::WireEnvelope::encode_value(
7041 value,
7042 preallocated.encoder,
7043 &mut out,
7044 )?;
7045 } else {
7046 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7047 }
7048 }
7049
7050 1 => {
7051 if let Some(value) = &self.name {
7052 ::fidl_next::WireEnvelope::encode_value(
7053 value,
7054 preallocated.encoder,
7055 &mut out,
7056 )?;
7057 } else {
7058 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7059 }
7060 }
7061
7062 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7063 }
7064 unsafe {
7065 preallocated.write_next(out.assume_init_ref());
7066 }
7067 }
7068
7069 ::fidl_next::WireTable::encode_len(table, max_ord);
7070
7071 Ok(())
7072 }
7073}
7074
7075impl<'de> ::fidl_next::FromWire<WireStorage<'de>> for Storage {
7076 #[inline]
7077 fn from_wire(wire_: WireStorage<'de>) -> Self {
7078 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7079
7080 let name = wire_.table.get(1);
7081
7082 let source = wire_.table.get(2);
7083
7084 let backing_dir = wire_.table.get(3);
7085
7086 let subdir = wire_.table.get(4);
7087
7088 let storage_id = wire_.table.get(5);
7089
7090 Self {
7091 name: name.map(|envelope| {
7092 ::fidl_next::FromWire::from_wire(unsafe {
7093 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7094 })
7095 }),
7096
7097 source: source.map(|envelope| {
7098 ::fidl_next::FromWire::from_wire(unsafe {
7099 envelope.read_unchecked::<crate::WireRef<'de>>()
7100 })
7101 }),
7102
7103 backing_dir: backing_dir.map(|envelope| {
7104 ::fidl_next::FromWire::from_wire(unsafe {
7105 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7106 })
7107 }),
7108
7109 subdir: subdir.map(|envelope| {
7110 ::fidl_next::FromWire::from_wire(unsafe {
7111 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7112 })
7113 }),
7114
7115 storage_id: storage_id.map(|envelope| {
7116 ::fidl_next::FromWire::from_wire(unsafe {
7117 envelope.read_unchecked::<crate::WireStorageId>()
7118 })
7119 }),
7120 }
7121 }
7122}
7123
7124impl<'de> ::fidl_next::IntoNatural for WireStorage<'de> {
7125 type Natural = Storage;
7126}
7127
7128impl<'de> ::fidl_next::FromWireRef<WireStorage<'de>> for Storage {
7129 #[inline]
7130 fn from_wire_ref(wire: &WireStorage<'de>) -> Self {
7131 Self {
7132 name: wire.table.get(1).map(|envelope| {
7133 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7134 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7135 })
7136 }),
7137
7138 source: wire.table.get(2).map(|envelope| {
7139 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7140 envelope.deref_unchecked::<crate::WireRef<'de>>()
7141 })
7142 }),
7143
7144 backing_dir: wire.table.get(3).map(|envelope| {
7145 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7146 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7147 })
7148 }),
7149
7150 subdir: wire.table.get(4).map(|envelope| {
7151 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7152 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7153 })
7154 }),
7155
7156 storage_id: wire.table.get(5).map(|envelope| {
7157 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7158 envelope.deref_unchecked::<crate::WireStorageId>()
7159 })
7160 }),
7161 }
7162 }
7163}
7164
7165#[repr(C)]
7167pub struct WireStorage<'de> {
7168 table: ::fidl_next::WireTable<'de>,
7169}
7170
7171impl<'de> Drop for WireStorage<'de> {
7172 fn drop(&mut self) {
7173 let _ = self
7174 .table
7175 .get(1)
7176 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
7177
7178 let _ = self
7179 .table
7180 .get(2)
7181 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
7182
7183 let _ = self
7184 .table
7185 .get(3)
7186 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
7187
7188 let _ = self
7189 .table
7190 .get(4)
7191 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
7192
7193 let _ = self
7194 .table
7195 .get(5)
7196 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireStorageId>() });
7197 }
7198}
7199
7200unsafe impl ::fidl_next::Wire for WireStorage<'static> {
7201 type Decoded<'de> = WireStorage<'de>;
7202
7203 #[inline]
7204 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7205 ::fidl_next::munge!(let Self { table } = out);
7206 ::fidl_next::WireTable::zero_padding(table);
7207 }
7208}
7209
7210unsafe impl<___D> ::fidl_next::Decode<___D> for WireStorage<'static>
7211where
7212 ___D: ::fidl_next::Decoder + ?Sized,
7213{
7214 fn decode(
7215 slot: ::fidl_next::Slot<'_, Self>,
7216 decoder: &mut ___D,
7217 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7218 ::fidl_next::munge!(let Self { table } = slot);
7219
7220 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
7221 match ordinal {
7222 0 => unsafe { ::core::hint::unreachable_unchecked() },
7223
7224 1 => {
7225 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
7226 slot.as_mut(),
7227 decoder,
7228 )?;
7229
7230 let value = unsafe {
7231 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
7232 };
7233
7234 if value.len() > 100 {
7235 return Err(::fidl_next::DecodeError::VectorTooLong {
7236 size: value.len() as u64,
7237 limit: 100,
7238 });
7239 }
7240
7241 Ok(())
7242 }
7243
7244 2 => {
7245 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
7246 slot.as_mut(),
7247 decoder,
7248 )?;
7249
7250 Ok(())
7251 }
7252
7253 3 => {
7254 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
7255 slot.as_mut(),
7256 decoder,
7257 )?;
7258
7259 let value = unsafe {
7260 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
7261 };
7262
7263 if value.len() > 100 {
7264 return Err(::fidl_next::DecodeError::VectorTooLong {
7265 size: value.len() as u64,
7266 limit: 100,
7267 });
7268 }
7269
7270 Ok(())
7271 }
7272
7273 4 => {
7274 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
7275 slot.as_mut(),
7276 decoder,
7277 )?;
7278
7279 let value = unsafe {
7280 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
7281 };
7282
7283 if value.len() > 1024 {
7284 return Err(::fidl_next::DecodeError::VectorTooLong {
7285 size: value.len() as u64,
7286 limit: 1024,
7287 });
7288 }
7289
7290 Ok(())
7291 }
7292
7293 5 => {
7294 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireStorageId>(
7295 slot.as_mut(),
7296 decoder,
7297 )?;
7298
7299 Ok(())
7300 }
7301
7302 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
7303 }
7304 })
7305 }
7306}
7307
7308impl<'de> WireStorage<'de> {
7309 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
7310 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
7311 }
7312
7313 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
7314 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
7315 }
7316
7317 pub fn backing_dir(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
7318 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
7319 }
7320
7321 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
7322 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
7323 }
7324
7325 pub fn storage_id(&self) -> ::core::option::Option<&crate::WireStorageId> {
7326 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
7327 }
7328}
7329
7330impl<'de> ::core::fmt::Debug for WireStorage<'de> {
7331 fn fmt(
7332 &self,
7333 f: &mut ::core::fmt::Formatter<'_>,
7334 ) -> ::core::result::Result<(), ::core::fmt::Error> {
7335 f.debug_struct("Storage")
7336 .field("name", &self.name())
7337 .field("source", &self.source())
7338 .field("backing_dir", &self.backing_dir())
7339 .field("subdir", &self.subdir())
7340 .field("storage_id", &self.storage_id())
7341 .finish()
7342 }
7343}
7344
7345#[doc = " Declares a dictionary capability.\n"]
7346#[derive(PartialEq, Clone, Debug, Default)]
7347pub struct Dictionary {
7348 pub name: ::core::option::Option<::std::string::String>,
7349
7350 pub source: ::core::option::Option<crate::Ref>,
7351
7352 pub source_dictionary: ::core::option::Option<::std::string::String>,
7353
7354 pub source_path: ::core::option::Option<::std::string::String>,
7355}
7356
7357impl Dictionary {
7358 fn __max_ordinal(&self) -> usize {
7359 if self.source_path.is_some() {
7360 return 4;
7361 }
7362
7363 if self.source_dictionary.is_some() {
7364 return 3;
7365 }
7366
7367 if self.source.is_some() {
7368 return 2;
7369 }
7370
7371 if self.name.is_some() {
7372 return 1;
7373 }
7374
7375 0
7376 }
7377}
7378
7379impl ::fidl_next::Encodable for Dictionary {
7380 type Encoded = WireDictionary<'static>;
7381}
7382
7383unsafe impl<___E> ::fidl_next::Encode<___E> for Dictionary
7384where
7385 ___E: ::fidl_next::Encoder + ?Sized,
7386{
7387 #[inline]
7388 fn encode(
7389 mut self,
7390 encoder: &mut ___E,
7391 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7392 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7393 ::fidl_next::munge!(let WireDictionary { table } = out);
7394
7395 let max_ord = self.__max_ordinal();
7396
7397 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7398 ::fidl_next::Wire::zero_padding(&mut out);
7399
7400 let mut preallocated =
7401 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7402
7403 for i in 1..=max_ord {
7404 match i {
7405 4 => {
7406 if let Some(value) = self.source_path.take() {
7407 ::fidl_next::WireEnvelope::encode_value(
7408 value,
7409 preallocated.encoder,
7410 &mut out,
7411 )?;
7412 } else {
7413 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7414 }
7415 }
7416
7417 3 => {
7418 if let Some(value) = self.source_dictionary.take() {
7419 ::fidl_next::WireEnvelope::encode_value(
7420 value,
7421 preallocated.encoder,
7422 &mut out,
7423 )?;
7424 } else {
7425 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7426 }
7427 }
7428
7429 2 => {
7430 if let Some(value) = self.source.take() {
7431 ::fidl_next::WireEnvelope::encode_value(
7432 value,
7433 preallocated.encoder,
7434 &mut out,
7435 )?;
7436 } else {
7437 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7438 }
7439 }
7440
7441 1 => {
7442 if let Some(value) = self.name.take() {
7443 ::fidl_next::WireEnvelope::encode_value(
7444 value,
7445 preallocated.encoder,
7446 &mut out,
7447 )?;
7448 } else {
7449 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7450 }
7451 }
7452
7453 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7454 }
7455 unsafe {
7456 preallocated.write_next(out.assume_init_ref());
7457 }
7458 }
7459
7460 ::fidl_next::WireTable::encode_len(table, max_ord);
7461
7462 Ok(())
7463 }
7464}
7465
7466unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Dictionary
7467where
7468 ___E: ::fidl_next::Encoder + ?Sized,
7469{
7470 #[inline]
7471 fn encode_ref(
7472 &self,
7473 encoder: &mut ___E,
7474 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7475 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7476 ::fidl_next::munge!(let WireDictionary { table } = out);
7477
7478 let max_ord = self.__max_ordinal();
7479
7480 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7481 ::fidl_next::Wire::zero_padding(&mut out);
7482
7483 let mut preallocated =
7484 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7485
7486 for i in 1..=max_ord {
7487 match i {
7488 4 => {
7489 if let Some(value) = &self.source_path {
7490 ::fidl_next::WireEnvelope::encode_value(
7491 value,
7492 preallocated.encoder,
7493 &mut out,
7494 )?;
7495 } else {
7496 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7497 }
7498 }
7499
7500 3 => {
7501 if let Some(value) = &self.source_dictionary {
7502 ::fidl_next::WireEnvelope::encode_value(
7503 value,
7504 preallocated.encoder,
7505 &mut out,
7506 )?;
7507 } else {
7508 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7509 }
7510 }
7511
7512 2 => {
7513 if let Some(value) = &self.source {
7514 ::fidl_next::WireEnvelope::encode_value(
7515 value,
7516 preallocated.encoder,
7517 &mut out,
7518 )?;
7519 } else {
7520 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7521 }
7522 }
7523
7524 1 => {
7525 if let Some(value) = &self.name {
7526 ::fidl_next::WireEnvelope::encode_value(
7527 value,
7528 preallocated.encoder,
7529 &mut out,
7530 )?;
7531 } else {
7532 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7533 }
7534 }
7535
7536 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7537 }
7538 unsafe {
7539 preallocated.write_next(out.assume_init_ref());
7540 }
7541 }
7542
7543 ::fidl_next::WireTable::encode_len(table, max_ord);
7544
7545 Ok(())
7546 }
7547}
7548
7549impl<'de> ::fidl_next::FromWire<WireDictionary<'de>> for Dictionary {
7550 #[inline]
7551 fn from_wire(wire_: WireDictionary<'de>) -> Self {
7552 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7553
7554 let name = wire_.table.get(1);
7555
7556 let source = wire_.table.get(2);
7557
7558 let source_dictionary = wire_.table.get(3);
7559
7560 let source_path = wire_.table.get(4);
7561
7562 Self {
7563 name: name.map(|envelope| {
7564 ::fidl_next::FromWire::from_wire(unsafe {
7565 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7566 })
7567 }),
7568
7569 source: source.map(|envelope| {
7570 ::fidl_next::FromWire::from_wire(unsafe {
7571 envelope.read_unchecked::<crate::WireRef<'de>>()
7572 })
7573 }),
7574
7575 source_dictionary: source_dictionary.map(|envelope| {
7576 ::fidl_next::FromWire::from_wire(unsafe {
7577 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7578 })
7579 }),
7580
7581 source_path: source_path.map(|envelope| {
7582 ::fidl_next::FromWire::from_wire(unsafe {
7583 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7584 })
7585 }),
7586 }
7587 }
7588}
7589
7590impl<'de> ::fidl_next::IntoNatural for WireDictionary<'de> {
7591 type Natural = Dictionary;
7592}
7593
7594impl<'de> ::fidl_next::FromWireRef<WireDictionary<'de>> for Dictionary {
7595 #[inline]
7596 fn from_wire_ref(wire: &WireDictionary<'de>) -> Self {
7597 Self {
7598 name: wire.table.get(1).map(|envelope| {
7599 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7600 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7601 })
7602 }),
7603
7604 source: wire.table.get(2).map(|envelope| {
7605 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7606 envelope.deref_unchecked::<crate::WireRef<'de>>()
7607 })
7608 }),
7609
7610 source_dictionary: wire.table.get(3).map(|envelope| {
7611 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7612 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7613 })
7614 }),
7615
7616 source_path: wire.table.get(4).map(|envelope| {
7617 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7618 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7619 })
7620 }),
7621 }
7622 }
7623}
7624
7625#[repr(C)]
7627pub struct WireDictionary<'de> {
7628 table: ::fidl_next::WireTable<'de>,
7629}
7630
7631impl<'de> Drop for WireDictionary<'de> {
7632 fn drop(&mut self) {
7633 let _ = self
7634 .table
7635 .get(1)
7636 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
7637
7638 let _ = self
7639 .table
7640 .get(2)
7641 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
7642
7643 let _ = self
7644 .table
7645 .get(3)
7646 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
7647
7648 let _ = self
7649 .table
7650 .get(4)
7651 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
7652 }
7653}
7654
7655unsafe impl ::fidl_next::Wire for WireDictionary<'static> {
7656 type Decoded<'de> = WireDictionary<'de>;
7657
7658 #[inline]
7659 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7660 ::fidl_next::munge!(let Self { table } = out);
7661 ::fidl_next::WireTable::zero_padding(table);
7662 }
7663}
7664
7665unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionary<'static>
7666where
7667 ___D: ::fidl_next::Decoder + ?Sized,
7668{
7669 fn decode(
7670 slot: ::fidl_next::Slot<'_, Self>,
7671 decoder: &mut ___D,
7672 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
7673 ::fidl_next::munge!(let Self { table } = slot);
7674
7675 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
7676 match ordinal {
7677 0 => unsafe { ::core::hint::unreachable_unchecked() },
7678
7679 1 => {
7680 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
7681 slot.as_mut(),
7682 decoder,
7683 )?;
7684
7685 let value = unsafe {
7686 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
7687 };
7688
7689 if value.len() > 100 {
7690 return Err(::fidl_next::DecodeError::VectorTooLong {
7691 size: value.len() as u64,
7692 limit: 100,
7693 });
7694 }
7695
7696 Ok(())
7697 }
7698
7699 2 => {
7700 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
7701 slot.as_mut(),
7702 decoder,
7703 )?;
7704
7705 Ok(())
7706 }
7707
7708 3 => {
7709 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
7710 slot.as_mut(),
7711 decoder,
7712 )?;
7713
7714 let value = unsafe {
7715 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
7716 };
7717
7718 if value.len() > 1024 {
7719 return Err(::fidl_next::DecodeError::VectorTooLong {
7720 size: value.len() as u64,
7721 limit: 1024,
7722 });
7723 }
7724
7725 Ok(())
7726 }
7727
7728 4 => {
7729 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
7730 slot.as_mut(),
7731 decoder,
7732 )?;
7733
7734 let value = unsafe {
7735 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
7736 };
7737
7738 if value.len() > 1024 {
7739 return Err(::fidl_next::DecodeError::VectorTooLong {
7740 size: value.len() as u64,
7741 limit: 1024,
7742 });
7743 }
7744
7745 Ok(())
7746 }
7747
7748 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
7749 }
7750 })
7751 }
7752}
7753
7754impl<'de> WireDictionary<'de> {
7755 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
7756 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
7757 }
7758
7759 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
7760 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
7761 }
7762
7763 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
7764 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
7765 }
7766
7767 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
7768 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
7769 }
7770}
7771
7772impl<'de> ::core::fmt::Debug for WireDictionary<'de> {
7773 fn fmt(
7774 &self,
7775 f: &mut ::core::fmt::Formatter<'_>,
7776 ) -> ::core::result::Result<(), ::core::fmt::Error> {
7777 f.debug_struct("Dictionary")
7778 .field("name", &self.name())
7779 .field("source", &self.source())
7780 .field("source_dictionary", &self.source_dictionary())
7781 .field("source_path", &self.source_path())
7782 .finish()
7783 }
7784}
7785
7786#[doc = " Declares a capability defined by this component.\n"]
7787#[derive(PartialEq, Clone, Debug)]
7788pub enum Capability {
7789 Service(crate::Service),
7790
7791 Protocol(crate::Protocol),
7792
7793 Directory(crate::Directory),
7794
7795 Storage(crate::Storage),
7796
7797 Runner(crate::Runner),
7798
7799 Resolver(crate::Resolver),
7800
7801 EventStream(crate::EventStream),
7802
7803 Dictionary(crate::Dictionary),
7804
7805 Config(crate::Configuration),
7806
7807 UnknownOrdinal_(u64),
7808}
7809
7810impl ::fidl_next::Encodable for Capability {
7811 type Encoded = WireCapability<'static>;
7812}
7813
7814unsafe impl<___E> ::fidl_next::Encode<___E> for Capability
7815where
7816 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7817 ___E: ::fidl_next::Encoder,
7818{
7819 #[inline]
7820 fn encode(
7821 self,
7822 encoder: &mut ___E,
7823 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7824 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7825 ::fidl_next::munge!(let WireCapability { raw, _phantom: _ } = out);
7826
7827 match self {
7828 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Service>(
7829 value, 1, encoder, raw,
7830 )?,
7831
7832 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Protocol>(
7833 value, 2, encoder, raw,
7834 )?,
7835
7836 Self::Directory(value) => {
7837 ::fidl_next::RawWireUnion::encode_as::<___E, crate::Directory>(
7838 value, 3, encoder, raw,
7839 )?
7840 }
7841
7842 Self::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Storage>(
7843 value, 4, encoder, raw,
7844 )?,
7845
7846 Self::Runner(value) => {
7847 ::fidl_next::RawWireUnion::encode_as::<___E, crate::Runner>(value, 5, encoder, raw)?
7848 }
7849
7850 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Resolver>(
7851 value, 6, encoder, raw,
7852 )?,
7853
7854 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
7855 ___E,
7856 crate::EventStream,
7857 >(value, 8, encoder, raw)?,
7858
7859 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
7860 ___E,
7861 crate::Dictionary,
7862 >(value, 9, encoder, raw)?,
7863
7864 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
7865 ___E,
7866 crate::Configuration,
7867 >(value, 10, encoder, raw)?,
7868
7869 Self::UnknownOrdinal_(ordinal) => {
7870 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
7871 }
7872 }
7873
7874 Ok(())
7875 }
7876}
7877
7878unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Capability
7879where
7880 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7881 ___E: ::fidl_next::Encoder,
7882{
7883 #[inline]
7884 fn encode_ref(
7885 &self,
7886 encoder: &mut ___E,
7887 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7888 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7889 ::fidl_next::munge!(let WireCapability { raw, _phantom: _ } = out);
7890
7891 match self {
7892 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::Service>(
7893 value, 1, encoder, raw,
7894 )?,
7895
7896 Self::Protocol(value) => {
7897 ::fidl_next::RawWireUnion::encode_as::<___E, &crate::Protocol>(
7898 value, 2, encoder, raw,
7899 )?
7900 }
7901
7902 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
7903 ___E,
7904 &crate::Directory,
7905 >(value, 3, encoder, raw)?,
7906
7907 Self::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::Storage>(
7908 value, 4, encoder, raw,
7909 )?,
7910
7911 Self::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::Runner>(
7912 value, 5, encoder, raw,
7913 )?,
7914
7915 Self::Resolver(value) => {
7916 ::fidl_next::RawWireUnion::encode_as::<___E, &crate::Resolver>(
7917 value, 6, encoder, raw,
7918 )?
7919 }
7920
7921 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
7922 ___E,
7923 &crate::EventStream,
7924 >(value, 8, encoder, raw)?,
7925
7926 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
7927 ___E,
7928 &crate::Dictionary,
7929 >(value, 9, encoder, raw)?,
7930
7931 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
7932 ___E,
7933 &crate::Configuration,
7934 >(value, 10, encoder, raw)?,
7935
7936 Self::UnknownOrdinal_(ordinal) => {
7937 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
7938 }
7939 }
7940
7941 Ok(())
7942 }
7943}
7944
7945impl ::fidl_next::EncodableOption for Capability {
7946 type EncodedOption = WireOptionalCapability<'static>;
7947}
7948
7949unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Capability
7950where
7951 ___E: ?Sized,
7952 Capability: ::fidl_next::Encode<___E>,
7953{
7954 #[inline]
7955 fn encode_option(
7956 this: ::core::option::Option<Self>,
7957 encoder: &mut ___E,
7958 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7959 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7960 ::fidl_next::munge!(let WireOptionalCapability { raw, _phantom: _ } = &mut *out);
7961
7962 if let Some(inner) = this {
7963 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7964 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
7965 } else {
7966 ::fidl_next::RawWireUnion::encode_absent(raw);
7967 }
7968
7969 Ok(())
7970 }
7971}
7972
7973unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Capability
7974where
7975 ___E: ?Sized,
7976 Capability: ::fidl_next::EncodeRef<___E>,
7977{
7978 #[inline]
7979 fn encode_option_ref(
7980 this: ::core::option::Option<&Self>,
7981 encoder: &mut ___E,
7982 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7983 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7984 ::fidl_next::munge!(let WireOptionalCapability { raw, _phantom: _ } = &mut *out);
7985
7986 if let Some(inner) = this {
7987 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7988 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
7989 } else {
7990 ::fidl_next::RawWireUnion::encode_absent(raw);
7991 }
7992
7993 Ok(())
7994 }
7995}
7996
7997impl<'de> ::fidl_next::FromWire<WireCapability<'de>> for Capability {
7998 #[inline]
7999 fn from_wire(wire: WireCapability<'de>) -> Self {
8000 let wire = ::core::mem::ManuallyDrop::new(wire);
8001 match wire.raw.ordinal() {
8002 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
8003 wire.raw.get().read_unchecked::<crate::WireService<'de>>()
8004 })),
8005
8006 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
8007 wire.raw.get().read_unchecked::<crate::WireProtocol<'de>>()
8008 })),
8009
8010 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
8011 wire.raw.get().read_unchecked::<crate::WireDirectory<'de>>()
8012 })),
8013
8014 4 => Self::Storage(::fidl_next::FromWire::from_wire(unsafe {
8015 wire.raw.get().read_unchecked::<crate::WireStorage<'de>>()
8016 })),
8017
8018 5 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
8019 wire.raw.get().read_unchecked::<crate::WireRunner<'de>>()
8020 })),
8021
8022 6 => Self::Resolver(::fidl_next::FromWire::from_wire(unsafe {
8023 wire.raw.get().read_unchecked::<crate::WireResolver<'de>>()
8024 })),
8025
8026 8 => Self::EventStream(::fidl_next::FromWire::from_wire(unsafe {
8027 wire.raw.get().read_unchecked::<crate::WireEventStream<'de>>()
8028 })),
8029
8030 9 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
8031 wire.raw.get().read_unchecked::<crate::WireDictionary<'de>>()
8032 })),
8033
8034 10 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
8035 wire.raw.get().read_unchecked::<crate::WireConfiguration<'de>>()
8036 })),
8037
8038 _ => unsafe { ::core::hint::unreachable_unchecked() },
8039 }
8040 }
8041}
8042
8043impl<'de> ::fidl_next::IntoNatural for WireCapability<'de> {
8044 type Natural = Capability;
8045}
8046
8047impl<'de> ::fidl_next::FromWireRef<WireCapability<'de>> for Capability {
8048 #[inline]
8049 fn from_wire_ref(wire: &WireCapability<'de>) -> Self {
8050 match wire.raw.ordinal() {
8051 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
8052 wire.raw.get().deref_unchecked::<crate::WireService<'de>>()
8053 })),
8054
8055 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
8056 wire.raw.get().deref_unchecked::<crate::WireProtocol<'de>>()
8057 })),
8058
8059 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
8060 wire.raw.get().deref_unchecked::<crate::WireDirectory<'de>>()
8061 })),
8062
8063 4 => Self::Storage(::fidl_next::FromWireRef::from_wire_ref(unsafe {
8064 wire.raw.get().deref_unchecked::<crate::WireStorage<'de>>()
8065 })),
8066
8067 5 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
8068 wire.raw.get().deref_unchecked::<crate::WireRunner<'de>>()
8069 })),
8070
8071 6 => Self::Resolver(::fidl_next::FromWireRef::from_wire_ref(unsafe {
8072 wire.raw.get().deref_unchecked::<crate::WireResolver<'de>>()
8073 })),
8074
8075 8 => Self::EventStream(::fidl_next::FromWireRef::from_wire_ref(unsafe {
8076 wire.raw.get().deref_unchecked::<crate::WireEventStream<'de>>()
8077 })),
8078
8079 9 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
8080 wire.raw.get().deref_unchecked::<crate::WireDictionary<'de>>()
8081 })),
8082
8083 10 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
8084 wire.raw.get().deref_unchecked::<crate::WireConfiguration<'de>>()
8085 })),
8086
8087 _ => unsafe { ::core::hint::unreachable_unchecked() },
8088 }
8089 }
8090}
8091
8092impl<'de> ::fidl_next::FromWireOption<WireOptionalCapability<'de>> for Capability {
8093 #[inline]
8094 fn from_wire_option(wire: WireOptionalCapability<'de>) -> ::core::option::Option<Self> {
8095 if let Some(inner) = wire.into_option() {
8096 Some(::fidl_next::FromWire::from_wire(inner))
8097 } else {
8098 None
8099 }
8100 }
8101}
8102
8103impl<'de> ::fidl_next::IntoNatural for WireOptionalCapability<'de> {
8104 type Natural = ::core::option::Option<Capability>;
8105}
8106
8107impl<'de> ::fidl_next::FromWireOption<WireOptionalCapability<'de>> for Box<Capability> {
8108 #[inline]
8109 fn from_wire_option(wire: WireOptionalCapability<'de>) -> ::core::option::Option<Self> {
8110 <Capability as ::fidl_next::FromWireOption<WireOptionalCapability<'de>>>::from_wire_option(
8111 wire,
8112 )
8113 .map(Box::new)
8114 }
8115}
8116
8117impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalCapability<'de>> for Box<Capability> {
8118 #[inline]
8119 fn from_wire_option_ref(wire: &WireOptionalCapability<'de>) -> ::core::option::Option<Self> {
8120 if let Some(inner) = wire.as_ref() {
8121 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
8122 } else {
8123 None
8124 }
8125 }
8126}
8127
8128#[repr(transparent)]
8130pub struct WireCapability<'de> {
8131 raw: ::fidl_next::RawWireUnion,
8132 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
8133}
8134
8135impl<'de> Drop for WireCapability<'de> {
8136 fn drop(&mut self) {
8137 match self.raw.ordinal() {
8138 1 => {
8139 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireService<'de>>() };
8140 }
8141
8142 2 => {
8143 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireProtocol<'de>>() };
8144 }
8145
8146 3 => {
8147 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDirectory<'de>>() };
8148 }
8149
8150 4 => {
8151 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireStorage<'de>>() };
8152 }
8153
8154 5 => {
8155 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireRunner<'de>>() };
8156 }
8157
8158 6 => {
8159 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireResolver<'de>>() };
8160 }
8161
8162 8 => {
8163 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireEventStream<'de>>() };
8164 }
8165
8166 9 => {
8167 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireDictionary<'de>>() };
8168 }
8169
8170 10 => {
8171 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireConfiguration<'de>>() };
8172 }
8173
8174 _ => (),
8175 }
8176 }
8177}
8178
8179unsafe impl ::fidl_next::Wire for WireCapability<'static> {
8180 type Decoded<'de> = WireCapability<'de>;
8181
8182 #[inline]
8183 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8184 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
8185 ::fidl_next::RawWireUnion::zero_padding(raw);
8186 }
8187}
8188
8189pub mod capability {
8190 pub enum Ref<'de> {
8191 Service(&'de crate::WireService<'de>),
8192
8193 Protocol(&'de crate::WireProtocol<'de>),
8194
8195 Directory(&'de crate::WireDirectory<'de>),
8196
8197 Storage(&'de crate::WireStorage<'de>),
8198
8199 Runner(&'de crate::WireRunner<'de>),
8200
8201 Resolver(&'de crate::WireResolver<'de>),
8202
8203 EventStream(&'de crate::WireEventStream<'de>),
8204
8205 Dictionary(&'de crate::WireDictionary<'de>),
8206
8207 Config(&'de crate::WireConfiguration<'de>),
8208
8209 UnknownOrdinal_(u64),
8210 }
8211}
8212
8213impl<'de> WireCapability<'de> {
8214 pub fn as_ref(&self) -> crate::capability::Ref<'_> {
8215 match self.raw.ordinal() {
8216 1 => crate::capability::Ref::Service(unsafe {
8217 self.raw.get().deref_unchecked::<crate::WireService<'_>>()
8218 }),
8219
8220 2 => crate::capability::Ref::Protocol(unsafe {
8221 self.raw.get().deref_unchecked::<crate::WireProtocol<'_>>()
8222 }),
8223
8224 3 => crate::capability::Ref::Directory(unsafe {
8225 self.raw.get().deref_unchecked::<crate::WireDirectory<'_>>()
8226 }),
8227
8228 4 => crate::capability::Ref::Storage(unsafe {
8229 self.raw.get().deref_unchecked::<crate::WireStorage<'_>>()
8230 }),
8231
8232 5 => crate::capability::Ref::Runner(unsafe {
8233 self.raw.get().deref_unchecked::<crate::WireRunner<'_>>()
8234 }),
8235
8236 6 => crate::capability::Ref::Resolver(unsafe {
8237 self.raw.get().deref_unchecked::<crate::WireResolver<'_>>()
8238 }),
8239
8240 8 => crate::capability::Ref::EventStream(unsafe {
8241 self.raw.get().deref_unchecked::<crate::WireEventStream<'_>>()
8242 }),
8243
8244 9 => crate::capability::Ref::Dictionary(unsafe {
8245 self.raw.get().deref_unchecked::<crate::WireDictionary<'_>>()
8246 }),
8247
8248 10 => crate::capability::Ref::Config(unsafe {
8249 self.raw.get().deref_unchecked::<crate::WireConfiguration<'_>>()
8250 }),
8251
8252 unknown => crate::capability::Ref::UnknownOrdinal_(unknown),
8253 }
8254 }
8255}
8256
8257unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapability<'static>
8258where
8259 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8260 ___D: ::fidl_next::Decoder,
8261{
8262 fn decode(
8263 mut slot: ::fidl_next::Slot<'_, Self>,
8264 decoder: &mut ___D,
8265 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8266 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
8267 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
8268 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireService<'static>>(
8269 raw, decoder,
8270 )?,
8271
8272 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireProtocol<'static>>(
8273 raw, decoder,
8274 )?,
8275
8276 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectory<'static>>(
8277 raw, decoder,
8278 )?,
8279
8280 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireStorage<'static>>(
8281 raw, decoder,
8282 )?,
8283
8284 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireRunner<'static>>(
8285 raw, decoder,
8286 )?,
8287
8288 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireResolver<'static>>(
8289 raw, decoder,
8290 )?,
8291
8292 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEventStream<'static>>(
8293 raw, decoder,
8294 )?,
8295
8296 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDictionary<'static>>(
8297 raw, decoder,
8298 )?,
8299
8300 10 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfiguration<'static>>(
8301 raw, decoder,
8302 )?,
8303
8304 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
8305 }
8306
8307 Ok(())
8308 }
8309}
8310
8311impl<'de> ::core::fmt::Debug for WireCapability<'de> {
8312 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8313 match self.raw.ordinal() {
8314 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireService<'_>>().fmt(f) },
8315 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireProtocol<'_>>().fmt(f) },
8316 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirectory<'_>>().fmt(f) },
8317 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireStorage<'_>>().fmt(f) },
8318 5 => unsafe { self.raw.get().deref_unchecked::<crate::WireRunner<'_>>().fmt(f) },
8319 6 => unsafe { self.raw.get().deref_unchecked::<crate::WireResolver<'_>>().fmt(f) },
8320 8 => unsafe { self.raw.get().deref_unchecked::<crate::WireEventStream<'_>>().fmt(f) },
8321 9 => unsafe { self.raw.get().deref_unchecked::<crate::WireDictionary<'_>>().fmt(f) },
8322 10 => unsafe {
8323 self.raw.get().deref_unchecked::<crate::WireConfiguration<'_>>().fmt(f)
8324 },
8325 _ => unsafe { ::core::hint::unreachable_unchecked() },
8326 }
8327 }
8328}
8329
8330#[repr(transparent)]
8331pub struct WireOptionalCapability<'de> {
8332 raw: ::fidl_next::RawWireUnion,
8333 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
8334}
8335
8336unsafe impl ::fidl_next::Wire for WireOptionalCapability<'static> {
8337 type Decoded<'de> = WireOptionalCapability<'de>;
8338
8339 #[inline]
8340 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8341 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
8342 ::fidl_next::RawWireUnion::zero_padding(raw);
8343 }
8344}
8345
8346impl<'de> WireOptionalCapability<'de> {
8347 pub fn is_some(&self) -> bool {
8348 self.raw.is_some()
8349 }
8350
8351 pub fn is_none(&self) -> bool {
8352 self.raw.is_none()
8353 }
8354
8355 pub fn as_ref(&self) -> ::core::option::Option<&WireCapability<'de>> {
8356 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
8357 }
8358
8359 pub fn into_option(self) -> ::core::option::Option<WireCapability<'de>> {
8360 if self.is_some() {
8361 Some(WireCapability { raw: self.raw, _phantom: ::core::marker::PhantomData })
8362 } else {
8363 None
8364 }
8365 }
8366}
8367
8368unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalCapability<'static>
8369where
8370 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8371 ___D: ::fidl_next::Decoder,
8372{
8373 fn decode(
8374 mut slot: ::fidl_next::Slot<'_, Self>,
8375 decoder: &mut ___D,
8376 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8377 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
8378 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
8379 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireService<'static>>(
8380 raw, decoder,
8381 )?,
8382
8383 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireProtocol<'static>>(
8384 raw, decoder,
8385 )?,
8386
8387 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectory<'static>>(
8388 raw, decoder,
8389 )?,
8390
8391 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireStorage<'static>>(
8392 raw, decoder,
8393 )?,
8394
8395 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireRunner<'static>>(
8396 raw, decoder,
8397 )?,
8398
8399 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireResolver<'static>>(
8400 raw, decoder,
8401 )?,
8402
8403 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEventStream<'static>>(
8404 raw, decoder,
8405 )?,
8406
8407 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDictionary<'static>>(
8408 raw, decoder,
8409 )?,
8410
8411 10 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfiguration<'static>>(
8412 raw, decoder,
8413 )?,
8414
8415 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
8416 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
8417 }
8418
8419 Ok(())
8420 }
8421}
8422
8423impl<'de> ::core::fmt::Debug for WireOptionalCapability<'de> {
8424 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
8425 self.as_ref().fmt(f)
8426 }
8427}
8428
8429#[doc = " Describes under what conditions the component may be started.\n"]
8430#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8431#[repr(u32)]
8432pub enum StartupMode {
8433 Lazy = 0,
8434 Eager = 1,
8435}
8436
8437impl ::fidl_next::Encodable for StartupMode {
8438 type Encoded = WireStartupMode;
8439}
8440impl ::core::convert::TryFrom<u32> for StartupMode {
8441 type Error = ::fidl_next::UnknownStrictEnumMemberError;
8442 fn try_from(
8443 value: u32,
8444 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
8445 match value {
8446 0 => Ok(Self::Lazy),
8447 1 => Ok(Self::Eager),
8448
8449 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
8450 }
8451 }
8452}
8453
8454unsafe impl<___E> ::fidl_next::Encode<___E> for StartupMode
8455where
8456 ___E: ?Sized,
8457{
8458 #[inline]
8459 fn encode(
8460 self,
8461 encoder: &mut ___E,
8462 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8463 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8464 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
8465 }
8466}
8467
8468unsafe impl<___E> ::fidl_next::EncodeRef<___E> for StartupMode
8469where
8470 ___E: ?Sized,
8471{
8472 #[inline]
8473 fn encode_ref(
8474 &self,
8475 encoder: &mut ___E,
8476 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8477 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8478 ::fidl_next::munge!(let WireStartupMode { value } = out);
8479 let _ = value.write(::fidl_next::WireU32::from(match *self {
8480 Self::Lazy => 0,
8481
8482 Self::Eager => 1,
8483 }));
8484
8485 Ok(())
8486 }
8487}
8488
8489impl ::core::convert::From<WireStartupMode> for StartupMode {
8490 fn from(wire: WireStartupMode) -> Self {
8491 match u32::from(wire.value) {
8492 0 => Self::Lazy,
8493
8494 1 => Self::Eager,
8495
8496 _ => unsafe { ::core::hint::unreachable_unchecked() },
8497 }
8498 }
8499}
8500
8501impl ::fidl_next::FromWire<WireStartupMode> for StartupMode {
8502 #[inline]
8503 fn from_wire(wire: WireStartupMode) -> Self {
8504 Self::from(wire)
8505 }
8506}
8507
8508impl ::fidl_next::IntoNatural for WireStartupMode {
8509 type Natural = StartupMode;
8510}
8511
8512impl ::fidl_next::FromWireRef<WireStartupMode> for StartupMode {
8513 #[inline]
8514 fn from_wire_ref(wire: &WireStartupMode) -> Self {
8515 Self::from(*wire)
8516 }
8517}
8518
8519#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8521#[repr(transparent)]
8522pub struct WireStartupMode {
8523 value: ::fidl_next::WireU32,
8524}
8525
8526unsafe impl ::fidl_next::Wire for WireStartupMode {
8527 type Decoded<'de> = Self;
8528
8529 #[inline]
8530 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
8531 }
8533}
8534
8535impl WireStartupMode {
8536 pub const LAZY: WireStartupMode = WireStartupMode { value: ::fidl_next::WireU32(0) };
8537
8538 pub const EAGER: WireStartupMode = WireStartupMode { value: ::fidl_next::WireU32(1) };
8539}
8540
8541unsafe impl<___D> ::fidl_next::Decode<___D> for WireStartupMode
8542where
8543 ___D: ?Sized,
8544{
8545 fn decode(
8546 slot: ::fidl_next::Slot<'_, Self>,
8547 _: &mut ___D,
8548 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8549 ::fidl_next::munge!(let Self { value } = slot);
8550
8551 match u32::from(*value) {
8552 0 | 1 => (),
8553 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
8554 }
8555
8556 Ok(())
8557 }
8558}
8559
8560impl ::core::convert::From<StartupMode> for WireStartupMode {
8561 fn from(natural: StartupMode) -> Self {
8562 match natural {
8563 StartupMode::Lazy => WireStartupMode::LAZY,
8564
8565 StartupMode::Eager => WireStartupMode::EAGER,
8566 }
8567 }
8568}
8569
8570#[doc = " Describes the action to take if this component instance terminates\n unexpectedly.\n"]
8571#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8572#[repr(u32)]
8573pub enum OnTerminate {
8574 None = 0,
8575 Reboot = 1,
8576}
8577
8578impl ::fidl_next::Encodable for OnTerminate {
8579 type Encoded = WireOnTerminate;
8580}
8581impl ::core::convert::TryFrom<u32> for OnTerminate {
8582 type Error = ::fidl_next::UnknownStrictEnumMemberError;
8583 fn try_from(
8584 value: u32,
8585 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
8586 match value {
8587 0 => Ok(Self::None),
8588 1 => Ok(Self::Reboot),
8589
8590 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
8591 }
8592 }
8593}
8594
8595unsafe impl<___E> ::fidl_next::Encode<___E> for OnTerminate
8596where
8597 ___E: ?Sized,
8598{
8599 #[inline]
8600 fn encode(
8601 self,
8602 encoder: &mut ___E,
8603 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8604 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8605 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
8606 }
8607}
8608
8609unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OnTerminate
8610where
8611 ___E: ?Sized,
8612{
8613 #[inline]
8614 fn encode_ref(
8615 &self,
8616 encoder: &mut ___E,
8617 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8618 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8619 ::fidl_next::munge!(let WireOnTerminate { value } = out);
8620 let _ = value.write(::fidl_next::WireU32::from(match *self {
8621 Self::None => 0,
8622
8623 Self::Reboot => 1,
8624 }));
8625
8626 Ok(())
8627 }
8628}
8629
8630impl ::core::convert::From<WireOnTerminate> for OnTerminate {
8631 fn from(wire: WireOnTerminate) -> Self {
8632 match u32::from(wire.value) {
8633 0 => Self::None,
8634
8635 1 => Self::Reboot,
8636
8637 _ => unsafe { ::core::hint::unreachable_unchecked() },
8638 }
8639 }
8640}
8641
8642impl ::fidl_next::FromWire<WireOnTerminate> for OnTerminate {
8643 #[inline]
8644 fn from_wire(wire: WireOnTerminate) -> Self {
8645 Self::from(wire)
8646 }
8647}
8648
8649impl ::fidl_next::IntoNatural for WireOnTerminate {
8650 type Natural = OnTerminate;
8651}
8652
8653impl ::fidl_next::FromWireRef<WireOnTerminate> for OnTerminate {
8654 #[inline]
8655 fn from_wire_ref(wire: &WireOnTerminate) -> Self {
8656 Self::from(*wire)
8657 }
8658}
8659
8660#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8662#[repr(transparent)]
8663pub struct WireOnTerminate {
8664 value: ::fidl_next::WireU32,
8665}
8666
8667unsafe impl ::fidl_next::Wire for WireOnTerminate {
8668 type Decoded<'de> = Self;
8669
8670 #[inline]
8671 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
8672 }
8674}
8675
8676impl WireOnTerminate {
8677 pub const NONE: WireOnTerminate = WireOnTerminate { value: ::fidl_next::WireU32(0) };
8678
8679 pub const REBOOT: WireOnTerminate = WireOnTerminate { value: ::fidl_next::WireU32(1) };
8680}
8681
8682unsafe impl<___D> ::fidl_next::Decode<___D> for WireOnTerminate
8683where
8684 ___D: ?Sized,
8685{
8686 fn decode(
8687 slot: ::fidl_next::Slot<'_, Self>,
8688 _: &mut ___D,
8689 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8690 ::fidl_next::munge!(let Self { value } = slot);
8691
8692 match u32::from(*value) {
8693 0 | 1 => (),
8694 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
8695 }
8696
8697 Ok(())
8698 }
8699}
8700
8701impl ::core::convert::From<OnTerminate> for WireOnTerminate {
8702 fn from(natural: OnTerminate) -> Self {
8703 match natural {
8704 OnTerminate::None => WireOnTerminate::NONE,
8705
8706 OnTerminate::Reboot => WireOnTerminate::REBOOT,
8707 }
8708 }
8709}
8710
8711#[doc = " The string identifier for a config field.\n"]
8712pub type ConfigKey = ::std::string::String;
8713
8714pub type WireConfigKey<'de> = ::fidl_next::WireString<'de>;
8716
8717#[doc = " A directive to override the value of a particular configuration field in the child.\n"]
8718#[derive(PartialEq, Clone, Debug, Default)]
8719pub struct ConfigOverride {
8720 pub key: ::core::option::Option<::std::string::String>,
8721
8722 pub value: ::core::option::Option<crate::ConfigValue>,
8723}
8724
8725impl ConfigOverride {
8726 fn __max_ordinal(&self) -> usize {
8727 if self.value.is_some() {
8728 return 2;
8729 }
8730
8731 if self.key.is_some() {
8732 return 1;
8733 }
8734
8735 0
8736 }
8737}
8738
8739impl ::fidl_next::Encodable for ConfigOverride {
8740 type Encoded = WireConfigOverride<'static>;
8741}
8742
8743unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigOverride
8744where
8745 ___E: ::fidl_next::Encoder + ?Sized,
8746{
8747 #[inline]
8748 fn encode(
8749 mut self,
8750 encoder: &mut ___E,
8751 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8752 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8753 ::fidl_next::munge!(let WireConfigOverride { table } = out);
8754
8755 let max_ord = self.__max_ordinal();
8756
8757 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8758 ::fidl_next::Wire::zero_padding(&mut out);
8759
8760 let mut preallocated =
8761 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8762
8763 for i in 1..=max_ord {
8764 match i {
8765 2 => {
8766 if let Some(value) = self.value.take() {
8767 ::fidl_next::WireEnvelope::encode_value(
8768 value,
8769 preallocated.encoder,
8770 &mut out,
8771 )?;
8772 } else {
8773 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8774 }
8775 }
8776
8777 1 => {
8778 if let Some(value) = self.key.take() {
8779 ::fidl_next::WireEnvelope::encode_value(
8780 value,
8781 preallocated.encoder,
8782 &mut out,
8783 )?;
8784 } else {
8785 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8786 }
8787 }
8788
8789 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8790 }
8791 unsafe {
8792 preallocated.write_next(out.assume_init_ref());
8793 }
8794 }
8795
8796 ::fidl_next::WireTable::encode_len(table, max_ord);
8797
8798 Ok(())
8799 }
8800}
8801
8802unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigOverride
8803where
8804 ___E: ::fidl_next::Encoder + ?Sized,
8805{
8806 #[inline]
8807 fn encode_ref(
8808 &self,
8809 encoder: &mut ___E,
8810 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8811 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8812 ::fidl_next::munge!(let WireConfigOverride { table } = out);
8813
8814 let max_ord = self.__max_ordinal();
8815
8816 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8817 ::fidl_next::Wire::zero_padding(&mut out);
8818
8819 let mut preallocated =
8820 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8821
8822 for i in 1..=max_ord {
8823 match i {
8824 2 => {
8825 if let Some(value) = &self.value {
8826 ::fidl_next::WireEnvelope::encode_value(
8827 value,
8828 preallocated.encoder,
8829 &mut out,
8830 )?;
8831 } else {
8832 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8833 }
8834 }
8835
8836 1 => {
8837 if let Some(value) = &self.key {
8838 ::fidl_next::WireEnvelope::encode_value(
8839 value,
8840 preallocated.encoder,
8841 &mut out,
8842 )?;
8843 } else {
8844 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8845 }
8846 }
8847
8848 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8849 }
8850 unsafe {
8851 preallocated.write_next(out.assume_init_ref());
8852 }
8853 }
8854
8855 ::fidl_next::WireTable::encode_len(table, max_ord);
8856
8857 Ok(())
8858 }
8859}
8860
8861impl<'de> ::fidl_next::FromWire<WireConfigOverride<'de>> for ConfigOverride {
8862 #[inline]
8863 fn from_wire(wire_: WireConfigOverride<'de>) -> Self {
8864 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8865
8866 let key = wire_.table.get(1);
8867
8868 let value = wire_.table.get(2);
8869
8870 Self {
8871 key: key.map(|envelope| {
8872 ::fidl_next::FromWire::from_wire(unsafe {
8873 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
8874 })
8875 }),
8876
8877 value: value.map(|envelope| {
8878 ::fidl_next::FromWire::from_wire(unsafe {
8879 envelope.read_unchecked::<crate::WireConfigValue<'de>>()
8880 })
8881 }),
8882 }
8883 }
8884}
8885
8886impl<'de> ::fidl_next::IntoNatural for WireConfigOverride<'de> {
8887 type Natural = ConfigOverride;
8888}
8889
8890impl<'de> ::fidl_next::FromWireRef<WireConfigOverride<'de>> for ConfigOverride {
8891 #[inline]
8892 fn from_wire_ref(wire: &WireConfigOverride<'de>) -> Self {
8893 Self {
8894 key: wire.table.get(1).map(|envelope| {
8895 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8896 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
8897 })
8898 }),
8899
8900 value: wire.table.get(2).map(|envelope| {
8901 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8902 envelope.deref_unchecked::<crate::WireConfigValue<'de>>()
8903 })
8904 }),
8905 }
8906 }
8907}
8908
8909#[repr(C)]
8911pub struct WireConfigOverride<'de> {
8912 table: ::fidl_next::WireTable<'de>,
8913}
8914
8915impl<'de> Drop for WireConfigOverride<'de> {
8916 fn drop(&mut self) {
8917 let _ = self
8918 .table
8919 .get(1)
8920 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
8921
8922 let _ = self
8923 .table
8924 .get(2)
8925 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigValue<'de>>() });
8926 }
8927}
8928
8929unsafe impl ::fidl_next::Wire for WireConfigOverride<'static> {
8930 type Decoded<'de> = WireConfigOverride<'de>;
8931
8932 #[inline]
8933 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8934 ::fidl_next::munge!(let Self { table } = out);
8935 ::fidl_next::WireTable::zero_padding(table);
8936 }
8937}
8938
8939unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigOverride<'static>
8940where
8941 ___D: ::fidl_next::Decoder + ?Sized,
8942{
8943 fn decode(
8944 slot: ::fidl_next::Slot<'_, Self>,
8945 decoder: &mut ___D,
8946 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
8947 ::fidl_next::munge!(let Self { table } = slot);
8948
8949 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8950 match ordinal {
8951 0 => unsafe { ::core::hint::unreachable_unchecked() },
8952
8953 1 => {
8954 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
8955 slot.as_mut(),
8956 decoder,
8957 )?;
8958
8959 let value = unsafe {
8960 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
8961 };
8962
8963 if value.len() > 64 {
8964 return Err(::fidl_next::DecodeError::VectorTooLong {
8965 size: value.len() as u64,
8966 limit: 64,
8967 });
8968 }
8969
8970 Ok(())
8971 }
8972
8973 2 => {
8974 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigValue<'static>>(
8975 slot.as_mut(),
8976 decoder,
8977 )?;
8978
8979 Ok(())
8980 }
8981
8982 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
8983 }
8984 })
8985 }
8986}
8987
8988impl<'de> WireConfigOverride<'de> {
8989 pub fn key(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
8990 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8991 }
8992
8993 pub fn value(&self) -> ::core::option::Option<&crate::WireConfigValue<'de>> {
8994 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
8995 }
8996}
8997
8998impl<'de> ::core::fmt::Debug for WireConfigOverride<'de> {
8999 fn fmt(
9000 &self,
9001 f: &mut ::core::fmt::Formatter<'_>,
9002 ) -> ::core::result::Result<(), ::core::fmt::Error> {
9003 f.debug_struct("ConfigOverride")
9004 .field("key", &self.key())
9005 .field("value", &self.value())
9006 .finish()
9007 }
9008}
9009
9010#[doc = " Statically declares a child component instance.\n"]
9011#[derive(PartialEq, Clone, Debug, Default)]
9012pub struct Child {
9013 pub name: ::core::option::Option<::std::string::String>,
9014
9015 pub url: ::core::option::Option<::std::string::String>,
9016
9017 pub startup: ::core::option::Option<crate::StartupMode>,
9018
9019 pub environment: ::core::option::Option<::std::string::String>,
9020
9021 pub on_terminate: ::core::option::Option<crate::OnTerminate>,
9022
9023 pub config_overrides: ::core::option::Option<::std::vec::Vec<crate::ConfigOverride>>,
9024}
9025
9026impl Child {
9027 fn __max_ordinal(&self) -> usize {
9028 if self.config_overrides.is_some() {
9029 return 6;
9030 }
9031
9032 if self.on_terminate.is_some() {
9033 return 5;
9034 }
9035
9036 if self.environment.is_some() {
9037 return 4;
9038 }
9039
9040 if self.startup.is_some() {
9041 return 3;
9042 }
9043
9044 if self.url.is_some() {
9045 return 2;
9046 }
9047
9048 if self.name.is_some() {
9049 return 1;
9050 }
9051
9052 0
9053 }
9054}
9055
9056impl ::fidl_next::Encodable for Child {
9057 type Encoded = WireChild<'static>;
9058}
9059
9060unsafe impl<___E> ::fidl_next::Encode<___E> for Child
9061where
9062 ___E: ::fidl_next::Encoder + ?Sized,
9063{
9064 #[inline]
9065 fn encode(
9066 mut self,
9067 encoder: &mut ___E,
9068 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9069 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9070 ::fidl_next::munge!(let WireChild { table } = out);
9071
9072 let max_ord = self.__max_ordinal();
9073
9074 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9075 ::fidl_next::Wire::zero_padding(&mut out);
9076
9077 let mut preallocated =
9078 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9079
9080 for i in 1..=max_ord {
9081 match i {
9082 6 => {
9083 if let Some(value) = self.config_overrides.take() {
9084 ::fidl_next::WireEnvelope::encode_value(
9085 value,
9086 preallocated.encoder,
9087 &mut out,
9088 )?;
9089 } else {
9090 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9091 }
9092 }
9093
9094 5 => {
9095 if let Some(value) = self.on_terminate.take() {
9096 ::fidl_next::WireEnvelope::encode_value(
9097 value,
9098 preallocated.encoder,
9099 &mut out,
9100 )?;
9101 } else {
9102 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9103 }
9104 }
9105
9106 4 => {
9107 if let Some(value) = self.environment.take() {
9108 ::fidl_next::WireEnvelope::encode_value(
9109 value,
9110 preallocated.encoder,
9111 &mut out,
9112 )?;
9113 } else {
9114 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9115 }
9116 }
9117
9118 3 => {
9119 if let Some(value) = self.startup.take() {
9120 ::fidl_next::WireEnvelope::encode_value(
9121 value,
9122 preallocated.encoder,
9123 &mut out,
9124 )?;
9125 } else {
9126 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9127 }
9128 }
9129
9130 2 => {
9131 if let Some(value) = self.url.take() {
9132 ::fidl_next::WireEnvelope::encode_value(
9133 value,
9134 preallocated.encoder,
9135 &mut out,
9136 )?;
9137 } else {
9138 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9139 }
9140 }
9141
9142 1 => {
9143 if let Some(value) = self.name.take() {
9144 ::fidl_next::WireEnvelope::encode_value(
9145 value,
9146 preallocated.encoder,
9147 &mut out,
9148 )?;
9149 } else {
9150 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9151 }
9152 }
9153
9154 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9155 }
9156 unsafe {
9157 preallocated.write_next(out.assume_init_ref());
9158 }
9159 }
9160
9161 ::fidl_next::WireTable::encode_len(table, max_ord);
9162
9163 Ok(())
9164 }
9165}
9166
9167unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Child
9168where
9169 ___E: ::fidl_next::Encoder + ?Sized,
9170{
9171 #[inline]
9172 fn encode_ref(
9173 &self,
9174 encoder: &mut ___E,
9175 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9176 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9177 ::fidl_next::munge!(let WireChild { table } = out);
9178
9179 let max_ord = self.__max_ordinal();
9180
9181 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9182 ::fidl_next::Wire::zero_padding(&mut out);
9183
9184 let mut preallocated =
9185 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9186
9187 for i in 1..=max_ord {
9188 match i {
9189 6 => {
9190 if let Some(value) = &self.config_overrides {
9191 ::fidl_next::WireEnvelope::encode_value(
9192 value,
9193 preallocated.encoder,
9194 &mut out,
9195 )?;
9196 } else {
9197 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9198 }
9199 }
9200
9201 5 => {
9202 if let Some(value) = &self.on_terminate {
9203 ::fidl_next::WireEnvelope::encode_value(
9204 value,
9205 preallocated.encoder,
9206 &mut out,
9207 )?;
9208 } else {
9209 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9210 }
9211 }
9212
9213 4 => {
9214 if let Some(value) = &self.environment {
9215 ::fidl_next::WireEnvelope::encode_value(
9216 value,
9217 preallocated.encoder,
9218 &mut out,
9219 )?;
9220 } else {
9221 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9222 }
9223 }
9224
9225 3 => {
9226 if let Some(value) = &self.startup {
9227 ::fidl_next::WireEnvelope::encode_value(
9228 value,
9229 preallocated.encoder,
9230 &mut out,
9231 )?;
9232 } else {
9233 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9234 }
9235 }
9236
9237 2 => {
9238 if let Some(value) = &self.url {
9239 ::fidl_next::WireEnvelope::encode_value(
9240 value,
9241 preallocated.encoder,
9242 &mut out,
9243 )?;
9244 } else {
9245 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9246 }
9247 }
9248
9249 1 => {
9250 if let Some(value) = &self.name {
9251 ::fidl_next::WireEnvelope::encode_value(
9252 value,
9253 preallocated.encoder,
9254 &mut out,
9255 )?;
9256 } else {
9257 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9258 }
9259 }
9260
9261 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9262 }
9263 unsafe {
9264 preallocated.write_next(out.assume_init_ref());
9265 }
9266 }
9267
9268 ::fidl_next::WireTable::encode_len(table, max_ord);
9269
9270 Ok(())
9271 }
9272}
9273
9274impl<'de> ::fidl_next::FromWire<WireChild<'de>> for Child {
9275 #[inline]
9276 fn from_wire(wire_: WireChild<'de>) -> Self {
9277 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
9278
9279 let name = wire_.table.get(1);
9280
9281 let url = wire_.table.get(2);
9282
9283 let startup = wire_.table.get(3);
9284
9285 let environment = wire_.table.get(4);
9286
9287 let on_terminate = wire_.table.get(5);
9288
9289 let config_overrides = wire_.table.get(6);
9290
9291 Self {
9292
9293
9294 name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
9295 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
9296 )),
9297
9298
9299 url: url.map(|envelope| ::fidl_next::FromWire::from_wire(
9300 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
9301 )),
9302
9303
9304 startup: startup.map(|envelope| ::fidl_next::FromWire::from_wire(
9305 unsafe { envelope.read_unchecked::<crate::WireStartupMode>() }
9306 )),
9307
9308
9309 environment: environment.map(|envelope| ::fidl_next::FromWire::from_wire(
9310 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
9311 )),
9312
9313
9314 on_terminate: on_terminate.map(|envelope| ::fidl_next::FromWire::from_wire(
9315 unsafe { envelope.read_unchecked::<crate::WireOnTerminate>() }
9316 )),
9317
9318
9319 config_overrides: config_overrides.map(|envelope| ::fidl_next::FromWire::from_wire(
9320 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigOverride<'de>>>() }
9321 )),
9322
9323 }
9324 }
9325}
9326
9327impl<'de> ::fidl_next::IntoNatural for WireChild<'de> {
9328 type Natural = Child;
9329}
9330
9331impl<'de> ::fidl_next::FromWireRef<WireChild<'de>> for Child {
9332 #[inline]
9333 fn from_wire_ref(wire: &WireChild<'de>) -> Self {
9334 Self {
9335
9336
9337 name: wire.table.get(1)
9338 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9339 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
9340 )),
9341
9342
9343 url: wire.table.get(2)
9344 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9345 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
9346 )),
9347
9348
9349 startup: wire.table.get(3)
9350 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9351 unsafe { envelope.deref_unchecked::<crate::WireStartupMode>() }
9352 )),
9353
9354
9355 environment: wire.table.get(4)
9356 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9357 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
9358 )),
9359
9360
9361 on_terminate: wire.table.get(5)
9362 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9363 unsafe { envelope.deref_unchecked::<crate::WireOnTerminate>() }
9364 )),
9365
9366
9367 config_overrides: wire.table.get(6)
9368 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9369 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigOverride<'de>>>() }
9370 )),
9371
9372 }
9373 }
9374}
9375
9376#[repr(C)]
9378pub struct WireChild<'de> {
9379 table: ::fidl_next::WireTable<'de>,
9380}
9381
9382impl<'de> Drop for WireChild<'de> {
9383 fn drop(&mut self) {
9384 let _ = self
9385 .table
9386 .get(1)
9387 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
9388
9389 let _ = self
9390 .table
9391 .get(2)
9392 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
9393
9394 let _ = self
9395 .table
9396 .get(3)
9397 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireStartupMode>() });
9398
9399 let _ = self
9400 .table
9401 .get(4)
9402 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
9403
9404 let _ = self
9405 .table
9406 .get(5)
9407 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireOnTerminate>() });
9408
9409 let _ = self.table.get(6).map(|envelope| unsafe {
9410 envelope
9411 .read_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigOverride<'de>>>()
9412 });
9413 }
9414}
9415
9416unsafe impl ::fidl_next::Wire for WireChild<'static> {
9417 type Decoded<'de> = WireChild<'de>;
9418
9419 #[inline]
9420 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9421 ::fidl_next::munge!(let Self { table } = out);
9422 ::fidl_next::WireTable::zero_padding(table);
9423 }
9424}
9425
9426unsafe impl<___D> ::fidl_next::Decode<___D> for WireChild<'static>
9427where
9428 ___D: ::fidl_next::Decoder + ?Sized,
9429{
9430 fn decode(
9431 slot: ::fidl_next::Slot<'_, Self>,
9432 decoder: &mut ___D,
9433 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9434 ::fidl_next::munge!(let Self { table } = slot);
9435
9436 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9437 match ordinal {
9438 0 => unsafe { ::core::hint::unreachable_unchecked() },
9439
9440 1 => {
9441 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
9442 slot.as_mut(),
9443 decoder,
9444 )?;
9445
9446 let value = unsafe {
9447 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
9448 };
9449
9450 if value.len() > 1024 {
9451 return Err(::fidl_next::DecodeError::VectorTooLong {
9452 size: value.len() as u64,
9453 limit: 1024,
9454 });
9455 }
9456
9457 Ok(())
9458 }
9459
9460 2 => {
9461 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
9462 slot.as_mut(),
9463 decoder,
9464 )?;
9465
9466 let value = unsafe {
9467 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
9468 };
9469
9470 if value.len() > 4096 {
9471 return Err(::fidl_next::DecodeError::VectorTooLong {
9472 size: value.len() as u64,
9473 limit: 4096,
9474 });
9475 }
9476
9477 Ok(())
9478 }
9479
9480 3 => {
9481 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireStartupMode>(
9482 slot.as_mut(),
9483 decoder,
9484 )?;
9485
9486 Ok(())
9487 }
9488
9489 4 => {
9490 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
9491 slot.as_mut(),
9492 decoder,
9493 )?;
9494
9495 let value = unsafe {
9496 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
9497 };
9498
9499 if value.len() > 100 {
9500 return Err(::fidl_next::DecodeError::VectorTooLong {
9501 size: value.len() as u64,
9502 limit: 100,
9503 });
9504 }
9505
9506 Ok(())
9507 }
9508
9509 5 => {
9510 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireOnTerminate>(
9511 slot.as_mut(),
9512 decoder,
9513 )?;
9514
9515 Ok(())
9516 }
9517
9518 6 => {
9519 ::fidl_next::WireEnvelope::decode_as::<
9520 ___D,
9521 ::fidl_next::WireVector<'static, crate::WireConfigOverride<'static>>,
9522 >(slot.as_mut(), decoder)?;
9523
9524 Ok(())
9525 }
9526
9527 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9528 }
9529 })
9530 }
9531}
9532
9533impl<'de> WireChild<'de> {
9534 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
9535 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9536 }
9537
9538 pub fn url(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
9539 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9540 }
9541
9542 pub fn startup(&self) -> ::core::option::Option<&crate::WireStartupMode> {
9543 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
9544 }
9545
9546 pub fn environment(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
9547 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
9548 }
9549
9550 pub fn on_terminate(&self) -> ::core::option::Option<&crate::WireOnTerminate> {
9551 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
9552 }
9553
9554 pub fn config_overrides(
9555 &self,
9556 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireConfigOverride<'de>>> {
9557 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
9558 }
9559}
9560
9561impl<'de> ::core::fmt::Debug for WireChild<'de> {
9562 fn fmt(
9563 &self,
9564 f: &mut ::core::fmt::Formatter<'_>,
9565 ) -> ::core::result::Result<(), ::core::fmt::Error> {
9566 f.debug_struct("Child")
9567 .field("name", &self.name())
9568 .field("url", &self.url())
9569 .field("startup", &self.startup())
9570 .field("environment", &self.environment())
9571 .field("on_terminate", &self.on_terminate())
9572 .field("config_overrides", &self.config_overrides())
9573 .finish()
9574 }
9575}
9576
9577#[doc = " The durability of component instances created in a collection.\n"]
9578#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9579#[repr(u32)]
9580pub enum Durability {
9581 Transient = 2,
9582 SingleRun = 3,
9583}
9584
9585impl ::fidl_next::Encodable for Durability {
9586 type Encoded = WireDurability;
9587}
9588impl ::core::convert::TryFrom<u32> for Durability {
9589 type Error = ::fidl_next::UnknownStrictEnumMemberError;
9590 fn try_from(
9591 value: u32,
9592 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
9593 match value {
9594 2 => Ok(Self::Transient),
9595 3 => Ok(Self::SingleRun),
9596
9597 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
9598 }
9599 }
9600}
9601
9602unsafe impl<___E> ::fidl_next::Encode<___E> for Durability
9603where
9604 ___E: ?Sized,
9605{
9606 #[inline]
9607 fn encode(
9608 self,
9609 encoder: &mut ___E,
9610 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9611 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9612 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
9613 }
9614}
9615
9616unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Durability
9617where
9618 ___E: ?Sized,
9619{
9620 #[inline]
9621 fn encode_ref(
9622 &self,
9623 encoder: &mut ___E,
9624 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9625 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9626 ::fidl_next::munge!(let WireDurability { value } = out);
9627 let _ = value.write(::fidl_next::WireU32::from(match *self {
9628 Self::Transient => 2,
9629
9630 Self::SingleRun => 3,
9631 }));
9632
9633 Ok(())
9634 }
9635}
9636
9637impl ::core::convert::From<WireDurability> for Durability {
9638 fn from(wire: WireDurability) -> Self {
9639 match u32::from(wire.value) {
9640 2 => Self::Transient,
9641
9642 3 => Self::SingleRun,
9643
9644 _ => unsafe { ::core::hint::unreachable_unchecked() },
9645 }
9646 }
9647}
9648
9649impl ::fidl_next::FromWire<WireDurability> for Durability {
9650 #[inline]
9651 fn from_wire(wire: WireDurability) -> Self {
9652 Self::from(wire)
9653 }
9654}
9655
9656impl ::fidl_next::IntoNatural for WireDurability {
9657 type Natural = Durability;
9658}
9659
9660impl ::fidl_next::FromWireRef<WireDurability> for Durability {
9661 #[inline]
9662 fn from_wire_ref(wire: &WireDurability) -> Self {
9663 Self::from(*wire)
9664 }
9665}
9666
9667#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9669#[repr(transparent)]
9670pub struct WireDurability {
9671 value: ::fidl_next::WireU32,
9672}
9673
9674unsafe impl ::fidl_next::Wire for WireDurability {
9675 type Decoded<'de> = Self;
9676
9677 #[inline]
9678 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
9679 }
9681}
9682
9683impl WireDurability {
9684 pub const TRANSIENT: WireDurability = WireDurability { value: ::fidl_next::WireU32(2) };
9685
9686 pub const SINGLE_RUN: WireDurability = WireDurability { value: ::fidl_next::WireU32(3) };
9687}
9688
9689unsafe impl<___D> ::fidl_next::Decode<___D> for WireDurability
9690where
9691 ___D: ?Sized,
9692{
9693 fn decode(
9694 slot: ::fidl_next::Slot<'_, Self>,
9695 _: &mut ___D,
9696 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
9697 ::fidl_next::munge!(let Self { value } = slot);
9698
9699 match u32::from(*value) {
9700 2 | 3 => (),
9701 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
9702 }
9703
9704 Ok(())
9705 }
9706}
9707
9708impl ::core::convert::From<Durability> for WireDurability {
9709 fn from(natural: Durability) -> Self {
9710 match natural {
9711 Durability::Transient => WireDurability::TRANSIENT,
9712
9713 Durability::SingleRun => WireDurability::SINGLE_RUN,
9714 }
9715 }
9716}
9717
9718#[doc = " Statically declares a component instance collection.\n"]
9719#[derive(PartialEq, Clone, Debug, Default)]
9720pub struct Collection {
9721 pub name: ::core::option::Option<::std::string::String>,
9722
9723 pub durability: ::core::option::Option<crate::Durability>,
9724
9725 pub environment: ::core::option::Option<::std::string::String>,
9726
9727 pub allowed_offers: ::core::option::Option<crate::AllowedOffers>,
9728
9729 pub allow_long_names: ::core::option::Option<bool>,
9730
9731 pub persistent_storage: ::core::option::Option<bool>,
9732}
9733
9734impl Collection {
9735 fn __max_ordinal(&self) -> usize {
9736 if self.persistent_storage.is_some() {
9737 return 6;
9738 }
9739
9740 if self.allow_long_names.is_some() {
9741 return 5;
9742 }
9743
9744 if self.allowed_offers.is_some() {
9745 return 4;
9746 }
9747
9748 if self.environment.is_some() {
9749 return 3;
9750 }
9751
9752 if self.durability.is_some() {
9753 return 2;
9754 }
9755
9756 if self.name.is_some() {
9757 return 1;
9758 }
9759
9760 0
9761 }
9762}
9763
9764impl ::fidl_next::Encodable for Collection {
9765 type Encoded = WireCollection<'static>;
9766}
9767
9768unsafe impl<___E> ::fidl_next::Encode<___E> for Collection
9769where
9770 ___E: ::fidl_next::Encoder + ?Sized,
9771{
9772 #[inline]
9773 fn encode(
9774 mut self,
9775 encoder: &mut ___E,
9776 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9777 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9778 ::fidl_next::munge!(let WireCollection { table } = out);
9779
9780 let max_ord = self.__max_ordinal();
9781
9782 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9783 ::fidl_next::Wire::zero_padding(&mut out);
9784
9785 let mut preallocated =
9786 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9787
9788 for i in 1..=max_ord {
9789 match i {
9790 6 => {
9791 if let Some(value) = self.persistent_storage.take() {
9792 ::fidl_next::WireEnvelope::encode_value(
9793 value,
9794 preallocated.encoder,
9795 &mut out,
9796 )?;
9797 } else {
9798 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9799 }
9800 }
9801
9802 5 => {
9803 if let Some(value) = self.allow_long_names.take() {
9804 ::fidl_next::WireEnvelope::encode_value(
9805 value,
9806 preallocated.encoder,
9807 &mut out,
9808 )?;
9809 } else {
9810 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9811 }
9812 }
9813
9814 4 => {
9815 if let Some(value) = self.allowed_offers.take() {
9816 ::fidl_next::WireEnvelope::encode_value(
9817 value,
9818 preallocated.encoder,
9819 &mut out,
9820 )?;
9821 } else {
9822 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9823 }
9824 }
9825
9826 3 => {
9827 if let Some(value) = self.environment.take() {
9828 ::fidl_next::WireEnvelope::encode_value(
9829 value,
9830 preallocated.encoder,
9831 &mut out,
9832 )?;
9833 } else {
9834 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9835 }
9836 }
9837
9838 2 => {
9839 if let Some(value) = self.durability.take() {
9840 ::fidl_next::WireEnvelope::encode_value(
9841 value,
9842 preallocated.encoder,
9843 &mut out,
9844 )?;
9845 } else {
9846 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9847 }
9848 }
9849
9850 1 => {
9851 if let Some(value) = self.name.take() {
9852 ::fidl_next::WireEnvelope::encode_value(
9853 value,
9854 preallocated.encoder,
9855 &mut out,
9856 )?;
9857 } else {
9858 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9859 }
9860 }
9861
9862 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9863 }
9864 unsafe {
9865 preallocated.write_next(out.assume_init_ref());
9866 }
9867 }
9868
9869 ::fidl_next::WireTable::encode_len(table, max_ord);
9870
9871 Ok(())
9872 }
9873}
9874
9875unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Collection
9876where
9877 ___E: ::fidl_next::Encoder + ?Sized,
9878{
9879 #[inline]
9880 fn encode_ref(
9881 &self,
9882 encoder: &mut ___E,
9883 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9884 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9885 ::fidl_next::munge!(let WireCollection { table } = out);
9886
9887 let max_ord = self.__max_ordinal();
9888
9889 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9890 ::fidl_next::Wire::zero_padding(&mut out);
9891
9892 let mut preallocated =
9893 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9894
9895 for i in 1..=max_ord {
9896 match i {
9897 6 => {
9898 if let Some(value) = &self.persistent_storage {
9899 ::fidl_next::WireEnvelope::encode_value(
9900 value,
9901 preallocated.encoder,
9902 &mut out,
9903 )?;
9904 } else {
9905 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9906 }
9907 }
9908
9909 5 => {
9910 if let Some(value) = &self.allow_long_names {
9911 ::fidl_next::WireEnvelope::encode_value(
9912 value,
9913 preallocated.encoder,
9914 &mut out,
9915 )?;
9916 } else {
9917 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9918 }
9919 }
9920
9921 4 => {
9922 if let Some(value) = &self.allowed_offers {
9923 ::fidl_next::WireEnvelope::encode_value(
9924 value,
9925 preallocated.encoder,
9926 &mut out,
9927 )?;
9928 } else {
9929 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9930 }
9931 }
9932
9933 3 => {
9934 if let Some(value) = &self.environment {
9935 ::fidl_next::WireEnvelope::encode_value(
9936 value,
9937 preallocated.encoder,
9938 &mut out,
9939 )?;
9940 } else {
9941 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9942 }
9943 }
9944
9945 2 => {
9946 if let Some(value) = &self.durability {
9947 ::fidl_next::WireEnvelope::encode_value(
9948 value,
9949 preallocated.encoder,
9950 &mut out,
9951 )?;
9952 } else {
9953 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9954 }
9955 }
9956
9957 1 => {
9958 if let Some(value) = &self.name {
9959 ::fidl_next::WireEnvelope::encode_value(
9960 value,
9961 preallocated.encoder,
9962 &mut out,
9963 )?;
9964 } else {
9965 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9966 }
9967 }
9968
9969 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9970 }
9971 unsafe {
9972 preallocated.write_next(out.assume_init_ref());
9973 }
9974 }
9975
9976 ::fidl_next::WireTable::encode_len(table, max_ord);
9977
9978 Ok(())
9979 }
9980}
9981
9982impl<'de> ::fidl_next::FromWire<WireCollection<'de>> for Collection {
9983 #[inline]
9984 fn from_wire(wire_: WireCollection<'de>) -> Self {
9985 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
9986
9987 let name = wire_.table.get(1);
9988
9989 let durability = wire_.table.get(2);
9990
9991 let environment = wire_.table.get(3);
9992
9993 let allowed_offers = wire_.table.get(4);
9994
9995 let allow_long_names = wire_.table.get(5);
9996
9997 let persistent_storage = wire_.table.get(6);
9998
9999 Self {
10000 name: name.map(|envelope| {
10001 ::fidl_next::FromWire::from_wire(unsafe {
10002 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
10003 })
10004 }),
10005
10006 durability: durability.map(|envelope| {
10007 ::fidl_next::FromWire::from_wire(unsafe {
10008 envelope.read_unchecked::<crate::WireDurability>()
10009 })
10010 }),
10011
10012 environment: environment.map(|envelope| {
10013 ::fidl_next::FromWire::from_wire(unsafe {
10014 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
10015 })
10016 }),
10017
10018 allowed_offers: allowed_offers.map(|envelope| {
10019 ::fidl_next::FromWire::from_wire(unsafe {
10020 envelope.read_unchecked::<crate::WireAllowedOffers>()
10021 })
10022 }),
10023
10024 allow_long_names: allow_long_names.map(|envelope| {
10025 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
10026 }),
10027
10028 persistent_storage: persistent_storage.map(|envelope| {
10029 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
10030 }),
10031 }
10032 }
10033}
10034
10035impl<'de> ::fidl_next::IntoNatural for WireCollection<'de> {
10036 type Natural = Collection;
10037}
10038
10039impl<'de> ::fidl_next::FromWireRef<WireCollection<'de>> for Collection {
10040 #[inline]
10041 fn from_wire_ref(wire: &WireCollection<'de>) -> Self {
10042 Self {
10043 name: wire.table.get(1).map(|envelope| {
10044 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10045 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
10046 })
10047 }),
10048
10049 durability: wire.table.get(2).map(|envelope| {
10050 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10051 envelope.deref_unchecked::<crate::WireDurability>()
10052 })
10053 }),
10054
10055 environment: wire.table.get(3).map(|envelope| {
10056 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10057 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
10058 })
10059 }),
10060
10061 allowed_offers: wire.table.get(4).map(|envelope| {
10062 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10063 envelope.deref_unchecked::<crate::WireAllowedOffers>()
10064 })
10065 }),
10066
10067 allow_long_names: wire.table.get(5).map(|envelope| {
10068 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10069 envelope.deref_unchecked::<bool>()
10070 })
10071 }),
10072
10073 persistent_storage: wire.table.get(6).map(|envelope| {
10074 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10075 envelope.deref_unchecked::<bool>()
10076 })
10077 }),
10078 }
10079 }
10080}
10081
10082#[repr(C)]
10084pub struct WireCollection<'de> {
10085 table: ::fidl_next::WireTable<'de>,
10086}
10087
10088impl<'de> Drop for WireCollection<'de> {
10089 fn drop(&mut self) {
10090 let _ = self
10091 .table
10092 .get(1)
10093 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
10094
10095 let _ = self
10096 .table
10097 .get(2)
10098 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDurability>() });
10099
10100 let _ = self
10101 .table
10102 .get(3)
10103 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
10104
10105 let _ = self
10106 .table
10107 .get(4)
10108 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAllowedOffers>() });
10109
10110 let _ = self.table.get(5).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
10111
10112 let _ = self.table.get(6).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
10113 }
10114}
10115
10116unsafe impl ::fidl_next::Wire for WireCollection<'static> {
10117 type Decoded<'de> = WireCollection<'de>;
10118
10119 #[inline]
10120 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10121 ::fidl_next::munge!(let Self { table } = out);
10122 ::fidl_next::WireTable::zero_padding(table);
10123 }
10124}
10125
10126unsafe impl<___D> ::fidl_next::Decode<___D> for WireCollection<'static>
10127where
10128 ___D: ::fidl_next::Decoder + ?Sized,
10129{
10130 fn decode(
10131 slot: ::fidl_next::Slot<'_, Self>,
10132 decoder: &mut ___D,
10133 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10134 ::fidl_next::munge!(let Self { table } = slot);
10135
10136 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10137 match ordinal {
10138 0 => unsafe { ::core::hint::unreachable_unchecked() },
10139
10140 1 => {
10141 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
10142 slot.as_mut(),
10143 decoder,
10144 )?;
10145
10146 let value = unsafe {
10147 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
10148 };
10149
10150 if value.len() > 100 {
10151 return Err(::fidl_next::DecodeError::VectorTooLong {
10152 size: value.len() as u64,
10153 limit: 100,
10154 });
10155 }
10156
10157 Ok(())
10158 }
10159
10160 2 => {
10161 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDurability>(
10162 slot.as_mut(),
10163 decoder,
10164 )?;
10165
10166 Ok(())
10167 }
10168
10169 3 => {
10170 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
10171 slot.as_mut(),
10172 decoder,
10173 )?;
10174
10175 let value = unsafe {
10176 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
10177 };
10178
10179 if value.len() > 100 {
10180 return Err(::fidl_next::DecodeError::VectorTooLong {
10181 size: value.len() as u64,
10182 limit: 100,
10183 });
10184 }
10185
10186 Ok(())
10187 }
10188
10189 4 => {
10190 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAllowedOffers>(
10191 slot.as_mut(),
10192 decoder,
10193 )?;
10194
10195 Ok(())
10196 }
10197
10198 5 => {
10199 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
10200
10201 Ok(())
10202 }
10203
10204 6 => {
10205 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
10206
10207 Ok(())
10208 }
10209
10210 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
10211 }
10212 })
10213 }
10214}
10215
10216impl<'de> WireCollection<'de> {
10217 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
10218 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10219 }
10220
10221 pub fn durability(&self) -> ::core::option::Option<&crate::WireDurability> {
10222 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10223 }
10224
10225 pub fn environment(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
10226 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10227 }
10228
10229 pub fn allowed_offers(&self) -> ::core::option::Option<&crate::WireAllowedOffers> {
10230 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10231 }
10232
10233 pub fn allow_long_names(&self) -> ::core::option::Option<&bool> {
10234 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10235 }
10236
10237 pub fn persistent_storage(&self) -> ::core::option::Option<&bool> {
10238 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10239 }
10240}
10241
10242impl<'de> ::core::fmt::Debug for WireCollection<'de> {
10243 fn fmt(
10244 &self,
10245 f: &mut ::core::fmt::Formatter<'_>,
10246 ) -> ::core::result::Result<(), ::core::fmt::Error> {
10247 f.debug_struct("Collection")
10248 .field("name", &self.name())
10249 .field("durability", &self.durability())
10250 .field("environment", &self.environment())
10251 .field("allowed_offers", &self.allowed_offers())
10252 .field("allow_long_names", &self.allow_long_names())
10253 .field("persistent_storage", &self.persistent_storage())
10254 .finish()
10255 }
10256}
10257
10258#[doc = " Describes the type of dependency implied by the capability.\n"]
10259#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10260#[repr(u32)]
10261pub enum DependencyType {
10262 Strong = 1,
10263 Weak = 2,
10264}
10265
10266impl ::fidl_next::Encodable for DependencyType {
10267 type Encoded = WireDependencyType;
10268}
10269impl ::core::convert::TryFrom<u32> for DependencyType {
10270 type Error = ::fidl_next::UnknownStrictEnumMemberError;
10271 fn try_from(
10272 value: u32,
10273 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
10274 match value {
10275 1 => Ok(Self::Strong),
10276 2 => Ok(Self::Weak),
10277
10278 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
10279 }
10280 }
10281}
10282
10283unsafe impl<___E> ::fidl_next::Encode<___E> for DependencyType
10284where
10285 ___E: ?Sized,
10286{
10287 #[inline]
10288 fn encode(
10289 self,
10290 encoder: &mut ___E,
10291 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10292 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10293 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
10294 }
10295}
10296
10297unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DependencyType
10298where
10299 ___E: ?Sized,
10300{
10301 #[inline]
10302 fn encode_ref(
10303 &self,
10304 encoder: &mut ___E,
10305 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10306 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10307 ::fidl_next::munge!(let WireDependencyType { value } = out);
10308 let _ = value.write(::fidl_next::WireU32::from(match *self {
10309 Self::Strong => 1,
10310
10311 Self::Weak => 2,
10312 }));
10313
10314 Ok(())
10315 }
10316}
10317
10318impl ::core::convert::From<WireDependencyType> for DependencyType {
10319 fn from(wire: WireDependencyType) -> Self {
10320 match u32::from(wire.value) {
10321 1 => Self::Strong,
10322
10323 2 => Self::Weak,
10324
10325 _ => unsafe { ::core::hint::unreachable_unchecked() },
10326 }
10327 }
10328}
10329
10330impl ::fidl_next::FromWire<WireDependencyType> for DependencyType {
10331 #[inline]
10332 fn from_wire(wire: WireDependencyType) -> Self {
10333 Self::from(wire)
10334 }
10335}
10336
10337impl ::fidl_next::IntoNatural for WireDependencyType {
10338 type Natural = DependencyType;
10339}
10340
10341impl ::fidl_next::FromWireRef<WireDependencyType> for DependencyType {
10342 #[inline]
10343 fn from_wire_ref(wire: &WireDependencyType) -> Self {
10344 Self::from(*wire)
10345 }
10346}
10347
10348#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10350#[repr(transparent)]
10351pub struct WireDependencyType {
10352 value: ::fidl_next::WireU32,
10353}
10354
10355unsafe impl ::fidl_next::Wire for WireDependencyType {
10356 type Decoded<'de> = Self;
10357
10358 #[inline]
10359 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
10360 }
10362}
10363
10364impl WireDependencyType {
10365 pub const STRONG: WireDependencyType = WireDependencyType { value: ::fidl_next::WireU32(1) };
10366
10367 pub const WEAK: WireDependencyType = WireDependencyType { value: ::fidl_next::WireU32(2) };
10368}
10369
10370unsafe impl<___D> ::fidl_next::Decode<___D> for WireDependencyType
10371where
10372 ___D: ?Sized,
10373{
10374 fn decode(
10375 slot: ::fidl_next::Slot<'_, Self>,
10376 _: &mut ___D,
10377 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10378 ::fidl_next::munge!(let Self { value } = slot);
10379
10380 match u32::from(*value) {
10381 1 | 2 => (),
10382 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
10383 }
10384
10385 Ok(())
10386 }
10387}
10388
10389impl ::core::convert::From<DependencyType> for WireDependencyType {
10390 fn from(natural: DependencyType) -> Self {
10391 match natural {
10392 DependencyType::Strong => WireDependencyType::STRONG,
10393
10394 DependencyType::Weak => WireDependencyType::WEAK,
10395 }
10396 }
10397}
10398
10399#[doc = " Type used to create a mapping between 2 names. Used to rename service or component instances\n in FIDL declarations.\n"]
10400#[derive(PartialEq, Clone, Debug)]
10401pub struct NameMapping {
10402 pub source_name: ::std::string::String,
10403
10404 pub target_name: ::std::string::String,
10405}
10406
10407impl ::fidl_next::Encodable for NameMapping {
10408 type Encoded = WireNameMapping<'static>;
10409}
10410
10411unsafe impl<___E> ::fidl_next::Encode<___E> for NameMapping
10412where
10413 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10414 ___E: ::fidl_next::Encoder,
10415{
10416 #[inline]
10417 fn encode(
10418 self,
10419 encoder_: &mut ___E,
10420 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10421 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10422 ::fidl_next::munge! {
10423 let Self::Encoded {
10424 source_name,
10425 target_name,
10426
10427 } = out_;
10428 }
10429
10430 ::fidl_next::Encode::encode(self.source_name, encoder_, source_name)?;
10431
10432 ::fidl_next::Encode::encode(self.target_name, encoder_, target_name)?;
10433
10434 Ok(())
10435 }
10436}
10437
10438unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NameMapping
10439where
10440 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10441 ___E: ::fidl_next::Encoder,
10442{
10443 #[inline]
10444 fn encode_ref(
10445 &self,
10446 encoder_: &mut ___E,
10447 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10448 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10449 ::fidl_next::munge! {
10450 let Self::Encoded {
10451
10452 source_name,
10453 target_name,
10454
10455 } = out_;
10456 }
10457
10458 ::fidl_next::EncodeRef::encode_ref(&self.source_name, encoder_, source_name)?;
10459
10460 ::fidl_next::EncodeRef::encode_ref(&self.target_name, encoder_, target_name)?;
10461
10462 Ok(())
10463 }
10464}
10465
10466impl ::fidl_next::EncodableOption for NameMapping {
10467 type EncodedOption = ::fidl_next::WireBox<'static, WireNameMapping<'static>>;
10468}
10469
10470unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NameMapping
10471where
10472 ___E: ::fidl_next::Encoder + ?Sized,
10473 NameMapping: ::fidl_next::Encode<___E>,
10474{
10475 #[inline]
10476 fn encode_option(
10477 this: ::core::option::Option<Self>,
10478 encoder: &mut ___E,
10479 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10480 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10481 if let Some(inner) = this {
10482 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10483 ::fidl_next::WireBox::encode_present(out);
10484 } else {
10485 ::fidl_next::WireBox::encode_absent(out);
10486 }
10487
10488 Ok(())
10489 }
10490}
10491
10492unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for NameMapping
10493where
10494 ___E: ::fidl_next::Encoder + ?Sized,
10495 NameMapping: ::fidl_next::EncodeRef<___E>,
10496{
10497 #[inline]
10498 fn encode_option_ref(
10499 this: ::core::option::Option<&Self>,
10500 encoder: &mut ___E,
10501 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10502 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10503 if let Some(inner) = this {
10504 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
10505 ::fidl_next::WireBox::encode_present(out);
10506 } else {
10507 ::fidl_next::WireBox::encode_absent(out);
10508 }
10509
10510 Ok(())
10511 }
10512}
10513
10514impl<'de> ::fidl_next::FromWire<WireNameMapping<'de>> for NameMapping {
10515 #[inline]
10516 fn from_wire(wire: WireNameMapping<'de>) -> Self {
10517 Self {
10518 source_name: ::fidl_next::FromWire::from_wire(wire.source_name),
10519
10520 target_name: ::fidl_next::FromWire::from_wire(wire.target_name),
10521 }
10522 }
10523}
10524
10525impl<'de> ::fidl_next::IntoNatural for WireNameMapping<'de> {
10526 type Natural = NameMapping;
10527}
10528
10529impl<'de> ::fidl_next::FromWireRef<WireNameMapping<'de>> for NameMapping {
10530 #[inline]
10531 fn from_wire_ref(wire: &WireNameMapping<'de>) -> Self {
10532 Self {
10533 source_name: ::fidl_next::FromWireRef::from_wire_ref(&wire.source_name),
10534
10535 target_name: ::fidl_next::FromWireRef::from_wire_ref(&wire.target_name),
10536 }
10537 }
10538}
10539
10540#[derive(Debug)]
10542#[repr(C)]
10543pub struct WireNameMapping<'de> {
10544 pub source_name: ::fidl_next::WireString<'de>,
10545
10546 pub target_name: ::fidl_next::WireString<'de>,
10547}
10548static_assertions::const_assert_eq!(std::mem::size_of::<WireNameMapping<'_>>(), 32);
10549static_assertions::const_assert_eq!(std::mem::align_of::<WireNameMapping<'_>>(), 8);
10550
10551static_assertions::const_assert_eq!(std::mem::offset_of!(WireNameMapping<'_>, source_name), 0);
10552
10553static_assertions::const_assert_eq!(std::mem::offset_of!(WireNameMapping<'_>, target_name), 16);
10554
10555unsafe impl ::fidl_next::Wire for WireNameMapping<'static> {
10556 type Decoded<'de> = WireNameMapping<'de>;
10557
10558 #[inline]
10559 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
10560 ::fidl_next::munge! {
10561 let Self {
10562
10563 source_name,
10564 target_name,
10565
10566 } = &mut *out_;
10567 }
10568
10569 ::fidl_next::Wire::zero_padding(source_name);
10570
10571 ::fidl_next::Wire::zero_padding(target_name);
10572 }
10573}
10574
10575unsafe impl<___D> ::fidl_next::Decode<___D> for WireNameMapping<'static>
10576where
10577 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10578 ___D: ::fidl_next::Decoder,
10579{
10580 fn decode(
10581 slot_: ::fidl_next::Slot<'_, Self>,
10582 decoder_: &mut ___D,
10583 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10584 ::fidl_next::munge! {
10585 let Self {
10586
10587 mut source_name,
10588 mut target_name,
10589
10590 } = slot_;
10591 }
10592
10593 ::fidl_next::Decode::decode(source_name.as_mut(), decoder_)?;
10594
10595 let source_name = unsafe { source_name.deref_unchecked() };
10596
10597 if source_name.len() > 100 {
10598 return Err(::fidl_next::DecodeError::VectorTooLong {
10599 size: source_name.len() as u64,
10600 limit: 100,
10601 });
10602 }
10603
10604 ::fidl_next::Decode::decode(target_name.as_mut(), decoder_)?;
10605
10606 let target_name = unsafe { target_name.deref_unchecked() };
10607
10608 if target_name.len() > 100 {
10609 return Err(::fidl_next::DecodeError::VectorTooLong {
10610 size: target_name.len() as u64,
10611 limit: 100,
10612 });
10613 }
10614
10615 Ok(())
10616 }
10617}
10618
10619#[doc = " Specifies how a declared environment\'s initial set of properties are assigned.\n"]
10620#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10621#[repr(u32)]
10622pub enum EnvironmentExtends {
10623 None = 0,
10624 Realm = 1,
10625}
10626
10627impl ::fidl_next::Encodable for EnvironmentExtends {
10628 type Encoded = WireEnvironmentExtends;
10629}
10630impl ::core::convert::TryFrom<u32> for EnvironmentExtends {
10631 type Error = ::fidl_next::UnknownStrictEnumMemberError;
10632 fn try_from(
10633 value: u32,
10634 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
10635 match value {
10636 0 => Ok(Self::None),
10637 1 => Ok(Self::Realm),
10638
10639 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
10640 }
10641 }
10642}
10643
10644unsafe impl<___E> ::fidl_next::Encode<___E> for EnvironmentExtends
10645where
10646 ___E: ?Sized,
10647{
10648 #[inline]
10649 fn encode(
10650 self,
10651 encoder: &mut ___E,
10652 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10653 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10654 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
10655 }
10656}
10657
10658unsafe impl<___E> ::fidl_next::EncodeRef<___E> for EnvironmentExtends
10659where
10660 ___E: ?Sized,
10661{
10662 #[inline]
10663 fn encode_ref(
10664 &self,
10665 encoder: &mut ___E,
10666 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10667 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10668 ::fidl_next::munge!(let WireEnvironmentExtends { value } = out);
10669 let _ = value.write(::fidl_next::WireU32::from(match *self {
10670 Self::None => 0,
10671
10672 Self::Realm => 1,
10673 }));
10674
10675 Ok(())
10676 }
10677}
10678
10679impl ::core::convert::From<WireEnvironmentExtends> for EnvironmentExtends {
10680 fn from(wire: WireEnvironmentExtends) -> Self {
10681 match u32::from(wire.value) {
10682 0 => Self::None,
10683
10684 1 => Self::Realm,
10685
10686 _ => unsafe { ::core::hint::unreachable_unchecked() },
10687 }
10688 }
10689}
10690
10691impl ::fidl_next::FromWire<WireEnvironmentExtends> for EnvironmentExtends {
10692 #[inline]
10693 fn from_wire(wire: WireEnvironmentExtends) -> Self {
10694 Self::from(wire)
10695 }
10696}
10697
10698impl ::fidl_next::IntoNatural for WireEnvironmentExtends {
10699 type Natural = EnvironmentExtends;
10700}
10701
10702impl ::fidl_next::FromWireRef<WireEnvironmentExtends> for EnvironmentExtends {
10703 #[inline]
10704 fn from_wire_ref(wire: &WireEnvironmentExtends) -> Self {
10705 Self::from(*wire)
10706 }
10707}
10708
10709#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10711#[repr(transparent)]
10712pub struct WireEnvironmentExtends {
10713 value: ::fidl_next::WireU32,
10714}
10715
10716unsafe impl ::fidl_next::Wire for WireEnvironmentExtends {
10717 type Decoded<'de> = Self;
10718
10719 #[inline]
10720 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
10721 }
10723}
10724
10725impl WireEnvironmentExtends {
10726 pub const NONE: WireEnvironmentExtends =
10727 WireEnvironmentExtends { value: ::fidl_next::WireU32(0) };
10728
10729 pub const REALM: WireEnvironmentExtends =
10730 WireEnvironmentExtends { value: ::fidl_next::WireU32(1) };
10731}
10732
10733unsafe impl<___D> ::fidl_next::Decode<___D> for WireEnvironmentExtends
10734where
10735 ___D: ?Sized,
10736{
10737 fn decode(
10738 slot: ::fidl_next::Slot<'_, Self>,
10739 _: &mut ___D,
10740 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10741 ::fidl_next::munge!(let Self { value } = slot);
10742
10743 match u32::from(*value) {
10744 0 | 1 => (),
10745 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
10746 }
10747
10748 Ok(())
10749 }
10750}
10751
10752impl ::core::convert::From<EnvironmentExtends> for WireEnvironmentExtends {
10753 fn from(natural: EnvironmentExtends) -> Self {
10754 match natural {
10755 EnvironmentExtends::None => WireEnvironmentExtends::NONE,
10756
10757 EnvironmentExtends::Realm => WireEnvironmentExtends::REALM,
10758 }
10759 }
10760}
10761
10762pub const MAX_URL_SCHEME_LENGTH: u32 = 100 as u32;
10763
10764pub type UrlScheme = ::std::string::String;
10765
10766pub type WireUrlScheme<'de> = ::fidl_next::WireString<'de>;
10768
10769#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10770#[repr(u32)]
10771pub enum ConfigTypeLayout {
10772 Bool = 1,
10773 Uint8 = 2,
10774 Uint16 = 3,
10775 Uint32 = 4,
10776 Uint64 = 5,
10777 Int8 = 6,
10778 Int16 = 7,
10779 Int32 = 8,
10780 Int64 = 9,
10781 String = 10,
10782 Vector = 11,
10783 UnknownOrdinal_(u32) = 12,
10784}
10785
10786impl ::fidl_next::Encodable for ConfigTypeLayout {
10787 type Encoded = WireConfigTypeLayout;
10788}
10789impl ::std::convert::From<u32> for ConfigTypeLayout {
10790 fn from(value: u32) -> Self {
10791 match value {
10792 1 => Self::Bool,
10793 2 => Self::Uint8,
10794 3 => Self::Uint16,
10795 4 => Self::Uint32,
10796 5 => Self::Uint64,
10797 6 => Self::Int8,
10798 7 => Self::Int16,
10799 8 => Self::Int32,
10800 9 => Self::Int64,
10801 10 => Self::String,
10802 11 => Self::Vector,
10803
10804 _ => Self::UnknownOrdinal_(value),
10805 }
10806 }
10807}
10808
10809unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigTypeLayout
10810where
10811 ___E: ?Sized,
10812{
10813 #[inline]
10814 fn encode(
10815 self,
10816 encoder: &mut ___E,
10817 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10818 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10819 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
10820 }
10821}
10822
10823unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigTypeLayout
10824where
10825 ___E: ?Sized,
10826{
10827 #[inline]
10828 fn encode_ref(
10829 &self,
10830 encoder: &mut ___E,
10831 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10832 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10833 ::fidl_next::munge!(let WireConfigTypeLayout { value } = out);
10834 let _ = value.write(::fidl_next::WireU32::from(match *self {
10835 Self::Bool => 1,
10836
10837 Self::Uint8 => 2,
10838
10839 Self::Uint16 => 3,
10840
10841 Self::Uint32 => 4,
10842
10843 Self::Uint64 => 5,
10844
10845 Self::Int8 => 6,
10846
10847 Self::Int16 => 7,
10848
10849 Self::Int32 => 8,
10850
10851 Self::Int64 => 9,
10852
10853 Self::String => 10,
10854
10855 Self::Vector => 11,
10856
10857 Self::UnknownOrdinal_(value) => value,
10858 }));
10859
10860 Ok(())
10861 }
10862}
10863
10864impl ::core::convert::From<WireConfigTypeLayout> for ConfigTypeLayout {
10865 fn from(wire: WireConfigTypeLayout) -> Self {
10866 match u32::from(wire.value) {
10867 1 => Self::Bool,
10868
10869 2 => Self::Uint8,
10870
10871 3 => Self::Uint16,
10872
10873 4 => Self::Uint32,
10874
10875 5 => Self::Uint64,
10876
10877 6 => Self::Int8,
10878
10879 7 => Self::Int16,
10880
10881 8 => Self::Int32,
10882
10883 9 => Self::Int64,
10884
10885 10 => Self::String,
10886
10887 11 => Self::Vector,
10888
10889 value => Self::UnknownOrdinal_(value),
10890 }
10891 }
10892}
10893
10894impl ::fidl_next::FromWire<WireConfigTypeLayout> for ConfigTypeLayout {
10895 #[inline]
10896 fn from_wire(wire: WireConfigTypeLayout) -> Self {
10897 Self::from(wire)
10898 }
10899}
10900
10901impl ::fidl_next::IntoNatural for WireConfigTypeLayout {
10902 type Natural = ConfigTypeLayout;
10903}
10904
10905impl ::fidl_next::FromWireRef<WireConfigTypeLayout> for ConfigTypeLayout {
10906 #[inline]
10907 fn from_wire_ref(wire: &WireConfigTypeLayout) -> Self {
10908 Self::from(*wire)
10909 }
10910}
10911
10912#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10914#[repr(transparent)]
10915pub struct WireConfigTypeLayout {
10916 value: ::fidl_next::WireU32,
10917}
10918
10919unsafe impl ::fidl_next::Wire for WireConfigTypeLayout {
10920 type Decoded<'de> = Self;
10921
10922 #[inline]
10923 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
10924 }
10926}
10927
10928impl WireConfigTypeLayout {
10929 pub const BOOL: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(1) };
10930
10931 pub const UINT8: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(2) };
10932
10933 pub const UINT16: WireConfigTypeLayout =
10934 WireConfigTypeLayout { value: ::fidl_next::WireU32(3) };
10935
10936 pub const UINT32: WireConfigTypeLayout =
10937 WireConfigTypeLayout { value: ::fidl_next::WireU32(4) };
10938
10939 pub const UINT64: WireConfigTypeLayout =
10940 WireConfigTypeLayout { value: ::fidl_next::WireU32(5) };
10941
10942 pub const INT8: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(6) };
10943
10944 pub const INT16: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(7) };
10945
10946 pub const INT32: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(8) };
10947
10948 pub const INT64: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(9) };
10949
10950 pub const STRING: WireConfigTypeLayout =
10951 WireConfigTypeLayout { value: ::fidl_next::WireU32(10) };
10952
10953 pub const VECTOR: WireConfigTypeLayout =
10954 WireConfigTypeLayout { value: ::fidl_next::WireU32(11) };
10955}
10956
10957unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigTypeLayout
10958where
10959 ___D: ?Sized,
10960{
10961 fn decode(
10962 slot: ::fidl_next::Slot<'_, Self>,
10963 _: &mut ___D,
10964 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
10965 Ok(())
10966 }
10967}
10968
10969impl ::core::convert::From<ConfigTypeLayout> for WireConfigTypeLayout {
10970 fn from(natural: ConfigTypeLayout) -> Self {
10971 match natural {
10972 ConfigTypeLayout::Bool => WireConfigTypeLayout::BOOL,
10973
10974 ConfigTypeLayout::Uint8 => WireConfigTypeLayout::UINT8,
10975
10976 ConfigTypeLayout::Uint16 => WireConfigTypeLayout::UINT16,
10977
10978 ConfigTypeLayout::Uint32 => WireConfigTypeLayout::UINT32,
10979
10980 ConfigTypeLayout::Uint64 => WireConfigTypeLayout::UINT64,
10981
10982 ConfigTypeLayout::Int8 => WireConfigTypeLayout::INT8,
10983
10984 ConfigTypeLayout::Int16 => WireConfigTypeLayout::INT16,
10985
10986 ConfigTypeLayout::Int32 => WireConfigTypeLayout::INT32,
10987
10988 ConfigTypeLayout::Int64 => WireConfigTypeLayout::INT64,
10989
10990 ConfigTypeLayout::String => WireConfigTypeLayout::STRING,
10991
10992 ConfigTypeLayout::Vector => WireConfigTypeLayout::VECTOR,
10993
10994 ConfigTypeLayout::UnknownOrdinal_(value) => {
10995 WireConfigTypeLayout { value: ::fidl_next::WireU32::from(value) }
10996 }
10997 }
10998 }
10999}
11000
11001#[derive(PartialEq, Clone, Debug)]
11002pub enum LayoutConstraint {
11003 MaxSize(u32),
11004
11005 UnknownOrdinal_(u64),
11006}
11007
11008impl ::fidl_next::Encodable for LayoutConstraint {
11009 type Encoded = WireLayoutConstraint<'static>;
11010}
11011
11012unsafe impl<___E> ::fidl_next::Encode<___E> for LayoutConstraint
11013where
11014 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11015 ___E: ::fidl_next::Encoder,
11016{
11017 #[inline]
11018 fn encode(
11019 self,
11020 encoder: &mut ___E,
11021 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11022 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11023 ::fidl_next::munge!(let WireLayoutConstraint { raw, _phantom: _ } = out);
11024
11025 match self {
11026 Self::MaxSize(value) => {
11027 ::fidl_next::RawWireUnion::encode_as::<___E, u32>(value, 1, encoder, raw)?
11028 }
11029
11030 Self::UnknownOrdinal_(ordinal) => {
11031 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
11032 }
11033 }
11034
11035 Ok(())
11036 }
11037}
11038
11039unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LayoutConstraint
11040where
11041 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11042 ___E: ::fidl_next::Encoder,
11043{
11044 #[inline]
11045 fn encode_ref(
11046 &self,
11047 encoder: &mut ___E,
11048 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11049 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11050 ::fidl_next::munge!(let WireLayoutConstraint { raw, _phantom: _ } = out);
11051
11052 match self {
11053 Self::MaxSize(value) => {
11054 ::fidl_next::RawWireUnion::encode_as::<___E, &u32>(value, 1, encoder, raw)?
11055 }
11056
11057 Self::UnknownOrdinal_(ordinal) => {
11058 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
11059 }
11060 }
11061
11062 Ok(())
11063 }
11064}
11065
11066impl ::fidl_next::EncodableOption for LayoutConstraint {
11067 type EncodedOption = WireOptionalLayoutConstraint<'static>;
11068}
11069
11070unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LayoutConstraint
11071where
11072 ___E: ?Sized,
11073 LayoutConstraint: ::fidl_next::Encode<___E>,
11074{
11075 #[inline]
11076 fn encode_option(
11077 this: ::core::option::Option<Self>,
11078 encoder: &mut ___E,
11079 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11080 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11081 ::fidl_next::munge!(let WireOptionalLayoutConstraint { raw, _phantom: _ } = &mut *out);
11082
11083 if let Some(inner) = this {
11084 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
11085 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
11086 } else {
11087 ::fidl_next::RawWireUnion::encode_absent(raw);
11088 }
11089
11090 Ok(())
11091 }
11092}
11093
11094unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for LayoutConstraint
11095where
11096 ___E: ?Sized,
11097 LayoutConstraint: ::fidl_next::EncodeRef<___E>,
11098{
11099 #[inline]
11100 fn encode_option_ref(
11101 this: ::core::option::Option<&Self>,
11102 encoder: &mut ___E,
11103 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11104 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11105 ::fidl_next::munge!(let WireOptionalLayoutConstraint { raw, _phantom: _ } = &mut *out);
11106
11107 if let Some(inner) = this {
11108 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
11109 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
11110 } else {
11111 ::fidl_next::RawWireUnion::encode_absent(raw);
11112 }
11113
11114 Ok(())
11115 }
11116}
11117
11118impl<'de> ::fidl_next::FromWire<WireLayoutConstraint<'de>> for LayoutConstraint {
11119 #[inline]
11120 fn from_wire(wire: WireLayoutConstraint<'de>) -> Self {
11121 let wire = ::core::mem::ManuallyDrop::new(wire);
11122 match wire.raw.ordinal() {
11123 1 => Self::MaxSize(::fidl_next::FromWire::from_wire(unsafe {
11124 wire.raw.get().read_unchecked::<::fidl_next::WireU32>()
11125 })),
11126
11127 _ => unsafe { ::core::hint::unreachable_unchecked() },
11128 }
11129 }
11130}
11131
11132impl<'de> ::fidl_next::IntoNatural for WireLayoutConstraint<'de> {
11133 type Natural = LayoutConstraint;
11134}
11135
11136impl<'de> ::fidl_next::FromWireRef<WireLayoutConstraint<'de>> for LayoutConstraint {
11137 #[inline]
11138 fn from_wire_ref(wire: &WireLayoutConstraint<'de>) -> Self {
11139 match wire.raw.ordinal() {
11140 1 => Self::MaxSize(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11141 wire.raw.get().deref_unchecked::<::fidl_next::WireU32>()
11142 })),
11143
11144 _ => unsafe { ::core::hint::unreachable_unchecked() },
11145 }
11146 }
11147}
11148
11149impl<'de> ::fidl_next::FromWireOption<WireOptionalLayoutConstraint<'de>> for LayoutConstraint {
11150 #[inline]
11151 fn from_wire_option(wire: WireOptionalLayoutConstraint<'de>) -> ::core::option::Option<Self> {
11152 if let Some(inner) = wire.into_option() {
11153 Some(::fidl_next::FromWire::from_wire(inner))
11154 } else {
11155 None
11156 }
11157 }
11158}
11159
11160impl<'de> ::fidl_next::IntoNatural for WireOptionalLayoutConstraint<'de> {
11161 type Natural = ::core::option::Option<LayoutConstraint>;
11162}
11163
11164impl<'de> ::fidl_next::FromWireOption<WireOptionalLayoutConstraint<'de>> for Box<LayoutConstraint> {
11165 #[inline]
11166 fn from_wire_option(wire: WireOptionalLayoutConstraint<'de>) -> ::core::option::Option<Self> {
11167 <
11168 LayoutConstraint as ::fidl_next::FromWireOption<WireOptionalLayoutConstraint<'de>>
11169 >::from_wire_option(wire).map(Box::new)
11170 }
11171}
11172
11173impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalLayoutConstraint<'de>>
11174 for Box<LayoutConstraint>
11175{
11176 #[inline]
11177 fn from_wire_option_ref(
11178 wire: &WireOptionalLayoutConstraint<'de>,
11179 ) -> ::core::option::Option<Self> {
11180 if let Some(inner) = wire.as_ref() {
11181 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
11182 } else {
11183 None
11184 }
11185 }
11186}
11187
11188#[repr(transparent)]
11190pub struct WireLayoutConstraint<'de> {
11191 raw: ::fidl_next::RawWireUnion,
11192 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
11193}
11194
11195impl<'de> Drop for WireLayoutConstraint<'de> {
11196 fn drop(&mut self) {
11197 match self.raw.ordinal() {
11198 1 => {
11199 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU32>() };
11200 }
11201
11202 _ => (),
11203 }
11204 }
11205}
11206
11207unsafe impl ::fidl_next::Wire for WireLayoutConstraint<'static> {
11208 type Decoded<'de> = WireLayoutConstraint<'de>;
11209
11210 #[inline]
11211 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11212 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
11213 ::fidl_next::RawWireUnion::zero_padding(raw);
11214 }
11215}
11216
11217pub mod layout_constraint {
11218 pub enum Ref<'de> {
11219 MaxSize(&'de ::fidl_next::WireU32),
11220
11221 UnknownOrdinal_(u64),
11222 }
11223}
11224
11225impl<'de> WireLayoutConstraint<'de> {
11226 pub fn as_ref(&self) -> crate::layout_constraint::Ref<'_> {
11227 match self.raw.ordinal() {
11228 1 => crate::layout_constraint::Ref::MaxSize(unsafe {
11229 self.raw.get().deref_unchecked::<::fidl_next::WireU32>()
11230 }),
11231
11232 unknown => crate::layout_constraint::Ref::UnknownOrdinal_(unknown),
11233 }
11234 }
11235}
11236
11237unsafe impl<___D> ::fidl_next::Decode<___D> for WireLayoutConstraint<'static>
11238where
11239 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11240 ___D: ::fidl_next::Decoder,
11241{
11242 fn decode(
11243 mut slot: ::fidl_next::Slot<'_, Self>,
11244 decoder: &mut ___D,
11245 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11246 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
11247 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
11248 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
11249
11250 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
11251 }
11252
11253 Ok(())
11254 }
11255}
11256
11257impl<'de> ::core::fmt::Debug for WireLayoutConstraint<'de> {
11258 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11259 match self.raw.ordinal() {
11260 1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU32>().fmt(f) },
11261 _ => unsafe { ::core::hint::unreachable_unchecked() },
11262 }
11263 }
11264}
11265
11266#[repr(transparent)]
11267pub struct WireOptionalLayoutConstraint<'de> {
11268 raw: ::fidl_next::RawWireUnion,
11269 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
11270}
11271
11272unsafe impl ::fidl_next::Wire for WireOptionalLayoutConstraint<'static> {
11273 type Decoded<'de> = WireOptionalLayoutConstraint<'de>;
11274
11275 #[inline]
11276 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11277 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
11278 ::fidl_next::RawWireUnion::zero_padding(raw);
11279 }
11280}
11281
11282impl<'de> WireOptionalLayoutConstraint<'de> {
11283 pub fn is_some(&self) -> bool {
11284 self.raw.is_some()
11285 }
11286
11287 pub fn is_none(&self) -> bool {
11288 self.raw.is_none()
11289 }
11290
11291 pub fn as_ref(&self) -> ::core::option::Option<&WireLayoutConstraint<'de>> {
11292 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
11293 }
11294
11295 pub fn into_option(self) -> ::core::option::Option<WireLayoutConstraint<'de>> {
11296 if self.is_some() {
11297 Some(WireLayoutConstraint { raw: self.raw, _phantom: ::core::marker::PhantomData })
11298 } else {
11299 None
11300 }
11301 }
11302}
11303
11304unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalLayoutConstraint<'static>
11305where
11306 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11307 ___D: ::fidl_next::Decoder,
11308{
11309 fn decode(
11310 mut slot: ::fidl_next::Slot<'_, Self>,
11311 decoder: &mut ___D,
11312 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11313 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
11314 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
11315 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
11316
11317 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
11318 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
11319 }
11320
11321 Ok(())
11322 }
11323}
11324
11325impl<'de> ::core::fmt::Debug for WireOptionalLayoutConstraint<'de> {
11326 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11327 self.as_ref().fmt(f)
11328 }
11329}
11330
11331#[derive(PartialEq, Clone, Debug)]
11332pub struct ConfigType {
11333 pub layout: crate::ConfigTypeLayout,
11334
11335 pub parameters: ::core::option::Option<::std::vec::Vec<crate::LayoutParameter>>,
11336
11337 pub constraints: ::std::vec::Vec<crate::LayoutConstraint>,
11338}
11339
11340impl ::fidl_next::Encodable for ConfigType {
11341 type Encoded = WireConfigType<'static>;
11342}
11343
11344unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigType
11345where
11346 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11347 ___E: ::fidl_next::Encoder,
11348{
11349 #[inline]
11350 fn encode(
11351 self,
11352 encoder_: &mut ___E,
11353 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11354 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11355 ::fidl_next::munge! {
11356 let Self::Encoded {
11357 layout,
11358 parameters,
11359 constraints,
11360
11361 } = out_;
11362 }
11363
11364 ::fidl_next::Encode::encode(self.layout, encoder_, layout)?;
11365
11366 ::fidl_next::Encode::encode(self.parameters, encoder_, parameters)?;
11367
11368 ::fidl_next::Encode::encode(self.constraints, encoder_, constraints)?;
11369
11370 Ok(())
11371 }
11372}
11373
11374unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigType
11375where
11376 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11377 ___E: ::fidl_next::Encoder,
11378{
11379 #[inline]
11380 fn encode_ref(
11381 &self,
11382 encoder_: &mut ___E,
11383 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11384 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11385 ::fidl_next::munge! {
11386 let Self::Encoded {
11387
11388 layout,
11389 parameters,
11390 constraints,
11391
11392 } = out_;
11393 }
11394
11395 ::fidl_next::EncodeRef::encode_ref(&self.layout, encoder_, layout)?;
11396
11397 ::fidl_next::EncodeRef::encode_ref(&self.parameters, encoder_, parameters)?;
11398
11399 ::fidl_next::EncodeRef::encode_ref(&self.constraints, encoder_, constraints)?;
11400
11401 Ok(())
11402 }
11403}
11404
11405impl ::fidl_next::EncodableOption for ConfigType {
11406 type EncodedOption = ::fidl_next::WireBox<'static, WireConfigType<'static>>;
11407}
11408
11409unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ConfigType
11410where
11411 ___E: ::fidl_next::Encoder + ?Sized,
11412 ConfigType: ::fidl_next::Encode<___E>,
11413{
11414 #[inline]
11415 fn encode_option(
11416 this: ::core::option::Option<Self>,
11417 encoder: &mut ___E,
11418 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11419 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11420 if let Some(inner) = this {
11421 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
11422 ::fidl_next::WireBox::encode_present(out);
11423 } else {
11424 ::fidl_next::WireBox::encode_absent(out);
11425 }
11426
11427 Ok(())
11428 }
11429}
11430
11431unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ConfigType
11432where
11433 ___E: ::fidl_next::Encoder + ?Sized,
11434 ConfigType: ::fidl_next::EncodeRef<___E>,
11435{
11436 #[inline]
11437 fn encode_option_ref(
11438 this: ::core::option::Option<&Self>,
11439 encoder: &mut ___E,
11440 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11441 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11442 if let Some(inner) = this {
11443 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
11444 ::fidl_next::WireBox::encode_present(out);
11445 } else {
11446 ::fidl_next::WireBox::encode_absent(out);
11447 }
11448
11449 Ok(())
11450 }
11451}
11452
11453impl<'de> ::fidl_next::FromWire<WireConfigType<'de>> for ConfigType {
11454 #[inline]
11455 fn from_wire(wire: WireConfigType<'de>) -> Self {
11456 Self {
11457 layout: ::fidl_next::FromWire::from_wire(wire.layout),
11458
11459 parameters: ::fidl_next::FromWire::from_wire(wire.parameters),
11460
11461 constraints: ::fidl_next::FromWire::from_wire(wire.constraints),
11462 }
11463 }
11464}
11465
11466impl<'de> ::fidl_next::IntoNatural for WireConfigType<'de> {
11467 type Natural = ConfigType;
11468}
11469
11470impl<'de> ::fidl_next::FromWireRef<WireConfigType<'de>> for ConfigType {
11471 #[inline]
11472 fn from_wire_ref(wire: &WireConfigType<'de>) -> Self {
11473 Self {
11474 layout: ::fidl_next::FromWireRef::from_wire_ref(&wire.layout),
11475
11476 parameters: ::fidl_next::FromWireRef::from_wire_ref(&wire.parameters),
11477
11478 constraints: ::fidl_next::FromWireRef::from_wire_ref(&wire.constraints),
11479 }
11480 }
11481}
11482
11483#[derive(Debug)]
11485#[repr(C)]
11486pub struct WireConfigType<'de> {
11487 pub layout: crate::WireConfigTypeLayout,
11488
11489 pub parameters: ::fidl_next::WireOptionalVector<'de, crate::WireLayoutParameter<'de>>,
11490
11491 pub constraints: ::fidl_next::WireVector<'de, crate::WireLayoutConstraint<'de>>,
11492}
11493static_assertions::const_assert_eq!(std::mem::size_of::<WireConfigType<'_>>(), 40);
11494static_assertions::const_assert_eq!(std::mem::align_of::<WireConfigType<'_>>(), 8);
11495
11496static_assertions::const_assert_eq!(std::mem::offset_of!(WireConfigType<'_>, layout), 0);
11497
11498static_assertions::const_assert_eq!(std::mem::offset_of!(WireConfigType<'_>, parameters), 8);
11499
11500static_assertions::const_assert_eq!(std::mem::offset_of!(WireConfigType<'_>, constraints), 24);
11501
11502unsafe impl ::fidl_next::Wire for WireConfigType<'static> {
11503 type Decoded<'de> = WireConfigType<'de>;
11504
11505 #[inline]
11506 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
11507 ::fidl_next::munge! {
11508 let Self {
11509
11510 layout,
11511 parameters,
11512 constraints,
11513
11514 } = &mut *out_;
11515 }
11516
11517 ::fidl_next::Wire::zero_padding(layout);
11518
11519 ::fidl_next::Wire::zero_padding(parameters);
11520
11521 ::fidl_next::Wire::zero_padding(constraints);
11522
11523 unsafe {
11524 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
11525 }
11526 }
11527}
11528
11529unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigType<'static>
11530where
11531 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11532 ___D: ::fidl_next::Decoder,
11533{
11534 fn decode(
11535 slot_: ::fidl_next::Slot<'_, Self>,
11536 decoder_: &mut ___D,
11537 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11538 ::fidl_next::munge! {
11539 let Self {
11540
11541 mut layout,
11542 mut parameters,
11543 mut constraints,
11544
11545 } = slot_;
11546 }
11547
11548 ::fidl_next::Decode::decode(layout.as_mut(), decoder_)?;
11549
11550 ::fidl_next::Decode::decode(parameters.as_mut(), decoder_)?;
11551
11552 ::fidl_next::Decode::decode(constraints.as_mut(), decoder_)?;
11553
11554 Ok(())
11555 }
11556}
11557
11558#[doc = " The checksum produced for a configuration interface.\n Two configuration interfaces are the same if their checksums are the same.\n"]
11559#[derive(PartialEq, Clone, Debug)]
11560pub enum ConfigChecksum {
11561 Sha256([u8; 32]),
11562
11563 UnknownOrdinal_(u64),
11564}
11565
11566impl ::fidl_next::Encodable for ConfigChecksum {
11567 type Encoded = WireConfigChecksum<'static>;
11568}
11569
11570unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigChecksum
11571where
11572 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11573 ___E: ::fidl_next::Encoder,
11574{
11575 #[inline]
11576 fn encode(
11577 self,
11578 encoder: &mut ___E,
11579 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11580 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11581 ::fidl_next::munge!(let WireConfigChecksum { raw, _phantom: _ } = out);
11582
11583 match self {
11584 Self::Sha256(value) => {
11585 ::fidl_next::RawWireUnion::encode_as::<___E, [u8; 32]>(value, 1, encoder, raw)?
11586 }
11587
11588 Self::UnknownOrdinal_(ordinal) => {
11589 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
11590 }
11591 }
11592
11593 Ok(())
11594 }
11595}
11596
11597unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigChecksum
11598where
11599 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11600 ___E: ::fidl_next::Encoder,
11601{
11602 #[inline]
11603 fn encode_ref(
11604 &self,
11605 encoder: &mut ___E,
11606 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11607 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11608 ::fidl_next::munge!(let WireConfigChecksum { raw, _phantom: _ } = out);
11609
11610 match self {
11611 Self::Sha256(value) => {
11612 ::fidl_next::RawWireUnion::encode_as::<___E, &[u8; 32]>(value, 1, encoder, raw)?
11613 }
11614
11615 Self::UnknownOrdinal_(ordinal) => {
11616 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
11617 }
11618 }
11619
11620 Ok(())
11621 }
11622}
11623
11624impl ::fidl_next::EncodableOption for ConfigChecksum {
11625 type EncodedOption = WireOptionalConfigChecksum<'static>;
11626}
11627
11628unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ConfigChecksum
11629where
11630 ___E: ?Sized,
11631 ConfigChecksum: ::fidl_next::Encode<___E>,
11632{
11633 #[inline]
11634 fn encode_option(
11635 this: ::core::option::Option<Self>,
11636 encoder: &mut ___E,
11637 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11638 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11639 ::fidl_next::munge!(let WireOptionalConfigChecksum { raw, _phantom: _ } = &mut *out);
11640
11641 if let Some(inner) = this {
11642 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
11643 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
11644 } else {
11645 ::fidl_next::RawWireUnion::encode_absent(raw);
11646 }
11647
11648 Ok(())
11649 }
11650}
11651
11652unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ConfigChecksum
11653where
11654 ___E: ?Sized,
11655 ConfigChecksum: ::fidl_next::EncodeRef<___E>,
11656{
11657 #[inline]
11658 fn encode_option_ref(
11659 this: ::core::option::Option<&Self>,
11660 encoder: &mut ___E,
11661 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
11662 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11663 ::fidl_next::munge!(let WireOptionalConfigChecksum { raw, _phantom: _ } = &mut *out);
11664
11665 if let Some(inner) = this {
11666 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
11667 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
11668 } else {
11669 ::fidl_next::RawWireUnion::encode_absent(raw);
11670 }
11671
11672 Ok(())
11673 }
11674}
11675
11676impl<'de> ::fidl_next::FromWire<WireConfigChecksum<'de>> for ConfigChecksum {
11677 #[inline]
11678 fn from_wire(wire: WireConfigChecksum<'de>) -> Self {
11679 let wire = ::core::mem::ManuallyDrop::new(wire);
11680 match wire.raw.ordinal() {
11681 1 => Self::Sha256(::fidl_next::FromWire::from_wire(unsafe {
11682 wire.raw.get().read_unchecked::<[u8; 32]>()
11683 })),
11684
11685 _ => unsafe { ::core::hint::unreachable_unchecked() },
11686 }
11687 }
11688}
11689
11690impl<'de> ::fidl_next::IntoNatural for WireConfigChecksum<'de> {
11691 type Natural = ConfigChecksum;
11692}
11693
11694impl<'de> ::fidl_next::FromWireRef<WireConfigChecksum<'de>> for ConfigChecksum {
11695 #[inline]
11696 fn from_wire_ref(wire: &WireConfigChecksum<'de>) -> Self {
11697 match wire.raw.ordinal() {
11698 1 => Self::Sha256(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11699 wire.raw.get().deref_unchecked::<[u8; 32]>()
11700 })),
11701
11702 _ => unsafe { ::core::hint::unreachable_unchecked() },
11703 }
11704 }
11705}
11706
11707impl<'de> ::fidl_next::FromWireOption<WireOptionalConfigChecksum<'de>> for ConfigChecksum {
11708 #[inline]
11709 fn from_wire_option(wire: WireOptionalConfigChecksum<'de>) -> ::core::option::Option<Self> {
11710 if let Some(inner) = wire.into_option() {
11711 Some(::fidl_next::FromWire::from_wire(inner))
11712 } else {
11713 None
11714 }
11715 }
11716}
11717
11718impl<'de> ::fidl_next::IntoNatural for WireOptionalConfigChecksum<'de> {
11719 type Natural = ::core::option::Option<ConfigChecksum>;
11720}
11721
11722impl<'de> ::fidl_next::FromWireOption<WireOptionalConfigChecksum<'de>> for Box<ConfigChecksum> {
11723 #[inline]
11724 fn from_wire_option(wire: WireOptionalConfigChecksum<'de>) -> ::core::option::Option<Self> {
11725 <
11726 ConfigChecksum as ::fidl_next::FromWireOption<WireOptionalConfigChecksum<'de>>
11727 >::from_wire_option(wire).map(Box::new)
11728 }
11729}
11730
11731impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalConfigChecksum<'de>> for Box<ConfigChecksum> {
11732 #[inline]
11733 fn from_wire_option_ref(
11734 wire: &WireOptionalConfigChecksum<'de>,
11735 ) -> ::core::option::Option<Self> {
11736 if let Some(inner) = wire.as_ref() {
11737 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
11738 } else {
11739 None
11740 }
11741 }
11742}
11743
11744#[repr(transparent)]
11746pub struct WireConfigChecksum<'de> {
11747 raw: ::fidl_next::RawWireUnion,
11748 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
11749}
11750
11751impl<'de> Drop for WireConfigChecksum<'de> {
11752 fn drop(&mut self) {
11753 match self.raw.ordinal() {
11754 1 => {
11755 let _ = unsafe { self.raw.get().read_unchecked::<[u8; 32]>() };
11756 }
11757
11758 _ => (),
11759 }
11760 }
11761}
11762
11763unsafe impl ::fidl_next::Wire for WireConfigChecksum<'static> {
11764 type Decoded<'de> = WireConfigChecksum<'de>;
11765
11766 #[inline]
11767 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11768 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
11769 ::fidl_next::RawWireUnion::zero_padding(raw);
11770 }
11771}
11772
11773pub mod config_checksum {
11774 pub enum Ref<'de> {
11775 Sha256(&'de [u8; 32]),
11776
11777 UnknownOrdinal_(u64),
11778 }
11779}
11780
11781impl<'de> WireConfigChecksum<'de> {
11782 pub fn as_ref(&self) -> crate::config_checksum::Ref<'_> {
11783 match self.raw.ordinal() {
11784 1 => crate::config_checksum::Ref::Sha256(unsafe {
11785 self.raw.get().deref_unchecked::<[u8; 32]>()
11786 }),
11787
11788 unknown => crate::config_checksum::Ref::UnknownOrdinal_(unknown),
11789 }
11790 }
11791}
11792
11793unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigChecksum<'static>
11794where
11795 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11796 ___D: ::fidl_next::Decoder,
11797{
11798 fn decode(
11799 mut slot: ::fidl_next::Slot<'_, Self>,
11800 decoder: &mut ___D,
11801 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11802 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
11803 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
11804 1 => ::fidl_next::RawWireUnion::decode_as::<___D, [u8; 32]>(raw, decoder)?,
11805
11806 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
11807 }
11808
11809 Ok(())
11810 }
11811}
11812
11813impl<'de> ::core::fmt::Debug for WireConfigChecksum<'de> {
11814 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11815 match self.raw.ordinal() {
11816 1 => unsafe { self.raw.get().deref_unchecked::<[u8; 32]>().fmt(f) },
11817 _ => unsafe { ::core::hint::unreachable_unchecked() },
11818 }
11819 }
11820}
11821
11822#[repr(transparent)]
11823pub struct WireOptionalConfigChecksum<'de> {
11824 raw: ::fidl_next::RawWireUnion,
11825 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
11826}
11827
11828unsafe impl ::fidl_next::Wire for WireOptionalConfigChecksum<'static> {
11829 type Decoded<'de> = WireOptionalConfigChecksum<'de>;
11830
11831 #[inline]
11832 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11833 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
11834 ::fidl_next::RawWireUnion::zero_padding(raw);
11835 }
11836}
11837
11838impl<'de> WireOptionalConfigChecksum<'de> {
11839 pub fn is_some(&self) -> bool {
11840 self.raw.is_some()
11841 }
11842
11843 pub fn is_none(&self) -> bool {
11844 self.raw.is_none()
11845 }
11846
11847 pub fn as_ref(&self) -> ::core::option::Option<&WireConfigChecksum<'de>> {
11848 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
11849 }
11850
11851 pub fn into_option(self) -> ::core::option::Option<WireConfigChecksum<'de>> {
11852 if self.is_some() {
11853 Some(WireConfigChecksum { raw: self.raw, _phantom: ::core::marker::PhantomData })
11854 } else {
11855 None
11856 }
11857 }
11858}
11859
11860unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConfigChecksum<'static>
11861where
11862 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
11863 ___D: ::fidl_next::Decoder,
11864{
11865 fn decode(
11866 mut slot: ::fidl_next::Slot<'_, Self>,
11867 decoder: &mut ___D,
11868 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
11869 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
11870 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
11871 1 => ::fidl_next::RawWireUnion::decode_as::<___D, [u8; 32]>(raw, decoder)?,
11872
11873 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
11874 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
11875 }
11876
11877 Ok(())
11878 }
11879}
11880
11881impl<'de> ::core::fmt::Debug for WireOptionalConfigChecksum<'de> {
11882 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
11883 self.as_ref().fmt(f)
11884 }
11885}
11886
11887#[doc = " Declares storage used by a component, which was offered to it.\n"]
11888#[derive(PartialEq, Clone, Debug, Default)]
11889pub struct UseStorage {
11890 pub source_name: ::core::option::Option<::std::string::String>,
11891
11892 pub target_path: ::core::option::Option<::std::string::String>,
11893
11894 pub availability: ::core::option::Option<crate::Availability>,
11895}
11896
11897impl UseStorage {
11898 fn __max_ordinal(&self) -> usize {
11899 if self.availability.is_some() {
11900 return 3;
11901 }
11902
11903 if self.target_path.is_some() {
11904 return 2;
11905 }
11906
11907 if self.source_name.is_some() {
11908 return 1;
11909 }
11910
11911 0
11912 }
11913}
11914
11915impl ::fidl_next::Encodable for UseStorage {
11916 type Encoded = WireUseStorage<'static>;
11917}
11918
11919unsafe impl<___E> ::fidl_next::Encode<___E> for UseStorage
11920where
11921 ___E: ::fidl_next::Encoder + ?Sized,
11922{
11923 #[inline]
11924 fn encode(
11925 mut self,
11926 encoder: &mut ___E,
11927 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11928 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11929 ::fidl_next::munge!(let WireUseStorage { table } = out);
11930
11931 let max_ord = self.__max_ordinal();
11932
11933 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11934 ::fidl_next::Wire::zero_padding(&mut out);
11935
11936 let mut preallocated =
11937 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11938
11939 for i in 1..=max_ord {
11940 match i {
11941 3 => {
11942 if let Some(value) = self.availability.take() {
11943 ::fidl_next::WireEnvelope::encode_value(
11944 value,
11945 preallocated.encoder,
11946 &mut out,
11947 )?;
11948 } else {
11949 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11950 }
11951 }
11952
11953 2 => {
11954 if let Some(value) = self.target_path.take() {
11955 ::fidl_next::WireEnvelope::encode_value(
11956 value,
11957 preallocated.encoder,
11958 &mut out,
11959 )?;
11960 } else {
11961 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11962 }
11963 }
11964
11965 1 => {
11966 if let Some(value) = self.source_name.take() {
11967 ::fidl_next::WireEnvelope::encode_value(
11968 value,
11969 preallocated.encoder,
11970 &mut out,
11971 )?;
11972 } else {
11973 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11974 }
11975 }
11976
11977 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11978 }
11979 unsafe {
11980 preallocated.write_next(out.assume_init_ref());
11981 }
11982 }
11983
11984 ::fidl_next::WireTable::encode_len(table, max_ord);
11985
11986 Ok(())
11987 }
11988}
11989
11990unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UseStorage
11991where
11992 ___E: ::fidl_next::Encoder + ?Sized,
11993{
11994 #[inline]
11995 fn encode_ref(
11996 &self,
11997 encoder: &mut ___E,
11998 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11999 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12000 ::fidl_next::munge!(let WireUseStorage { table } = out);
12001
12002 let max_ord = self.__max_ordinal();
12003
12004 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12005 ::fidl_next::Wire::zero_padding(&mut out);
12006
12007 let mut preallocated =
12008 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12009
12010 for i in 1..=max_ord {
12011 match i {
12012 3 => {
12013 if let Some(value) = &self.availability {
12014 ::fidl_next::WireEnvelope::encode_value(
12015 value,
12016 preallocated.encoder,
12017 &mut out,
12018 )?;
12019 } else {
12020 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12021 }
12022 }
12023
12024 2 => {
12025 if let Some(value) = &self.target_path {
12026 ::fidl_next::WireEnvelope::encode_value(
12027 value,
12028 preallocated.encoder,
12029 &mut out,
12030 )?;
12031 } else {
12032 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12033 }
12034 }
12035
12036 1 => {
12037 if let Some(value) = &self.source_name {
12038 ::fidl_next::WireEnvelope::encode_value(
12039 value,
12040 preallocated.encoder,
12041 &mut out,
12042 )?;
12043 } else {
12044 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12045 }
12046 }
12047
12048 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12049 }
12050 unsafe {
12051 preallocated.write_next(out.assume_init_ref());
12052 }
12053 }
12054
12055 ::fidl_next::WireTable::encode_len(table, max_ord);
12056
12057 Ok(())
12058 }
12059}
12060
12061impl<'de> ::fidl_next::FromWire<WireUseStorage<'de>> for UseStorage {
12062 #[inline]
12063 fn from_wire(wire_: WireUseStorage<'de>) -> Self {
12064 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
12065
12066 let source_name = wire_.table.get(1);
12067
12068 let target_path = wire_.table.get(2);
12069
12070 let availability = wire_.table.get(3);
12071
12072 Self {
12073 source_name: source_name.map(|envelope| {
12074 ::fidl_next::FromWire::from_wire(unsafe {
12075 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12076 })
12077 }),
12078
12079 target_path: target_path.map(|envelope| {
12080 ::fidl_next::FromWire::from_wire(unsafe {
12081 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12082 })
12083 }),
12084
12085 availability: availability.map(|envelope| {
12086 ::fidl_next::FromWire::from_wire(unsafe {
12087 envelope.read_unchecked::<crate::WireAvailability>()
12088 })
12089 }),
12090 }
12091 }
12092}
12093
12094impl<'de> ::fidl_next::IntoNatural for WireUseStorage<'de> {
12095 type Natural = UseStorage;
12096}
12097
12098impl<'de> ::fidl_next::FromWireRef<WireUseStorage<'de>> for UseStorage {
12099 #[inline]
12100 fn from_wire_ref(wire: &WireUseStorage<'de>) -> Self {
12101 Self {
12102 source_name: wire.table.get(1).map(|envelope| {
12103 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12104 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12105 })
12106 }),
12107
12108 target_path: wire.table.get(2).map(|envelope| {
12109 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12110 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12111 })
12112 }),
12113
12114 availability: wire.table.get(3).map(|envelope| {
12115 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12116 envelope.deref_unchecked::<crate::WireAvailability>()
12117 })
12118 }),
12119 }
12120 }
12121}
12122
12123#[repr(C)]
12125pub struct WireUseStorage<'de> {
12126 table: ::fidl_next::WireTable<'de>,
12127}
12128
12129impl<'de> Drop for WireUseStorage<'de> {
12130 fn drop(&mut self) {
12131 let _ = self
12132 .table
12133 .get(1)
12134 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
12135
12136 let _ = self
12137 .table
12138 .get(2)
12139 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
12140
12141 let _ = self
12142 .table
12143 .get(3)
12144 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
12145 }
12146}
12147
12148unsafe impl ::fidl_next::Wire for WireUseStorage<'static> {
12149 type Decoded<'de> = WireUseStorage<'de>;
12150
12151 #[inline]
12152 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12153 ::fidl_next::munge!(let Self { table } = out);
12154 ::fidl_next::WireTable::zero_padding(table);
12155 }
12156}
12157
12158unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseStorage<'static>
12159where
12160 ___D: ::fidl_next::Decoder + ?Sized,
12161{
12162 fn decode(
12163 slot: ::fidl_next::Slot<'_, Self>,
12164 decoder: &mut ___D,
12165 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12166 ::fidl_next::munge!(let Self { table } = slot);
12167
12168 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12169 match ordinal {
12170 0 => unsafe { ::core::hint::unreachable_unchecked() },
12171
12172 1 => {
12173 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
12174 slot.as_mut(),
12175 decoder,
12176 )?;
12177
12178 let value = unsafe {
12179 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
12180 };
12181
12182 if value.len() > 100 {
12183 return Err(::fidl_next::DecodeError::VectorTooLong {
12184 size: value.len() as u64,
12185 limit: 100,
12186 });
12187 }
12188
12189 Ok(())
12190 }
12191
12192 2 => {
12193 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
12194 slot.as_mut(),
12195 decoder,
12196 )?;
12197
12198 let value = unsafe {
12199 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
12200 };
12201
12202 if value.len() > 1024 {
12203 return Err(::fidl_next::DecodeError::VectorTooLong {
12204 size: value.len() as u64,
12205 limit: 1024,
12206 });
12207 }
12208
12209 Ok(())
12210 }
12211
12212 3 => {
12213 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
12214 slot.as_mut(),
12215 decoder,
12216 )?;
12217
12218 Ok(())
12219 }
12220
12221 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
12222 }
12223 })
12224 }
12225}
12226
12227impl<'de> WireUseStorage<'de> {
12228 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
12229 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12230 }
12231
12232 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
12233 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12234 }
12235
12236 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
12237 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
12238 }
12239}
12240
12241impl<'de> ::core::fmt::Debug for WireUseStorage<'de> {
12242 fn fmt(
12243 &self,
12244 f: &mut ::core::fmt::Formatter<'_>,
12245 ) -> ::core::result::Result<(), ::core::fmt::Error> {
12246 f.debug_struct("UseStorage")
12247 .field("source_name", &self.source_name())
12248 .field("target_path", &self.target_path())
12249 .field("availability", &self.availability())
12250 .finish()
12251 }
12252}
12253
12254::fidl_next::bitflags::bitflags! {
12255 #[doc = " Allowed sources for runtime overrides of a config field\'s value.\n"]#[derive(
12256 Clone,
12257 Copy,
12258 Debug,
12259 PartialEq,
12260 Eq,
12261 Hash,
12262 )]
12263 pub struct ConfigMutability: u32 {
12264 #[doc = " Allow parent components to provide overrides for the configuration field.\n"]const PARENT = 1;
12265 const _ = !0;
12266 }
12267}
12268
12269impl ::fidl_next::Encodable for ConfigMutability {
12270 type Encoded = WireConfigMutability;
12271}
12272
12273unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigMutability
12274where
12275 ___E: ?Sized,
12276{
12277 #[inline]
12278 fn encode(
12279 self,
12280 encoder: &mut ___E,
12281 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12282 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12283 ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
12284 }
12285}
12286
12287unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigMutability
12288where
12289 ___E: ?Sized,
12290{
12291 #[inline]
12292 fn encode_ref(
12293 &self,
12294 _: &mut ___E,
12295 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12296 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12297 ::fidl_next::munge!(let WireConfigMutability { value } = out);
12298
12299 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
12300 Ok(())
12301 }
12302}
12303
12304impl ::core::convert::From<WireConfigMutability> for ConfigMutability {
12305 fn from(wire: WireConfigMutability) -> Self {
12306 Self::from_bits_retain(u32::from(wire.value))
12307 }
12308}
12309
12310impl ::fidl_next::FromWire<WireConfigMutability> for ConfigMutability {
12311 #[inline]
12312 fn from_wire(wire: WireConfigMutability) -> Self {
12313 Self::from(wire)
12314 }
12315}
12316
12317impl ::fidl_next::IntoNatural for WireConfigMutability {
12318 type Natural = ConfigMutability;
12319}
12320
12321impl ::fidl_next::FromWireRef<WireConfigMutability> for ConfigMutability {
12322 #[inline]
12323 fn from_wire_ref(wire: &WireConfigMutability) -> Self {
12324 Self::from(*wire)
12325 }
12326}
12327
12328#[derive(Clone, Copy, Debug)]
12330#[repr(transparent)]
12331pub struct WireConfigMutability {
12332 value: ::fidl_next::WireU32,
12333}
12334
12335unsafe impl ::fidl_next::Wire for WireConfigMutability {
12336 type Decoded<'de> = Self;
12337
12338 #[inline]
12339 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
12340 }
12342}
12343
12344unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigMutability
12345where
12346 ___D: ?Sized,
12347{
12348 fn decode(
12349 slot: ::fidl_next::Slot<'_, Self>,
12350 _: &mut ___D,
12351 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12352 Ok(())
12353 }
12354}
12355
12356impl ::core::convert::From<ConfigMutability> for WireConfigMutability {
12357 fn from(natural: ConfigMutability) -> Self {
12358 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
12359 }
12360}
12361
12362#[doc = " Declares a single config field (key + type)\n"]
12363#[derive(PartialEq, Clone, Debug, Default)]
12364pub struct ConfigField {
12365 pub key: ::core::option::Option<::std::string::String>,
12366
12367 pub type_: ::core::option::Option<crate::ConfigType>,
12368
12369 pub mutability: ::core::option::Option<crate::ConfigMutability>,
12370}
12371
12372impl ConfigField {
12373 fn __max_ordinal(&self) -> usize {
12374 if self.mutability.is_some() {
12375 return 3;
12376 }
12377
12378 if self.type_.is_some() {
12379 return 2;
12380 }
12381
12382 if self.key.is_some() {
12383 return 1;
12384 }
12385
12386 0
12387 }
12388}
12389
12390impl ::fidl_next::Encodable for ConfigField {
12391 type Encoded = WireConfigField<'static>;
12392}
12393
12394unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigField
12395where
12396 ___E: ::fidl_next::Encoder + ?Sized,
12397{
12398 #[inline]
12399 fn encode(
12400 mut self,
12401 encoder: &mut ___E,
12402 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12403 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12404 ::fidl_next::munge!(let WireConfigField { table } = out);
12405
12406 let max_ord = self.__max_ordinal();
12407
12408 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12409 ::fidl_next::Wire::zero_padding(&mut out);
12410
12411 let mut preallocated =
12412 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12413
12414 for i in 1..=max_ord {
12415 match i {
12416 3 => {
12417 if let Some(value) = self.mutability.take() {
12418 ::fidl_next::WireEnvelope::encode_value(
12419 value,
12420 preallocated.encoder,
12421 &mut out,
12422 )?;
12423 } else {
12424 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12425 }
12426 }
12427
12428 2 => {
12429 if let Some(value) = self.type_.take() {
12430 ::fidl_next::WireEnvelope::encode_value(
12431 value,
12432 preallocated.encoder,
12433 &mut out,
12434 )?;
12435 } else {
12436 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12437 }
12438 }
12439
12440 1 => {
12441 if let Some(value) = self.key.take() {
12442 ::fidl_next::WireEnvelope::encode_value(
12443 value,
12444 preallocated.encoder,
12445 &mut out,
12446 )?;
12447 } else {
12448 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12449 }
12450 }
12451
12452 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12453 }
12454 unsafe {
12455 preallocated.write_next(out.assume_init_ref());
12456 }
12457 }
12458
12459 ::fidl_next::WireTable::encode_len(table, max_ord);
12460
12461 Ok(())
12462 }
12463}
12464
12465unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigField
12466where
12467 ___E: ::fidl_next::Encoder + ?Sized,
12468{
12469 #[inline]
12470 fn encode_ref(
12471 &self,
12472 encoder: &mut ___E,
12473 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12474 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12475 ::fidl_next::munge!(let WireConfigField { table } = out);
12476
12477 let max_ord = self.__max_ordinal();
12478
12479 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12480 ::fidl_next::Wire::zero_padding(&mut out);
12481
12482 let mut preallocated =
12483 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12484
12485 for i in 1..=max_ord {
12486 match i {
12487 3 => {
12488 if let Some(value) = &self.mutability {
12489 ::fidl_next::WireEnvelope::encode_value(
12490 value,
12491 preallocated.encoder,
12492 &mut out,
12493 )?;
12494 } else {
12495 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12496 }
12497 }
12498
12499 2 => {
12500 if let Some(value) = &self.type_ {
12501 ::fidl_next::WireEnvelope::encode_value(
12502 value,
12503 preallocated.encoder,
12504 &mut out,
12505 )?;
12506 } else {
12507 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12508 }
12509 }
12510
12511 1 => {
12512 if let Some(value) = &self.key {
12513 ::fidl_next::WireEnvelope::encode_value(
12514 value,
12515 preallocated.encoder,
12516 &mut out,
12517 )?;
12518 } else {
12519 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12520 }
12521 }
12522
12523 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12524 }
12525 unsafe {
12526 preallocated.write_next(out.assume_init_ref());
12527 }
12528 }
12529
12530 ::fidl_next::WireTable::encode_len(table, max_ord);
12531
12532 Ok(())
12533 }
12534}
12535
12536impl<'de> ::fidl_next::FromWire<WireConfigField<'de>> for ConfigField {
12537 #[inline]
12538 fn from_wire(wire_: WireConfigField<'de>) -> Self {
12539 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
12540
12541 let key = wire_.table.get(1);
12542
12543 let type_ = wire_.table.get(2);
12544
12545 let mutability = wire_.table.get(3);
12546
12547 Self {
12548 key: key.map(|envelope| {
12549 ::fidl_next::FromWire::from_wire(unsafe {
12550 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12551 })
12552 }),
12553
12554 type_: type_.map(|envelope| {
12555 ::fidl_next::FromWire::from_wire(unsafe {
12556 envelope.read_unchecked::<crate::WireConfigType<'de>>()
12557 })
12558 }),
12559
12560 mutability: mutability.map(|envelope| {
12561 ::fidl_next::FromWire::from_wire(unsafe {
12562 envelope.read_unchecked::<crate::WireConfigMutability>()
12563 })
12564 }),
12565 }
12566 }
12567}
12568
12569impl<'de> ::fidl_next::IntoNatural for WireConfigField<'de> {
12570 type Natural = ConfigField;
12571}
12572
12573impl<'de> ::fidl_next::FromWireRef<WireConfigField<'de>> for ConfigField {
12574 #[inline]
12575 fn from_wire_ref(wire: &WireConfigField<'de>) -> Self {
12576 Self {
12577 key: wire.table.get(1).map(|envelope| {
12578 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12579 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12580 })
12581 }),
12582
12583 type_: wire.table.get(2).map(|envelope| {
12584 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12585 envelope.deref_unchecked::<crate::WireConfigType<'de>>()
12586 })
12587 }),
12588
12589 mutability: wire.table.get(3).map(|envelope| {
12590 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12591 envelope.deref_unchecked::<crate::WireConfigMutability>()
12592 })
12593 }),
12594 }
12595 }
12596}
12597
12598#[repr(C)]
12600pub struct WireConfigField<'de> {
12601 table: ::fidl_next::WireTable<'de>,
12602}
12603
12604impl<'de> Drop for WireConfigField<'de> {
12605 fn drop(&mut self) {
12606 let _ = self
12607 .table
12608 .get(1)
12609 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
12610
12611 let _ = self
12612 .table
12613 .get(2)
12614 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigType<'de>>() });
12615
12616 let _ = self
12617 .table
12618 .get(3)
12619 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigMutability>() });
12620 }
12621}
12622
12623unsafe impl ::fidl_next::Wire for WireConfigField<'static> {
12624 type Decoded<'de> = WireConfigField<'de>;
12625
12626 #[inline]
12627 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12628 ::fidl_next::munge!(let Self { table } = out);
12629 ::fidl_next::WireTable::zero_padding(table);
12630 }
12631}
12632
12633unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigField<'static>
12634where
12635 ___D: ::fidl_next::Decoder + ?Sized,
12636{
12637 fn decode(
12638 slot: ::fidl_next::Slot<'_, Self>,
12639 decoder: &mut ___D,
12640 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12641 ::fidl_next::munge!(let Self { table } = slot);
12642
12643 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12644 match ordinal {
12645 0 => unsafe { ::core::hint::unreachable_unchecked() },
12646
12647 1 => {
12648 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
12649 slot.as_mut(),
12650 decoder,
12651 )?;
12652
12653 let value = unsafe {
12654 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
12655 };
12656
12657 if value.len() > 64 {
12658 return Err(::fidl_next::DecodeError::VectorTooLong {
12659 size: value.len() as u64,
12660 limit: 64,
12661 });
12662 }
12663
12664 Ok(())
12665 }
12666
12667 2 => {
12668 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigType<'static>>(
12669 slot.as_mut(),
12670 decoder,
12671 )?;
12672
12673 Ok(())
12674 }
12675
12676 3 => {
12677 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigMutability>(
12678 slot.as_mut(),
12679 decoder,
12680 )?;
12681
12682 Ok(())
12683 }
12684
12685 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
12686 }
12687 })
12688 }
12689}
12690
12691impl<'de> WireConfigField<'de> {
12692 pub fn key(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
12693 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12694 }
12695
12696 pub fn type_(&self) -> ::core::option::Option<&crate::WireConfigType<'de>> {
12697 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12698 }
12699
12700 pub fn mutability(&self) -> ::core::option::Option<&crate::WireConfigMutability> {
12701 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
12702 }
12703}
12704
12705impl<'de> ::core::fmt::Debug for WireConfigField<'de> {
12706 fn fmt(
12707 &self,
12708 f: &mut ::core::fmt::Formatter<'_>,
12709 ) -> ::core::result::Result<(), ::core::fmt::Error> {
12710 f.debug_struct("ConfigField")
12711 .field("key", &self.key())
12712 .field("type_", &self.type_())
12713 .field("mutability", &self.mutability())
12714 .finish()
12715 }
12716}
12717
12718#[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"]
12719#[derive(PartialEq, Clone, Debug, Default)]
12720pub struct Program {
12721 pub runner: ::core::option::Option<::std::string::String>,
12722
12723 pub info: ::core::option::Option<::fidl_next_fuchsia_data::Dictionary>,
12724}
12725
12726impl Program {
12727 fn __max_ordinal(&self) -> usize {
12728 if self.info.is_some() {
12729 return 2;
12730 }
12731
12732 if self.runner.is_some() {
12733 return 1;
12734 }
12735
12736 0
12737 }
12738}
12739
12740impl ::fidl_next::Encodable for Program {
12741 type Encoded = WireProgram<'static>;
12742}
12743
12744unsafe impl<___E> ::fidl_next::Encode<___E> for Program
12745where
12746 ___E: ::fidl_next::Encoder + ?Sized,
12747{
12748 #[inline]
12749 fn encode(
12750 mut self,
12751 encoder: &mut ___E,
12752 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12753 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12754 ::fidl_next::munge!(let WireProgram { table } = out);
12755
12756 let max_ord = self.__max_ordinal();
12757
12758 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12759 ::fidl_next::Wire::zero_padding(&mut out);
12760
12761 let mut preallocated =
12762 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12763
12764 for i in 1..=max_ord {
12765 match i {
12766 2 => {
12767 if let Some(value) = self.info.take() {
12768 ::fidl_next::WireEnvelope::encode_value(
12769 value,
12770 preallocated.encoder,
12771 &mut out,
12772 )?;
12773 } else {
12774 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12775 }
12776 }
12777
12778 1 => {
12779 if let Some(value) = self.runner.take() {
12780 ::fidl_next::WireEnvelope::encode_value(
12781 value,
12782 preallocated.encoder,
12783 &mut out,
12784 )?;
12785 } else {
12786 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12787 }
12788 }
12789
12790 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12791 }
12792 unsafe {
12793 preallocated.write_next(out.assume_init_ref());
12794 }
12795 }
12796
12797 ::fidl_next::WireTable::encode_len(table, max_ord);
12798
12799 Ok(())
12800 }
12801}
12802
12803unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Program
12804where
12805 ___E: ::fidl_next::Encoder + ?Sized,
12806{
12807 #[inline]
12808 fn encode_ref(
12809 &self,
12810 encoder: &mut ___E,
12811 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12812 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12813 ::fidl_next::munge!(let WireProgram { table } = out);
12814
12815 let max_ord = self.__max_ordinal();
12816
12817 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12818 ::fidl_next::Wire::zero_padding(&mut out);
12819
12820 let mut preallocated =
12821 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12822
12823 for i in 1..=max_ord {
12824 match i {
12825 2 => {
12826 if let Some(value) = &self.info {
12827 ::fidl_next::WireEnvelope::encode_value(
12828 value,
12829 preallocated.encoder,
12830 &mut out,
12831 )?;
12832 } else {
12833 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12834 }
12835 }
12836
12837 1 => {
12838 if let Some(value) = &self.runner {
12839 ::fidl_next::WireEnvelope::encode_value(
12840 value,
12841 preallocated.encoder,
12842 &mut out,
12843 )?;
12844 } else {
12845 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12846 }
12847 }
12848
12849 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12850 }
12851 unsafe {
12852 preallocated.write_next(out.assume_init_ref());
12853 }
12854 }
12855
12856 ::fidl_next::WireTable::encode_len(table, max_ord);
12857
12858 Ok(())
12859 }
12860}
12861
12862impl<'de> ::fidl_next::FromWire<WireProgram<'de>> for Program {
12863 #[inline]
12864 fn from_wire(wire_: WireProgram<'de>) -> Self {
12865 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
12866
12867 let runner = wire_.table.get(1);
12868
12869 let info = wire_.table.get(2);
12870
12871 Self {
12872 runner: runner.map(|envelope| {
12873 ::fidl_next::FromWire::from_wire(unsafe {
12874 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12875 })
12876 }),
12877
12878 info: info.map(|envelope| {
12879 ::fidl_next::FromWire::from_wire(unsafe {
12880 envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
12881 })
12882 }),
12883 }
12884 }
12885}
12886
12887impl<'de> ::fidl_next::IntoNatural for WireProgram<'de> {
12888 type Natural = Program;
12889}
12890
12891impl<'de> ::fidl_next::FromWireRef<WireProgram<'de>> for Program {
12892 #[inline]
12893 fn from_wire_ref(wire: &WireProgram<'de>) -> Self {
12894 Self {
12895 runner: wire.table.get(1).map(|envelope| {
12896 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12897 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12898 })
12899 }),
12900
12901 info: wire.table.get(2).map(|envelope| {
12902 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12903 envelope.deref_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
12904 })
12905 }),
12906 }
12907 }
12908}
12909
12910#[repr(C)]
12912pub struct WireProgram<'de> {
12913 table: ::fidl_next::WireTable<'de>,
12914}
12915
12916impl<'de> Drop for WireProgram<'de> {
12917 fn drop(&mut self) {
12918 let _ = self
12919 .table
12920 .get(1)
12921 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
12922
12923 let _ = self.table.get(2).map(|envelope| unsafe {
12924 envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
12925 });
12926 }
12927}
12928
12929unsafe impl ::fidl_next::Wire for WireProgram<'static> {
12930 type Decoded<'de> = WireProgram<'de>;
12931
12932 #[inline]
12933 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12934 ::fidl_next::munge!(let Self { table } = out);
12935 ::fidl_next::WireTable::zero_padding(table);
12936 }
12937}
12938
12939unsafe impl<___D> ::fidl_next::Decode<___D> for WireProgram<'static>
12940where
12941 ___D: ::fidl_next::Decoder + ?Sized,
12942{
12943 fn decode(
12944 slot: ::fidl_next::Slot<'_, Self>,
12945 decoder: &mut ___D,
12946 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
12947 ::fidl_next::munge!(let Self { table } = slot);
12948
12949 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12950 match ordinal {
12951 0 => unsafe { ::core::hint::unreachable_unchecked() },
12952
12953 1 => {
12954 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
12955 slot.as_mut(),
12956 decoder,
12957 )?;
12958
12959 let value = unsafe {
12960 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
12961 };
12962
12963 if value.len() > 100 {
12964 return Err(::fidl_next::DecodeError::VectorTooLong {
12965 size: value.len() as u64,
12966 limit: 100,
12967 });
12968 }
12969
12970 Ok(())
12971 }
12972
12973 2 => {
12974 ::fidl_next::WireEnvelope::decode_as::<
12975 ___D,
12976 ::fidl_next_fuchsia_data::WireDictionary<'static>,
12977 >(slot.as_mut(), decoder)?;
12978
12979 Ok(())
12980 }
12981
12982 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
12983 }
12984 })
12985 }
12986}
12987
12988impl<'de> WireProgram<'de> {
12989 pub fn runner(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
12990 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12991 }
12992
12993 pub fn info(&self) -> ::core::option::Option<&::fidl_next_fuchsia_data::WireDictionary<'de>> {
12994 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12995 }
12996}
12997
12998impl<'de> ::core::fmt::Debug for WireProgram<'de> {
12999 fn fmt(
13000 &self,
13001 f: &mut ::core::fmt::Formatter<'_>,
13002 ) -> ::core::result::Result<(), ::core::fmt::Error> {
13003 f.debug_struct("Program")
13004 .field("runner", &self.runner())
13005 .field("info", &self.info())
13006 .finish()
13007 }
13008}
13009
13010#[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"]
13011#[derive(PartialEq, Clone, Debug, Default)]
13012pub struct UseService {
13013 pub source: ::core::option::Option<crate::Ref>,
13014
13015 pub source_name: ::core::option::Option<::std::string::String>,
13016
13017 pub target_path: ::core::option::Option<::std::string::String>,
13018
13019 pub dependency_type: ::core::option::Option<crate::DependencyType>,
13020
13021 pub availability: ::core::option::Option<crate::Availability>,
13022
13023 pub source_dictionary: ::core::option::Option<::std::string::String>,
13024}
13025
13026impl UseService {
13027 fn __max_ordinal(&self) -> usize {
13028 if self.source_dictionary.is_some() {
13029 return 6;
13030 }
13031
13032 if self.availability.is_some() {
13033 return 5;
13034 }
13035
13036 if self.dependency_type.is_some() {
13037 return 4;
13038 }
13039
13040 if self.target_path.is_some() {
13041 return 3;
13042 }
13043
13044 if self.source_name.is_some() {
13045 return 2;
13046 }
13047
13048 if self.source.is_some() {
13049 return 1;
13050 }
13051
13052 0
13053 }
13054}
13055
13056impl ::fidl_next::Encodable for UseService {
13057 type Encoded = WireUseService<'static>;
13058}
13059
13060unsafe impl<___E> ::fidl_next::Encode<___E> for UseService
13061where
13062 ___E: ::fidl_next::Encoder + ?Sized,
13063{
13064 #[inline]
13065 fn encode(
13066 mut self,
13067 encoder: &mut ___E,
13068 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13069 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13070 ::fidl_next::munge!(let WireUseService { table } = out);
13071
13072 let max_ord = self.__max_ordinal();
13073
13074 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
13075 ::fidl_next::Wire::zero_padding(&mut out);
13076
13077 let mut preallocated =
13078 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
13079
13080 for i in 1..=max_ord {
13081 match i {
13082 6 => {
13083 if let Some(value) = self.source_dictionary.take() {
13084 ::fidl_next::WireEnvelope::encode_value(
13085 value,
13086 preallocated.encoder,
13087 &mut out,
13088 )?;
13089 } else {
13090 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13091 }
13092 }
13093
13094 5 => {
13095 if let Some(value) = self.availability.take() {
13096 ::fidl_next::WireEnvelope::encode_value(
13097 value,
13098 preallocated.encoder,
13099 &mut out,
13100 )?;
13101 } else {
13102 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13103 }
13104 }
13105
13106 4 => {
13107 if let Some(value) = self.dependency_type.take() {
13108 ::fidl_next::WireEnvelope::encode_value(
13109 value,
13110 preallocated.encoder,
13111 &mut out,
13112 )?;
13113 } else {
13114 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13115 }
13116 }
13117
13118 3 => {
13119 if let Some(value) = self.target_path.take() {
13120 ::fidl_next::WireEnvelope::encode_value(
13121 value,
13122 preallocated.encoder,
13123 &mut out,
13124 )?;
13125 } else {
13126 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13127 }
13128 }
13129
13130 2 => {
13131 if let Some(value) = self.source_name.take() {
13132 ::fidl_next::WireEnvelope::encode_value(
13133 value,
13134 preallocated.encoder,
13135 &mut out,
13136 )?;
13137 } else {
13138 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13139 }
13140 }
13141
13142 1 => {
13143 if let Some(value) = self.source.take() {
13144 ::fidl_next::WireEnvelope::encode_value(
13145 value,
13146 preallocated.encoder,
13147 &mut out,
13148 )?;
13149 } else {
13150 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13151 }
13152 }
13153
13154 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
13155 }
13156 unsafe {
13157 preallocated.write_next(out.assume_init_ref());
13158 }
13159 }
13160
13161 ::fidl_next::WireTable::encode_len(table, max_ord);
13162
13163 Ok(())
13164 }
13165}
13166
13167unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UseService
13168where
13169 ___E: ::fidl_next::Encoder + ?Sized,
13170{
13171 #[inline]
13172 fn encode_ref(
13173 &self,
13174 encoder: &mut ___E,
13175 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13176 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13177 ::fidl_next::munge!(let WireUseService { table } = out);
13178
13179 let max_ord = self.__max_ordinal();
13180
13181 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
13182 ::fidl_next::Wire::zero_padding(&mut out);
13183
13184 let mut preallocated =
13185 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
13186
13187 for i in 1..=max_ord {
13188 match i {
13189 6 => {
13190 if let Some(value) = &self.source_dictionary {
13191 ::fidl_next::WireEnvelope::encode_value(
13192 value,
13193 preallocated.encoder,
13194 &mut out,
13195 )?;
13196 } else {
13197 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13198 }
13199 }
13200
13201 5 => {
13202 if let Some(value) = &self.availability {
13203 ::fidl_next::WireEnvelope::encode_value(
13204 value,
13205 preallocated.encoder,
13206 &mut out,
13207 )?;
13208 } else {
13209 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13210 }
13211 }
13212
13213 4 => {
13214 if let Some(value) = &self.dependency_type {
13215 ::fidl_next::WireEnvelope::encode_value(
13216 value,
13217 preallocated.encoder,
13218 &mut out,
13219 )?;
13220 } else {
13221 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13222 }
13223 }
13224
13225 3 => {
13226 if let Some(value) = &self.target_path {
13227 ::fidl_next::WireEnvelope::encode_value(
13228 value,
13229 preallocated.encoder,
13230 &mut out,
13231 )?;
13232 } else {
13233 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13234 }
13235 }
13236
13237 2 => {
13238 if let Some(value) = &self.source_name {
13239 ::fidl_next::WireEnvelope::encode_value(
13240 value,
13241 preallocated.encoder,
13242 &mut out,
13243 )?;
13244 } else {
13245 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13246 }
13247 }
13248
13249 1 => {
13250 if let Some(value) = &self.source {
13251 ::fidl_next::WireEnvelope::encode_value(
13252 value,
13253 preallocated.encoder,
13254 &mut out,
13255 )?;
13256 } else {
13257 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13258 }
13259 }
13260
13261 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
13262 }
13263 unsafe {
13264 preallocated.write_next(out.assume_init_ref());
13265 }
13266 }
13267
13268 ::fidl_next::WireTable::encode_len(table, max_ord);
13269
13270 Ok(())
13271 }
13272}
13273
13274impl<'de> ::fidl_next::FromWire<WireUseService<'de>> for UseService {
13275 #[inline]
13276 fn from_wire(wire_: WireUseService<'de>) -> Self {
13277 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
13278
13279 let source = wire_.table.get(1);
13280
13281 let source_name = wire_.table.get(2);
13282
13283 let target_path = wire_.table.get(3);
13284
13285 let dependency_type = wire_.table.get(4);
13286
13287 let availability = wire_.table.get(5);
13288
13289 let source_dictionary = wire_.table.get(6);
13290
13291 Self {
13292 source: source.map(|envelope| {
13293 ::fidl_next::FromWire::from_wire(unsafe {
13294 envelope.read_unchecked::<crate::WireRef<'de>>()
13295 })
13296 }),
13297
13298 source_name: source_name.map(|envelope| {
13299 ::fidl_next::FromWire::from_wire(unsafe {
13300 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13301 })
13302 }),
13303
13304 target_path: target_path.map(|envelope| {
13305 ::fidl_next::FromWire::from_wire(unsafe {
13306 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13307 })
13308 }),
13309
13310 dependency_type: dependency_type.map(|envelope| {
13311 ::fidl_next::FromWire::from_wire(unsafe {
13312 envelope.read_unchecked::<crate::WireDependencyType>()
13313 })
13314 }),
13315
13316 availability: availability.map(|envelope| {
13317 ::fidl_next::FromWire::from_wire(unsafe {
13318 envelope.read_unchecked::<crate::WireAvailability>()
13319 })
13320 }),
13321
13322 source_dictionary: source_dictionary.map(|envelope| {
13323 ::fidl_next::FromWire::from_wire(unsafe {
13324 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13325 })
13326 }),
13327 }
13328 }
13329}
13330
13331impl<'de> ::fidl_next::IntoNatural for WireUseService<'de> {
13332 type Natural = UseService;
13333}
13334
13335impl<'de> ::fidl_next::FromWireRef<WireUseService<'de>> for UseService {
13336 #[inline]
13337 fn from_wire_ref(wire: &WireUseService<'de>) -> Self {
13338 Self {
13339 source: wire.table.get(1).map(|envelope| {
13340 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13341 envelope.deref_unchecked::<crate::WireRef<'de>>()
13342 })
13343 }),
13344
13345 source_name: wire.table.get(2).map(|envelope| {
13346 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13347 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13348 })
13349 }),
13350
13351 target_path: wire.table.get(3).map(|envelope| {
13352 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13353 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13354 })
13355 }),
13356
13357 dependency_type: wire.table.get(4).map(|envelope| {
13358 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13359 envelope.deref_unchecked::<crate::WireDependencyType>()
13360 })
13361 }),
13362
13363 availability: wire.table.get(5).map(|envelope| {
13364 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13365 envelope.deref_unchecked::<crate::WireAvailability>()
13366 })
13367 }),
13368
13369 source_dictionary: wire.table.get(6).map(|envelope| {
13370 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13371 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13372 })
13373 }),
13374 }
13375 }
13376}
13377
13378#[repr(C)]
13380pub struct WireUseService<'de> {
13381 table: ::fidl_next::WireTable<'de>,
13382}
13383
13384impl<'de> Drop for WireUseService<'de> {
13385 fn drop(&mut self) {
13386 let _ = self
13387 .table
13388 .get(1)
13389 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
13390
13391 let _ = self
13392 .table
13393 .get(2)
13394 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
13395
13396 let _ = self
13397 .table
13398 .get(3)
13399 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
13400
13401 let _ = self
13402 .table
13403 .get(4)
13404 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDependencyType>() });
13405
13406 let _ = self
13407 .table
13408 .get(5)
13409 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
13410
13411 let _ = self
13412 .table
13413 .get(6)
13414 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
13415 }
13416}
13417
13418unsafe impl ::fidl_next::Wire for WireUseService<'static> {
13419 type Decoded<'de> = WireUseService<'de>;
13420
13421 #[inline]
13422 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13423 ::fidl_next::munge!(let Self { table } = out);
13424 ::fidl_next::WireTable::zero_padding(table);
13425 }
13426}
13427
13428unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseService<'static>
13429where
13430 ___D: ::fidl_next::Decoder + ?Sized,
13431{
13432 fn decode(
13433 slot: ::fidl_next::Slot<'_, Self>,
13434 decoder: &mut ___D,
13435 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
13436 ::fidl_next::munge!(let Self { table } = slot);
13437
13438 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13439 match ordinal {
13440 0 => unsafe { ::core::hint::unreachable_unchecked() },
13441
13442 1 => {
13443 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
13444 slot.as_mut(),
13445 decoder,
13446 )?;
13447
13448 Ok(())
13449 }
13450
13451 2 => {
13452 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
13453 slot.as_mut(),
13454 decoder,
13455 )?;
13456
13457 let value = unsafe {
13458 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
13459 };
13460
13461 if value.len() > 100 {
13462 return Err(::fidl_next::DecodeError::VectorTooLong {
13463 size: value.len() as u64,
13464 limit: 100,
13465 });
13466 }
13467
13468 Ok(())
13469 }
13470
13471 3 => {
13472 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
13473 slot.as_mut(),
13474 decoder,
13475 )?;
13476
13477 let value = unsafe {
13478 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
13479 };
13480
13481 if value.len() > 1024 {
13482 return Err(::fidl_next::DecodeError::VectorTooLong {
13483 size: value.len() as u64,
13484 limit: 1024,
13485 });
13486 }
13487
13488 Ok(())
13489 }
13490
13491 4 => {
13492 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
13493 slot.as_mut(),
13494 decoder,
13495 )?;
13496
13497 Ok(())
13498 }
13499
13500 5 => {
13501 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
13502 slot.as_mut(),
13503 decoder,
13504 )?;
13505
13506 Ok(())
13507 }
13508
13509 6 => {
13510 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
13511 slot.as_mut(),
13512 decoder,
13513 )?;
13514
13515 let value = unsafe {
13516 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
13517 };
13518
13519 if value.len() > 1024 {
13520 return Err(::fidl_next::DecodeError::VectorTooLong {
13521 size: value.len() as u64,
13522 limit: 1024,
13523 });
13524 }
13525
13526 Ok(())
13527 }
13528
13529 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
13530 }
13531 })
13532 }
13533}
13534
13535impl<'de> WireUseService<'de> {
13536 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
13537 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13538 }
13539
13540 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
13541 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
13542 }
13543
13544 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
13545 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
13546 }
13547
13548 pub fn dependency_type(&self) -> ::core::option::Option<&crate::WireDependencyType> {
13549 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
13550 }
13551
13552 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
13553 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
13554 }
13555
13556 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
13557 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
13558 }
13559}
13560
13561impl<'de> ::core::fmt::Debug for WireUseService<'de> {
13562 fn fmt(
13563 &self,
13564 f: &mut ::core::fmt::Formatter<'_>,
13565 ) -> ::core::result::Result<(), ::core::fmt::Error> {
13566 f.debug_struct("UseService")
13567 .field("source", &self.source())
13568 .field("source_name", &self.source_name())
13569 .field("target_path", &self.target_path())
13570 .field("dependency_type", &self.dependency_type())
13571 .field("availability", &self.availability())
13572 .field("source_dictionary", &self.source_dictionary())
13573 .finish()
13574 }
13575}
13576
13577#[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"]
13578#[derive(PartialEq, Clone, Debug, Default)]
13579pub struct UseProtocol {
13580 pub source: ::core::option::Option<crate::Ref>,
13581
13582 pub source_name: ::core::option::Option<::std::string::String>,
13583
13584 pub target_path: ::core::option::Option<::std::string::String>,
13585
13586 pub dependency_type: ::core::option::Option<crate::DependencyType>,
13587
13588 pub availability: ::core::option::Option<crate::Availability>,
13589
13590 pub source_dictionary: ::core::option::Option<::std::string::String>,
13591
13592 pub numbered_handle: ::core::option::Option<u8>,
13593}
13594
13595impl UseProtocol {
13596 fn __max_ordinal(&self) -> usize {
13597 if self.numbered_handle.is_some() {
13598 return 7;
13599 }
13600
13601 if self.source_dictionary.is_some() {
13602 return 6;
13603 }
13604
13605 if self.availability.is_some() {
13606 return 5;
13607 }
13608
13609 if self.dependency_type.is_some() {
13610 return 4;
13611 }
13612
13613 if self.target_path.is_some() {
13614 return 3;
13615 }
13616
13617 if self.source_name.is_some() {
13618 return 2;
13619 }
13620
13621 if self.source.is_some() {
13622 return 1;
13623 }
13624
13625 0
13626 }
13627}
13628
13629impl ::fidl_next::Encodable for UseProtocol {
13630 type Encoded = WireUseProtocol<'static>;
13631}
13632
13633unsafe impl<___E> ::fidl_next::Encode<___E> for UseProtocol
13634where
13635 ___E: ::fidl_next::Encoder + ?Sized,
13636{
13637 #[inline]
13638 fn encode(
13639 mut self,
13640 encoder: &mut ___E,
13641 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13642 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13643 ::fidl_next::munge!(let WireUseProtocol { table } = out);
13644
13645 let max_ord = self.__max_ordinal();
13646
13647 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
13648 ::fidl_next::Wire::zero_padding(&mut out);
13649
13650 let mut preallocated =
13651 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
13652
13653 for i in 1..=max_ord {
13654 match i {
13655 7 => {
13656 if let Some(value) = self.numbered_handle.take() {
13657 ::fidl_next::WireEnvelope::encode_value(
13658 value,
13659 preallocated.encoder,
13660 &mut out,
13661 )?;
13662 } else {
13663 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13664 }
13665 }
13666
13667 6 => {
13668 if let Some(value) = self.source_dictionary.take() {
13669 ::fidl_next::WireEnvelope::encode_value(
13670 value,
13671 preallocated.encoder,
13672 &mut out,
13673 )?;
13674 } else {
13675 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13676 }
13677 }
13678
13679 5 => {
13680 if let Some(value) = self.availability.take() {
13681 ::fidl_next::WireEnvelope::encode_value(
13682 value,
13683 preallocated.encoder,
13684 &mut out,
13685 )?;
13686 } else {
13687 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13688 }
13689 }
13690
13691 4 => {
13692 if let Some(value) = self.dependency_type.take() {
13693 ::fidl_next::WireEnvelope::encode_value(
13694 value,
13695 preallocated.encoder,
13696 &mut out,
13697 )?;
13698 } else {
13699 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13700 }
13701 }
13702
13703 3 => {
13704 if let Some(value) = self.target_path.take() {
13705 ::fidl_next::WireEnvelope::encode_value(
13706 value,
13707 preallocated.encoder,
13708 &mut out,
13709 )?;
13710 } else {
13711 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13712 }
13713 }
13714
13715 2 => {
13716 if let Some(value) = self.source_name.take() {
13717 ::fidl_next::WireEnvelope::encode_value(
13718 value,
13719 preallocated.encoder,
13720 &mut out,
13721 )?;
13722 } else {
13723 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13724 }
13725 }
13726
13727 1 => {
13728 if let Some(value) = self.source.take() {
13729 ::fidl_next::WireEnvelope::encode_value(
13730 value,
13731 preallocated.encoder,
13732 &mut out,
13733 )?;
13734 } else {
13735 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13736 }
13737 }
13738
13739 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
13740 }
13741 unsafe {
13742 preallocated.write_next(out.assume_init_ref());
13743 }
13744 }
13745
13746 ::fidl_next::WireTable::encode_len(table, max_ord);
13747
13748 Ok(())
13749 }
13750}
13751
13752unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UseProtocol
13753where
13754 ___E: ::fidl_next::Encoder + ?Sized,
13755{
13756 #[inline]
13757 fn encode_ref(
13758 &self,
13759 encoder: &mut ___E,
13760 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13761 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13762 ::fidl_next::munge!(let WireUseProtocol { table } = out);
13763
13764 let max_ord = self.__max_ordinal();
13765
13766 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
13767 ::fidl_next::Wire::zero_padding(&mut out);
13768
13769 let mut preallocated =
13770 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
13771
13772 for i in 1..=max_ord {
13773 match i {
13774 7 => {
13775 if let Some(value) = &self.numbered_handle {
13776 ::fidl_next::WireEnvelope::encode_value(
13777 value,
13778 preallocated.encoder,
13779 &mut out,
13780 )?;
13781 } else {
13782 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13783 }
13784 }
13785
13786 6 => {
13787 if let Some(value) = &self.source_dictionary {
13788 ::fidl_next::WireEnvelope::encode_value(
13789 value,
13790 preallocated.encoder,
13791 &mut out,
13792 )?;
13793 } else {
13794 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13795 }
13796 }
13797
13798 5 => {
13799 if let Some(value) = &self.availability {
13800 ::fidl_next::WireEnvelope::encode_value(
13801 value,
13802 preallocated.encoder,
13803 &mut out,
13804 )?;
13805 } else {
13806 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13807 }
13808 }
13809
13810 4 => {
13811 if let Some(value) = &self.dependency_type {
13812 ::fidl_next::WireEnvelope::encode_value(
13813 value,
13814 preallocated.encoder,
13815 &mut out,
13816 )?;
13817 } else {
13818 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13819 }
13820 }
13821
13822 3 => {
13823 if let Some(value) = &self.target_path {
13824 ::fidl_next::WireEnvelope::encode_value(
13825 value,
13826 preallocated.encoder,
13827 &mut out,
13828 )?;
13829 } else {
13830 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13831 }
13832 }
13833
13834 2 => {
13835 if let Some(value) = &self.source_name {
13836 ::fidl_next::WireEnvelope::encode_value(
13837 value,
13838 preallocated.encoder,
13839 &mut out,
13840 )?;
13841 } else {
13842 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13843 }
13844 }
13845
13846 1 => {
13847 if let Some(value) = &self.source {
13848 ::fidl_next::WireEnvelope::encode_value(
13849 value,
13850 preallocated.encoder,
13851 &mut out,
13852 )?;
13853 } else {
13854 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13855 }
13856 }
13857
13858 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
13859 }
13860 unsafe {
13861 preallocated.write_next(out.assume_init_ref());
13862 }
13863 }
13864
13865 ::fidl_next::WireTable::encode_len(table, max_ord);
13866
13867 Ok(())
13868 }
13869}
13870
13871impl<'de> ::fidl_next::FromWire<WireUseProtocol<'de>> for UseProtocol {
13872 #[inline]
13873 fn from_wire(wire_: WireUseProtocol<'de>) -> Self {
13874 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
13875
13876 let source = wire_.table.get(1);
13877
13878 let source_name = wire_.table.get(2);
13879
13880 let target_path = wire_.table.get(3);
13881
13882 let dependency_type = wire_.table.get(4);
13883
13884 let availability = wire_.table.get(5);
13885
13886 let source_dictionary = wire_.table.get(6);
13887
13888 let numbered_handle = wire_.table.get(7);
13889
13890 Self {
13891 source: source.map(|envelope| {
13892 ::fidl_next::FromWire::from_wire(unsafe {
13893 envelope.read_unchecked::<crate::WireRef<'de>>()
13894 })
13895 }),
13896
13897 source_name: source_name.map(|envelope| {
13898 ::fidl_next::FromWire::from_wire(unsafe {
13899 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13900 })
13901 }),
13902
13903 target_path: target_path.map(|envelope| {
13904 ::fidl_next::FromWire::from_wire(unsafe {
13905 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13906 })
13907 }),
13908
13909 dependency_type: dependency_type.map(|envelope| {
13910 ::fidl_next::FromWire::from_wire(unsafe {
13911 envelope.read_unchecked::<crate::WireDependencyType>()
13912 })
13913 }),
13914
13915 availability: availability.map(|envelope| {
13916 ::fidl_next::FromWire::from_wire(unsafe {
13917 envelope.read_unchecked::<crate::WireAvailability>()
13918 })
13919 }),
13920
13921 source_dictionary: source_dictionary.map(|envelope| {
13922 ::fidl_next::FromWire::from_wire(unsafe {
13923 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13924 })
13925 }),
13926
13927 numbered_handle: numbered_handle.map(|envelope| {
13928 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
13929 }),
13930 }
13931 }
13932}
13933
13934impl<'de> ::fidl_next::IntoNatural for WireUseProtocol<'de> {
13935 type Natural = UseProtocol;
13936}
13937
13938impl<'de> ::fidl_next::FromWireRef<WireUseProtocol<'de>> for UseProtocol {
13939 #[inline]
13940 fn from_wire_ref(wire: &WireUseProtocol<'de>) -> Self {
13941 Self {
13942 source: wire.table.get(1).map(|envelope| {
13943 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13944 envelope.deref_unchecked::<crate::WireRef<'de>>()
13945 })
13946 }),
13947
13948 source_name: wire.table.get(2).map(|envelope| {
13949 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13950 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13951 })
13952 }),
13953
13954 target_path: wire.table.get(3).map(|envelope| {
13955 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13956 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13957 })
13958 }),
13959
13960 dependency_type: wire.table.get(4).map(|envelope| {
13961 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13962 envelope.deref_unchecked::<crate::WireDependencyType>()
13963 })
13964 }),
13965
13966 availability: wire.table.get(5).map(|envelope| {
13967 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13968 envelope.deref_unchecked::<crate::WireAvailability>()
13969 })
13970 }),
13971
13972 source_dictionary: wire.table.get(6).map(|envelope| {
13973 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13974 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13975 })
13976 }),
13977
13978 numbered_handle: wire.table.get(7).map(|envelope| {
13979 ::fidl_next::FromWireRef::from_wire_ref(unsafe { envelope.deref_unchecked::<u8>() })
13980 }),
13981 }
13982 }
13983}
13984
13985#[repr(C)]
13987pub struct WireUseProtocol<'de> {
13988 table: ::fidl_next::WireTable<'de>,
13989}
13990
13991impl<'de> Drop for WireUseProtocol<'de> {
13992 fn drop(&mut self) {
13993 let _ = self
13994 .table
13995 .get(1)
13996 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
13997
13998 let _ = self
13999 .table
14000 .get(2)
14001 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
14002
14003 let _ = self
14004 .table
14005 .get(3)
14006 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
14007
14008 let _ = self
14009 .table
14010 .get(4)
14011 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDependencyType>() });
14012
14013 let _ = self
14014 .table
14015 .get(5)
14016 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
14017
14018 let _ = self
14019 .table
14020 .get(6)
14021 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
14022
14023 let _ = self.table.get(7).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
14024 }
14025}
14026
14027unsafe impl ::fidl_next::Wire for WireUseProtocol<'static> {
14028 type Decoded<'de> = WireUseProtocol<'de>;
14029
14030 #[inline]
14031 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14032 ::fidl_next::munge!(let Self { table } = out);
14033 ::fidl_next::WireTable::zero_padding(table);
14034 }
14035}
14036
14037unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseProtocol<'static>
14038where
14039 ___D: ::fidl_next::Decoder + ?Sized,
14040{
14041 fn decode(
14042 slot: ::fidl_next::Slot<'_, Self>,
14043 decoder: &mut ___D,
14044 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
14045 ::fidl_next::munge!(let Self { table } = slot);
14046
14047 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
14048 match ordinal {
14049 0 => unsafe { ::core::hint::unreachable_unchecked() },
14050
14051 1 => {
14052 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
14053 slot.as_mut(),
14054 decoder,
14055 )?;
14056
14057 Ok(())
14058 }
14059
14060 2 => {
14061 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
14062 slot.as_mut(),
14063 decoder,
14064 )?;
14065
14066 let value = unsafe {
14067 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
14068 };
14069
14070 if value.len() > 100 {
14071 return Err(::fidl_next::DecodeError::VectorTooLong {
14072 size: value.len() as u64,
14073 limit: 100,
14074 });
14075 }
14076
14077 Ok(())
14078 }
14079
14080 3 => {
14081 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
14082 slot.as_mut(),
14083 decoder,
14084 )?;
14085
14086 let value = unsafe {
14087 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
14088 };
14089
14090 if value.len() > 1024 {
14091 return Err(::fidl_next::DecodeError::VectorTooLong {
14092 size: value.len() as u64,
14093 limit: 1024,
14094 });
14095 }
14096
14097 Ok(())
14098 }
14099
14100 4 => {
14101 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
14102 slot.as_mut(),
14103 decoder,
14104 )?;
14105
14106 Ok(())
14107 }
14108
14109 5 => {
14110 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
14111 slot.as_mut(),
14112 decoder,
14113 )?;
14114
14115 Ok(())
14116 }
14117
14118 6 => {
14119 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
14120 slot.as_mut(),
14121 decoder,
14122 )?;
14123
14124 let value = unsafe {
14125 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
14126 };
14127
14128 if value.len() > 1024 {
14129 return Err(::fidl_next::DecodeError::VectorTooLong {
14130 size: value.len() as u64,
14131 limit: 1024,
14132 });
14133 }
14134
14135 Ok(())
14136 }
14137
14138 7 => {
14139 ::fidl_next::WireEnvelope::decode_as::<___D, u8>(slot.as_mut(), decoder)?;
14140
14141 Ok(())
14142 }
14143
14144 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
14145 }
14146 })
14147 }
14148}
14149
14150impl<'de> WireUseProtocol<'de> {
14151 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
14152 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
14153 }
14154
14155 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
14156 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
14157 }
14158
14159 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
14160 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
14161 }
14162
14163 pub fn dependency_type(&self) -> ::core::option::Option<&crate::WireDependencyType> {
14164 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
14165 }
14166
14167 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
14168 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
14169 }
14170
14171 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
14172 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
14173 }
14174
14175 pub fn numbered_handle(&self) -> ::core::option::Option<&u8> {
14176 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
14177 }
14178}
14179
14180impl<'de> ::core::fmt::Debug for WireUseProtocol<'de> {
14181 fn fmt(
14182 &self,
14183 f: &mut ::core::fmt::Formatter<'_>,
14184 ) -> ::core::result::Result<(), ::core::fmt::Error> {
14185 f.debug_struct("UseProtocol")
14186 .field("source", &self.source())
14187 .field("source_name", &self.source_name())
14188 .field("target_path", &self.target_path())
14189 .field("dependency_type", &self.dependency_type())
14190 .field("availability", &self.availability())
14191 .field("source_dictionary", &self.source_dictionary())
14192 .field("numbered_handle", &self.numbered_handle())
14193 .finish()
14194 }
14195}
14196
14197#[doc = " Declares a directory used by a component, which was offered to it.\n"]
14198#[derive(PartialEq, Clone, Debug, Default)]
14199pub struct UseDirectory {
14200 pub source: ::core::option::Option<crate::Ref>,
14201
14202 pub source_name: ::core::option::Option<::std::string::String>,
14203
14204 pub target_path: ::core::option::Option<::std::string::String>,
14205
14206 pub rights: ::core::option::Option<::fidl_next_fuchsia_io::Operations>,
14207
14208 pub subdir: ::core::option::Option<::std::string::String>,
14209
14210 pub dependency_type: ::core::option::Option<crate::DependencyType>,
14211
14212 pub availability: ::core::option::Option<crate::Availability>,
14213
14214 pub source_dictionary: ::core::option::Option<::std::string::String>,
14215}
14216
14217impl UseDirectory {
14218 fn __max_ordinal(&self) -> usize {
14219 if self.source_dictionary.is_some() {
14220 return 8;
14221 }
14222
14223 if self.availability.is_some() {
14224 return 7;
14225 }
14226
14227 if self.dependency_type.is_some() {
14228 return 6;
14229 }
14230
14231 if self.subdir.is_some() {
14232 return 5;
14233 }
14234
14235 if self.rights.is_some() {
14236 return 4;
14237 }
14238
14239 if self.target_path.is_some() {
14240 return 3;
14241 }
14242
14243 if self.source_name.is_some() {
14244 return 2;
14245 }
14246
14247 if self.source.is_some() {
14248 return 1;
14249 }
14250
14251 0
14252 }
14253}
14254
14255impl ::fidl_next::Encodable for UseDirectory {
14256 type Encoded = WireUseDirectory<'static>;
14257}
14258
14259unsafe impl<___E> ::fidl_next::Encode<___E> for UseDirectory
14260where
14261 ___E: ::fidl_next::Encoder + ?Sized,
14262{
14263 #[inline]
14264 fn encode(
14265 mut self,
14266 encoder: &mut ___E,
14267 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14268 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14269 ::fidl_next::munge!(let WireUseDirectory { table } = out);
14270
14271 let max_ord = self.__max_ordinal();
14272
14273 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
14274 ::fidl_next::Wire::zero_padding(&mut out);
14275
14276 let mut preallocated =
14277 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
14278
14279 for i in 1..=max_ord {
14280 match i {
14281 8 => {
14282 if let Some(value) = self.source_dictionary.take() {
14283 ::fidl_next::WireEnvelope::encode_value(
14284 value,
14285 preallocated.encoder,
14286 &mut out,
14287 )?;
14288 } else {
14289 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14290 }
14291 }
14292
14293 7 => {
14294 if let Some(value) = self.availability.take() {
14295 ::fidl_next::WireEnvelope::encode_value(
14296 value,
14297 preallocated.encoder,
14298 &mut out,
14299 )?;
14300 } else {
14301 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14302 }
14303 }
14304
14305 6 => {
14306 if let Some(value) = self.dependency_type.take() {
14307 ::fidl_next::WireEnvelope::encode_value(
14308 value,
14309 preallocated.encoder,
14310 &mut out,
14311 )?;
14312 } else {
14313 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14314 }
14315 }
14316
14317 5 => {
14318 if let Some(value) = self.subdir.take() {
14319 ::fidl_next::WireEnvelope::encode_value(
14320 value,
14321 preallocated.encoder,
14322 &mut out,
14323 )?;
14324 } else {
14325 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14326 }
14327 }
14328
14329 4 => {
14330 if let Some(value) = self.rights.take() {
14331 ::fidl_next::WireEnvelope::encode_value(
14332 value,
14333 preallocated.encoder,
14334 &mut out,
14335 )?;
14336 } else {
14337 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14338 }
14339 }
14340
14341 3 => {
14342 if let Some(value) = self.target_path.take() {
14343 ::fidl_next::WireEnvelope::encode_value(
14344 value,
14345 preallocated.encoder,
14346 &mut out,
14347 )?;
14348 } else {
14349 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14350 }
14351 }
14352
14353 2 => {
14354 if let Some(value) = self.source_name.take() {
14355 ::fidl_next::WireEnvelope::encode_value(
14356 value,
14357 preallocated.encoder,
14358 &mut out,
14359 )?;
14360 } else {
14361 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14362 }
14363 }
14364
14365 1 => {
14366 if let Some(value) = self.source.take() {
14367 ::fidl_next::WireEnvelope::encode_value(
14368 value,
14369 preallocated.encoder,
14370 &mut out,
14371 )?;
14372 } else {
14373 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14374 }
14375 }
14376
14377 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
14378 }
14379 unsafe {
14380 preallocated.write_next(out.assume_init_ref());
14381 }
14382 }
14383
14384 ::fidl_next::WireTable::encode_len(table, max_ord);
14385
14386 Ok(())
14387 }
14388}
14389
14390unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UseDirectory
14391where
14392 ___E: ::fidl_next::Encoder + ?Sized,
14393{
14394 #[inline]
14395 fn encode_ref(
14396 &self,
14397 encoder: &mut ___E,
14398 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14399 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14400 ::fidl_next::munge!(let WireUseDirectory { table } = out);
14401
14402 let max_ord = self.__max_ordinal();
14403
14404 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
14405 ::fidl_next::Wire::zero_padding(&mut out);
14406
14407 let mut preallocated =
14408 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
14409
14410 for i in 1..=max_ord {
14411 match i {
14412 8 => {
14413 if let Some(value) = &self.source_dictionary {
14414 ::fidl_next::WireEnvelope::encode_value(
14415 value,
14416 preallocated.encoder,
14417 &mut out,
14418 )?;
14419 } else {
14420 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14421 }
14422 }
14423
14424 7 => {
14425 if let Some(value) = &self.availability {
14426 ::fidl_next::WireEnvelope::encode_value(
14427 value,
14428 preallocated.encoder,
14429 &mut out,
14430 )?;
14431 } else {
14432 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14433 }
14434 }
14435
14436 6 => {
14437 if let Some(value) = &self.dependency_type {
14438 ::fidl_next::WireEnvelope::encode_value(
14439 value,
14440 preallocated.encoder,
14441 &mut out,
14442 )?;
14443 } else {
14444 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14445 }
14446 }
14447
14448 5 => {
14449 if let Some(value) = &self.subdir {
14450 ::fidl_next::WireEnvelope::encode_value(
14451 value,
14452 preallocated.encoder,
14453 &mut out,
14454 )?;
14455 } else {
14456 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14457 }
14458 }
14459
14460 4 => {
14461 if let Some(value) = &self.rights {
14462 ::fidl_next::WireEnvelope::encode_value(
14463 value,
14464 preallocated.encoder,
14465 &mut out,
14466 )?;
14467 } else {
14468 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14469 }
14470 }
14471
14472 3 => {
14473 if let Some(value) = &self.target_path {
14474 ::fidl_next::WireEnvelope::encode_value(
14475 value,
14476 preallocated.encoder,
14477 &mut out,
14478 )?;
14479 } else {
14480 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14481 }
14482 }
14483
14484 2 => {
14485 if let Some(value) = &self.source_name {
14486 ::fidl_next::WireEnvelope::encode_value(
14487 value,
14488 preallocated.encoder,
14489 &mut out,
14490 )?;
14491 } else {
14492 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14493 }
14494 }
14495
14496 1 => {
14497 if let Some(value) = &self.source {
14498 ::fidl_next::WireEnvelope::encode_value(
14499 value,
14500 preallocated.encoder,
14501 &mut out,
14502 )?;
14503 } else {
14504 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14505 }
14506 }
14507
14508 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
14509 }
14510 unsafe {
14511 preallocated.write_next(out.assume_init_ref());
14512 }
14513 }
14514
14515 ::fidl_next::WireTable::encode_len(table, max_ord);
14516
14517 Ok(())
14518 }
14519}
14520
14521impl<'de> ::fidl_next::FromWire<WireUseDirectory<'de>> for UseDirectory {
14522 #[inline]
14523 fn from_wire(wire_: WireUseDirectory<'de>) -> Self {
14524 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
14525
14526 let source = wire_.table.get(1);
14527
14528 let source_name = wire_.table.get(2);
14529
14530 let target_path = wire_.table.get(3);
14531
14532 let rights = wire_.table.get(4);
14533
14534 let subdir = wire_.table.get(5);
14535
14536 let dependency_type = wire_.table.get(6);
14537
14538 let availability = wire_.table.get(7);
14539
14540 let source_dictionary = wire_.table.get(8);
14541
14542 Self {
14543 source: source.map(|envelope| {
14544 ::fidl_next::FromWire::from_wire(unsafe {
14545 envelope.read_unchecked::<crate::WireRef<'de>>()
14546 })
14547 }),
14548
14549 source_name: source_name.map(|envelope| {
14550 ::fidl_next::FromWire::from_wire(unsafe {
14551 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
14552 })
14553 }),
14554
14555 target_path: target_path.map(|envelope| {
14556 ::fidl_next::FromWire::from_wire(unsafe {
14557 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
14558 })
14559 }),
14560
14561 rights: rights.map(|envelope| {
14562 ::fidl_next::FromWire::from_wire(unsafe {
14563 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
14564 })
14565 }),
14566
14567 subdir: subdir.map(|envelope| {
14568 ::fidl_next::FromWire::from_wire(unsafe {
14569 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
14570 })
14571 }),
14572
14573 dependency_type: dependency_type.map(|envelope| {
14574 ::fidl_next::FromWire::from_wire(unsafe {
14575 envelope.read_unchecked::<crate::WireDependencyType>()
14576 })
14577 }),
14578
14579 availability: availability.map(|envelope| {
14580 ::fidl_next::FromWire::from_wire(unsafe {
14581 envelope.read_unchecked::<crate::WireAvailability>()
14582 })
14583 }),
14584
14585 source_dictionary: source_dictionary.map(|envelope| {
14586 ::fidl_next::FromWire::from_wire(unsafe {
14587 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
14588 })
14589 }),
14590 }
14591 }
14592}
14593
14594impl<'de> ::fidl_next::IntoNatural for WireUseDirectory<'de> {
14595 type Natural = UseDirectory;
14596}
14597
14598impl<'de> ::fidl_next::FromWireRef<WireUseDirectory<'de>> for UseDirectory {
14599 #[inline]
14600 fn from_wire_ref(wire: &WireUseDirectory<'de>) -> Self {
14601 Self {
14602 source: wire.table.get(1).map(|envelope| {
14603 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14604 envelope.deref_unchecked::<crate::WireRef<'de>>()
14605 })
14606 }),
14607
14608 source_name: wire.table.get(2).map(|envelope| {
14609 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14610 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
14611 })
14612 }),
14613
14614 target_path: wire.table.get(3).map(|envelope| {
14615 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14616 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
14617 })
14618 }),
14619
14620 rights: wire.table.get(4).map(|envelope| {
14621 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14622 envelope.deref_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
14623 })
14624 }),
14625
14626 subdir: wire.table.get(5).map(|envelope| {
14627 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14628 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
14629 })
14630 }),
14631
14632 dependency_type: wire.table.get(6).map(|envelope| {
14633 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14634 envelope.deref_unchecked::<crate::WireDependencyType>()
14635 })
14636 }),
14637
14638 availability: wire.table.get(7).map(|envelope| {
14639 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14640 envelope.deref_unchecked::<crate::WireAvailability>()
14641 })
14642 }),
14643
14644 source_dictionary: wire.table.get(8).map(|envelope| {
14645 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14646 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
14647 })
14648 }),
14649 }
14650 }
14651}
14652
14653#[repr(C)]
14655pub struct WireUseDirectory<'de> {
14656 table: ::fidl_next::WireTable<'de>,
14657}
14658
14659impl<'de> Drop for WireUseDirectory<'de> {
14660 fn drop(&mut self) {
14661 let _ = self
14662 .table
14663 .get(1)
14664 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
14665
14666 let _ = self
14667 .table
14668 .get(2)
14669 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
14670
14671 let _ = self
14672 .table
14673 .get(3)
14674 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
14675
14676 let _ = self.table.get(4).map(|envelope| unsafe {
14677 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
14678 });
14679
14680 let _ = self
14681 .table
14682 .get(5)
14683 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
14684
14685 let _ = self
14686 .table
14687 .get(6)
14688 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDependencyType>() });
14689
14690 let _ = self
14691 .table
14692 .get(7)
14693 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
14694
14695 let _ = self
14696 .table
14697 .get(8)
14698 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
14699 }
14700}
14701
14702unsafe impl ::fidl_next::Wire for WireUseDirectory<'static> {
14703 type Decoded<'de> = WireUseDirectory<'de>;
14704
14705 #[inline]
14706 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14707 ::fidl_next::munge!(let Self { table } = out);
14708 ::fidl_next::WireTable::zero_padding(table);
14709 }
14710}
14711
14712unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseDirectory<'static>
14713where
14714 ___D: ::fidl_next::Decoder + ?Sized,
14715{
14716 fn decode(
14717 slot: ::fidl_next::Slot<'_, Self>,
14718 decoder: &mut ___D,
14719 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
14720 ::fidl_next::munge!(let Self { table } = slot);
14721
14722 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
14723 match ordinal {
14724 0 => unsafe { ::core::hint::unreachable_unchecked() },
14725
14726 1 => {
14727 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
14728 slot.as_mut(),
14729 decoder,
14730 )?;
14731
14732 Ok(())
14733 }
14734
14735 2 => {
14736 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
14737 slot.as_mut(),
14738 decoder,
14739 )?;
14740
14741 let value = unsafe {
14742 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
14743 };
14744
14745 if value.len() > 100 {
14746 return Err(::fidl_next::DecodeError::VectorTooLong {
14747 size: value.len() as u64,
14748 limit: 100,
14749 });
14750 }
14751
14752 Ok(())
14753 }
14754
14755 3 => {
14756 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
14757 slot.as_mut(),
14758 decoder,
14759 )?;
14760
14761 let value = unsafe {
14762 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
14763 };
14764
14765 if value.len() > 1024 {
14766 return Err(::fidl_next::DecodeError::VectorTooLong {
14767 size: value.len() as u64,
14768 limit: 1024,
14769 });
14770 }
14771
14772 Ok(())
14773 }
14774
14775 4 => {
14776 ::fidl_next::WireEnvelope::decode_as::<
14777 ___D,
14778 ::fidl_next_fuchsia_io::WireOperations,
14779 >(slot.as_mut(), decoder)?;
14780
14781 Ok(())
14782 }
14783
14784 5 => {
14785 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
14786 slot.as_mut(),
14787 decoder,
14788 )?;
14789
14790 let value = unsafe {
14791 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
14792 };
14793
14794 if value.len() > 1024 {
14795 return Err(::fidl_next::DecodeError::VectorTooLong {
14796 size: value.len() as u64,
14797 limit: 1024,
14798 });
14799 }
14800
14801 Ok(())
14802 }
14803
14804 6 => {
14805 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
14806 slot.as_mut(),
14807 decoder,
14808 )?;
14809
14810 Ok(())
14811 }
14812
14813 7 => {
14814 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
14815 slot.as_mut(),
14816 decoder,
14817 )?;
14818
14819 Ok(())
14820 }
14821
14822 8 => {
14823 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
14824 slot.as_mut(),
14825 decoder,
14826 )?;
14827
14828 let value = unsafe {
14829 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
14830 };
14831
14832 if value.len() > 1024 {
14833 return Err(::fidl_next::DecodeError::VectorTooLong {
14834 size: value.len() as u64,
14835 limit: 1024,
14836 });
14837 }
14838
14839 Ok(())
14840 }
14841
14842 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
14843 }
14844 })
14845 }
14846}
14847
14848impl<'de> WireUseDirectory<'de> {
14849 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
14850 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
14851 }
14852
14853 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
14854 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
14855 }
14856
14857 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
14858 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
14859 }
14860
14861 pub fn rights(&self) -> ::core::option::Option<&::fidl_next_fuchsia_io::WireOperations> {
14862 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
14863 }
14864
14865 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
14866 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
14867 }
14868
14869 pub fn dependency_type(&self) -> ::core::option::Option<&crate::WireDependencyType> {
14870 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
14871 }
14872
14873 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
14874 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
14875 }
14876
14877 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
14878 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
14879 }
14880}
14881
14882impl<'de> ::core::fmt::Debug for WireUseDirectory<'de> {
14883 fn fmt(
14884 &self,
14885 f: &mut ::core::fmt::Formatter<'_>,
14886 ) -> ::core::result::Result<(), ::core::fmt::Error> {
14887 f.debug_struct("UseDirectory")
14888 .field("source", &self.source())
14889 .field("source_name", &self.source_name())
14890 .field("target_path", &self.target_path())
14891 .field("rights", &self.rights())
14892 .field("subdir", &self.subdir())
14893 .field("dependency_type", &self.dependency_type())
14894 .field("availability", &self.availability())
14895 .field("source_dictionary", &self.source_dictionary())
14896 .finish()
14897 }
14898}
14899
14900#[doc = " Declares an EventStream used by a component.\n"]
14901#[derive(PartialEq, Clone, Debug, Default)]
14902pub struct UseEventStream {
14903 pub source_name: ::core::option::Option<::std::string::String>,
14904
14905 pub source: ::core::option::Option<crate::Ref>,
14906
14907 pub scope: ::core::option::Option<::std::vec::Vec<crate::Ref>>,
14908
14909 pub target_path: ::core::option::Option<::std::string::String>,
14910
14911 pub availability: ::core::option::Option<crate::Availability>,
14912
14913 pub filter: ::core::option::Option<::fidl_next_fuchsia_data::Dictionary>,
14914}
14915
14916impl UseEventStream {
14917 fn __max_ordinal(&self) -> usize {
14918 if self.filter.is_some() {
14919 return 6;
14920 }
14921
14922 if self.availability.is_some() {
14923 return 5;
14924 }
14925
14926 if self.target_path.is_some() {
14927 return 4;
14928 }
14929
14930 if self.scope.is_some() {
14931 return 3;
14932 }
14933
14934 if self.source.is_some() {
14935 return 2;
14936 }
14937
14938 if self.source_name.is_some() {
14939 return 1;
14940 }
14941
14942 0
14943 }
14944}
14945
14946impl ::fidl_next::Encodable for UseEventStream {
14947 type Encoded = WireUseEventStream<'static>;
14948}
14949
14950unsafe impl<___E> ::fidl_next::Encode<___E> for UseEventStream
14951where
14952 ___E: ::fidl_next::Encoder + ?Sized,
14953{
14954 #[inline]
14955 fn encode(
14956 mut self,
14957 encoder: &mut ___E,
14958 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14959 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14960 ::fidl_next::munge!(let WireUseEventStream { table } = out);
14961
14962 let max_ord = self.__max_ordinal();
14963
14964 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
14965 ::fidl_next::Wire::zero_padding(&mut out);
14966
14967 let mut preallocated =
14968 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
14969
14970 for i in 1..=max_ord {
14971 match i {
14972 6 => {
14973 if let Some(value) = self.filter.take() {
14974 ::fidl_next::WireEnvelope::encode_value(
14975 value,
14976 preallocated.encoder,
14977 &mut out,
14978 )?;
14979 } else {
14980 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14981 }
14982 }
14983
14984 5 => {
14985 if let Some(value) = self.availability.take() {
14986 ::fidl_next::WireEnvelope::encode_value(
14987 value,
14988 preallocated.encoder,
14989 &mut out,
14990 )?;
14991 } else {
14992 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14993 }
14994 }
14995
14996 4 => {
14997 if let Some(value) = self.target_path.take() {
14998 ::fidl_next::WireEnvelope::encode_value(
14999 value,
15000 preallocated.encoder,
15001 &mut out,
15002 )?;
15003 } else {
15004 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15005 }
15006 }
15007
15008 3 => {
15009 if let Some(value) = self.scope.take() {
15010 ::fidl_next::WireEnvelope::encode_value(
15011 value,
15012 preallocated.encoder,
15013 &mut out,
15014 )?;
15015 } else {
15016 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15017 }
15018 }
15019
15020 2 => {
15021 if let Some(value) = self.source.take() {
15022 ::fidl_next::WireEnvelope::encode_value(
15023 value,
15024 preallocated.encoder,
15025 &mut out,
15026 )?;
15027 } else {
15028 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15029 }
15030 }
15031
15032 1 => {
15033 if let Some(value) = self.source_name.take() {
15034 ::fidl_next::WireEnvelope::encode_value(
15035 value,
15036 preallocated.encoder,
15037 &mut out,
15038 )?;
15039 } else {
15040 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15041 }
15042 }
15043
15044 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
15045 }
15046 unsafe {
15047 preallocated.write_next(out.assume_init_ref());
15048 }
15049 }
15050
15051 ::fidl_next::WireTable::encode_len(table, max_ord);
15052
15053 Ok(())
15054 }
15055}
15056
15057unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UseEventStream
15058where
15059 ___E: ::fidl_next::Encoder + ?Sized,
15060{
15061 #[inline]
15062 fn encode_ref(
15063 &self,
15064 encoder: &mut ___E,
15065 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15066 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15067 ::fidl_next::munge!(let WireUseEventStream { table } = out);
15068
15069 let max_ord = self.__max_ordinal();
15070
15071 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
15072 ::fidl_next::Wire::zero_padding(&mut out);
15073
15074 let mut preallocated =
15075 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
15076
15077 for i in 1..=max_ord {
15078 match i {
15079 6 => {
15080 if let Some(value) = &self.filter {
15081 ::fidl_next::WireEnvelope::encode_value(
15082 value,
15083 preallocated.encoder,
15084 &mut out,
15085 )?;
15086 } else {
15087 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15088 }
15089 }
15090
15091 5 => {
15092 if let Some(value) = &self.availability {
15093 ::fidl_next::WireEnvelope::encode_value(
15094 value,
15095 preallocated.encoder,
15096 &mut out,
15097 )?;
15098 } else {
15099 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15100 }
15101 }
15102
15103 4 => {
15104 if let Some(value) = &self.target_path {
15105 ::fidl_next::WireEnvelope::encode_value(
15106 value,
15107 preallocated.encoder,
15108 &mut out,
15109 )?;
15110 } else {
15111 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15112 }
15113 }
15114
15115 3 => {
15116 if let Some(value) = &self.scope {
15117 ::fidl_next::WireEnvelope::encode_value(
15118 value,
15119 preallocated.encoder,
15120 &mut out,
15121 )?;
15122 } else {
15123 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15124 }
15125 }
15126
15127 2 => {
15128 if let Some(value) = &self.source {
15129 ::fidl_next::WireEnvelope::encode_value(
15130 value,
15131 preallocated.encoder,
15132 &mut out,
15133 )?;
15134 } else {
15135 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15136 }
15137 }
15138
15139 1 => {
15140 if let Some(value) = &self.source_name {
15141 ::fidl_next::WireEnvelope::encode_value(
15142 value,
15143 preallocated.encoder,
15144 &mut out,
15145 )?;
15146 } else {
15147 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15148 }
15149 }
15150
15151 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
15152 }
15153 unsafe {
15154 preallocated.write_next(out.assume_init_ref());
15155 }
15156 }
15157
15158 ::fidl_next::WireTable::encode_len(table, max_ord);
15159
15160 Ok(())
15161 }
15162}
15163
15164impl<'de> ::fidl_next::FromWire<WireUseEventStream<'de>> for UseEventStream {
15165 #[inline]
15166 fn from_wire(wire_: WireUseEventStream<'de>) -> Self {
15167 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
15168
15169 let source_name = wire_.table.get(1);
15170
15171 let source = wire_.table.get(2);
15172
15173 let scope = wire_.table.get(3);
15174
15175 let target_path = wire_.table.get(4);
15176
15177 let availability = wire_.table.get(5);
15178
15179 let filter = wire_.table.get(6);
15180
15181 Self {
15182 source_name: source_name.map(|envelope| {
15183 ::fidl_next::FromWire::from_wire(unsafe {
15184 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15185 })
15186 }),
15187
15188 source: source.map(|envelope| {
15189 ::fidl_next::FromWire::from_wire(unsafe {
15190 envelope.read_unchecked::<crate::WireRef<'de>>()
15191 })
15192 }),
15193
15194 scope: scope.map(|envelope| {
15195 ::fidl_next::FromWire::from_wire(unsafe {
15196 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireRef<'de>>>()
15197 })
15198 }),
15199
15200 target_path: target_path.map(|envelope| {
15201 ::fidl_next::FromWire::from_wire(unsafe {
15202 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15203 })
15204 }),
15205
15206 availability: availability.map(|envelope| {
15207 ::fidl_next::FromWire::from_wire(unsafe {
15208 envelope.read_unchecked::<crate::WireAvailability>()
15209 })
15210 }),
15211
15212 filter: filter.map(|envelope| {
15213 ::fidl_next::FromWire::from_wire(unsafe {
15214 envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
15215 })
15216 }),
15217 }
15218 }
15219}
15220
15221impl<'de> ::fidl_next::IntoNatural for WireUseEventStream<'de> {
15222 type Natural = UseEventStream;
15223}
15224
15225impl<'de> ::fidl_next::FromWireRef<WireUseEventStream<'de>> for UseEventStream {
15226 #[inline]
15227 fn from_wire_ref(wire: &WireUseEventStream<'de>) -> Self {
15228 Self {
15229 source_name: wire.table.get(1).map(|envelope| {
15230 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15231 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15232 })
15233 }),
15234
15235 source: wire.table.get(2).map(|envelope| {
15236 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15237 envelope.deref_unchecked::<crate::WireRef<'de>>()
15238 })
15239 }),
15240
15241 scope: wire.table.get(3).map(|envelope| {
15242 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15243 envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireRef<'de>>>()
15244 })
15245 }),
15246
15247 target_path: wire.table.get(4).map(|envelope| {
15248 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15249 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15250 })
15251 }),
15252
15253 availability: wire.table.get(5).map(|envelope| {
15254 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15255 envelope.deref_unchecked::<crate::WireAvailability>()
15256 })
15257 }),
15258
15259 filter: wire.table.get(6).map(|envelope| {
15260 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15261 envelope.deref_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
15262 })
15263 }),
15264 }
15265 }
15266}
15267
15268#[repr(C)]
15270pub struct WireUseEventStream<'de> {
15271 table: ::fidl_next::WireTable<'de>,
15272}
15273
15274impl<'de> Drop for WireUseEventStream<'de> {
15275 fn drop(&mut self) {
15276 let _ = self
15277 .table
15278 .get(1)
15279 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
15280
15281 let _ = self
15282 .table
15283 .get(2)
15284 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
15285
15286 let _ = self.table.get(3).map(|envelope| unsafe {
15287 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireRef<'de>>>()
15288 });
15289
15290 let _ = self
15291 .table
15292 .get(4)
15293 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
15294
15295 let _ = self
15296 .table
15297 .get(5)
15298 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
15299
15300 let _ = self.table.get(6).map(|envelope| unsafe {
15301 envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
15302 });
15303 }
15304}
15305
15306unsafe impl ::fidl_next::Wire for WireUseEventStream<'static> {
15307 type Decoded<'de> = WireUseEventStream<'de>;
15308
15309 #[inline]
15310 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
15311 ::fidl_next::munge!(let Self { table } = out);
15312 ::fidl_next::WireTable::zero_padding(table);
15313 }
15314}
15315
15316unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseEventStream<'static>
15317where
15318 ___D: ::fidl_next::Decoder + ?Sized,
15319{
15320 fn decode(
15321 slot: ::fidl_next::Slot<'_, Self>,
15322 decoder: &mut ___D,
15323 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15324 ::fidl_next::munge!(let Self { table } = slot);
15325
15326 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
15327 match ordinal {
15328 0 => unsafe { ::core::hint::unreachable_unchecked() },
15329
15330 1 => {
15331 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
15332 slot.as_mut(),
15333 decoder,
15334 )?;
15335
15336 let value = unsafe {
15337 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
15338 };
15339
15340 if value.len() > 100 {
15341 return Err(::fidl_next::DecodeError::VectorTooLong {
15342 size: value.len() as u64,
15343 limit: 100,
15344 });
15345 }
15346
15347 Ok(())
15348 }
15349
15350 2 => {
15351 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
15352 slot.as_mut(),
15353 decoder,
15354 )?;
15355
15356 Ok(())
15357 }
15358
15359 3 => {
15360 ::fidl_next::WireEnvelope::decode_as::<
15361 ___D,
15362 ::fidl_next::WireVector<'static, crate::WireRef<'static>>,
15363 >(slot.as_mut(), decoder)?;
15364
15365 Ok(())
15366 }
15367
15368 4 => {
15369 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
15370 slot.as_mut(),
15371 decoder,
15372 )?;
15373
15374 let value = unsafe {
15375 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
15376 };
15377
15378 if value.len() > 100 {
15379 return Err(::fidl_next::DecodeError::VectorTooLong {
15380 size: value.len() as u64,
15381 limit: 100,
15382 });
15383 }
15384
15385 Ok(())
15386 }
15387
15388 5 => {
15389 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
15390 slot.as_mut(),
15391 decoder,
15392 )?;
15393
15394 Ok(())
15395 }
15396
15397 6 => {
15398 ::fidl_next::WireEnvelope::decode_as::<
15399 ___D,
15400 ::fidl_next_fuchsia_data::WireDictionary<'static>,
15401 >(slot.as_mut(), decoder)?;
15402
15403 Ok(())
15404 }
15405
15406 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
15407 }
15408 })
15409 }
15410}
15411
15412impl<'de> WireUseEventStream<'de> {
15413 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
15414 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
15415 }
15416
15417 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
15418 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
15419 }
15420
15421 pub fn scope(
15422 &self,
15423 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireRef<'de>>> {
15424 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
15425 }
15426
15427 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
15428 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
15429 }
15430
15431 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
15432 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
15433 }
15434
15435 pub fn filter(&self) -> ::core::option::Option<&::fidl_next_fuchsia_data::WireDictionary<'de>> {
15436 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
15437 }
15438}
15439
15440impl<'de> ::core::fmt::Debug for WireUseEventStream<'de> {
15441 fn fmt(
15442 &self,
15443 f: &mut ::core::fmt::Formatter<'_>,
15444 ) -> ::core::result::Result<(), ::core::fmt::Error> {
15445 f.debug_struct("UseEventStream")
15446 .field("source_name", &self.source_name())
15447 .field("source", &self.source())
15448 .field("scope", &self.scope())
15449 .field("target_path", &self.target_path())
15450 .field("availability", &self.availability())
15451 .field("filter", &self.filter())
15452 .finish()
15453 }
15454}
15455
15456#[doc = " Declares runner used by a component.\n"]
15457#[derive(PartialEq, Clone, Debug, Default)]
15458pub struct UseRunner {
15459 pub source: ::core::option::Option<crate::Ref>,
15460
15461 pub source_name: ::core::option::Option<::std::string::String>,
15462
15463 pub source_dictionary: ::core::option::Option<::std::string::String>,
15464}
15465
15466impl UseRunner {
15467 fn __max_ordinal(&self) -> usize {
15468 if self.source_dictionary.is_some() {
15469 return 3;
15470 }
15471
15472 if self.source_name.is_some() {
15473 return 2;
15474 }
15475
15476 if self.source.is_some() {
15477 return 1;
15478 }
15479
15480 0
15481 }
15482}
15483
15484impl ::fidl_next::Encodable for UseRunner {
15485 type Encoded = WireUseRunner<'static>;
15486}
15487
15488unsafe impl<___E> ::fidl_next::Encode<___E> for UseRunner
15489where
15490 ___E: ::fidl_next::Encoder + ?Sized,
15491{
15492 #[inline]
15493 fn encode(
15494 mut self,
15495 encoder: &mut ___E,
15496 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15497 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15498 ::fidl_next::munge!(let WireUseRunner { table } = out);
15499
15500 let max_ord = self.__max_ordinal();
15501
15502 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
15503 ::fidl_next::Wire::zero_padding(&mut out);
15504
15505 let mut preallocated =
15506 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
15507
15508 for i in 1..=max_ord {
15509 match i {
15510 3 => {
15511 if let Some(value) = self.source_dictionary.take() {
15512 ::fidl_next::WireEnvelope::encode_value(
15513 value,
15514 preallocated.encoder,
15515 &mut out,
15516 )?;
15517 } else {
15518 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15519 }
15520 }
15521
15522 2 => {
15523 if let Some(value) = self.source_name.take() {
15524 ::fidl_next::WireEnvelope::encode_value(
15525 value,
15526 preallocated.encoder,
15527 &mut out,
15528 )?;
15529 } else {
15530 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15531 }
15532 }
15533
15534 1 => {
15535 if let Some(value) = self.source.take() {
15536 ::fidl_next::WireEnvelope::encode_value(
15537 value,
15538 preallocated.encoder,
15539 &mut out,
15540 )?;
15541 } else {
15542 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15543 }
15544 }
15545
15546 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
15547 }
15548 unsafe {
15549 preallocated.write_next(out.assume_init_ref());
15550 }
15551 }
15552
15553 ::fidl_next::WireTable::encode_len(table, max_ord);
15554
15555 Ok(())
15556 }
15557}
15558
15559unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UseRunner
15560where
15561 ___E: ::fidl_next::Encoder + ?Sized,
15562{
15563 #[inline]
15564 fn encode_ref(
15565 &self,
15566 encoder: &mut ___E,
15567 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15568 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15569 ::fidl_next::munge!(let WireUseRunner { table } = out);
15570
15571 let max_ord = self.__max_ordinal();
15572
15573 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
15574 ::fidl_next::Wire::zero_padding(&mut out);
15575
15576 let mut preallocated =
15577 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
15578
15579 for i in 1..=max_ord {
15580 match i {
15581 3 => {
15582 if let Some(value) = &self.source_dictionary {
15583 ::fidl_next::WireEnvelope::encode_value(
15584 value,
15585 preallocated.encoder,
15586 &mut out,
15587 )?;
15588 } else {
15589 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15590 }
15591 }
15592
15593 2 => {
15594 if let Some(value) = &self.source_name {
15595 ::fidl_next::WireEnvelope::encode_value(
15596 value,
15597 preallocated.encoder,
15598 &mut out,
15599 )?;
15600 } else {
15601 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15602 }
15603 }
15604
15605 1 => {
15606 if let Some(value) = &self.source {
15607 ::fidl_next::WireEnvelope::encode_value(
15608 value,
15609 preallocated.encoder,
15610 &mut out,
15611 )?;
15612 } else {
15613 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15614 }
15615 }
15616
15617 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
15618 }
15619 unsafe {
15620 preallocated.write_next(out.assume_init_ref());
15621 }
15622 }
15623
15624 ::fidl_next::WireTable::encode_len(table, max_ord);
15625
15626 Ok(())
15627 }
15628}
15629
15630impl<'de> ::fidl_next::FromWire<WireUseRunner<'de>> for UseRunner {
15631 #[inline]
15632 fn from_wire(wire_: WireUseRunner<'de>) -> Self {
15633 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
15634
15635 let source = wire_.table.get(1);
15636
15637 let source_name = wire_.table.get(2);
15638
15639 let source_dictionary = wire_.table.get(3);
15640
15641 Self {
15642 source: source.map(|envelope| {
15643 ::fidl_next::FromWire::from_wire(unsafe {
15644 envelope.read_unchecked::<crate::WireRef<'de>>()
15645 })
15646 }),
15647
15648 source_name: source_name.map(|envelope| {
15649 ::fidl_next::FromWire::from_wire(unsafe {
15650 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15651 })
15652 }),
15653
15654 source_dictionary: source_dictionary.map(|envelope| {
15655 ::fidl_next::FromWire::from_wire(unsafe {
15656 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15657 })
15658 }),
15659 }
15660 }
15661}
15662
15663impl<'de> ::fidl_next::IntoNatural for WireUseRunner<'de> {
15664 type Natural = UseRunner;
15665}
15666
15667impl<'de> ::fidl_next::FromWireRef<WireUseRunner<'de>> for UseRunner {
15668 #[inline]
15669 fn from_wire_ref(wire: &WireUseRunner<'de>) -> Self {
15670 Self {
15671 source: wire.table.get(1).map(|envelope| {
15672 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15673 envelope.deref_unchecked::<crate::WireRef<'de>>()
15674 })
15675 }),
15676
15677 source_name: wire.table.get(2).map(|envelope| {
15678 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15679 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15680 })
15681 }),
15682
15683 source_dictionary: wire.table.get(3).map(|envelope| {
15684 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15685 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15686 })
15687 }),
15688 }
15689 }
15690}
15691
15692#[repr(C)]
15694pub struct WireUseRunner<'de> {
15695 table: ::fidl_next::WireTable<'de>,
15696}
15697
15698impl<'de> Drop for WireUseRunner<'de> {
15699 fn drop(&mut self) {
15700 let _ = self
15701 .table
15702 .get(1)
15703 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
15704
15705 let _ = self
15706 .table
15707 .get(2)
15708 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
15709
15710 let _ = self
15711 .table
15712 .get(3)
15713 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
15714 }
15715}
15716
15717unsafe impl ::fidl_next::Wire for WireUseRunner<'static> {
15718 type Decoded<'de> = WireUseRunner<'de>;
15719
15720 #[inline]
15721 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
15722 ::fidl_next::munge!(let Self { table } = out);
15723 ::fidl_next::WireTable::zero_padding(table);
15724 }
15725}
15726
15727unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseRunner<'static>
15728where
15729 ___D: ::fidl_next::Decoder + ?Sized,
15730{
15731 fn decode(
15732 slot: ::fidl_next::Slot<'_, Self>,
15733 decoder: &mut ___D,
15734 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
15735 ::fidl_next::munge!(let Self { table } = slot);
15736
15737 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
15738 match ordinal {
15739 0 => unsafe { ::core::hint::unreachable_unchecked() },
15740
15741 1 => {
15742 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
15743 slot.as_mut(),
15744 decoder,
15745 )?;
15746
15747 Ok(())
15748 }
15749
15750 2 => {
15751 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
15752 slot.as_mut(),
15753 decoder,
15754 )?;
15755
15756 let value = unsafe {
15757 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
15758 };
15759
15760 if value.len() > 100 {
15761 return Err(::fidl_next::DecodeError::VectorTooLong {
15762 size: value.len() as u64,
15763 limit: 100,
15764 });
15765 }
15766
15767 Ok(())
15768 }
15769
15770 3 => {
15771 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
15772 slot.as_mut(),
15773 decoder,
15774 )?;
15775
15776 let value = unsafe {
15777 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
15778 };
15779
15780 if value.len() > 1024 {
15781 return Err(::fidl_next::DecodeError::VectorTooLong {
15782 size: value.len() as u64,
15783 limit: 1024,
15784 });
15785 }
15786
15787 Ok(())
15788 }
15789
15790 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
15791 }
15792 })
15793 }
15794}
15795
15796impl<'de> WireUseRunner<'de> {
15797 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
15798 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
15799 }
15800
15801 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
15802 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
15803 }
15804
15805 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
15806 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
15807 }
15808}
15809
15810impl<'de> ::core::fmt::Debug for WireUseRunner<'de> {
15811 fn fmt(
15812 &self,
15813 f: &mut ::core::fmt::Formatter<'_>,
15814 ) -> ::core::result::Result<(), ::core::fmt::Error> {
15815 f.debug_struct("UseRunner")
15816 .field("source", &self.source())
15817 .field("source_name", &self.source_name())
15818 .field("source_dictionary", &self.source_dictionary())
15819 .finish()
15820 }
15821}
15822
15823#[derive(PartialEq, Clone, Debug, Default)]
15824pub struct UseConfiguration {
15825 pub source: ::core::option::Option<crate::Ref>,
15826
15827 pub source_name: ::core::option::Option<::std::string::String>,
15828
15829 pub target_name: ::core::option::Option<::std::string::String>,
15830
15831 pub availability: ::core::option::Option<crate::Availability>,
15832
15833 pub type_: ::core::option::Option<crate::ConfigType>,
15834
15835 pub default: ::core::option::Option<crate::ConfigValue>,
15836
15837 pub source_dictionary: ::core::option::Option<::std::string::String>,
15838}
15839
15840impl UseConfiguration {
15841 fn __max_ordinal(&self) -> usize {
15842 if self.source_dictionary.is_some() {
15843 return 7;
15844 }
15845
15846 if self.default.is_some() {
15847 return 6;
15848 }
15849
15850 if self.type_.is_some() {
15851 return 5;
15852 }
15853
15854 if self.availability.is_some() {
15855 return 4;
15856 }
15857
15858 if self.target_name.is_some() {
15859 return 3;
15860 }
15861
15862 if self.source_name.is_some() {
15863 return 2;
15864 }
15865
15866 if self.source.is_some() {
15867 return 1;
15868 }
15869
15870 0
15871 }
15872}
15873
15874impl ::fidl_next::Encodable for UseConfiguration {
15875 type Encoded = WireUseConfiguration<'static>;
15876}
15877
15878unsafe impl<___E> ::fidl_next::Encode<___E> for UseConfiguration
15879where
15880 ___E: ::fidl_next::Encoder + ?Sized,
15881{
15882 #[inline]
15883 fn encode(
15884 mut self,
15885 encoder: &mut ___E,
15886 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15887 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15888 ::fidl_next::munge!(let WireUseConfiguration { table } = out);
15889
15890 let max_ord = self.__max_ordinal();
15891
15892 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
15893 ::fidl_next::Wire::zero_padding(&mut out);
15894
15895 let mut preallocated =
15896 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
15897
15898 for i in 1..=max_ord {
15899 match i {
15900 7 => {
15901 if let Some(value) = self.source_dictionary.take() {
15902 ::fidl_next::WireEnvelope::encode_value(
15903 value,
15904 preallocated.encoder,
15905 &mut out,
15906 )?;
15907 } else {
15908 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15909 }
15910 }
15911
15912 6 => {
15913 if let Some(value) = self.default.take() {
15914 ::fidl_next::WireEnvelope::encode_value(
15915 value,
15916 preallocated.encoder,
15917 &mut out,
15918 )?;
15919 } else {
15920 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15921 }
15922 }
15923
15924 5 => {
15925 if let Some(value) = self.type_.take() {
15926 ::fidl_next::WireEnvelope::encode_value(
15927 value,
15928 preallocated.encoder,
15929 &mut out,
15930 )?;
15931 } else {
15932 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15933 }
15934 }
15935
15936 4 => {
15937 if let Some(value) = self.availability.take() {
15938 ::fidl_next::WireEnvelope::encode_value(
15939 value,
15940 preallocated.encoder,
15941 &mut out,
15942 )?;
15943 } else {
15944 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15945 }
15946 }
15947
15948 3 => {
15949 if let Some(value) = self.target_name.take() {
15950 ::fidl_next::WireEnvelope::encode_value(
15951 value,
15952 preallocated.encoder,
15953 &mut out,
15954 )?;
15955 } else {
15956 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15957 }
15958 }
15959
15960 2 => {
15961 if let Some(value) = self.source_name.take() {
15962 ::fidl_next::WireEnvelope::encode_value(
15963 value,
15964 preallocated.encoder,
15965 &mut out,
15966 )?;
15967 } else {
15968 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15969 }
15970 }
15971
15972 1 => {
15973 if let Some(value) = self.source.take() {
15974 ::fidl_next::WireEnvelope::encode_value(
15975 value,
15976 preallocated.encoder,
15977 &mut out,
15978 )?;
15979 } else {
15980 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15981 }
15982 }
15983
15984 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
15985 }
15986 unsafe {
15987 preallocated.write_next(out.assume_init_ref());
15988 }
15989 }
15990
15991 ::fidl_next::WireTable::encode_len(table, max_ord);
15992
15993 Ok(())
15994 }
15995}
15996
15997unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UseConfiguration
15998where
15999 ___E: ::fidl_next::Encoder + ?Sized,
16000{
16001 #[inline]
16002 fn encode_ref(
16003 &self,
16004 encoder: &mut ___E,
16005 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16006 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16007 ::fidl_next::munge!(let WireUseConfiguration { table } = out);
16008
16009 let max_ord = self.__max_ordinal();
16010
16011 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
16012 ::fidl_next::Wire::zero_padding(&mut out);
16013
16014 let mut preallocated =
16015 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
16016
16017 for i in 1..=max_ord {
16018 match i {
16019 7 => {
16020 if let Some(value) = &self.source_dictionary {
16021 ::fidl_next::WireEnvelope::encode_value(
16022 value,
16023 preallocated.encoder,
16024 &mut out,
16025 )?;
16026 } else {
16027 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16028 }
16029 }
16030
16031 6 => {
16032 if let Some(value) = &self.default {
16033 ::fidl_next::WireEnvelope::encode_value(
16034 value,
16035 preallocated.encoder,
16036 &mut out,
16037 )?;
16038 } else {
16039 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16040 }
16041 }
16042
16043 5 => {
16044 if let Some(value) = &self.type_ {
16045 ::fidl_next::WireEnvelope::encode_value(
16046 value,
16047 preallocated.encoder,
16048 &mut out,
16049 )?;
16050 } else {
16051 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16052 }
16053 }
16054
16055 4 => {
16056 if let Some(value) = &self.availability {
16057 ::fidl_next::WireEnvelope::encode_value(
16058 value,
16059 preallocated.encoder,
16060 &mut out,
16061 )?;
16062 } else {
16063 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16064 }
16065 }
16066
16067 3 => {
16068 if let Some(value) = &self.target_name {
16069 ::fidl_next::WireEnvelope::encode_value(
16070 value,
16071 preallocated.encoder,
16072 &mut out,
16073 )?;
16074 } else {
16075 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16076 }
16077 }
16078
16079 2 => {
16080 if let Some(value) = &self.source_name {
16081 ::fidl_next::WireEnvelope::encode_value(
16082 value,
16083 preallocated.encoder,
16084 &mut out,
16085 )?;
16086 } else {
16087 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16088 }
16089 }
16090
16091 1 => {
16092 if let Some(value) = &self.source {
16093 ::fidl_next::WireEnvelope::encode_value(
16094 value,
16095 preallocated.encoder,
16096 &mut out,
16097 )?;
16098 } else {
16099 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16100 }
16101 }
16102
16103 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
16104 }
16105 unsafe {
16106 preallocated.write_next(out.assume_init_ref());
16107 }
16108 }
16109
16110 ::fidl_next::WireTable::encode_len(table, max_ord);
16111
16112 Ok(())
16113 }
16114}
16115
16116impl<'de> ::fidl_next::FromWire<WireUseConfiguration<'de>> for UseConfiguration {
16117 #[inline]
16118 fn from_wire(wire_: WireUseConfiguration<'de>) -> Self {
16119 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
16120
16121 let source = wire_.table.get(1);
16122
16123 let source_name = wire_.table.get(2);
16124
16125 let target_name = wire_.table.get(3);
16126
16127 let availability = wire_.table.get(4);
16128
16129 let type_ = wire_.table.get(5);
16130
16131 let default = wire_.table.get(6);
16132
16133 let source_dictionary = wire_.table.get(7);
16134
16135 Self {
16136 source: source.map(|envelope| {
16137 ::fidl_next::FromWire::from_wire(unsafe {
16138 envelope.read_unchecked::<crate::WireRef<'de>>()
16139 })
16140 }),
16141
16142 source_name: source_name.map(|envelope| {
16143 ::fidl_next::FromWire::from_wire(unsafe {
16144 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16145 })
16146 }),
16147
16148 target_name: target_name.map(|envelope| {
16149 ::fidl_next::FromWire::from_wire(unsafe {
16150 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16151 })
16152 }),
16153
16154 availability: availability.map(|envelope| {
16155 ::fidl_next::FromWire::from_wire(unsafe {
16156 envelope.read_unchecked::<crate::WireAvailability>()
16157 })
16158 }),
16159
16160 type_: type_.map(|envelope| {
16161 ::fidl_next::FromWire::from_wire(unsafe {
16162 envelope.read_unchecked::<crate::WireConfigType<'de>>()
16163 })
16164 }),
16165
16166 default: default.map(|envelope| {
16167 ::fidl_next::FromWire::from_wire(unsafe {
16168 envelope.read_unchecked::<crate::WireConfigValue<'de>>()
16169 })
16170 }),
16171
16172 source_dictionary: source_dictionary.map(|envelope| {
16173 ::fidl_next::FromWire::from_wire(unsafe {
16174 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16175 })
16176 }),
16177 }
16178 }
16179}
16180
16181impl<'de> ::fidl_next::IntoNatural for WireUseConfiguration<'de> {
16182 type Natural = UseConfiguration;
16183}
16184
16185impl<'de> ::fidl_next::FromWireRef<WireUseConfiguration<'de>> for UseConfiguration {
16186 #[inline]
16187 fn from_wire_ref(wire: &WireUseConfiguration<'de>) -> Self {
16188 Self {
16189 source: wire.table.get(1).map(|envelope| {
16190 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16191 envelope.deref_unchecked::<crate::WireRef<'de>>()
16192 })
16193 }),
16194
16195 source_name: wire.table.get(2).map(|envelope| {
16196 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16197 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16198 })
16199 }),
16200
16201 target_name: wire.table.get(3).map(|envelope| {
16202 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16203 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16204 })
16205 }),
16206
16207 availability: wire.table.get(4).map(|envelope| {
16208 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16209 envelope.deref_unchecked::<crate::WireAvailability>()
16210 })
16211 }),
16212
16213 type_: wire.table.get(5).map(|envelope| {
16214 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16215 envelope.deref_unchecked::<crate::WireConfigType<'de>>()
16216 })
16217 }),
16218
16219 default: wire.table.get(6).map(|envelope| {
16220 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16221 envelope.deref_unchecked::<crate::WireConfigValue<'de>>()
16222 })
16223 }),
16224
16225 source_dictionary: wire.table.get(7).map(|envelope| {
16226 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16227 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16228 })
16229 }),
16230 }
16231 }
16232}
16233
16234#[repr(C)]
16236pub struct WireUseConfiguration<'de> {
16237 table: ::fidl_next::WireTable<'de>,
16238}
16239
16240impl<'de> Drop for WireUseConfiguration<'de> {
16241 fn drop(&mut self) {
16242 let _ = self
16243 .table
16244 .get(1)
16245 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
16246
16247 let _ = self
16248 .table
16249 .get(2)
16250 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
16251
16252 let _ = self
16253 .table
16254 .get(3)
16255 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
16256
16257 let _ = self
16258 .table
16259 .get(4)
16260 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
16261
16262 let _ = self
16263 .table
16264 .get(5)
16265 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigType<'de>>() });
16266
16267 let _ = self
16268 .table
16269 .get(6)
16270 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigValue<'de>>() });
16271
16272 let _ = self
16273 .table
16274 .get(7)
16275 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
16276 }
16277}
16278
16279unsafe impl ::fidl_next::Wire for WireUseConfiguration<'static> {
16280 type Decoded<'de> = WireUseConfiguration<'de>;
16281
16282 #[inline]
16283 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
16284 ::fidl_next::munge!(let Self { table } = out);
16285 ::fidl_next::WireTable::zero_padding(table);
16286 }
16287}
16288
16289unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseConfiguration<'static>
16290where
16291 ___D: ::fidl_next::Decoder + ?Sized,
16292{
16293 fn decode(
16294 slot: ::fidl_next::Slot<'_, Self>,
16295 decoder: &mut ___D,
16296 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
16297 ::fidl_next::munge!(let Self { table } = slot);
16298
16299 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
16300 match ordinal {
16301 0 => unsafe { ::core::hint::unreachable_unchecked() },
16302
16303 1 => {
16304 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
16305 slot.as_mut(),
16306 decoder,
16307 )?;
16308
16309 Ok(())
16310 }
16311
16312 2 => {
16313 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
16314 slot.as_mut(),
16315 decoder,
16316 )?;
16317
16318 let value = unsafe {
16319 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
16320 };
16321
16322 if value.len() > 100 {
16323 return Err(::fidl_next::DecodeError::VectorTooLong {
16324 size: value.len() as u64,
16325 limit: 100,
16326 });
16327 }
16328
16329 Ok(())
16330 }
16331
16332 3 => {
16333 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
16334 slot.as_mut(),
16335 decoder,
16336 )?;
16337
16338 let value = unsafe {
16339 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
16340 };
16341
16342 if value.len() > 100 {
16343 return Err(::fidl_next::DecodeError::VectorTooLong {
16344 size: value.len() as u64,
16345 limit: 100,
16346 });
16347 }
16348
16349 Ok(())
16350 }
16351
16352 4 => {
16353 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
16354 slot.as_mut(),
16355 decoder,
16356 )?;
16357
16358 Ok(())
16359 }
16360
16361 5 => {
16362 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigType<'static>>(
16363 slot.as_mut(),
16364 decoder,
16365 )?;
16366
16367 Ok(())
16368 }
16369
16370 6 => {
16371 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigValue<'static>>(
16372 slot.as_mut(),
16373 decoder,
16374 )?;
16375
16376 Ok(())
16377 }
16378
16379 7 => {
16380 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
16381 slot.as_mut(),
16382 decoder,
16383 )?;
16384
16385 let value = unsafe {
16386 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
16387 };
16388
16389 if value.len() > 1024 {
16390 return Err(::fidl_next::DecodeError::VectorTooLong {
16391 size: value.len() as u64,
16392 limit: 1024,
16393 });
16394 }
16395
16396 Ok(())
16397 }
16398
16399 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
16400 }
16401 })
16402 }
16403}
16404
16405impl<'de> WireUseConfiguration<'de> {
16406 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
16407 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
16408 }
16409
16410 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
16411 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
16412 }
16413
16414 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
16415 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
16416 }
16417
16418 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
16419 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
16420 }
16421
16422 pub fn type_(&self) -> ::core::option::Option<&crate::WireConfigType<'de>> {
16423 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
16424 }
16425
16426 pub fn default(&self) -> ::core::option::Option<&crate::WireConfigValue<'de>> {
16427 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
16428 }
16429
16430 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
16431 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
16432 }
16433}
16434
16435impl<'de> ::core::fmt::Debug for WireUseConfiguration<'de> {
16436 fn fmt(
16437 &self,
16438 f: &mut ::core::fmt::Formatter<'_>,
16439 ) -> ::core::result::Result<(), ::core::fmt::Error> {
16440 f.debug_struct("UseConfiguration")
16441 .field("source", &self.source())
16442 .field("source_name", &self.source_name())
16443 .field("target_name", &self.target_name())
16444 .field("availability", &self.availability())
16445 .field("type_", &self.type_())
16446 .field("default", &self.default())
16447 .field("source_dictionary", &self.source_dictionary())
16448 .finish()
16449 }
16450}
16451
16452#[derive(PartialEq, Clone, Debug, Default)]
16453pub struct UseDictionary {
16454 pub source: ::core::option::Option<crate::Ref>,
16455
16456 pub source_name: ::core::option::Option<::std::string::String>,
16457
16458 pub target_path: ::core::option::Option<::std::string::String>,
16459
16460 pub dependency_type: ::core::option::Option<crate::DependencyType>,
16461
16462 pub availability: ::core::option::Option<crate::Availability>,
16463
16464 pub source_dictionary: ::core::option::Option<::std::string::String>,
16465}
16466
16467impl UseDictionary {
16468 fn __max_ordinal(&self) -> usize {
16469 if self.source_dictionary.is_some() {
16470 return 8;
16471 }
16472
16473 if self.availability.is_some() {
16474 return 7;
16475 }
16476
16477 if self.dependency_type.is_some() {
16478 return 6;
16479 }
16480
16481 if self.target_path.is_some() {
16482 return 3;
16483 }
16484
16485 if self.source_name.is_some() {
16486 return 2;
16487 }
16488
16489 if self.source.is_some() {
16490 return 1;
16491 }
16492
16493 0
16494 }
16495}
16496
16497impl ::fidl_next::Encodable for UseDictionary {
16498 type Encoded = WireUseDictionary<'static>;
16499}
16500
16501unsafe impl<___E> ::fidl_next::Encode<___E> for UseDictionary
16502where
16503 ___E: ::fidl_next::Encoder + ?Sized,
16504{
16505 #[inline]
16506 fn encode(
16507 mut self,
16508 encoder: &mut ___E,
16509 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16510 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16511 ::fidl_next::munge!(let WireUseDictionary { table } = out);
16512
16513 let max_ord = self.__max_ordinal();
16514
16515 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
16516 ::fidl_next::Wire::zero_padding(&mut out);
16517
16518 let mut preallocated =
16519 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
16520
16521 for i in 1..=max_ord {
16522 match i {
16523 8 => {
16524 if let Some(value) = self.source_dictionary.take() {
16525 ::fidl_next::WireEnvelope::encode_value(
16526 value,
16527 preallocated.encoder,
16528 &mut out,
16529 )?;
16530 } else {
16531 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16532 }
16533 }
16534
16535 7 => {
16536 if let Some(value) = self.availability.take() {
16537 ::fidl_next::WireEnvelope::encode_value(
16538 value,
16539 preallocated.encoder,
16540 &mut out,
16541 )?;
16542 } else {
16543 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16544 }
16545 }
16546
16547 6 => {
16548 if let Some(value) = self.dependency_type.take() {
16549 ::fidl_next::WireEnvelope::encode_value(
16550 value,
16551 preallocated.encoder,
16552 &mut out,
16553 )?;
16554 } else {
16555 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16556 }
16557 }
16558
16559 3 => {
16560 if let Some(value) = self.target_path.take() {
16561 ::fidl_next::WireEnvelope::encode_value(
16562 value,
16563 preallocated.encoder,
16564 &mut out,
16565 )?;
16566 } else {
16567 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16568 }
16569 }
16570
16571 2 => {
16572 if let Some(value) = self.source_name.take() {
16573 ::fidl_next::WireEnvelope::encode_value(
16574 value,
16575 preallocated.encoder,
16576 &mut out,
16577 )?;
16578 } else {
16579 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16580 }
16581 }
16582
16583 1 => {
16584 if let Some(value) = self.source.take() {
16585 ::fidl_next::WireEnvelope::encode_value(
16586 value,
16587 preallocated.encoder,
16588 &mut out,
16589 )?;
16590 } else {
16591 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16592 }
16593 }
16594
16595 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
16596 }
16597 unsafe {
16598 preallocated.write_next(out.assume_init_ref());
16599 }
16600 }
16601
16602 ::fidl_next::WireTable::encode_len(table, max_ord);
16603
16604 Ok(())
16605 }
16606}
16607
16608unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UseDictionary
16609where
16610 ___E: ::fidl_next::Encoder + ?Sized,
16611{
16612 #[inline]
16613 fn encode_ref(
16614 &self,
16615 encoder: &mut ___E,
16616 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16617 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16618 ::fidl_next::munge!(let WireUseDictionary { table } = out);
16619
16620 let max_ord = self.__max_ordinal();
16621
16622 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
16623 ::fidl_next::Wire::zero_padding(&mut out);
16624
16625 let mut preallocated =
16626 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
16627
16628 for i in 1..=max_ord {
16629 match i {
16630 8 => {
16631 if let Some(value) = &self.source_dictionary {
16632 ::fidl_next::WireEnvelope::encode_value(
16633 value,
16634 preallocated.encoder,
16635 &mut out,
16636 )?;
16637 } else {
16638 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16639 }
16640 }
16641
16642 7 => {
16643 if let Some(value) = &self.availability {
16644 ::fidl_next::WireEnvelope::encode_value(
16645 value,
16646 preallocated.encoder,
16647 &mut out,
16648 )?;
16649 } else {
16650 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16651 }
16652 }
16653
16654 6 => {
16655 if let Some(value) = &self.dependency_type {
16656 ::fidl_next::WireEnvelope::encode_value(
16657 value,
16658 preallocated.encoder,
16659 &mut out,
16660 )?;
16661 } else {
16662 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16663 }
16664 }
16665
16666 3 => {
16667 if let Some(value) = &self.target_path {
16668 ::fidl_next::WireEnvelope::encode_value(
16669 value,
16670 preallocated.encoder,
16671 &mut out,
16672 )?;
16673 } else {
16674 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16675 }
16676 }
16677
16678 2 => {
16679 if let Some(value) = &self.source_name {
16680 ::fidl_next::WireEnvelope::encode_value(
16681 value,
16682 preallocated.encoder,
16683 &mut out,
16684 )?;
16685 } else {
16686 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16687 }
16688 }
16689
16690 1 => {
16691 if let Some(value) = &self.source {
16692 ::fidl_next::WireEnvelope::encode_value(
16693 value,
16694 preallocated.encoder,
16695 &mut out,
16696 )?;
16697 } else {
16698 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16699 }
16700 }
16701
16702 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
16703 }
16704 unsafe {
16705 preallocated.write_next(out.assume_init_ref());
16706 }
16707 }
16708
16709 ::fidl_next::WireTable::encode_len(table, max_ord);
16710
16711 Ok(())
16712 }
16713}
16714
16715impl<'de> ::fidl_next::FromWire<WireUseDictionary<'de>> for UseDictionary {
16716 #[inline]
16717 fn from_wire(wire_: WireUseDictionary<'de>) -> Self {
16718 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
16719
16720 let source = wire_.table.get(1);
16721
16722 let source_name = wire_.table.get(2);
16723
16724 let target_path = wire_.table.get(3);
16725
16726 let dependency_type = wire_.table.get(6);
16727
16728 let availability = wire_.table.get(7);
16729
16730 let source_dictionary = wire_.table.get(8);
16731
16732 Self {
16733 source: source.map(|envelope| {
16734 ::fidl_next::FromWire::from_wire(unsafe {
16735 envelope.read_unchecked::<crate::WireRef<'de>>()
16736 })
16737 }),
16738
16739 source_name: source_name.map(|envelope| {
16740 ::fidl_next::FromWire::from_wire(unsafe {
16741 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16742 })
16743 }),
16744
16745 target_path: target_path.map(|envelope| {
16746 ::fidl_next::FromWire::from_wire(unsafe {
16747 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16748 })
16749 }),
16750
16751 dependency_type: dependency_type.map(|envelope| {
16752 ::fidl_next::FromWire::from_wire(unsafe {
16753 envelope.read_unchecked::<crate::WireDependencyType>()
16754 })
16755 }),
16756
16757 availability: availability.map(|envelope| {
16758 ::fidl_next::FromWire::from_wire(unsafe {
16759 envelope.read_unchecked::<crate::WireAvailability>()
16760 })
16761 }),
16762
16763 source_dictionary: source_dictionary.map(|envelope| {
16764 ::fidl_next::FromWire::from_wire(unsafe {
16765 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16766 })
16767 }),
16768 }
16769 }
16770}
16771
16772impl<'de> ::fidl_next::IntoNatural for WireUseDictionary<'de> {
16773 type Natural = UseDictionary;
16774}
16775
16776impl<'de> ::fidl_next::FromWireRef<WireUseDictionary<'de>> for UseDictionary {
16777 #[inline]
16778 fn from_wire_ref(wire: &WireUseDictionary<'de>) -> Self {
16779 Self {
16780 source: wire.table.get(1).map(|envelope| {
16781 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16782 envelope.deref_unchecked::<crate::WireRef<'de>>()
16783 })
16784 }),
16785
16786 source_name: wire.table.get(2).map(|envelope| {
16787 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16788 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16789 })
16790 }),
16791
16792 target_path: wire.table.get(3).map(|envelope| {
16793 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16794 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16795 })
16796 }),
16797
16798 dependency_type: wire.table.get(6).map(|envelope| {
16799 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16800 envelope.deref_unchecked::<crate::WireDependencyType>()
16801 })
16802 }),
16803
16804 availability: wire.table.get(7).map(|envelope| {
16805 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16806 envelope.deref_unchecked::<crate::WireAvailability>()
16807 })
16808 }),
16809
16810 source_dictionary: wire.table.get(8).map(|envelope| {
16811 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16812 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16813 })
16814 }),
16815 }
16816 }
16817}
16818
16819#[repr(C)]
16821pub struct WireUseDictionary<'de> {
16822 table: ::fidl_next::WireTable<'de>,
16823}
16824
16825impl<'de> Drop for WireUseDictionary<'de> {
16826 fn drop(&mut self) {
16827 let _ = self
16828 .table
16829 .get(1)
16830 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
16831
16832 let _ = self
16833 .table
16834 .get(2)
16835 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
16836
16837 let _ = self
16838 .table
16839 .get(3)
16840 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
16841
16842 let _ = self
16843 .table
16844 .get(6)
16845 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDependencyType>() });
16846
16847 let _ = self
16848 .table
16849 .get(7)
16850 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
16851
16852 let _ = self
16853 .table
16854 .get(8)
16855 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
16856 }
16857}
16858
16859unsafe impl ::fidl_next::Wire for WireUseDictionary<'static> {
16860 type Decoded<'de> = WireUseDictionary<'de>;
16861
16862 #[inline]
16863 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
16864 ::fidl_next::munge!(let Self { table } = out);
16865 ::fidl_next::WireTable::zero_padding(table);
16866 }
16867}
16868
16869unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseDictionary<'static>
16870where
16871 ___D: ::fidl_next::Decoder + ?Sized,
16872{
16873 fn decode(
16874 slot: ::fidl_next::Slot<'_, Self>,
16875 decoder: &mut ___D,
16876 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
16877 ::fidl_next::munge!(let Self { table } = slot);
16878
16879 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
16880 match ordinal {
16881 0 => unsafe { ::core::hint::unreachable_unchecked() },
16882
16883 1 => {
16884 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
16885 slot.as_mut(),
16886 decoder,
16887 )?;
16888
16889 Ok(())
16890 }
16891
16892 2 => {
16893 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
16894 slot.as_mut(),
16895 decoder,
16896 )?;
16897
16898 let value = unsafe {
16899 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
16900 };
16901
16902 if value.len() > 100 {
16903 return Err(::fidl_next::DecodeError::VectorTooLong {
16904 size: value.len() as u64,
16905 limit: 100,
16906 });
16907 }
16908
16909 Ok(())
16910 }
16911
16912 3 => {
16913 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
16914 slot.as_mut(),
16915 decoder,
16916 )?;
16917
16918 let value = unsafe {
16919 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
16920 };
16921
16922 if value.len() > 1024 {
16923 return Err(::fidl_next::DecodeError::VectorTooLong {
16924 size: value.len() as u64,
16925 limit: 1024,
16926 });
16927 }
16928
16929 Ok(())
16930 }
16931
16932 6 => {
16933 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
16934 slot.as_mut(),
16935 decoder,
16936 )?;
16937
16938 Ok(())
16939 }
16940
16941 7 => {
16942 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
16943 slot.as_mut(),
16944 decoder,
16945 )?;
16946
16947 Ok(())
16948 }
16949
16950 8 => {
16951 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
16952 slot.as_mut(),
16953 decoder,
16954 )?;
16955
16956 let value = unsafe {
16957 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
16958 };
16959
16960 if value.len() > 1024 {
16961 return Err(::fidl_next::DecodeError::VectorTooLong {
16962 size: value.len() as u64,
16963 limit: 1024,
16964 });
16965 }
16966
16967 Ok(())
16968 }
16969
16970 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
16971 }
16972 })
16973 }
16974}
16975
16976impl<'de> WireUseDictionary<'de> {
16977 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
16978 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
16979 }
16980
16981 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
16982 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
16983 }
16984
16985 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
16986 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
16987 }
16988
16989 pub fn dependency_type(&self) -> ::core::option::Option<&crate::WireDependencyType> {
16990 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
16991 }
16992
16993 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
16994 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
16995 }
16996
16997 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
16998 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
16999 }
17000}
17001
17002impl<'de> ::core::fmt::Debug for WireUseDictionary<'de> {
17003 fn fmt(
17004 &self,
17005 f: &mut ::core::fmt::Formatter<'_>,
17006 ) -> ::core::result::Result<(), ::core::fmt::Error> {
17007 f.debug_struct("UseDictionary")
17008 .field("source", &self.source())
17009 .field("source_name", &self.source_name())
17010 .field("target_path", &self.target_path())
17011 .field("dependency_type", &self.dependency_type())
17012 .field("availability", &self.availability())
17013 .field("source_dictionary", &self.source_dictionary())
17014 .finish()
17015 }
17016}
17017
17018#[doc = " Declares a capability used by a component, which was offered to it.\n"]
17019#[derive(PartialEq, Clone, Debug)]
17020pub enum Use {
17021 Service(crate::UseService),
17022
17023 Protocol(crate::UseProtocol),
17024
17025 Directory(crate::UseDirectory),
17026
17027 Storage(crate::UseStorage),
17028
17029 EventStream(crate::UseEventStream),
17030
17031 Runner(crate::UseRunner),
17032
17033 Config(crate::UseConfiguration),
17034
17035 Dictionary(crate::UseDictionary),
17036
17037 UnknownOrdinal_(u64),
17038}
17039
17040impl ::fidl_next::Encodable for Use {
17041 type Encoded = WireUse<'static>;
17042}
17043
17044unsafe impl<___E> ::fidl_next::Encode<___E> for Use
17045where
17046 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17047 ___E: ::fidl_next::Encoder,
17048{
17049 #[inline]
17050 fn encode(
17051 self,
17052 encoder: &mut ___E,
17053 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17054 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17055 ::fidl_next::munge!(let WireUse { raw, _phantom: _ } = out);
17056
17057 match self {
17058 Self::Service(value) => {
17059 ::fidl_next::RawWireUnion::encode_as::<___E, crate::UseService>(
17060 value, 1, encoder, raw,
17061 )?
17062 }
17063
17064 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
17065 ___E,
17066 crate::UseProtocol,
17067 >(value, 2, encoder, raw)?,
17068
17069 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
17070 ___E,
17071 crate::UseDirectory,
17072 >(value, 3, encoder, raw)?,
17073
17074 Self::Storage(value) => {
17075 ::fidl_next::RawWireUnion::encode_as::<___E, crate::UseStorage>(
17076 value, 4, encoder, raw,
17077 )?
17078 }
17079
17080 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
17081 ___E,
17082 crate::UseEventStream,
17083 >(value, 7, encoder, raw)?,
17084
17085 Self::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::UseRunner>(
17086 value, 8, encoder, raw,
17087 )?,
17088
17089 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
17090 ___E,
17091 crate::UseConfiguration,
17092 >(value, 9, encoder, raw)?,
17093
17094 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
17095 ___E,
17096 crate::UseDictionary,
17097 >(value, 10, encoder, raw)?,
17098
17099 Self::UnknownOrdinal_(ordinal) => {
17100 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
17101 }
17102 }
17103
17104 Ok(())
17105 }
17106}
17107
17108unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Use
17109where
17110 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17111 ___E: ::fidl_next::Encoder,
17112{
17113 #[inline]
17114 fn encode_ref(
17115 &self,
17116 encoder: &mut ___E,
17117 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17118 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17119 ::fidl_next::munge!(let WireUse { raw, _phantom: _ } = out);
17120
17121 match self {
17122 Self::Service(value) => {
17123 ::fidl_next::RawWireUnion::encode_as::<___E, &crate::UseService>(
17124 value, 1, encoder, raw,
17125 )?
17126 }
17127
17128 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
17129 ___E,
17130 &crate::UseProtocol,
17131 >(value, 2, encoder, raw)?,
17132
17133 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
17134 ___E,
17135 &crate::UseDirectory,
17136 >(value, 3, encoder, raw)?,
17137
17138 Self::Storage(value) => {
17139 ::fidl_next::RawWireUnion::encode_as::<___E, &crate::UseStorage>(
17140 value, 4, encoder, raw,
17141 )?
17142 }
17143
17144 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
17145 ___E,
17146 &crate::UseEventStream,
17147 >(value, 7, encoder, raw)?,
17148
17149 Self::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<___E, &crate::UseRunner>(
17150 value, 8, encoder, raw,
17151 )?,
17152
17153 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
17154 ___E,
17155 &crate::UseConfiguration,
17156 >(value, 9, encoder, raw)?,
17157
17158 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
17159 ___E,
17160 &crate::UseDictionary,
17161 >(value, 10, encoder, raw)?,
17162
17163 Self::UnknownOrdinal_(ordinal) => {
17164 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
17165 }
17166 }
17167
17168 Ok(())
17169 }
17170}
17171
17172impl ::fidl_next::EncodableOption for Use {
17173 type EncodedOption = WireOptionalUse<'static>;
17174}
17175
17176unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Use
17177where
17178 ___E: ?Sized,
17179 Use: ::fidl_next::Encode<___E>,
17180{
17181 #[inline]
17182 fn encode_option(
17183 this: ::core::option::Option<Self>,
17184 encoder: &mut ___E,
17185 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17186 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17187 ::fidl_next::munge!(let WireOptionalUse { raw, _phantom: _ } = &mut *out);
17188
17189 if let Some(inner) = this {
17190 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
17191 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
17192 } else {
17193 ::fidl_next::RawWireUnion::encode_absent(raw);
17194 }
17195
17196 Ok(())
17197 }
17198}
17199
17200unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Use
17201where
17202 ___E: ?Sized,
17203 Use: ::fidl_next::EncodeRef<___E>,
17204{
17205 #[inline]
17206 fn encode_option_ref(
17207 this: ::core::option::Option<&Self>,
17208 encoder: &mut ___E,
17209 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17210 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17211 ::fidl_next::munge!(let WireOptionalUse { raw, _phantom: _ } = &mut *out);
17212
17213 if let Some(inner) = this {
17214 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
17215 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
17216 } else {
17217 ::fidl_next::RawWireUnion::encode_absent(raw);
17218 }
17219
17220 Ok(())
17221 }
17222}
17223
17224impl<'de> ::fidl_next::FromWire<WireUse<'de>> for Use {
17225 #[inline]
17226 fn from_wire(wire: WireUse<'de>) -> Self {
17227 let wire = ::core::mem::ManuallyDrop::new(wire);
17228 match wire.raw.ordinal() {
17229 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
17230 wire.raw.get().read_unchecked::<crate::WireUseService<'de>>()
17231 })),
17232
17233 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
17234 wire.raw.get().read_unchecked::<crate::WireUseProtocol<'de>>()
17235 })),
17236
17237 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
17238 wire.raw.get().read_unchecked::<crate::WireUseDirectory<'de>>()
17239 })),
17240
17241 4 => Self::Storage(::fidl_next::FromWire::from_wire(unsafe {
17242 wire.raw.get().read_unchecked::<crate::WireUseStorage<'de>>()
17243 })),
17244
17245 7 => Self::EventStream(::fidl_next::FromWire::from_wire(unsafe {
17246 wire.raw.get().read_unchecked::<crate::WireUseEventStream<'de>>()
17247 })),
17248
17249 8 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
17250 wire.raw.get().read_unchecked::<crate::WireUseRunner<'de>>()
17251 })),
17252
17253 9 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
17254 wire.raw.get().read_unchecked::<crate::WireUseConfiguration<'de>>()
17255 })),
17256
17257 10 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
17258 wire.raw.get().read_unchecked::<crate::WireUseDictionary<'de>>()
17259 })),
17260
17261 _ => unsafe { ::core::hint::unreachable_unchecked() },
17262 }
17263 }
17264}
17265
17266impl<'de> ::fidl_next::IntoNatural for WireUse<'de> {
17267 type Natural = Use;
17268}
17269
17270impl<'de> ::fidl_next::FromWireRef<WireUse<'de>> for Use {
17271 #[inline]
17272 fn from_wire_ref(wire: &WireUse<'de>) -> Self {
17273 match wire.raw.ordinal() {
17274 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17275 wire.raw.get().deref_unchecked::<crate::WireUseService<'de>>()
17276 })),
17277
17278 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17279 wire.raw.get().deref_unchecked::<crate::WireUseProtocol<'de>>()
17280 })),
17281
17282 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17283 wire.raw.get().deref_unchecked::<crate::WireUseDirectory<'de>>()
17284 })),
17285
17286 4 => Self::Storage(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17287 wire.raw.get().deref_unchecked::<crate::WireUseStorage<'de>>()
17288 })),
17289
17290 7 => Self::EventStream(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17291 wire.raw.get().deref_unchecked::<crate::WireUseEventStream<'de>>()
17292 })),
17293
17294 8 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17295 wire.raw.get().deref_unchecked::<crate::WireUseRunner<'de>>()
17296 })),
17297
17298 9 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17299 wire.raw.get().deref_unchecked::<crate::WireUseConfiguration<'de>>()
17300 })),
17301
17302 10 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
17303 wire.raw.get().deref_unchecked::<crate::WireUseDictionary<'de>>()
17304 })),
17305
17306 _ => unsafe { ::core::hint::unreachable_unchecked() },
17307 }
17308 }
17309}
17310
17311impl<'de> ::fidl_next::FromWireOption<WireOptionalUse<'de>> for Use {
17312 #[inline]
17313 fn from_wire_option(wire: WireOptionalUse<'de>) -> ::core::option::Option<Self> {
17314 if let Some(inner) = wire.into_option() {
17315 Some(::fidl_next::FromWire::from_wire(inner))
17316 } else {
17317 None
17318 }
17319 }
17320}
17321
17322impl<'de> ::fidl_next::IntoNatural for WireOptionalUse<'de> {
17323 type Natural = ::core::option::Option<Use>;
17324}
17325
17326impl<'de> ::fidl_next::FromWireOption<WireOptionalUse<'de>> for Box<Use> {
17327 #[inline]
17328 fn from_wire_option(wire: WireOptionalUse<'de>) -> ::core::option::Option<Self> {
17329 <Use as ::fidl_next::FromWireOption<WireOptionalUse<'de>>>::from_wire_option(wire)
17330 .map(Box::new)
17331 }
17332}
17333
17334impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalUse<'de>> for Box<Use> {
17335 #[inline]
17336 fn from_wire_option_ref(wire: &WireOptionalUse<'de>) -> ::core::option::Option<Self> {
17337 if let Some(inner) = wire.as_ref() {
17338 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
17339 } else {
17340 None
17341 }
17342 }
17343}
17344
17345#[repr(transparent)]
17347pub struct WireUse<'de> {
17348 raw: ::fidl_next::RawWireUnion,
17349 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
17350}
17351
17352impl<'de> Drop for WireUse<'de> {
17353 fn drop(&mut self) {
17354 match self.raw.ordinal() {
17355 1 => {
17356 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUseService<'de>>() };
17357 }
17358
17359 2 => {
17360 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUseProtocol<'de>>() };
17361 }
17362
17363 3 => {
17364 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUseDirectory<'de>>() };
17365 }
17366
17367 4 => {
17368 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUseStorage<'de>>() };
17369 }
17370
17371 7 => {
17372 let _ =
17373 unsafe { self.raw.get().read_unchecked::<crate::WireUseEventStream<'de>>() };
17374 }
17375
17376 8 => {
17377 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUseRunner<'de>>() };
17378 }
17379
17380 9 => {
17381 let _ =
17382 unsafe { self.raw.get().read_unchecked::<crate::WireUseConfiguration<'de>>() };
17383 }
17384
17385 10 => {
17386 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireUseDictionary<'de>>() };
17387 }
17388
17389 _ => (),
17390 }
17391 }
17392}
17393
17394unsafe impl ::fidl_next::Wire for WireUse<'static> {
17395 type Decoded<'de> = WireUse<'de>;
17396
17397 #[inline]
17398 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
17399 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
17400 ::fidl_next::RawWireUnion::zero_padding(raw);
17401 }
17402}
17403
17404pub mod use_ {
17405 pub enum Ref<'de> {
17406 Service(&'de crate::WireUseService<'de>),
17407
17408 Protocol(&'de crate::WireUseProtocol<'de>),
17409
17410 Directory(&'de crate::WireUseDirectory<'de>),
17411
17412 Storage(&'de crate::WireUseStorage<'de>),
17413
17414 EventStream(&'de crate::WireUseEventStream<'de>),
17415
17416 Runner(&'de crate::WireUseRunner<'de>),
17417
17418 Config(&'de crate::WireUseConfiguration<'de>),
17419
17420 Dictionary(&'de crate::WireUseDictionary<'de>),
17421
17422 UnknownOrdinal_(u64),
17423 }
17424}
17425
17426impl<'de> WireUse<'de> {
17427 pub fn as_ref(&self) -> crate::use_::Ref<'_> {
17428 match self.raw.ordinal() {
17429 1 => crate::use_::Ref::Service(unsafe {
17430 self.raw.get().deref_unchecked::<crate::WireUseService<'_>>()
17431 }),
17432
17433 2 => crate::use_::Ref::Protocol(unsafe {
17434 self.raw.get().deref_unchecked::<crate::WireUseProtocol<'_>>()
17435 }),
17436
17437 3 => crate::use_::Ref::Directory(unsafe {
17438 self.raw.get().deref_unchecked::<crate::WireUseDirectory<'_>>()
17439 }),
17440
17441 4 => crate::use_::Ref::Storage(unsafe {
17442 self.raw.get().deref_unchecked::<crate::WireUseStorage<'_>>()
17443 }),
17444
17445 7 => crate::use_::Ref::EventStream(unsafe {
17446 self.raw.get().deref_unchecked::<crate::WireUseEventStream<'_>>()
17447 }),
17448
17449 8 => crate::use_::Ref::Runner(unsafe {
17450 self.raw.get().deref_unchecked::<crate::WireUseRunner<'_>>()
17451 }),
17452
17453 9 => crate::use_::Ref::Config(unsafe {
17454 self.raw.get().deref_unchecked::<crate::WireUseConfiguration<'_>>()
17455 }),
17456
17457 10 => crate::use_::Ref::Dictionary(unsafe {
17458 self.raw.get().deref_unchecked::<crate::WireUseDictionary<'_>>()
17459 }),
17460
17461 unknown => crate::use_::Ref::UnknownOrdinal_(unknown),
17462 }
17463 }
17464}
17465
17466unsafe impl<___D> ::fidl_next::Decode<___D> for WireUse<'static>
17467where
17468 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
17469 ___D: ::fidl_next::Decoder,
17470{
17471 fn decode(
17472 mut slot: ::fidl_next::Slot<'_, Self>,
17473 decoder: &mut ___D,
17474 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
17475 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
17476 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
17477 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseService<'static>>(
17478 raw, decoder,
17479 )?,
17480
17481 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseProtocol<'static>>(
17482 raw, decoder,
17483 )?,
17484
17485 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseDirectory<'static>>(
17486 raw, decoder,
17487 )?,
17488
17489 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseStorage<'static>>(
17490 raw, decoder,
17491 )?,
17492
17493 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseEventStream<'static>>(
17494 raw, decoder,
17495 )?,
17496
17497 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseRunner<'static>>(
17498 raw, decoder,
17499 )?,
17500
17501 9 => {
17502 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseConfiguration<'static>>(
17503 raw, decoder,
17504 )?
17505 }
17506
17507 10 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseDictionary<'static>>(
17508 raw, decoder,
17509 )?,
17510
17511 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
17512 }
17513
17514 Ok(())
17515 }
17516}
17517
17518impl<'de> ::core::fmt::Debug for WireUse<'de> {
17519 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
17520 match self.raw.ordinal() {
17521 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseService<'_>>().fmt(f) },
17522 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseProtocol<'_>>().fmt(f) },
17523 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseDirectory<'_>>().fmt(f) },
17524 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseStorage<'_>>().fmt(f) },
17525 7 => unsafe {
17526 self.raw.get().deref_unchecked::<crate::WireUseEventStream<'_>>().fmt(f)
17527 },
17528 8 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseRunner<'_>>().fmt(f) },
17529 9 => unsafe {
17530 self.raw.get().deref_unchecked::<crate::WireUseConfiguration<'_>>().fmt(f)
17531 },
17532 10 => unsafe {
17533 self.raw.get().deref_unchecked::<crate::WireUseDictionary<'_>>().fmt(f)
17534 },
17535 _ => unsafe { ::core::hint::unreachable_unchecked() },
17536 }
17537 }
17538}
17539
17540#[repr(transparent)]
17541pub struct WireOptionalUse<'de> {
17542 raw: ::fidl_next::RawWireUnion,
17543 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
17544}
17545
17546unsafe impl ::fidl_next::Wire for WireOptionalUse<'static> {
17547 type Decoded<'de> = WireOptionalUse<'de>;
17548
17549 #[inline]
17550 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
17551 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
17552 ::fidl_next::RawWireUnion::zero_padding(raw);
17553 }
17554}
17555
17556impl<'de> WireOptionalUse<'de> {
17557 pub fn is_some(&self) -> bool {
17558 self.raw.is_some()
17559 }
17560
17561 pub fn is_none(&self) -> bool {
17562 self.raw.is_none()
17563 }
17564
17565 pub fn as_ref(&self) -> ::core::option::Option<&WireUse<'de>> {
17566 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
17567 }
17568
17569 pub fn into_option(self) -> ::core::option::Option<WireUse<'de>> {
17570 if self.is_some() {
17571 Some(WireUse { raw: self.raw, _phantom: ::core::marker::PhantomData })
17572 } else {
17573 None
17574 }
17575 }
17576}
17577
17578unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalUse<'static>
17579where
17580 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
17581 ___D: ::fidl_next::Decoder,
17582{
17583 fn decode(
17584 mut slot: ::fidl_next::Slot<'_, Self>,
17585 decoder: &mut ___D,
17586 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
17587 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
17588 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
17589 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseService<'static>>(
17590 raw, decoder,
17591 )?,
17592
17593 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseProtocol<'static>>(
17594 raw, decoder,
17595 )?,
17596
17597 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseDirectory<'static>>(
17598 raw, decoder,
17599 )?,
17600
17601 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseStorage<'static>>(
17602 raw, decoder,
17603 )?,
17604
17605 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseEventStream<'static>>(
17606 raw, decoder,
17607 )?,
17608
17609 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseRunner<'static>>(
17610 raw, decoder,
17611 )?,
17612
17613 9 => {
17614 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseConfiguration<'static>>(
17615 raw, decoder,
17616 )?
17617 }
17618
17619 10 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseDictionary<'static>>(
17620 raw, decoder,
17621 )?,
17622
17623 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
17624 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
17625 }
17626
17627 Ok(())
17628 }
17629}
17630
17631impl<'de> ::core::fmt::Debug for WireOptionalUse<'de> {
17632 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
17633 self.as_ref().fmt(f)
17634 }
17635}
17636
17637#[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"]
17638#[derive(PartialEq, Clone, Debug, Default)]
17639pub struct ExposeService {
17640 pub source: ::core::option::Option<crate::Ref>,
17641
17642 pub source_name: ::core::option::Option<::std::string::String>,
17643
17644 pub target: ::core::option::Option<crate::Ref>,
17645
17646 pub target_name: ::core::option::Option<::std::string::String>,
17647
17648 pub availability: ::core::option::Option<crate::Availability>,
17649
17650 pub source_dictionary: ::core::option::Option<::std::string::String>,
17651}
17652
17653impl ExposeService {
17654 fn __max_ordinal(&self) -> usize {
17655 if self.source_dictionary.is_some() {
17656 return 6;
17657 }
17658
17659 if self.availability.is_some() {
17660 return 5;
17661 }
17662
17663 if self.target_name.is_some() {
17664 return 4;
17665 }
17666
17667 if self.target.is_some() {
17668 return 3;
17669 }
17670
17671 if self.source_name.is_some() {
17672 return 2;
17673 }
17674
17675 if self.source.is_some() {
17676 return 1;
17677 }
17678
17679 0
17680 }
17681}
17682
17683impl ::fidl_next::Encodable for ExposeService {
17684 type Encoded = WireExposeService<'static>;
17685}
17686
17687unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeService
17688where
17689 ___E: ::fidl_next::Encoder + ?Sized,
17690{
17691 #[inline]
17692 fn encode(
17693 mut self,
17694 encoder: &mut ___E,
17695 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17696 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17697 ::fidl_next::munge!(let WireExposeService { table } = out);
17698
17699 let max_ord = self.__max_ordinal();
17700
17701 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
17702 ::fidl_next::Wire::zero_padding(&mut out);
17703
17704 let mut preallocated =
17705 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
17706
17707 for i in 1..=max_ord {
17708 match i {
17709 6 => {
17710 if let Some(value) = self.source_dictionary.take() {
17711 ::fidl_next::WireEnvelope::encode_value(
17712 value,
17713 preallocated.encoder,
17714 &mut out,
17715 )?;
17716 } else {
17717 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17718 }
17719 }
17720
17721 5 => {
17722 if let Some(value) = self.availability.take() {
17723 ::fidl_next::WireEnvelope::encode_value(
17724 value,
17725 preallocated.encoder,
17726 &mut out,
17727 )?;
17728 } else {
17729 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17730 }
17731 }
17732
17733 4 => {
17734 if let Some(value) = self.target_name.take() {
17735 ::fidl_next::WireEnvelope::encode_value(
17736 value,
17737 preallocated.encoder,
17738 &mut out,
17739 )?;
17740 } else {
17741 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17742 }
17743 }
17744
17745 3 => {
17746 if let Some(value) = self.target.take() {
17747 ::fidl_next::WireEnvelope::encode_value(
17748 value,
17749 preallocated.encoder,
17750 &mut out,
17751 )?;
17752 } else {
17753 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17754 }
17755 }
17756
17757 2 => {
17758 if let Some(value) = self.source_name.take() {
17759 ::fidl_next::WireEnvelope::encode_value(
17760 value,
17761 preallocated.encoder,
17762 &mut out,
17763 )?;
17764 } else {
17765 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17766 }
17767 }
17768
17769 1 => {
17770 if let Some(value) = self.source.take() {
17771 ::fidl_next::WireEnvelope::encode_value(
17772 value,
17773 preallocated.encoder,
17774 &mut out,
17775 )?;
17776 } else {
17777 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17778 }
17779 }
17780
17781 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
17782 }
17783 unsafe {
17784 preallocated.write_next(out.assume_init_ref());
17785 }
17786 }
17787
17788 ::fidl_next::WireTable::encode_len(table, max_ord);
17789
17790 Ok(())
17791 }
17792}
17793
17794unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExposeService
17795where
17796 ___E: ::fidl_next::Encoder + ?Sized,
17797{
17798 #[inline]
17799 fn encode_ref(
17800 &self,
17801 encoder: &mut ___E,
17802 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17803 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17804 ::fidl_next::munge!(let WireExposeService { table } = out);
17805
17806 let max_ord = self.__max_ordinal();
17807
17808 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
17809 ::fidl_next::Wire::zero_padding(&mut out);
17810
17811 let mut preallocated =
17812 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
17813
17814 for i in 1..=max_ord {
17815 match i {
17816 6 => {
17817 if let Some(value) = &self.source_dictionary {
17818 ::fidl_next::WireEnvelope::encode_value(
17819 value,
17820 preallocated.encoder,
17821 &mut out,
17822 )?;
17823 } else {
17824 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17825 }
17826 }
17827
17828 5 => {
17829 if let Some(value) = &self.availability {
17830 ::fidl_next::WireEnvelope::encode_value(
17831 value,
17832 preallocated.encoder,
17833 &mut out,
17834 )?;
17835 } else {
17836 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17837 }
17838 }
17839
17840 4 => {
17841 if let Some(value) = &self.target_name {
17842 ::fidl_next::WireEnvelope::encode_value(
17843 value,
17844 preallocated.encoder,
17845 &mut out,
17846 )?;
17847 } else {
17848 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17849 }
17850 }
17851
17852 3 => {
17853 if let Some(value) = &self.target {
17854 ::fidl_next::WireEnvelope::encode_value(
17855 value,
17856 preallocated.encoder,
17857 &mut out,
17858 )?;
17859 } else {
17860 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17861 }
17862 }
17863
17864 2 => {
17865 if let Some(value) = &self.source_name {
17866 ::fidl_next::WireEnvelope::encode_value(
17867 value,
17868 preallocated.encoder,
17869 &mut out,
17870 )?;
17871 } else {
17872 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17873 }
17874 }
17875
17876 1 => {
17877 if let Some(value) = &self.source {
17878 ::fidl_next::WireEnvelope::encode_value(
17879 value,
17880 preallocated.encoder,
17881 &mut out,
17882 )?;
17883 } else {
17884 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17885 }
17886 }
17887
17888 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
17889 }
17890 unsafe {
17891 preallocated.write_next(out.assume_init_ref());
17892 }
17893 }
17894
17895 ::fidl_next::WireTable::encode_len(table, max_ord);
17896
17897 Ok(())
17898 }
17899}
17900
17901impl<'de> ::fidl_next::FromWire<WireExposeService<'de>> for ExposeService {
17902 #[inline]
17903 fn from_wire(wire_: WireExposeService<'de>) -> Self {
17904 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
17905
17906 let source = wire_.table.get(1);
17907
17908 let source_name = wire_.table.get(2);
17909
17910 let target = wire_.table.get(3);
17911
17912 let target_name = wire_.table.get(4);
17913
17914 let availability = wire_.table.get(5);
17915
17916 let source_dictionary = wire_.table.get(6);
17917
17918 Self {
17919 source: source.map(|envelope| {
17920 ::fidl_next::FromWire::from_wire(unsafe {
17921 envelope.read_unchecked::<crate::WireRef<'de>>()
17922 })
17923 }),
17924
17925 source_name: source_name.map(|envelope| {
17926 ::fidl_next::FromWire::from_wire(unsafe {
17927 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17928 })
17929 }),
17930
17931 target: target.map(|envelope| {
17932 ::fidl_next::FromWire::from_wire(unsafe {
17933 envelope.read_unchecked::<crate::WireRef<'de>>()
17934 })
17935 }),
17936
17937 target_name: target_name.map(|envelope| {
17938 ::fidl_next::FromWire::from_wire(unsafe {
17939 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17940 })
17941 }),
17942
17943 availability: availability.map(|envelope| {
17944 ::fidl_next::FromWire::from_wire(unsafe {
17945 envelope.read_unchecked::<crate::WireAvailability>()
17946 })
17947 }),
17948
17949 source_dictionary: source_dictionary.map(|envelope| {
17950 ::fidl_next::FromWire::from_wire(unsafe {
17951 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17952 })
17953 }),
17954 }
17955 }
17956}
17957
17958impl<'de> ::fidl_next::IntoNatural for WireExposeService<'de> {
17959 type Natural = ExposeService;
17960}
17961
17962impl<'de> ::fidl_next::FromWireRef<WireExposeService<'de>> for ExposeService {
17963 #[inline]
17964 fn from_wire_ref(wire: &WireExposeService<'de>) -> Self {
17965 Self {
17966 source: wire.table.get(1).map(|envelope| {
17967 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17968 envelope.deref_unchecked::<crate::WireRef<'de>>()
17969 })
17970 }),
17971
17972 source_name: wire.table.get(2).map(|envelope| {
17973 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17974 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17975 })
17976 }),
17977
17978 target: wire.table.get(3).map(|envelope| {
17979 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17980 envelope.deref_unchecked::<crate::WireRef<'de>>()
17981 })
17982 }),
17983
17984 target_name: wire.table.get(4).map(|envelope| {
17985 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17986 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17987 })
17988 }),
17989
17990 availability: wire.table.get(5).map(|envelope| {
17991 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17992 envelope.deref_unchecked::<crate::WireAvailability>()
17993 })
17994 }),
17995
17996 source_dictionary: wire.table.get(6).map(|envelope| {
17997 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17998 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17999 })
18000 }),
18001 }
18002 }
18003}
18004
18005#[repr(C)]
18007pub struct WireExposeService<'de> {
18008 table: ::fidl_next::WireTable<'de>,
18009}
18010
18011impl<'de> Drop for WireExposeService<'de> {
18012 fn drop(&mut self) {
18013 let _ = self
18014 .table
18015 .get(1)
18016 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
18017
18018 let _ = self
18019 .table
18020 .get(2)
18021 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
18022
18023 let _ = self
18024 .table
18025 .get(3)
18026 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
18027
18028 let _ = self
18029 .table
18030 .get(4)
18031 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
18032
18033 let _ = self
18034 .table
18035 .get(5)
18036 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
18037
18038 let _ = self
18039 .table
18040 .get(6)
18041 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
18042 }
18043}
18044
18045unsafe impl ::fidl_next::Wire for WireExposeService<'static> {
18046 type Decoded<'de> = WireExposeService<'de>;
18047
18048 #[inline]
18049 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
18050 ::fidl_next::munge!(let Self { table } = out);
18051 ::fidl_next::WireTable::zero_padding(table);
18052 }
18053}
18054
18055unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeService<'static>
18056where
18057 ___D: ::fidl_next::Decoder + ?Sized,
18058{
18059 fn decode(
18060 slot: ::fidl_next::Slot<'_, Self>,
18061 decoder: &mut ___D,
18062 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
18063 ::fidl_next::munge!(let Self { table } = slot);
18064
18065 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
18066 match ordinal {
18067 0 => unsafe { ::core::hint::unreachable_unchecked() },
18068
18069 1 => {
18070 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
18071 slot.as_mut(),
18072 decoder,
18073 )?;
18074
18075 Ok(())
18076 }
18077
18078 2 => {
18079 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
18080 slot.as_mut(),
18081 decoder,
18082 )?;
18083
18084 let value = unsafe {
18085 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
18086 };
18087
18088 if value.len() > 100 {
18089 return Err(::fidl_next::DecodeError::VectorTooLong {
18090 size: value.len() as u64,
18091 limit: 100,
18092 });
18093 }
18094
18095 Ok(())
18096 }
18097
18098 3 => {
18099 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
18100 slot.as_mut(),
18101 decoder,
18102 )?;
18103
18104 Ok(())
18105 }
18106
18107 4 => {
18108 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
18109 slot.as_mut(),
18110 decoder,
18111 )?;
18112
18113 let value = unsafe {
18114 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
18115 };
18116
18117 if value.len() > 100 {
18118 return Err(::fidl_next::DecodeError::VectorTooLong {
18119 size: value.len() as u64,
18120 limit: 100,
18121 });
18122 }
18123
18124 Ok(())
18125 }
18126
18127 5 => {
18128 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
18129 slot.as_mut(),
18130 decoder,
18131 )?;
18132
18133 Ok(())
18134 }
18135
18136 6 => {
18137 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
18138 slot.as_mut(),
18139 decoder,
18140 )?;
18141
18142 let value = unsafe {
18143 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
18144 };
18145
18146 if value.len() > 1024 {
18147 return Err(::fidl_next::DecodeError::VectorTooLong {
18148 size: value.len() as u64,
18149 limit: 1024,
18150 });
18151 }
18152
18153 Ok(())
18154 }
18155
18156 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
18157 }
18158 })
18159 }
18160}
18161
18162impl<'de> WireExposeService<'de> {
18163 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
18164 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
18165 }
18166
18167 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
18168 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
18169 }
18170
18171 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
18172 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
18173 }
18174
18175 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
18176 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
18177 }
18178
18179 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
18180 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
18181 }
18182
18183 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
18184 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
18185 }
18186}
18187
18188impl<'de> ::core::fmt::Debug for WireExposeService<'de> {
18189 fn fmt(
18190 &self,
18191 f: &mut ::core::fmt::Formatter<'_>,
18192 ) -> ::core::result::Result<(), ::core::fmt::Error> {
18193 f.debug_struct("ExposeService")
18194 .field("source", &self.source())
18195 .field("source_name", &self.source_name())
18196 .field("target", &self.target())
18197 .field("target_name", &self.target_name())
18198 .field("availability", &self.availability())
18199 .field("source_dictionary", &self.source_dictionary())
18200 .finish()
18201 }
18202}
18203
18204#[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"]
18205#[derive(PartialEq, Clone, Debug, Default)]
18206pub struct ExposeProtocol {
18207 pub source: ::core::option::Option<crate::Ref>,
18208
18209 pub source_name: ::core::option::Option<::std::string::String>,
18210
18211 pub target: ::core::option::Option<crate::Ref>,
18212
18213 pub target_name: ::core::option::Option<::std::string::String>,
18214
18215 pub availability: ::core::option::Option<crate::Availability>,
18216
18217 pub source_dictionary: ::core::option::Option<::std::string::String>,
18218}
18219
18220impl ExposeProtocol {
18221 fn __max_ordinal(&self) -> usize {
18222 if self.source_dictionary.is_some() {
18223 return 6;
18224 }
18225
18226 if self.availability.is_some() {
18227 return 5;
18228 }
18229
18230 if self.target_name.is_some() {
18231 return 4;
18232 }
18233
18234 if self.target.is_some() {
18235 return 3;
18236 }
18237
18238 if self.source_name.is_some() {
18239 return 2;
18240 }
18241
18242 if self.source.is_some() {
18243 return 1;
18244 }
18245
18246 0
18247 }
18248}
18249
18250impl ::fidl_next::Encodable for ExposeProtocol {
18251 type Encoded = WireExposeProtocol<'static>;
18252}
18253
18254unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeProtocol
18255where
18256 ___E: ::fidl_next::Encoder + ?Sized,
18257{
18258 #[inline]
18259 fn encode(
18260 mut self,
18261 encoder: &mut ___E,
18262 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18263 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18264 ::fidl_next::munge!(let WireExposeProtocol { table } = out);
18265
18266 let max_ord = self.__max_ordinal();
18267
18268 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18269 ::fidl_next::Wire::zero_padding(&mut out);
18270
18271 let mut preallocated =
18272 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18273
18274 for i in 1..=max_ord {
18275 match i {
18276 6 => {
18277 if let Some(value) = self.source_dictionary.take() {
18278 ::fidl_next::WireEnvelope::encode_value(
18279 value,
18280 preallocated.encoder,
18281 &mut out,
18282 )?;
18283 } else {
18284 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18285 }
18286 }
18287
18288 5 => {
18289 if let Some(value) = self.availability.take() {
18290 ::fidl_next::WireEnvelope::encode_value(
18291 value,
18292 preallocated.encoder,
18293 &mut out,
18294 )?;
18295 } else {
18296 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18297 }
18298 }
18299
18300 4 => {
18301 if let Some(value) = self.target_name.take() {
18302 ::fidl_next::WireEnvelope::encode_value(
18303 value,
18304 preallocated.encoder,
18305 &mut out,
18306 )?;
18307 } else {
18308 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18309 }
18310 }
18311
18312 3 => {
18313 if let Some(value) = self.target.take() {
18314 ::fidl_next::WireEnvelope::encode_value(
18315 value,
18316 preallocated.encoder,
18317 &mut out,
18318 )?;
18319 } else {
18320 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18321 }
18322 }
18323
18324 2 => {
18325 if let Some(value) = self.source_name.take() {
18326 ::fidl_next::WireEnvelope::encode_value(
18327 value,
18328 preallocated.encoder,
18329 &mut out,
18330 )?;
18331 } else {
18332 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18333 }
18334 }
18335
18336 1 => {
18337 if let Some(value) = self.source.take() {
18338 ::fidl_next::WireEnvelope::encode_value(
18339 value,
18340 preallocated.encoder,
18341 &mut out,
18342 )?;
18343 } else {
18344 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18345 }
18346 }
18347
18348 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18349 }
18350 unsafe {
18351 preallocated.write_next(out.assume_init_ref());
18352 }
18353 }
18354
18355 ::fidl_next::WireTable::encode_len(table, max_ord);
18356
18357 Ok(())
18358 }
18359}
18360
18361unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExposeProtocol
18362where
18363 ___E: ::fidl_next::Encoder + ?Sized,
18364{
18365 #[inline]
18366 fn encode_ref(
18367 &self,
18368 encoder: &mut ___E,
18369 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18370 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18371 ::fidl_next::munge!(let WireExposeProtocol { table } = out);
18372
18373 let max_ord = self.__max_ordinal();
18374
18375 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18376 ::fidl_next::Wire::zero_padding(&mut out);
18377
18378 let mut preallocated =
18379 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18380
18381 for i in 1..=max_ord {
18382 match i {
18383 6 => {
18384 if let Some(value) = &self.source_dictionary {
18385 ::fidl_next::WireEnvelope::encode_value(
18386 value,
18387 preallocated.encoder,
18388 &mut out,
18389 )?;
18390 } else {
18391 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18392 }
18393 }
18394
18395 5 => {
18396 if let Some(value) = &self.availability {
18397 ::fidl_next::WireEnvelope::encode_value(
18398 value,
18399 preallocated.encoder,
18400 &mut out,
18401 )?;
18402 } else {
18403 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18404 }
18405 }
18406
18407 4 => {
18408 if let Some(value) = &self.target_name {
18409 ::fidl_next::WireEnvelope::encode_value(
18410 value,
18411 preallocated.encoder,
18412 &mut out,
18413 )?;
18414 } else {
18415 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18416 }
18417 }
18418
18419 3 => {
18420 if let Some(value) = &self.target {
18421 ::fidl_next::WireEnvelope::encode_value(
18422 value,
18423 preallocated.encoder,
18424 &mut out,
18425 )?;
18426 } else {
18427 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18428 }
18429 }
18430
18431 2 => {
18432 if let Some(value) = &self.source_name {
18433 ::fidl_next::WireEnvelope::encode_value(
18434 value,
18435 preallocated.encoder,
18436 &mut out,
18437 )?;
18438 } else {
18439 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18440 }
18441 }
18442
18443 1 => {
18444 if let Some(value) = &self.source {
18445 ::fidl_next::WireEnvelope::encode_value(
18446 value,
18447 preallocated.encoder,
18448 &mut out,
18449 )?;
18450 } else {
18451 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18452 }
18453 }
18454
18455 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18456 }
18457 unsafe {
18458 preallocated.write_next(out.assume_init_ref());
18459 }
18460 }
18461
18462 ::fidl_next::WireTable::encode_len(table, max_ord);
18463
18464 Ok(())
18465 }
18466}
18467
18468impl<'de> ::fidl_next::FromWire<WireExposeProtocol<'de>> for ExposeProtocol {
18469 #[inline]
18470 fn from_wire(wire_: WireExposeProtocol<'de>) -> Self {
18471 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
18472
18473 let source = wire_.table.get(1);
18474
18475 let source_name = wire_.table.get(2);
18476
18477 let target = wire_.table.get(3);
18478
18479 let target_name = wire_.table.get(4);
18480
18481 let availability = wire_.table.get(5);
18482
18483 let source_dictionary = wire_.table.get(6);
18484
18485 Self {
18486 source: source.map(|envelope| {
18487 ::fidl_next::FromWire::from_wire(unsafe {
18488 envelope.read_unchecked::<crate::WireRef<'de>>()
18489 })
18490 }),
18491
18492 source_name: source_name.map(|envelope| {
18493 ::fidl_next::FromWire::from_wire(unsafe {
18494 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
18495 })
18496 }),
18497
18498 target: target.map(|envelope| {
18499 ::fidl_next::FromWire::from_wire(unsafe {
18500 envelope.read_unchecked::<crate::WireRef<'de>>()
18501 })
18502 }),
18503
18504 target_name: target_name.map(|envelope| {
18505 ::fidl_next::FromWire::from_wire(unsafe {
18506 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
18507 })
18508 }),
18509
18510 availability: availability.map(|envelope| {
18511 ::fidl_next::FromWire::from_wire(unsafe {
18512 envelope.read_unchecked::<crate::WireAvailability>()
18513 })
18514 }),
18515
18516 source_dictionary: source_dictionary.map(|envelope| {
18517 ::fidl_next::FromWire::from_wire(unsafe {
18518 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
18519 })
18520 }),
18521 }
18522 }
18523}
18524
18525impl<'de> ::fidl_next::IntoNatural for WireExposeProtocol<'de> {
18526 type Natural = ExposeProtocol;
18527}
18528
18529impl<'de> ::fidl_next::FromWireRef<WireExposeProtocol<'de>> for ExposeProtocol {
18530 #[inline]
18531 fn from_wire_ref(wire: &WireExposeProtocol<'de>) -> Self {
18532 Self {
18533 source: wire.table.get(1).map(|envelope| {
18534 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18535 envelope.deref_unchecked::<crate::WireRef<'de>>()
18536 })
18537 }),
18538
18539 source_name: wire.table.get(2).map(|envelope| {
18540 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18541 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
18542 })
18543 }),
18544
18545 target: wire.table.get(3).map(|envelope| {
18546 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18547 envelope.deref_unchecked::<crate::WireRef<'de>>()
18548 })
18549 }),
18550
18551 target_name: wire.table.get(4).map(|envelope| {
18552 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18553 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
18554 })
18555 }),
18556
18557 availability: wire.table.get(5).map(|envelope| {
18558 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18559 envelope.deref_unchecked::<crate::WireAvailability>()
18560 })
18561 }),
18562
18563 source_dictionary: wire.table.get(6).map(|envelope| {
18564 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18565 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
18566 })
18567 }),
18568 }
18569 }
18570}
18571
18572#[repr(C)]
18574pub struct WireExposeProtocol<'de> {
18575 table: ::fidl_next::WireTable<'de>,
18576}
18577
18578impl<'de> Drop for WireExposeProtocol<'de> {
18579 fn drop(&mut self) {
18580 let _ = self
18581 .table
18582 .get(1)
18583 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
18584
18585 let _ = self
18586 .table
18587 .get(2)
18588 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
18589
18590 let _ = self
18591 .table
18592 .get(3)
18593 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
18594
18595 let _ = self
18596 .table
18597 .get(4)
18598 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
18599
18600 let _ = self
18601 .table
18602 .get(5)
18603 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
18604
18605 let _ = self
18606 .table
18607 .get(6)
18608 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
18609 }
18610}
18611
18612unsafe impl ::fidl_next::Wire for WireExposeProtocol<'static> {
18613 type Decoded<'de> = WireExposeProtocol<'de>;
18614
18615 #[inline]
18616 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
18617 ::fidl_next::munge!(let Self { table } = out);
18618 ::fidl_next::WireTable::zero_padding(table);
18619 }
18620}
18621
18622unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeProtocol<'static>
18623where
18624 ___D: ::fidl_next::Decoder + ?Sized,
18625{
18626 fn decode(
18627 slot: ::fidl_next::Slot<'_, Self>,
18628 decoder: &mut ___D,
18629 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
18630 ::fidl_next::munge!(let Self { table } = slot);
18631
18632 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
18633 match ordinal {
18634 0 => unsafe { ::core::hint::unreachable_unchecked() },
18635
18636 1 => {
18637 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
18638 slot.as_mut(),
18639 decoder,
18640 )?;
18641
18642 Ok(())
18643 }
18644
18645 2 => {
18646 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
18647 slot.as_mut(),
18648 decoder,
18649 )?;
18650
18651 let value = unsafe {
18652 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
18653 };
18654
18655 if value.len() > 100 {
18656 return Err(::fidl_next::DecodeError::VectorTooLong {
18657 size: value.len() as u64,
18658 limit: 100,
18659 });
18660 }
18661
18662 Ok(())
18663 }
18664
18665 3 => {
18666 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
18667 slot.as_mut(),
18668 decoder,
18669 )?;
18670
18671 Ok(())
18672 }
18673
18674 4 => {
18675 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
18676 slot.as_mut(),
18677 decoder,
18678 )?;
18679
18680 let value = unsafe {
18681 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
18682 };
18683
18684 if value.len() > 100 {
18685 return Err(::fidl_next::DecodeError::VectorTooLong {
18686 size: value.len() as u64,
18687 limit: 100,
18688 });
18689 }
18690
18691 Ok(())
18692 }
18693
18694 5 => {
18695 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
18696 slot.as_mut(),
18697 decoder,
18698 )?;
18699
18700 Ok(())
18701 }
18702
18703 6 => {
18704 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
18705 slot.as_mut(),
18706 decoder,
18707 )?;
18708
18709 let value = unsafe {
18710 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
18711 };
18712
18713 if value.len() > 1024 {
18714 return Err(::fidl_next::DecodeError::VectorTooLong {
18715 size: value.len() as u64,
18716 limit: 1024,
18717 });
18718 }
18719
18720 Ok(())
18721 }
18722
18723 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
18724 }
18725 })
18726 }
18727}
18728
18729impl<'de> WireExposeProtocol<'de> {
18730 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
18731 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
18732 }
18733
18734 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
18735 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
18736 }
18737
18738 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
18739 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
18740 }
18741
18742 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
18743 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
18744 }
18745
18746 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
18747 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
18748 }
18749
18750 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
18751 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
18752 }
18753}
18754
18755impl<'de> ::core::fmt::Debug for WireExposeProtocol<'de> {
18756 fn fmt(
18757 &self,
18758 f: &mut ::core::fmt::Formatter<'_>,
18759 ) -> ::core::result::Result<(), ::core::fmt::Error> {
18760 f.debug_struct("ExposeProtocol")
18761 .field("source", &self.source())
18762 .field("source_name", &self.source_name())
18763 .field("target", &self.target())
18764 .field("target_name", &self.target_name())
18765 .field("availability", &self.availability())
18766 .field("source_dictionary", &self.source_dictionary())
18767 .finish()
18768 }
18769}
18770
18771#[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"]
18772#[derive(PartialEq, Clone, Debug, Default)]
18773pub struct ExposeDirectory {
18774 pub source: ::core::option::Option<crate::Ref>,
18775
18776 pub source_name: ::core::option::Option<::std::string::String>,
18777
18778 pub target: ::core::option::Option<crate::Ref>,
18779
18780 pub target_name: ::core::option::Option<::std::string::String>,
18781
18782 pub rights: ::core::option::Option<::fidl_next_fuchsia_io::Operations>,
18783
18784 pub subdir: ::core::option::Option<::std::string::String>,
18785
18786 pub availability: ::core::option::Option<crate::Availability>,
18787
18788 pub source_dictionary: ::core::option::Option<::std::string::String>,
18789}
18790
18791impl ExposeDirectory {
18792 fn __max_ordinal(&self) -> usize {
18793 if self.source_dictionary.is_some() {
18794 return 8;
18795 }
18796
18797 if self.availability.is_some() {
18798 return 7;
18799 }
18800
18801 if self.subdir.is_some() {
18802 return 6;
18803 }
18804
18805 if self.rights.is_some() {
18806 return 5;
18807 }
18808
18809 if self.target_name.is_some() {
18810 return 4;
18811 }
18812
18813 if self.target.is_some() {
18814 return 3;
18815 }
18816
18817 if self.source_name.is_some() {
18818 return 2;
18819 }
18820
18821 if self.source.is_some() {
18822 return 1;
18823 }
18824
18825 0
18826 }
18827}
18828
18829impl ::fidl_next::Encodable for ExposeDirectory {
18830 type Encoded = WireExposeDirectory<'static>;
18831}
18832
18833unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeDirectory
18834where
18835 ___E: ::fidl_next::Encoder + ?Sized,
18836{
18837 #[inline]
18838 fn encode(
18839 mut self,
18840 encoder: &mut ___E,
18841 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18842 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18843 ::fidl_next::munge!(let WireExposeDirectory { table } = out);
18844
18845 let max_ord = self.__max_ordinal();
18846
18847 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18848 ::fidl_next::Wire::zero_padding(&mut out);
18849
18850 let mut preallocated =
18851 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18852
18853 for i in 1..=max_ord {
18854 match i {
18855 8 => {
18856 if let Some(value) = self.source_dictionary.take() {
18857 ::fidl_next::WireEnvelope::encode_value(
18858 value,
18859 preallocated.encoder,
18860 &mut out,
18861 )?;
18862 } else {
18863 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18864 }
18865 }
18866
18867 7 => {
18868 if let Some(value) = self.availability.take() {
18869 ::fidl_next::WireEnvelope::encode_value(
18870 value,
18871 preallocated.encoder,
18872 &mut out,
18873 )?;
18874 } else {
18875 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18876 }
18877 }
18878
18879 6 => {
18880 if let Some(value) = self.subdir.take() {
18881 ::fidl_next::WireEnvelope::encode_value(
18882 value,
18883 preallocated.encoder,
18884 &mut out,
18885 )?;
18886 } else {
18887 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18888 }
18889 }
18890
18891 5 => {
18892 if let Some(value) = self.rights.take() {
18893 ::fidl_next::WireEnvelope::encode_value(
18894 value,
18895 preallocated.encoder,
18896 &mut out,
18897 )?;
18898 } else {
18899 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18900 }
18901 }
18902
18903 4 => {
18904 if let Some(value) = self.target_name.take() {
18905 ::fidl_next::WireEnvelope::encode_value(
18906 value,
18907 preallocated.encoder,
18908 &mut out,
18909 )?;
18910 } else {
18911 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18912 }
18913 }
18914
18915 3 => {
18916 if let Some(value) = self.target.take() {
18917 ::fidl_next::WireEnvelope::encode_value(
18918 value,
18919 preallocated.encoder,
18920 &mut out,
18921 )?;
18922 } else {
18923 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18924 }
18925 }
18926
18927 2 => {
18928 if let Some(value) = self.source_name.take() {
18929 ::fidl_next::WireEnvelope::encode_value(
18930 value,
18931 preallocated.encoder,
18932 &mut out,
18933 )?;
18934 } else {
18935 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18936 }
18937 }
18938
18939 1 => {
18940 if let Some(value) = self.source.take() {
18941 ::fidl_next::WireEnvelope::encode_value(
18942 value,
18943 preallocated.encoder,
18944 &mut out,
18945 )?;
18946 } else {
18947 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18948 }
18949 }
18950
18951 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18952 }
18953 unsafe {
18954 preallocated.write_next(out.assume_init_ref());
18955 }
18956 }
18957
18958 ::fidl_next::WireTable::encode_len(table, max_ord);
18959
18960 Ok(())
18961 }
18962}
18963
18964unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExposeDirectory
18965where
18966 ___E: ::fidl_next::Encoder + ?Sized,
18967{
18968 #[inline]
18969 fn encode_ref(
18970 &self,
18971 encoder: &mut ___E,
18972 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18973 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18974 ::fidl_next::munge!(let WireExposeDirectory { table } = out);
18975
18976 let max_ord = self.__max_ordinal();
18977
18978 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18979 ::fidl_next::Wire::zero_padding(&mut out);
18980
18981 let mut preallocated =
18982 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18983
18984 for i in 1..=max_ord {
18985 match i {
18986 8 => {
18987 if let Some(value) = &self.source_dictionary {
18988 ::fidl_next::WireEnvelope::encode_value(
18989 value,
18990 preallocated.encoder,
18991 &mut out,
18992 )?;
18993 } else {
18994 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18995 }
18996 }
18997
18998 7 => {
18999 if let Some(value) = &self.availability {
19000 ::fidl_next::WireEnvelope::encode_value(
19001 value,
19002 preallocated.encoder,
19003 &mut out,
19004 )?;
19005 } else {
19006 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19007 }
19008 }
19009
19010 6 => {
19011 if let Some(value) = &self.subdir {
19012 ::fidl_next::WireEnvelope::encode_value(
19013 value,
19014 preallocated.encoder,
19015 &mut out,
19016 )?;
19017 } else {
19018 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19019 }
19020 }
19021
19022 5 => {
19023 if let Some(value) = &self.rights {
19024 ::fidl_next::WireEnvelope::encode_value(
19025 value,
19026 preallocated.encoder,
19027 &mut out,
19028 )?;
19029 } else {
19030 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19031 }
19032 }
19033
19034 4 => {
19035 if let Some(value) = &self.target_name {
19036 ::fidl_next::WireEnvelope::encode_value(
19037 value,
19038 preallocated.encoder,
19039 &mut out,
19040 )?;
19041 } else {
19042 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19043 }
19044 }
19045
19046 3 => {
19047 if let Some(value) = &self.target {
19048 ::fidl_next::WireEnvelope::encode_value(
19049 value,
19050 preallocated.encoder,
19051 &mut out,
19052 )?;
19053 } else {
19054 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19055 }
19056 }
19057
19058 2 => {
19059 if let Some(value) = &self.source_name {
19060 ::fidl_next::WireEnvelope::encode_value(
19061 value,
19062 preallocated.encoder,
19063 &mut out,
19064 )?;
19065 } else {
19066 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19067 }
19068 }
19069
19070 1 => {
19071 if let Some(value) = &self.source {
19072 ::fidl_next::WireEnvelope::encode_value(
19073 value,
19074 preallocated.encoder,
19075 &mut out,
19076 )?;
19077 } else {
19078 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19079 }
19080 }
19081
19082 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
19083 }
19084 unsafe {
19085 preallocated.write_next(out.assume_init_ref());
19086 }
19087 }
19088
19089 ::fidl_next::WireTable::encode_len(table, max_ord);
19090
19091 Ok(())
19092 }
19093}
19094
19095impl<'de> ::fidl_next::FromWire<WireExposeDirectory<'de>> for ExposeDirectory {
19096 #[inline]
19097 fn from_wire(wire_: WireExposeDirectory<'de>) -> Self {
19098 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
19099
19100 let source = wire_.table.get(1);
19101
19102 let source_name = wire_.table.get(2);
19103
19104 let target = wire_.table.get(3);
19105
19106 let target_name = wire_.table.get(4);
19107
19108 let rights = wire_.table.get(5);
19109
19110 let subdir = wire_.table.get(6);
19111
19112 let availability = wire_.table.get(7);
19113
19114 let source_dictionary = wire_.table.get(8);
19115
19116 Self {
19117 source: source.map(|envelope| {
19118 ::fidl_next::FromWire::from_wire(unsafe {
19119 envelope.read_unchecked::<crate::WireRef<'de>>()
19120 })
19121 }),
19122
19123 source_name: source_name.map(|envelope| {
19124 ::fidl_next::FromWire::from_wire(unsafe {
19125 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
19126 })
19127 }),
19128
19129 target: target.map(|envelope| {
19130 ::fidl_next::FromWire::from_wire(unsafe {
19131 envelope.read_unchecked::<crate::WireRef<'de>>()
19132 })
19133 }),
19134
19135 target_name: target_name.map(|envelope| {
19136 ::fidl_next::FromWire::from_wire(unsafe {
19137 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
19138 })
19139 }),
19140
19141 rights: rights.map(|envelope| {
19142 ::fidl_next::FromWire::from_wire(unsafe {
19143 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
19144 })
19145 }),
19146
19147 subdir: subdir.map(|envelope| {
19148 ::fidl_next::FromWire::from_wire(unsafe {
19149 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
19150 })
19151 }),
19152
19153 availability: availability.map(|envelope| {
19154 ::fidl_next::FromWire::from_wire(unsafe {
19155 envelope.read_unchecked::<crate::WireAvailability>()
19156 })
19157 }),
19158
19159 source_dictionary: source_dictionary.map(|envelope| {
19160 ::fidl_next::FromWire::from_wire(unsafe {
19161 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
19162 })
19163 }),
19164 }
19165 }
19166}
19167
19168impl<'de> ::fidl_next::IntoNatural for WireExposeDirectory<'de> {
19169 type Natural = ExposeDirectory;
19170}
19171
19172impl<'de> ::fidl_next::FromWireRef<WireExposeDirectory<'de>> for ExposeDirectory {
19173 #[inline]
19174 fn from_wire_ref(wire: &WireExposeDirectory<'de>) -> Self {
19175 Self {
19176 source: wire.table.get(1).map(|envelope| {
19177 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19178 envelope.deref_unchecked::<crate::WireRef<'de>>()
19179 })
19180 }),
19181
19182 source_name: wire.table.get(2).map(|envelope| {
19183 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19184 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
19185 })
19186 }),
19187
19188 target: wire.table.get(3).map(|envelope| {
19189 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19190 envelope.deref_unchecked::<crate::WireRef<'de>>()
19191 })
19192 }),
19193
19194 target_name: wire.table.get(4).map(|envelope| {
19195 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19196 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
19197 })
19198 }),
19199
19200 rights: wire.table.get(5).map(|envelope| {
19201 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19202 envelope.deref_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
19203 })
19204 }),
19205
19206 subdir: wire.table.get(6).map(|envelope| {
19207 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19208 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
19209 })
19210 }),
19211
19212 availability: wire.table.get(7).map(|envelope| {
19213 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19214 envelope.deref_unchecked::<crate::WireAvailability>()
19215 })
19216 }),
19217
19218 source_dictionary: wire.table.get(8).map(|envelope| {
19219 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19220 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
19221 })
19222 }),
19223 }
19224 }
19225}
19226
19227#[repr(C)]
19229pub struct WireExposeDirectory<'de> {
19230 table: ::fidl_next::WireTable<'de>,
19231}
19232
19233impl<'de> Drop for WireExposeDirectory<'de> {
19234 fn drop(&mut self) {
19235 let _ = self
19236 .table
19237 .get(1)
19238 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
19239
19240 let _ = self
19241 .table
19242 .get(2)
19243 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
19244
19245 let _ = self
19246 .table
19247 .get(3)
19248 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
19249
19250 let _ = self
19251 .table
19252 .get(4)
19253 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
19254
19255 let _ = self.table.get(5).map(|envelope| unsafe {
19256 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
19257 });
19258
19259 let _ = self
19260 .table
19261 .get(6)
19262 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
19263
19264 let _ = self
19265 .table
19266 .get(7)
19267 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
19268
19269 let _ = self
19270 .table
19271 .get(8)
19272 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
19273 }
19274}
19275
19276unsafe impl ::fidl_next::Wire for WireExposeDirectory<'static> {
19277 type Decoded<'de> = WireExposeDirectory<'de>;
19278
19279 #[inline]
19280 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
19281 ::fidl_next::munge!(let Self { table } = out);
19282 ::fidl_next::WireTable::zero_padding(table);
19283 }
19284}
19285
19286unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeDirectory<'static>
19287where
19288 ___D: ::fidl_next::Decoder + ?Sized,
19289{
19290 fn decode(
19291 slot: ::fidl_next::Slot<'_, Self>,
19292 decoder: &mut ___D,
19293 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
19294 ::fidl_next::munge!(let Self { table } = slot);
19295
19296 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
19297 match ordinal {
19298 0 => unsafe { ::core::hint::unreachable_unchecked() },
19299
19300 1 => {
19301 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
19302 slot.as_mut(),
19303 decoder,
19304 )?;
19305
19306 Ok(())
19307 }
19308
19309 2 => {
19310 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
19311 slot.as_mut(),
19312 decoder,
19313 )?;
19314
19315 let value = unsafe {
19316 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
19317 };
19318
19319 if value.len() > 100 {
19320 return Err(::fidl_next::DecodeError::VectorTooLong {
19321 size: value.len() as u64,
19322 limit: 100,
19323 });
19324 }
19325
19326 Ok(())
19327 }
19328
19329 3 => {
19330 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
19331 slot.as_mut(),
19332 decoder,
19333 )?;
19334
19335 Ok(())
19336 }
19337
19338 4 => {
19339 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
19340 slot.as_mut(),
19341 decoder,
19342 )?;
19343
19344 let value = unsafe {
19345 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
19346 };
19347
19348 if value.len() > 100 {
19349 return Err(::fidl_next::DecodeError::VectorTooLong {
19350 size: value.len() as u64,
19351 limit: 100,
19352 });
19353 }
19354
19355 Ok(())
19356 }
19357
19358 5 => {
19359 ::fidl_next::WireEnvelope::decode_as::<
19360 ___D,
19361 ::fidl_next_fuchsia_io::WireOperations,
19362 >(slot.as_mut(), decoder)?;
19363
19364 Ok(())
19365 }
19366
19367 6 => {
19368 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
19369 slot.as_mut(),
19370 decoder,
19371 )?;
19372
19373 let value = unsafe {
19374 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
19375 };
19376
19377 if value.len() > 1024 {
19378 return Err(::fidl_next::DecodeError::VectorTooLong {
19379 size: value.len() as u64,
19380 limit: 1024,
19381 });
19382 }
19383
19384 Ok(())
19385 }
19386
19387 7 => {
19388 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
19389 slot.as_mut(),
19390 decoder,
19391 )?;
19392
19393 Ok(())
19394 }
19395
19396 8 => {
19397 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
19398 slot.as_mut(),
19399 decoder,
19400 )?;
19401
19402 let value = unsafe {
19403 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
19404 };
19405
19406 if value.len() > 1024 {
19407 return Err(::fidl_next::DecodeError::VectorTooLong {
19408 size: value.len() as u64,
19409 limit: 1024,
19410 });
19411 }
19412
19413 Ok(())
19414 }
19415
19416 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
19417 }
19418 })
19419 }
19420}
19421
19422impl<'de> WireExposeDirectory<'de> {
19423 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
19424 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
19425 }
19426
19427 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
19428 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
19429 }
19430
19431 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
19432 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
19433 }
19434
19435 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
19436 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
19437 }
19438
19439 pub fn rights(&self) -> ::core::option::Option<&::fidl_next_fuchsia_io::WireOperations> {
19440 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
19441 }
19442
19443 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
19444 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
19445 }
19446
19447 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
19448 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
19449 }
19450
19451 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
19452 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
19453 }
19454}
19455
19456impl<'de> ::core::fmt::Debug for WireExposeDirectory<'de> {
19457 fn fmt(
19458 &self,
19459 f: &mut ::core::fmt::Formatter<'_>,
19460 ) -> ::core::result::Result<(), ::core::fmt::Error> {
19461 f.debug_struct("ExposeDirectory")
19462 .field("source", &self.source())
19463 .field("source_name", &self.source_name())
19464 .field("target", &self.target())
19465 .field("target_name", &self.target_name())
19466 .field("rights", &self.rights())
19467 .field("subdir", &self.subdir())
19468 .field("availability", &self.availability())
19469 .field("source_dictionary", &self.source_dictionary())
19470 .finish()
19471 }
19472}
19473
19474#[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"]
19475#[derive(PartialEq, Clone, Debug, Default)]
19476pub struct ExposeRunner {
19477 pub source: ::core::option::Option<crate::Ref>,
19478
19479 pub source_name: ::core::option::Option<::std::string::String>,
19480
19481 pub target: ::core::option::Option<crate::Ref>,
19482
19483 pub target_name: ::core::option::Option<::std::string::String>,
19484
19485 pub source_dictionary: ::core::option::Option<::std::string::String>,
19486}
19487
19488impl ExposeRunner {
19489 fn __max_ordinal(&self) -> usize {
19490 if self.source_dictionary.is_some() {
19491 return 6;
19492 }
19493
19494 if self.target_name.is_some() {
19495 return 4;
19496 }
19497
19498 if self.target.is_some() {
19499 return 3;
19500 }
19501
19502 if self.source_name.is_some() {
19503 return 2;
19504 }
19505
19506 if self.source.is_some() {
19507 return 1;
19508 }
19509
19510 0
19511 }
19512}
19513
19514impl ::fidl_next::Encodable for ExposeRunner {
19515 type Encoded = WireExposeRunner<'static>;
19516}
19517
19518unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeRunner
19519where
19520 ___E: ::fidl_next::Encoder + ?Sized,
19521{
19522 #[inline]
19523 fn encode(
19524 mut self,
19525 encoder: &mut ___E,
19526 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19527 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19528 ::fidl_next::munge!(let WireExposeRunner { table } = out);
19529
19530 let max_ord = self.__max_ordinal();
19531
19532 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
19533 ::fidl_next::Wire::zero_padding(&mut out);
19534
19535 let mut preallocated =
19536 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
19537
19538 for i in 1..=max_ord {
19539 match i {
19540 6 => {
19541 if let Some(value) = self.source_dictionary.take() {
19542 ::fidl_next::WireEnvelope::encode_value(
19543 value,
19544 preallocated.encoder,
19545 &mut out,
19546 )?;
19547 } else {
19548 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19549 }
19550 }
19551
19552 4 => {
19553 if let Some(value) = self.target_name.take() {
19554 ::fidl_next::WireEnvelope::encode_value(
19555 value,
19556 preallocated.encoder,
19557 &mut out,
19558 )?;
19559 } else {
19560 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19561 }
19562 }
19563
19564 3 => {
19565 if let Some(value) = self.target.take() {
19566 ::fidl_next::WireEnvelope::encode_value(
19567 value,
19568 preallocated.encoder,
19569 &mut out,
19570 )?;
19571 } else {
19572 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19573 }
19574 }
19575
19576 2 => {
19577 if let Some(value) = self.source_name.take() {
19578 ::fidl_next::WireEnvelope::encode_value(
19579 value,
19580 preallocated.encoder,
19581 &mut out,
19582 )?;
19583 } else {
19584 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19585 }
19586 }
19587
19588 1 => {
19589 if let Some(value) = self.source.take() {
19590 ::fidl_next::WireEnvelope::encode_value(
19591 value,
19592 preallocated.encoder,
19593 &mut out,
19594 )?;
19595 } else {
19596 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19597 }
19598 }
19599
19600 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
19601 }
19602 unsafe {
19603 preallocated.write_next(out.assume_init_ref());
19604 }
19605 }
19606
19607 ::fidl_next::WireTable::encode_len(table, max_ord);
19608
19609 Ok(())
19610 }
19611}
19612
19613unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExposeRunner
19614where
19615 ___E: ::fidl_next::Encoder + ?Sized,
19616{
19617 #[inline]
19618 fn encode_ref(
19619 &self,
19620 encoder: &mut ___E,
19621 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19622 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19623 ::fidl_next::munge!(let WireExposeRunner { table } = out);
19624
19625 let max_ord = self.__max_ordinal();
19626
19627 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
19628 ::fidl_next::Wire::zero_padding(&mut out);
19629
19630 let mut preallocated =
19631 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
19632
19633 for i in 1..=max_ord {
19634 match i {
19635 6 => {
19636 if let Some(value) = &self.source_dictionary {
19637 ::fidl_next::WireEnvelope::encode_value(
19638 value,
19639 preallocated.encoder,
19640 &mut out,
19641 )?;
19642 } else {
19643 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19644 }
19645 }
19646
19647 4 => {
19648 if let Some(value) = &self.target_name {
19649 ::fidl_next::WireEnvelope::encode_value(
19650 value,
19651 preallocated.encoder,
19652 &mut out,
19653 )?;
19654 } else {
19655 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19656 }
19657 }
19658
19659 3 => {
19660 if let Some(value) = &self.target {
19661 ::fidl_next::WireEnvelope::encode_value(
19662 value,
19663 preallocated.encoder,
19664 &mut out,
19665 )?;
19666 } else {
19667 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19668 }
19669 }
19670
19671 2 => {
19672 if let Some(value) = &self.source_name {
19673 ::fidl_next::WireEnvelope::encode_value(
19674 value,
19675 preallocated.encoder,
19676 &mut out,
19677 )?;
19678 } else {
19679 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19680 }
19681 }
19682
19683 1 => {
19684 if let Some(value) = &self.source {
19685 ::fidl_next::WireEnvelope::encode_value(
19686 value,
19687 preallocated.encoder,
19688 &mut out,
19689 )?;
19690 } else {
19691 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19692 }
19693 }
19694
19695 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
19696 }
19697 unsafe {
19698 preallocated.write_next(out.assume_init_ref());
19699 }
19700 }
19701
19702 ::fidl_next::WireTable::encode_len(table, max_ord);
19703
19704 Ok(())
19705 }
19706}
19707
19708impl<'de> ::fidl_next::FromWire<WireExposeRunner<'de>> for ExposeRunner {
19709 #[inline]
19710 fn from_wire(wire_: WireExposeRunner<'de>) -> Self {
19711 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
19712
19713 let source = wire_.table.get(1);
19714
19715 let source_name = wire_.table.get(2);
19716
19717 let target = wire_.table.get(3);
19718
19719 let target_name = wire_.table.get(4);
19720
19721 let source_dictionary = wire_.table.get(6);
19722
19723 Self {
19724 source: source.map(|envelope| {
19725 ::fidl_next::FromWire::from_wire(unsafe {
19726 envelope.read_unchecked::<crate::WireRef<'de>>()
19727 })
19728 }),
19729
19730 source_name: source_name.map(|envelope| {
19731 ::fidl_next::FromWire::from_wire(unsafe {
19732 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
19733 })
19734 }),
19735
19736 target: target.map(|envelope| {
19737 ::fidl_next::FromWire::from_wire(unsafe {
19738 envelope.read_unchecked::<crate::WireRef<'de>>()
19739 })
19740 }),
19741
19742 target_name: target_name.map(|envelope| {
19743 ::fidl_next::FromWire::from_wire(unsafe {
19744 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
19745 })
19746 }),
19747
19748 source_dictionary: source_dictionary.map(|envelope| {
19749 ::fidl_next::FromWire::from_wire(unsafe {
19750 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
19751 })
19752 }),
19753 }
19754 }
19755}
19756
19757impl<'de> ::fidl_next::IntoNatural for WireExposeRunner<'de> {
19758 type Natural = ExposeRunner;
19759}
19760
19761impl<'de> ::fidl_next::FromWireRef<WireExposeRunner<'de>> for ExposeRunner {
19762 #[inline]
19763 fn from_wire_ref(wire: &WireExposeRunner<'de>) -> Self {
19764 Self {
19765 source: wire.table.get(1).map(|envelope| {
19766 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19767 envelope.deref_unchecked::<crate::WireRef<'de>>()
19768 })
19769 }),
19770
19771 source_name: wire.table.get(2).map(|envelope| {
19772 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19773 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
19774 })
19775 }),
19776
19777 target: wire.table.get(3).map(|envelope| {
19778 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19779 envelope.deref_unchecked::<crate::WireRef<'de>>()
19780 })
19781 }),
19782
19783 target_name: wire.table.get(4).map(|envelope| {
19784 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19785 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
19786 })
19787 }),
19788
19789 source_dictionary: wire.table.get(6).map(|envelope| {
19790 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19791 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
19792 })
19793 }),
19794 }
19795 }
19796}
19797
19798#[repr(C)]
19800pub struct WireExposeRunner<'de> {
19801 table: ::fidl_next::WireTable<'de>,
19802}
19803
19804impl<'de> Drop for WireExposeRunner<'de> {
19805 fn drop(&mut self) {
19806 let _ = self
19807 .table
19808 .get(1)
19809 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
19810
19811 let _ = self
19812 .table
19813 .get(2)
19814 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
19815
19816 let _ = self
19817 .table
19818 .get(3)
19819 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
19820
19821 let _ = self
19822 .table
19823 .get(4)
19824 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
19825
19826 let _ = self
19827 .table
19828 .get(6)
19829 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
19830 }
19831}
19832
19833unsafe impl ::fidl_next::Wire for WireExposeRunner<'static> {
19834 type Decoded<'de> = WireExposeRunner<'de>;
19835
19836 #[inline]
19837 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
19838 ::fidl_next::munge!(let Self { table } = out);
19839 ::fidl_next::WireTable::zero_padding(table);
19840 }
19841}
19842
19843unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeRunner<'static>
19844where
19845 ___D: ::fidl_next::Decoder + ?Sized,
19846{
19847 fn decode(
19848 slot: ::fidl_next::Slot<'_, Self>,
19849 decoder: &mut ___D,
19850 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
19851 ::fidl_next::munge!(let Self { table } = slot);
19852
19853 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
19854 match ordinal {
19855 0 => unsafe { ::core::hint::unreachable_unchecked() },
19856
19857 1 => {
19858 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
19859 slot.as_mut(),
19860 decoder,
19861 )?;
19862
19863 Ok(())
19864 }
19865
19866 2 => {
19867 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
19868 slot.as_mut(),
19869 decoder,
19870 )?;
19871
19872 let value = unsafe {
19873 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
19874 };
19875
19876 if value.len() > 100 {
19877 return Err(::fidl_next::DecodeError::VectorTooLong {
19878 size: value.len() as u64,
19879 limit: 100,
19880 });
19881 }
19882
19883 Ok(())
19884 }
19885
19886 3 => {
19887 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
19888 slot.as_mut(),
19889 decoder,
19890 )?;
19891
19892 Ok(())
19893 }
19894
19895 4 => {
19896 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
19897 slot.as_mut(),
19898 decoder,
19899 )?;
19900
19901 let value = unsafe {
19902 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
19903 };
19904
19905 if value.len() > 100 {
19906 return Err(::fidl_next::DecodeError::VectorTooLong {
19907 size: value.len() as u64,
19908 limit: 100,
19909 });
19910 }
19911
19912 Ok(())
19913 }
19914
19915 6 => {
19916 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
19917 slot.as_mut(),
19918 decoder,
19919 )?;
19920
19921 let value = unsafe {
19922 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
19923 };
19924
19925 if value.len() > 1024 {
19926 return Err(::fidl_next::DecodeError::VectorTooLong {
19927 size: value.len() as u64,
19928 limit: 1024,
19929 });
19930 }
19931
19932 Ok(())
19933 }
19934
19935 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
19936 }
19937 })
19938 }
19939}
19940
19941impl<'de> WireExposeRunner<'de> {
19942 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
19943 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
19944 }
19945
19946 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
19947 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
19948 }
19949
19950 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
19951 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
19952 }
19953
19954 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
19955 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
19956 }
19957
19958 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
19959 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
19960 }
19961}
19962
19963impl<'de> ::core::fmt::Debug for WireExposeRunner<'de> {
19964 fn fmt(
19965 &self,
19966 f: &mut ::core::fmt::Formatter<'_>,
19967 ) -> ::core::result::Result<(), ::core::fmt::Error> {
19968 f.debug_struct("ExposeRunner")
19969 .field("source", &self.source())
19970 .field("source_name", &self.source_name())
19971 .field("target", &self.target())
19972 .field("target_name", &self.target_name())
19973 .field("source_dictionary", &self.source_dictionary())
19974 .finish()
19975 }
19976}
19977
19978#[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"]
19979#[derive(PartialEq, Clone, Debug, Default)]
19980pub struct ExposeResolver {
19981 pub source: ::core::option::Option<crate::Ref>,
19982
19983 pub source_name: ::core::option::Option<::std::string::String>,
19984
19985 pub target: ::core::option::Option<crate::Ref>,
19986
19987 pub target_name: ::core::option::Option<::std::string::String>,
19988
19989 pub source_dictionary: ::core::option::Option<::std::string::String>,
19990}
19991
19992impl ExposeResolver {
19993 fn __max_ordinal(&self) -> usize {
19994 if self.source_dictionary.is_some() {
19995 return 6;
19996 }
19997
19998 if self.target_name.is_some() {
19999 return 4;
20000 }
20001
20002 if self.target.is_some() {
20003 return 3;
20004 }
20005
20006 if self.source_name.is_some() {
20007 return 2;
20008 }
20009
20010 if self.source.is_some() {
20011 return 1;
20012 }
20013
20014 0
20015 }
20016}
20017
20018impl ::fidl_next::Encodable for ExposeResolver {
20019 type Encoded = WireExposeResolver<'static>;
20020}
20021
20022unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeResolver
20023where
20024 ___E: ::fidl_next::Encoder + ?Sized,
20025{
20026 #[inline]
20027 fn encode(
20028 mut self,
20029 encoder: &mut ___E,
20030 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20031 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20032 ::fidl_next::munge!(let WireExposeResolver { table } = out);
20033
20034 let max_ord = self.__max_ordinal();
20035
20036 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
20037 ::fidl_next::Wire::zero_padding(&mut out);
20038
20039 let mut preallocated =
20040 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
20041
20042 for i in 1..=max_ord {
20043 match i {
20044 6 => {
20045 if let Some(value) = self.source_dictionary.take() {
20046 ::fidl_next::WireEnvelope::encode_value(
20047 value,
20048 preallocated.encoder,
20049 &mut out,
20050 )?;
20051 } else {
20052 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20053 }
20054 }
20055
20056 4 => {
20057 if let Some(value) = self.target_name.take() {
20058 ::fidl_next::WireEnvelope::encode_value(
20059 value,
20060 preallocated.encoder,
20061 &mut out,
20062 )?;
20063 } else {
20064 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20065 }
20066 }
20067
20068 3 => {
20069 if let Some(value) = self.target.take() {
20070 ::fidl_next::WireEnvelope::encode_value(
20071 value,
20072 preallocated.encoder,
20073 &mut out,
20074 )?;
20075 } else {
20076 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20077 }
20078 }
20079
20080 2 => {
20081 if let Some(value) = self.source_name.take() {
20082 ::fidl_next::WireEnvelope::encode_value(
20083 value,
20084 preallocated.encoder,
20085 &mut out,
20086 )?;
20087 } else {
20088 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20089 }
20090 }
20091
20092 1 => {
20093 if let Some(value) = self.source.take() {
20094 ::fidl_next::WireEnvelope::encode_value(
20095 value,
20096 preallocated.encoder,
20097 &mut out,
20098 )?;
20099 } else {
20100 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20101 }
20102 }
20103
20104 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
20105 }
20106 unsafe {
20107 preallocated.write_next(out.assume_init_ref());
20108 }
20109 }
20110
20111 ::fidl_next::WireTable::encode_len(table, max_ord);
20112
20113 Ok(())
20114 }
20115}
20116
20117unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExposeResolver
20118where
20119 ___E: ::fidl_next::Encoder + ?Sized,
20120{
20121 #[inline]
20122 fn encode_ref(
20123 &self,
20124 encoder: &mut ___E,
20125 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20126 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20127 ::fidl_next::munge!(let WireExposeResolver { table } = out);
20128
20129 let max_ord = self.__max_ordinal();
20130
20131 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
20132 ::fidl_next::Wire::zero_padding(&mut out);
20133
20134 let mut preallocated =
20135 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
20136
20137 for i in 1..=max_ord {
20138 match i {
20139 6 => {
20140 if let Some(value) = &self.source_dictionary {
20141 ::fidl_next::WireEnvelope::encode_value(
20142 value,
20143 preallocated.encoder,
20144 &mut out,
20145 )?;
20146 } else {
20147 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20148 }
20149 }
20150
20151 4 => {
20152 if let Some(value) = &self.target_name {
20153 ::fidl_next::WireEnvelope::encode_value(
20154 value,
20155 preallocated.encoder,
20156 &mut out,
20157 )?;
20158 } else {
20159 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20160 }
20161 }
20162
20163 3 => {
20164 if let Some(value) = &self.target {
20165 ::fidl_next::WireEnvelope::encode_value(
20166 value,
20167 preallocated.encoder,
20168 &mut out,
20169 )?;
20170 } else {
20171 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20172 }
20173 }
20174
20175 2 => {
20176 if let Some(value) = &self.source_name {
20177 ::fidl_next::WireEnvelope::encode_value(
20178 value,
20179 preallocated.encoder,
20180 &mut out,
20181 )?;
20182 } else {
20183 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20184 }
20185 }
20186
20187 1 => {
20188 if let Some(value) = &self.source {
20189 ::fidl_next::WireEnvelope::encode_value(
20190 value,
20191 preallocated.encoder,
20192 &mut out,
20193 )?;
20194 } else {
20195 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20196 }
20197 }
20198
20199 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
20200 }
20201 unsafe {
20202 preallocated.write_next(out.assume_init_ref());
20203 }
20204 }
20205
20206 ::fidl_next::WireTable::encode_len(table, max_ord);
20207
20208 Ok(())
20209 }
20210}
20211
20212impl<'de> ::fidl_next::FromWire<WireExposeResolver<'de>> for ExposeResolver {
20213 #[inline]
20214 fn from_wire(wire_: WireExposeResolver<'de>) -> Self {
20215 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
20216
20217 let source = wire_.table.get(1);
20218
20219 let source_name = wire_.table.get(2);
20220
20221 let target = wire_.table.get(3);
20222
20223 let target_name = wire_.table.get(4);
20224
20225 let source_dictionary = wire_.table.get(6);
20226
20227 Self {
20228 source: source.map(|envelope| {
20229 ::fidl_next::FromWire::from_wire(unsafe {
20230 envelope.read_unchecked::<crate::WireRef<'de>>()
20231 })
20232 }),
20233
20234 source_name: source_name.map(|envelope| {
20235 ::fidl_next::FromWire::from_wire(unsafe {
20236 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
20237 })
20238 }),
20239
20240 target: target.map(|envelope| {
20241 ::fidl_next::FromWire::from_wire(unsafe {
20242 envelope.read_unchecked::<crate::WireRef<'de>>()
20243 })
20244 }),
20245
20246 target_name: target_name.map(|envelope| {
20247 ::fidl_next::FromWire::from_wire(unsafe {
20248 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
20249 })
20250 }),
20251
20252 source_dictionary: source_dictionary.map(|envelope| {
20253 ::fidl_next::FromWire::from_wire(unsafe {
20254 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
20255 })
20256 }),
20257 }
20258 }
20259}
20260
20261impl<'de> ::fidl_next::IntoNatural for WireExposeResolver<'de> {
20262 type Natural = ExposeResolver;
20263}
20264
20265impl<'de> ::fidl_next::FromWireRef<WireExposeResolver<'de>> for ExposeResolver {
20266 #[inline]
20267 fn from_wire_ref(wire: &WireExposeResolver<'de>) -> Self {
20268 Self {
20269 source: wire.table.get(1).map(|envelope| {
20270 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20271 envelope.deref_unchecked::<crate::WireRef<'de>>()
20272 })
20273 }),
20274
20275 source_name: wire.table.get(2).map(|envelope| {
20276 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20277 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
20278 })
20279 }),
20280
20281 target: wire.table.get(3).map(|envelope| {
20282 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20283 envelope.deref_unchecked::<crate::WireRef<'de>>()
20284 })
20285 }),
20286
20287 target_name: wire.table.get(4).map(|envelope| {
20288 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20289 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
20290 })
20291 }),
20292
20293 source_dictionary: wire.table.get(6).map(|envelope| {
20294 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20295 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
20296 })
20297 }),
20298 }
20299 }
20300}
20301
20302#[repr(C)]
20304pub struct WireExposeResolver<'de> {
20305 table: ::fidl_next::WireTable<'de>,
20306}
20307
20308impl<'de> Drop for WireExposeResolver<'de> {
20309 fn drop(&mut self) {
20310 let _ = self
20311 .table
20312 .get(1)
20313 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
20314
20315 let _ = self
20316 .table
20317 .get(2)
20318 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
20319
20320 let _ = self
20321 .table
20322 .get(3)
20323 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
20324
20325 let _ = self
20326 .table
20327 .get(4)
20328 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
20329
20330 let _ = self
20331 .table
20332 .get(6)
20333 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
20334 }
20335}
20336
20337unsafe impl ::fidl_next::Wire for WireExposeResolver<'static> {
20338 type Decoded<'de> = WireExposeResolver<'de>;
20339
20340 #[inline]
20341 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
20342 ::fidl_next::munge!(let Self { table } = out);
20343 ::fidl_next::WireTable::zero_padding(table);
20344 }
20345}
20346
20347unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeResolver<'static>
20348where
20349 ___D: ::fidl_next::Decoder + ?Sized,
20350{
20351 fn decode(
20352 slot: ::fidl_next::Slot<'_, Self>,
20353 decoder: &mut ___D,
20354 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
20355 ::fidl_next::munge!(let Self { table } = slot);
20356
20357 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
20358 match ordinal {
20359 0 => unsafe { ::core::hint::unreachable_unchecked() },
20360
20361 1 => {
20362 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
20363 slot.as_mut(),
20364 decoder,
20365 )?;
20366
20367 Ok(())
20368 }
20369
20370 2 => {
20371 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
20372 slot.as_mut(),
20373 decoder,
20374 )?;
20375
20376 let value = unsafe {
20377 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
20378 };
20379
20380 if value.len() > 100 {
20381 return Err(::fidl_next::DecodeError::VectorTooLong {
20382 size: value.len() as u64,
20383 limit: 100,
20384 });
20385 }
20386
20387 Ok(())
20388 }
20389
20390 3 => {
20391 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
20392 slot.as_mut(),
20393 decoder,
20394 )?;
20395
20396 Ok(())
20397 }
20398
20399 4 => {
20400 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
20401 slot.as_mut(),
20402 decoder,
20403 )?;
20404
20405 let value = unsafe {
20406 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
20407 };
20408
20409 if value.len() > 100 {
20410 return Err(::fidl_next::DecodeError::VectorTooLong {
20411 size: value.len() as u64,
20412 limit: 100,
20413 });
20414 }
20415
20416 Ok(())
20417 }
20418
20419 6 => {
20420 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
20421 slot.as_mut(),
20422 decoder,
20423 )?;
20424
20425 let value = unsafe {
20426 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
20427 };
20428
20429 if value.len() > 1024 {
20430 return Err(::fidl_next::DecodeError::VectorTooLong {
20431 size: value.len() as u64,
20432 limit: 1024,
20433 });
20434 }
20435
20436 Ok(())
20437 }
20438
20439 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
20440 }
20441 })
20442 }
20443}
20444
20445impl<'de> WireExposeResolver<'de> {
20446 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
20447 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
20448 }
20449
20450 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
20451 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
20452 }
20453
20454 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
20455 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
20456 }
20457
20458 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
20459 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
20460 }
20461
20462 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
20463 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
20464 }
20465}
20466
20467impl<'de> ::core::fmt::Debug for WireExposeResolver<'de> {
20468 fn fmt(
20469 &self,
20470 f: &mut ::core::fmt::Formatter<'_>,
20471 ) -> ::core::result::Result<(), ::core::fmt::Error> {
20472 f.debug_struct("ExposeResolver")
20473 .field("source", &self.source())
20474 .field("source_name", &self.source_name())
20475 .field("target", &self.target())
20476 .field("target_name", &self.target_name())
20477 .field("source_dictionary", &self.source_dictionary())
20478 .finish()
20479 }
20480}
20481
20482#[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"]
20483#[derive(PartialEq, Clone, Debug, Default)]
20484pub struct ExposeDictionary {
20485 pub source: ::core::option::Option<crate::Ref>,
20486
20487 pub source_name: ::core::option::Option<::std::string::String>,
20488
20489 pub target: ::core::option::Option<crate::Ref>,
20490
20491 pub target_name: ::core::option::Option<::std::string::String>,
20492
20493 pub availability: ::core::option::Option<crate::Availability>,
20494
20495 pub source_dictionary: ::core::option::Option<::std::string::String>,
20496}
20497
20498impl ExposeDictionary {
20499 fn __max_ordinal(&self) -> usize {
20500 if self.source_dictionary.is_some() {
20501 return 6;
20502 }
20503
20504 if self.availability.is_some() {
20505 return 5;
20506 }
20507
20508 if self.target_name.is_some() {
20509 return 4;
20510 }
20511
20512 if self.target.is_some() {
20513 return 3;
20514 }
20515
20516 if self.source_name.is_some() {
20517 return 2;
20518 }
20519
20520 if self.source.is_some() {
20521 return 1;
20522 }
20523
20524 0
20525 }
20526}
20527
20528impl ::fidl_next::Encodable for ExposeDictionary {
20529 type Encoded = WireExposeDictionary<'static>;
20530}
20531
20532unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeDictionary
20533where
20534 ___E: ::fidl_next::Encoder + ?Sized,
20535{
20536 #[inline]
20537 fn encode(
20538 mut self,
20539 encoder: &mut ___E,
20540 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20541 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20542 ::fidl_next::munge!(let WireExposeDictionary { table } = out);
20543
20544 let max_ord = self.__max_ordinal();
20545
20546 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
20547 ::fidl_next::Wire::zero_padding(&mut out);
20548
20549 let mut preallocated =
20550 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
20551
20552 for i in 1..=max_ord {
20553 match i {
20554 6 => {
20555 if let Some(value) = self.source_dictionary.take() {
20556 ::fidl_next::WireEnvelope::encode_value(
20557 value,
20558 preallocated.encoder,
20559 &mut out,
20560 )?;
20561 } else {
20562 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20563 }
20564 }
20565
20566 5 => {
20567 if let Some(value) = self.availability.take() {
20568 ::fidl_next::WireEnvelope::encode_value(
20569 value,
20570 preallocated.encoder,
20571 &mut out,
20572 )?;
20573 } else {
20574 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20575 }
20576 }
20577
20578 4 => {
20579 if let Some(value) = self.target_name.take() {
20580 ::fidl_next::WireEnvelope::encode_value(
20581 value,
20582 preallocated.encoder,
20583 &mut out,
20584 )?;
20585 } else {
20586 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20587 }
20588 }
20589
20590 3 => {
20591 if let Some(value) = self.target.take() {
20592 ::fidl_next::WireEnvelope::encode_value(
20593 value,
20594 preallocated.encoder,
20595 &mut out,
20596 )?;
20597 } else {
20598 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20599 }
20600 }
20601
20602 2 => {
20603 if let Some(value) = self.source_name.take() {
20604 ::fidl_next::WireEnvelope::encode_value(
20605 value,
20606 preallocated.encoder,
20607 &mut out,
20608 )?;
20609 } else {
20610 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20611 }
20612 }
20613
20614 1 => {
20615 if let Some(value) = self.source.take() {
20616 ::fidl_next::WireEnvelope::encode_value(
20617 value,
20618 preallocated.encoder,
20619 &mut out,
20620 )?;
20621 } else {
20622 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20623 }
20624 }
20625
20626 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
20627 }
20628 unsafe {
20629 preallocated.write_next(out.assume_init_ref());
20630 }
20631 }
20632
20633 ::fidl_next::WireTable::encode_len(table, max_ord);
20634
20635 Ok(())
20636 }
20637}
20638
20639unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExposeDictionary
20640where
20641 ___E: ::fidl_next::Encoder + ?Sized,
20642{
20643 #[inline]
20644 fn encode_ref(
20645 &self,
20646 encoder: &mut ___E,
20647 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
20648 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20649 ::fidl_next::munge!(let WireExposeDictionary { table } = out);
20650
20651 let max_ord = self.__max_ordinal();
20652
20653 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
20654 ::fidl_next::Wire::zero_padding(&mut out);
20655
20656 let mut preallocated =
20657 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
20658
20659 for i in 1..=max_ord {
20660 match i {
20661 6 => {
20662 if let Some(value) = &self.source_dictionary {
20663 ::fidl_next::WireEnvelope::encode_value(
20664 value,
20665 preallocated.encoder,
20666 &mut out,
20667 )?;
20668 } else {
20669 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20670 }
20671 }
20672
20673 5 => {
20674 if let Some(value) = &self.availability {
20675 ::fidl_next::WireEnvelope::encode_value(
20676 value,
20677 preallocated.encoder,
20678 &mut out,
20679 )?;
20680 } else {
20681 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20682 }
20683 }
20684
20685 4 => {
20686 if let Some(value) = &self.target_name {
20687 ::fidl_next::WireEnvelope::encode_value(
20688 value,
20689 preallocated.encoder,
20690 &mut out,
20691 )?;
20692 } else {
20693 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20694 }
20695 }
20696
20697 3 => {
20698 if let Some(value) = &self.target {
20699 ::fidl_next::WireEnvelope::encode_value(
20700 value,
20701 preallocated.encoder,
20702 &mut out,
20703 )?;
20704 } else {
20705 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20706 }
20707 }
20708
20709 2 => {
20710 if let Some(value) = &self.source_name {
20711 ::fidl_next::WireEnvelope::encode_value(
20712 value,
20713 preallocated.encoder,
20714 &mut out,
20715 )?;
20716 } else {
20717 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20718 }
20719 }
20720
20721 1 => {
20722 if let Some(value) = &self.source {
20723 ::fidl_next::WireEnvelope::encode_value(
20724 value,
20725 preallocated.encoder,
20726 &mut out,
20727 )?;
20728 } else {
20729 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20730 }
20731 }
20732
20733 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
20734 }
20735 unsafe {
20736 preallocated.write_next(out.assume_init_ref());
20737 }
20738 }
20739
20740 ::fidl_next::WireTable::encode_len(table, max_ord);
20741
20742 Ok(())
20743 }
20744}
20745
20746impl<'de> ::fidl_next::FromWire<WireExposeDictionary<'de>> for ExposeDictionary {
20747 #[inline]
20748 fn from_wire(wire_: WireExposeDictionary<'de>) -> Self {
20749 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
20750
20751 let source = wire_.table.get(1);
20752
20753 let source_name = wire_.table.get(2);
20754
20755 let target = wire_.table.get(3);
20756
20757 let target_name = wire_.table.get(4);
20758
20759 let availability = wire_.table.get(5);
20760
20761 let source_dictionary = wire_.table.get(6);
20762
20763 Self {
20764 source: source.map(|envelope| {
20765 ::fidl_next::FromWire::from_wire(unsafe {
20766 envelope.read_unchecked::<crate::WireRef<'de>>()
20767 })
20768 }),
20769
20770 source_name: source_name.map(|envelope| {
20771 ::fidl_next::FromWire::from_wire(unsafe {
20772 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
20773 })
20774 }),
20775
20776 target: target.map(|envelope| {
20777 ::fidl_next::FromWire::from_wire(unsafe {
20778 envelope.read_unchecked::<crate::WireRef<'de>>()
20779 })
20780 }),
20781
20782 target_name: target_name.map(|envelope| {
20783 ::fidl_next::FromWire::from_wire(unsafe {
20784 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
20785 })
20786 }),
20787
20788 availability: availability.map(|envelope| {
20789 ::fidl_next::FromWire::from_wire(unsafe {
20790 envelope.read_unchecked::<crate::WireAvailability>()
20791 })
20792 }),
20793
20794 source_dictionary: source_dictionary.map(|envelope| {
20795 ::fidl_next::FromWire::from_wire(unsafe {
20796 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
20797 })
20798 }),
20799 }
20800 }
20801}
20802
20803impl<'de> ::fidl_next::IntoNatural for WireExposeDictionary<'de> {
20804 type Natural = ExposeDictionary;
20805}
20806
20807impl<'de> ::fidl_next::FromWireRef<WireExposeDictionary<'de>> for ExposeDictionary {
20808 #[inline]
20809 fn from_wire_ref(wire: &WireExposeDictionary<'de>) -> Self {
20810 Self {
20811 source: wire.table.get(1).map(|envelope| {
20812 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20813 envelope.deref_unchecked::<crate::WireRef<'de>>()
20814 })
20815 }),
20816
20817 source_name: wire.table.get(2).map(|envelope| {
20818 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20819 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
20820 })
20821 }),
20822
20823 target: wire.table.get(3).map(|envelope| {
20824 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20825 envelope.deref_unchecked::<crate::WireRef<'de>>()
20826 })
20827 }),
20828
20829 target_name: wire.table.get(4).map(|envelope| {
20830 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20831 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
20832 })
20833 }),
20834
20835 availability: wire.table.get(5).map(|envelope| {
20836 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20837 envelope.deref_unchecked::<crate::WireAvailability>()
20838 })
20839 }),
20840
20841 source_dictionary: wire.table.get(6).map(|envelope| {
20842 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20843 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
20844 })
20845 }),
20846 }
20847 }
20848}
20849
20850#[repr(C)]
20852pub struct WireExposeDictionary<'de> {
20853 table: ::fidl_next::WireTable<'de>,
20854}
20855
20856impl<'de> Drop for WireExposeDictionary<'de> {
20857 fn drop(&mut self) {
20858 let _ = self
20859 .table
20860 .get(1)
20861 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
20862
20863 let _ = self
20864 .table
20865 .get(2)
20866 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
20867
20868 let _ = self
20869 .table
20870 .get(3)
20871 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
20872
20873 let _ = self
20874 .table
20875 .get(4)
20876 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
20877
20878 let _ = self
20879 .table
20880 .get(5)
20881 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
20882
20883 let _ = self
20884 .table
20885 .get(6)
20886 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
20887 }
20888}
20889
20890unsafe impl ::fidl_next::Wire for WireExposeDictionary<'static> {
20891 type Decoded<'de> = WireExposeDictionary<'de>;
20892
20893 #[inline]
20894 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
20895 ::fidl_next::munge!(let Self { table } = out);
20896 ::fidl_next::WireTable::zero_padding(table);
20897 }
20898}
20899
20900unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeDictionary<'static>
20901where
20902 ___D: ::fidl_next::Decoder + ?Sized,
20903{
20904 fn decode(
20905 slot: ::fidl_next::Slot<'_, Self>,
20906 decoder: &mut ___D,
20907 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
20908 ::fidl_next::munge!(let Self { table } = slot);
20909
20910 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
20911 match ordinal {
20912 0 => unsafe { ::core::hint::unreachable_unchecked() },
20913
20914 1 => {
20915 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
20916 slot.as_mut(),
20917 decoder,
20918 )?;
20919
20920 Ok(())
20921 }
20922
20923 2 => {
20924 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
20925 slot.as_mut(),
20926 decoder,
20927 )?;
20928
20929 let value = unsafe {
20930 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
20931 };
20932
20933 if value.len() > 100 {
20934 return Err(::fidl_next::DecodeError::VectorTooLong {
20935 size: value.len() as u64,
20936 limit: 100,
20937 });
20938 }
20939
20940 Ok(())
20941 }
20942
20943 3 => {
20944 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
20945 slot.as_mut(),
20946 decoder,
20947 )?;
20948
20949 Ok(())
20950 }
20951
20952 4 => {
20953 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
20954 slot.as_mut(),
20955 decoder,
20956 )?;
20957
20958 let value = unsafe {
20959 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
20960 };
20961
20962 if value.len() > 100 {
20963 return Err(::fidl_next::DecodeError::VectorTooLong {
20964 size: value.len() as u64,
20965 limit: 100,
20966 });
20967 }
20968
20969 Ok(())
20970 }
20971
20972 5 => {
20973 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
20974 slot.as_mut(),
20975 decoder,
20976 )?;
20977
20978 Ok(())
20979 }
20980
20981 6 => {
20982 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
20983 slot.as_mut(),
20984 decoder,
20985 )?;
20986
20987 let value = unsafe {
20988 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
20989 };
20990
20991 if value.len() > 1024 {
20992 return Err(::fidl_next::DecodeError::VectorTooLong {
20993 size: value.len() as u64,
20994 limit: 1024,
20995 });
20996 }
20997
20998 Ok(())
20999 }
21000
21001 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
21002 }
21003 })
21004 }
21005}
21006
21007impl<'de> WireExposeDictionary<'de> {
21008 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
21009 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
21010 }
21011
21012 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
21013 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
21014 }
21015
21016 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
21017 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
21018 }
21019
21020 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
21021 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
21022 }
21023
21024 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
21025 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
21026 }
21027
21028 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
21029 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
21030 }
21031}
21032
21033impl<'de> ::core::fmt::Debug for WireExposeDictionary<'de> {
21034 fn fmt(
21035 &self,
21036 f: &mut ::core::fmt::Formatter<'_>,
21037 ) -> ::core::result::Result<(), ::core::fmt::Error> {
21038 f.debug_struct("ExposeDictionary")
21039 .field("source", &self.source())
21040 .field("source_name", &self.source_name())
21041 .field("target", &self.target())
21042 .field("target_name", &self.target_name())
21043 .field("availability", &self.availability())
21044 .field("source_dictionary", &self.source_dictionary())
21045 .finish()
21046 }
21047}
21048
21049#[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"]
21050#[derive(PartialEq, Clone, Debug, Default)]
21051pub struct ExposeConfiguration {
21052 pub source: ::core::option::Option<crate::Ref>,
21053
21054 pub source_name: ::core::option::Option<::std::string::String>,
21055
21056 pub target: ::core::option::Option<crate::Ref>,
21057
21058 pub target_name: ::core::option::Option<::std::string::String>,
21059
21060 pub availability: ::core::option::Option<crate::Availability>,
21061
21062 pub source_dictionary: ::core::option::Option<::std::string::String>,
21063}
21064
21065impl ExposeConfiguration {
21066 fn __max_ordinal(&self) -> usize {
21067 if self.source_dictionary.is_some() {
21068 return 6;
21069 }
21070
21071 if self.availability.is_some() {
21072 return 5;
21073 }
21074
21075 if self.target_name.is_some() {
21076 return 4;
21077 }
21078
21079 if self.target.is_some() {
21080 return 3;
21081 }
21082
21083 if self.source_name.is_some() {
21084 return 2;
21085 }
21086
21087 if self.source.is_some() {
21088 return 1;
21089 }
21090
21091 0
21092 }
21093}
21094
21095impl ::fidl_next::Encodable for ExposeConfiguration {
21096 type Encoded = WireExposeConfiguration<'static>;
21097}
21098
21099unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeConfiguration
21100where
21101 ___E: ::fidl_next::Encoder + ?Sized,
21102{
21103 #[inline]
21104 fn encode(
21105 mut self,
21106 encoder: &mut ___E,
21107 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21108 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21109 ::fidl_next::munge!(let WireExposeConfiguration { table } = out);
21110
21111 let max_ord = self.__max_ordinal();
21112
21113 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
21114 ::fidl_next::Wire::zero_padding(&mut out);
21115
21116 let mut preallocated =
21117 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
21118
21119 for i in 1..=max_ord {
21120 match i {
21121 6 => {
21122 if let Some(value) = self.source_dictionary.take() {
21123 ::fidl_next::WireEnvelope::encode_value(
21124 value,
21125 preallocated.encoder,
21126 &mut out,
21127 )?;
21128 } else {
21129 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21130 }
21131 }
21132
21133 5 => {
21134 if let Some(value) = self.availability.take() {
21135 ::fidl_next::WireEnvelope::encode_value(
21136 value,
21137 preallocated.encoder,
21138 &mut out,
21139 )?;
21140 } else {
21141 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21142 }
21143 }
21144
21145 4 => {
21146 if let Some(value) = self.target_name.take() {
21147 ::fidl_next::WireEnvelope::encode_value(
21148 value,
21149 preallocated.encoder,
21150 &mut out,
21151 )?;
21152 } else {
21153 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21154 }
21155 }
21156
21157 3 => {
21158 if let Some(value) = self.target.take() {
21159 ::fidl_next::WireEnvelope::encode_value(
21160 value,
21161 preallocated.encoder,
21162 &mut out,
21163 )?;
21164 } else {
21165 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21166 }
21167 }
21168
21169 2 => {
21170 if let Some(value) = self.source_name.take() {
21171 ::fidl_next::WireEnvelope::encode_value(
21172 value,
21173 preallocated.encoder,
21174 &mut out,
21175 )?;
21176 } else {
21177 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21178 }
21179 }
21180
21181 1 => {
21182 if let Some(value) = self.source.take() {
21183 ::fidl_next::WireEnvelope::encode_value(
21184 value,
21185 preallocated.encoder,
21186 &mut out,
21187 )?;
21188 } else {
21189 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21190 }
21191 }
21192
21193 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
21194 }
21195 unsafe {
21196 preallocated.write_next(out.assume_init_ref());
21197 }
21198 }
21199
21200 ::fidl_next::WireTable::encode_len(table, max_ord);
21201
21202 Ok(())
21203 }
21204}
21205
21206unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExposeConfiguration
21207where
21208 ___E: ::fidl_next::Encoder + ?Sized,
21209{
21210 #[inline]
21211 fn encode_ref(
21212 &self,
21213 encoder: &mut ___E,
21214 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21215 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21216 ::fidl_next::munge!(let WireExposeConfiguration { table } = out);
21217
21218 let max_ord = self.__max_ordinal();
21219
21220 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
21221 ::fidl_next::Wire::zero_padding(&mut out);
21222
21223 let mut preallocated =
21224 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
21225
21226 for i in 1..=max_ord {
21227 match i {
21228 6 => {
21229 if let Some(value) = &self.source_dictionary {
21230 ::fidl_next::WireEnvelope::encode_value(
21231 value,
21232 preallocated.encoder,
21233 &mut out,
21234 )?;
21235 } else {
21236 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21237 }
21238 }
21239
21240 5 => {
21241 if let Some(value) = &self.availability {
21242 ::fidl_next::WireEnvelope::encode_value(
21243 value,
21244 preallocated.encoder,
21245 &mut out,
21246 )?;
21247 } else {
21248 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21249 }
21250 }
21251
21252 4 => {
21253 if let Some(value) = &self.target_name {
21254 ::fidl_next::WireEnvelope::encode_value(
21255 value,
21256 preallocated.encoder,
21257 &mut out,
21258 )?;
21259 } else {
21260 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21261 }
21262 }
21263
21264 3 => {
21265 if let Some(value) = &self.target {
21266 ::fidl_next::WireEnvelope::encode_value(
21267 value,
21268 preallocated.encoder,
21269 &mut out,
21270 )?;
21271 } else {
21272 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21273 }
21274 }
21275
21276 2 => {
21277 if let Some(value) = &self.source_name {
21278 ::fidl_next::WireEnvelope::encode_value(
21279 value,
21280 preallocated.encoder,
21281 &mut out,
21282 )?;
21283 } else {
21284 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21285 }
21286 }
21287
21288 1 => {
21289 if let Some(value) = &self.source {
21290 ::fidl_next::WireEnvelope::encode_value(
21291 value,
21292 preallocated.encoder,
21293 &mut out,
21294 )?;
21295 } else {
21296 ::fidl_next::WireEnvelope::encode_zero(&mut out)
21297 }
21298 }
21299
21300 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
21301 }
21302 unsafe {
21303 preallocated.write_next(out.assume_init_ref());
21304 }
21305 }
21306
21307 ::fidl_next::WireTable::encode_len(table, max_ord);
21308
21309 Ok(())
21310 }
21311}
21312
21313impl<'de> ::fidl_next::FromWire<WireExposeConfiguration<'de>> for ExposeConfiguration {
21314 #[inline]
21315 fn from_wire(wire_: WireExposeConfiguration<'de>) -> Self {
21316 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
21317
21318 let source = wire_.table.get(1);
21319
21320 let source_name = wire_.table.get(2);
21321
21322 let target = wire_.table.get(3);
21323
21324 let target_name = wire_.table.get(4);
21325
21326 let availability = wire_.table.get(5);
21327
21328 let source_dictionary = wire_.table.get(6);
21329
21330 Self {
21331 source: source.map(|envelope| {
21332 ::fidl_next::FromWire::from_wire(unsafe {
21333 envelope.read_unchecked::<crate::WireRef<'de>>()
21334 })
21335 }),
21336
21337 source_name: source_name.map(|envelope| {
21338 ::fidl_next::FromWire::from_wire(unsafe {
21339 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
21340 })
21341 }),
21342
21343 target: target.map(|envelope| {
21344 ::fidl_next::FromWire::from_wire(unsafe {
21345 envelope.read_unchecked::<crate::WireRef<'de>>()
21346 })
21347 }),
21348
21349 target_name: target_name.map(|envelope| {
21350 ::fidl_next::FromWire::from_wire(unsafe {
21351 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
21352 })
21353 }),
21354
21355 availability: availability.map(|envelope| {
21356 ::fidl_next::FromWire::from_wire(unsafe {
21357 envelope.read_unchecked::<crate::WireAvailability>()
21358 })
21359 }),
21360
21361 source_dictionary: source_dictionary.map(|envelope| {
21362 ::fidl_next::FromWire::from_wire(unsafe {
21363 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
21364 })
21365 }),
21366 }
21367 }
21368}
21369
21370impl<'de> ::fidl_next::IntoNatural for WireExposeConfiguration<'de> {
21371 type Natural = ExposeConfiguration;
21372}
21373
21374impl<'de> ::fidl_next::FromWireRef<WireExposeConfiguration<'de>> for ExposeConfiguration {
21375 #[inline]
21376 fn from_wire_ref(wire: &WireExposeConfiguration<'de>) -> Self {
21377 Self {
21378 source: wire.table.get(1).map(|envelope| {
21379 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
21380 envelope.deref_unchecked::<crate::WireRef<'de>>()
21381 })
21382 }),
21383
21384 source_name: wire.table.get(2).map(|envelope| {
21385 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
21386 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
21387 })
21388 }),
21389
21390 target: wire.table.get(3).map(|envelope| {
21391 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
21392 envelope.deref_unchecked::<crate::WireRef<'de>>()
21393 })
21394 }),
21395
21396 target_name: wire.table.get(4).map(|envelope| {
21397 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
21398 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
21399 })
21400 }),
21401
21402 availability: wire.table.get(5).map(|envelope| {
21403 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
21404 envelope.deref_unchecked::<crate::WireAvailability>()
21405 })
21406 }),
21407
21408 source_dictionary: wire.table.get(6).map(|envelope| {
21409 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
21410 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
21411 })
21412 }),
21413 }
21414 }
21415}
21416
21417#[repr(C)]
21419pub struct WireExposeConfiguration<'de> {
21420 table: ::fidl_next::WireTable<'de>,
21421}
21422
21423impl<'de> Drop for WireExposeConfiguration<'de> {
21424 fn drop(&mut self) {
21425 let _ = self
21426 .table
21427 .get(1)
21428 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
21429
21430 let _ = self
21431 .table
21432 .get(2)
21433 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
21434
21435 let _ = self
21436 .table
21437 .get(3)
21438 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
21439
21440 let _ = self
21441 .table
21442 .get(4)
21443 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
21444
21445 let _ = self
21446 .table
21447 .get(5)
21448 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
21449
21450 let _ = self
21451 .table
21452 .get(6)
21453 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
21454 }
21455}
21456
21457unsafe impl ::fidl_next::Wire for WireExposeConfiguration<'static> {
21458 type Decoded<'de> = WireExposeConfiguration<'de>;
21459
21460 #[inline]
21461 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
21462 ::fidl_next::munge!(let Self { table } = out);
21463 ::fidl_next::WireTable::zero_padding(table);
21464 }
21465}
21466
21467unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeConfiguration<'static>
21468where
21469 ___D: ::fidl_next::Decoder + ?Sized,
21470{
21471 fn decode(
21472 slot: ::fidl_next::Slot<'_, Self>,
21473 decoder: &mut ___D,
21474 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21475 ::fidl_next::munge!(let Self { table } = slot);
21476
21477 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
21478 match ordinal {
21479 0 => unsafe { ::core::hint::unreachable_unchecked() },
21480
21481 1 => {
21482 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
21483 slot.as_mut(),
21484 decoder,
21485 )?;
21486
21487 Ok(())
21488 }
21489
21490 2 => {
21491 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
21492 slot.as_mut(),
21493 decoder,
21494 )?;
21495
21496 let value = unsafe {
21497 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
21498 };
21499
21500 if value.len() > 100 {
21501 return Err(::fidl_next::DecodeError::VectorTooLong {
21502 size: value.len() as u64,
21503 limit: 100,
21504 });
21505 }
21506
21507 Ok(())
21508 }
21509
21510 3 => {
21511 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
21512 slot.as_mut(),
21513 decoder,
21514 )?;
21515
21516 Ok(())
21517 }
21518
21519 4 => {
21520 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
21521 slot.as_mut(),
21522 decoder,
21523 )?;
21524
21525 let value = unsafe {
21526 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
21527 };
21528
21529 if value.len() > 100 {
21530 return Err(::fidl_next::DecodeError::VectorTooLong {
21531 size: value.len() as u64,
21532 limit: 100,
21533 });
21534 }
21535
21536 Ok(())
21537 }
21538
21539 5 => {
21540 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
21541 slot.as_mut(),
21542 decoder,
21543 )?;
21544
21545 Ok(())
21546 }
21547
21548 6 => {
21549 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
21550 slot.as_mut(),
21551 decoder,
21552 )?;
21553
21554 let value = unsafe {
21555 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
21556 };
21557
21558 if value.len() > 1024 {
21559 return Err(::fidl_next::DecodeError::VectorTooLong {
21560 size: value.len() as u64,
21561 limit: 1024,
21562 });
21563 }
21564
21565 Ok(())
21566 }
21567
21568 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
21569 }
21570 })
21571 }
21572}
21573
21574impl<'de> WireExposeConfiguration<'de> {
21575 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
21576 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
21577 }
21578
21579 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
21580 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
21581 }
21582
21583 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
21584 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
21585 }
21586
21587 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
21588 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
21589 }
21590
21591 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
21592 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
21593 }
21594
21595 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
21596 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
21597 }
21598}
21599
21600impl<'de> ::core::fmt::Debug for WireExposeConfiguration<'de> {
21601 fn fmt(
21602 &self,
21603 f: &mut ::core::fmt::Formatter<'_>,
21604 ) -> ::core::result::Result<(), ::core::fmt::Error> {
21605 f.debug_struct("ExposeConfiguration")
21606 .field("source", &self.source())
21607 .field("source_name", &self.source_name())
21608 .field("target", &self.target())
21609 .field("target_name", &self.target_name())
21610 .field("availability", &self.availability())
21611 .field("source_dictionary", &self.source_dictionary())
21612 .finish()
21613 }
21614}
21615
21616#[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"]
21617#[derive(PartialEq, Clone, Debug)]
21618pub enum Expose {
21619 Service(crate::ExposeService),
21620
21621 Protocol(crate::ExposeProtocol),
21622
21623 Directory(crate::ExposeDirectory),
21624
21625 Runner(crate::ExposeRunner),
21626
21627 Resolver(crate::ExposeResolver),
21628
21629 Dictionary(crate::ExposeDictionary),
21630
21631 Config(crate::ExposeConfiguration),
21632
21633 UnknownOrdinal_(u64),
21634}
21635
21636impl ::fidl_next::Encodable for Expose {
21637 type Encoded = WireExpose<'static>;
21638}
21639
21640unsafe impl<___E> ::fidl_next::Encode<___E> for Expose
21641where
21642 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21643 ___E: ::fidl_next::Encoder,
21644{
21645 #[inline]
21646 fn encode(
21647 self,
21648 encoder: &mut ___E,
21649 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21650 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21651 ::fidl_next::munge!(let WireExpose { raw, _phantom: _ } = out);
21652
21653 match self {
21654 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
21655 ___E,
21656 crate::ExposeService,
21657 >(value, 1, encoder, raw)?,
21658
21659 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
21660 ___E,
21661 crate::ExposeProtocol,
21662 >(value, 2, encoder, raw)?,
21663
21664 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
21665 ___E,
21666 crate::ExposeDirectory,
21667 >(value, 3, encoder, raw)?,
21668
21669 Self::Runner(value) => {
21670 ::fidl_next::RawWireUnion::encode_as::<___E, crate::ExposeRunner>(
21671 value, 4, encoder, raw,
21672 )?
21673 }
21674
21675 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
21676 ___E,
21677 crate::ExposeResolver,
21678 >(value, 5, encoder, raw)?,
21679
21680 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
21681 ___E,
21682 crate::ExposeDictionary,
21683 >(value, 7, encoder, raw)?,
21684
21685 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
21686 ___E,
21687 crate::ExposeConfiguration,
21688 >(value, 8, encoder, raw)?,
21689
21690 Self::UnknownOrdinal_(ordinal) => {
21691 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
21692 }
21693 }
21694
21695 Ok(())
21696 }
21697}
21698
21699unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Expose
21700where
21701 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21702 ___E: ::fidl_next::Encoder,
21703{
21704 #[inline]
21705 fn encode_ref(
21706 &self,
21707 encoder: &mut ___E,
21708 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
21709 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21710 ::fidl_next::munge!(let WireExpose { raw, _phantom: _ } = out);
21711
21712 match self {
21713 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
21714 ___E,
21715 &crate::ExposeService,
21716 >(value, 1, encoder, raw)?,
21717
21718 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
21719 ___E,
21720 &crate::ExposeProtocol,
21721 >(value, 2, encoder, raw)?,
21722
21723 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
21724 ___E,
21725 &crate::ExposeDirectory,
21726 >(value, 3, encoder, raw)?,
21727
21728 Self::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<
21729 ___E,
21730 &crate::ExposeRunner,
21731 >(value, 4, encoder, raw)?,
21732
21733 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
21734 ___E,
21735 &crate::ExposeResolver,
21736 >(value, 5, encoder, raw)?,
21737
21738 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
21739 ___E,
21740 &crate::ExposeDictionary,
21741 >(value, 7, encoder, raw)?,
21742
21743 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
21744 ___E,
21745 &crate::ExposeConfiguration,
21746 >(value, 8, encoder, raw)?,
21747
21748 Self::UnknownOrdinal_(ordinal) => {
21749 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
21750 }
21751 }
21752
21753 Ok(())
21754 }
21755}
21756
21757impl ::fidl_next::EncodableOption for Expose {
21758 type EncodedOption = WireOptionalExpose<'static>;
21759}
21760
21761unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Expose
21762where
21763 ___E: ?Sized,
21764 Expose: ::fidl_next::Encode<___E>,
21765{
21766 #[inline]
21767 fn encode_option(
21768 this: ::core::option::Option<Self>,
21769 encoder: &mut ___E,
21770 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21771 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21772 ::fidl_next::munge!(let WireOptionalExpose { raw, _phantom: _ } = &mut *out);
21773
21774 if let Some(inner) = this {
21775 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
21776 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
21777 } else {
21778 ::fidl_next::RawWireUnion::encode_absent(raw);
21779 }
21780
21781 Ok(())
21782 }
21783}
21784
21785unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Expose
21786where
21787 ___E: ?Sized,
21788 Expose: ::fidl_next::EncodeRef<___E>,
21789{
21790 #[inline]
21791 fn encode_option_ref(
21792 this: ::core::option::Option<&Self>,
21793 encoder: &mut ___E,
21794 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
21795 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21796 ::fidl_next::munge!(let WireOptionalExpose { raw, _phantom: _ } = &mut *out);
21797
21798 if let Some(inner) = this {
21799 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
21800 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
21801 } else {
21802 ::fidl_next::RawWireUnion::encode_absent(raw);
21803 }
21804
21805 Ok(())
21806 }
21807}
21808
21809impl<'de> ::fidl_next::FromWire<WireExpose<'de>> for Expose {
21810 #[inline]
21811 fn from_wire(wire: WireExpose<'de>) -> Self {
21812 let wire = ::core::mem::ManuallyDrop::new(wire);
21813 match wire.raw.ordinal() {
21814 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
21815 wire.raw.get().read_unchecked::<crate::WireExposeService<'de>>()
21816 })),
21817
21818 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
21819 wire.raw.get().read_unchecked::<crate::WireExposeProtocol<'de>>()
21820 })),
21821
21822 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
21823 wire.raw.get().read_unchecked::<crate::WireExposeDirectory<'de>>()
21824 })),
21825
21826 4 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
21827 wire.raw.get().read_unchecked::<crate::WireExposeRunner<'de>>()
21828 })),
21829
21830 5 => Self::Resolver(::fidl_next::FromWire::from_wire(unsafe {
21831 wire.raw.get().read_unchecked::<crate::WireExposeResolver<'de>>()
21832 })),
21833
21834 7 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
21835 wire.raw.get().read_unchecked::<crate::WireExposeDictionary<'de>>()
21836 })),
21837
21838 8 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
21839 wire.raw.get().read_unchecked::<crate::WireExposeConfiguration<'de>>()
21840 })),
21841
21842 _ => unsafe { ::core::hint::unreachable_unchecked() },
21843 }
21844 }
21845}
21846
21847impl<'de> ::fidl_next::IntoNatural for WireExpose<'de> {
21848 type Natural = Expose;
21849}
21850
21851impl<'de> ::fidl_next::FromWireRef<WireExpose<'de>> for Expose {
21852 #[inline]
21853 fn from_wire_ref(wire: &WireExpose<'de>) -> Self {
21854 match wire.raw.ordinal() {
21855 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
21856 wire.raw.get().deref_unchecked::<crate::WireExposeService<'de>>()
21857 })),
21858
21859 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
21860 wire.raw.get().deref_unchecked::<crate::WireExposeProtocol<'de>>()
21861 })),
21862
21863 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
21864 wire.raw.get().deref_unchecked::<crate::WireExposeDirectory<'de>>()
21865 })),
21866
21867 4 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
21868 wire.raw.get().deref_unchecked::<crate::WireExposeRunner<'de>>()
21869 })),
21870
21871 5 => Self::Resolver(::fidl_next::FromWireRef::from_wire_ref(unsafe {
21872 wire.raw.get().deref_unchecked::<crate::WireExposeResolver<'de>>()
21873 })),
21874
21875 7 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
21876 wire.raw.get().deref_unchecked::<crate::WireExposeDictionary<'de>>()
21877 })),
21878
21879 8 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
21880 wire.raw.get().deref_unchecked::<crate::WireExposeConfiguration<'de>>()
21881 })),
21882
21883 _ => unsafe { ::core::hint::unreachable_unchecked() },
21884 }
21885 }
21886}
21887
21888impl<'de> ::fidl_next::FromWireOption<WireOptionalExpose<'de>> for Expose {
21889 #[inline]
21890 fn from_wire_option(wire: WireOptionalExpose<'de>) -> ::core::option::Option<Self> {
21891 if let Some(inner) = wire.into_option() {
21892 Some(::fidl_next::FromWire::from_wire(inner))
21893 } else {
21894 None
21895 }
21896 }
21897}
21898
21899impl<'de> ::fidl_next::IntoNatural for WireOptionalExpose<'de> {
21900 type Natural = ::core::option::Option<Expose>;
21901}
21902
21903impl<'de> ::fidl_next::FromWireOption<WireOptionalExpose<'de>> for Box<Expose> {
21904 #[inline]
21905 fn from_wire_option(wire: WireOptionalExpose<'de>) -> ::core::option::Option<Self> {
21906 <Expose as ::fidl_next::FromWireOption<WireOptionalExpose<'de>>>::from_wire_option(wire)
21907 .map(Box::new)
21908 }
21909}
21910
21911impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalExpose<'de>> for Box<Expose> {
21912 #[inline]
21913 fn from_wire_option_ref(wire: &WireOptionalExpose<'de>) -> ::core::option::Option<Self> {
21914 if let Some(inner) = wire.as_ref() {
21915 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
21916 } else {
21917 None
21918 }
21919 }
21920}
21921
21922#[repr(transparent)]
21924pub struct WireExpose<'de> {
21925 raw: ::fidl_next::RawWireUnion,
21926 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
21927}
21928
21929impl<'de> Drop for WireExpose<'de> {
21930 fn drop(&mut self) {
21931 match self.raw.ordinal() {
21932 1 => {
21933 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireExposeService<'de>>() };
21934 }
21935
21936 2 => {
21937 let _ =
21938 unsafe { self.raw.get().read_unchecked::<crate::WireExposeProtocol<'de>>() };
21939 }
21940
21941 3 => {
21942 let _ =
21943 unsafe { self.raw.get().read_unchecked::<crate::WireExposeDirectory<'de>>() };
21944 }
21945
21946 4 => {
21947 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireExposeRunner<'de>>() };
21948 }
21949
21950 5 => {
21951 let _ =
21952 unsafe { self.raw.get().read_unchecked::<crate::WireExposeResolver<'de>>() };
21953 }
21954
21955 7 => {
21956 let _ =
21957 unsafe { self.raw.get().read_unchecked::<crate::WireExposeDictionary<'de>>() };
21958 }
21959
21960 8 => {
21961 let _ = unsafe {
21962 self.raw.get().read_unchecked::<crate::WireExposeConfiguration<'de>>()
21963 };
21964 }
21965
21966 _ => (),
21967 }
21968 }
21969}
21970
21971unsafe impl ::fidl_next::Wire for WireExpose<'static> {
21972 type Decoded<'de> = WireExpose<'de>;
21973
21974 #[inline]
21975 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
21976 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
21977 ::fidl_next::RawWireUnion::zero_padding(raw);
21978 }
21979}
21980
21981pub mod expose {
21982 pub enum Ref<'de> {
21983 Service(&'de crate::WireExposeService<'de>),
21984
21985 Protocol(&'de crate::WireExposeProtocol<'de>),
21986
21987 Directory(&'de crate::WireExposeDirectory<'de>),
21988
21989 Runner(&'de crate::WireExposeRunner<'de>),
21990
21991 Resolver(&'de crate::WireExposeResolver<'de>),
21992
21993 Dictionary(&'de crate::WireExposeDictionary<'de>),
21994
21995 Config(&'de crate::WireExposeConfiguration<'de>),
21996
21997 UnknownOrdinal_(u64),
21998 }
21999}
22000
22001impl<'de> WireExpose<'de> {
22002 pub fn as_ref(&self) -> crate::expose::Ref<'_> {
22003 match self.raw.ordinal() {
22004 1 => crate::expose::Ref::Service(unsafe {
22005 self.raw.get().deref_unchecked::<crate::WireExposeService<'_>>()
22006 }),
22007
22008 2 => crate::expose::Ref::Protocol(unsafe {
22009 self.raw.get().deref_unchecked::<crate::WireExposeProtocol<'_>>()
22010 }),
22011
22012 3 => crate::expose::Ref::Directory(unsafe {
22013 self.raw.get().deref_unchecked::<crate::WireExposeDirectory<'_>>()
22014 }),
22015
22016 4 => crate::expose::Ref::Runner(unsafe {
22017 self.raw.get().deref_unchecked::<crate::WireExposeRunner<'_>>()
22018 }),
22019
22020 5 => crate::expose::Ref::Resolver(unsafe {
22021 self.raw.get().deref_unchecked::<crate::WireExposeResolver<'_>>()
22022 }),
22023
22024 7 => crate::expose::Ref::Dictionary(unsafe {
22025 self.raw.get().deref_unchecked::<crate::WireExposeDictionary<'_>>()
22026 }),
22027
22028 8 => crate::expose::Ref::Config(unsafe {
22029 self.raw.get().deref_unchecked::<crate::WireExposeConfiguration<'_>>()
22030 }),
22031
22032 unknown => crate::expose::Ref::UnknownOrdinal_(unknown),
22033 }
22034 }
22035}
22036
22037unsafe impl<___D> ::fidl_next::Decode<___D> for WireExpose<'static>
22038where
22039 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22040 ___D: ::fidl_next::Decoder,
22041{
22042 fn decode(
22043 mut slot: ::fidl_next::Slot<'_, Self>,
22044 decoder: &mut ___D,
22045 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22046 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
22047 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
22048 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeService<'static>>(
22049 raw, decoder,
22050 )?,
22051
22052 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeProtocol<'static>>(
22053 raw, decoder,
22054 )?,
22055
22056 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeDirectory<'static>>(
22057 raw, decoder,
22058 )?,
22059
22060 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeRunner<'static>>(
22061 raw, decoder,
22062 )?,
22063
22064 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeResolver<'static>>(
22065 raw, decoder,
22066 )?,
22067
22068 7 => {
22069 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeDictionary<'static>>(
22070 raw, decoder,
22071 )?
22072 }
22073
22074 8 => ::fidl_next::RawWireUnion::decode_as::<
22075 ___D,
22076 crate::WireExposeConfiguration<'static>,
22077 >(raw, decoder)?,
22078
22079 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
22080 }
22081
22082 Ok(())
22083 }
22084}
22085
22086impl<'de> ::core::fmt::Debug for WireExpose<'de> {
22087 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
22088 match self.raw.ordinal() {
22089 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireExposeService<'_>>().fmt(f) },
22090 2 => unsafe {
22091 self.raw.get().deref_unchecked::<crate::WireExposeProtocol<'_>>().fmt(f)
22092 },
22093 3 => unsafe {
22094 self.raw.get().deref_unchecked::<crate::WireExposeDirectory<'_>>().fmt(f)
22095 },
22096 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireExposeRunner<'_>>().fmt(f) },
22097 5 => unsafe {
22098 self.raw.get().deref_unchecked::<crate::WireExposeResolver<'_>>().fmt(f)
22099 },
22100 7 => unsafe {
22101 self.raw.get().deref_unchecked::<crate::WireExposeDictionary<'_>>().fmt(f)
22102 },
22103 8 => unsafe {
22104 self.raw.get().deref_unchecked::<crate::WireExposeConfiguration<'_>>().fmt(f)
22105 },
22106 _ => unsafe { ::core::hint::unreachable_unchecked() },
22107 }
22108 }
22109}
22110
22111#[repr(transparent)]
22112pub struct WireOptionalExpose<'de> {
22113 raw: ::fidl_next::RawWireUnion,
22114 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
22115}
22116
22117unsafe impl ::fidl_next::Wire for WireOptionalExpose<'static> {
22118 type Decoded<'de> = WireOptionalExpose<'de>;
22119
22120 #[inline]
22121 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22122 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
22123 ::fidl_next::RawWireUnion::zero_padding(raw);
22124 }
22125}
22126
22127impl<'de> WireOptionalExpose<'de> {
22128 pub fn is_some(&self) -> bool {
22129 self.raw.is_some()
22130 }
22131
22132 pub fn is_none(&self) -> bool {
22133 self.raw.is_none()
22134 }
22135
22136 pub fn as_ref(&self) -> ::core::option::Option<&WireExpose<'de>> {
22137 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
22138 }
22139
22140 pub fn into_option(self) -> ::core::option::Option<WireExpose<'de>> {
22141 if self.is_some() {
22142 Some(WireExpose { raw: self.raw, _phantom: ::core::marker::PhantomData })
22143 } else {
22144 None
22145 }
22146 }
22147}
22148
22149unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalExpose<'static>
22150where
22151 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22152 ___D: ::fidl_next::Decoder,
22153{
22154 fn decode(
22155 mut slot: ::fidl_next::Slot<'_, Self>,
22156 decoder: &mut ___D,
22157 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22158 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
22159 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
22160 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeService<'static>>(
22161 raw, decoder,
22162 )?,
22163
22164 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeProtocol<'static>>(
22165 raw, decoder,
22166 )?,
22167
22168 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeDirectory<'static>>(
22169 raw, decoder,
22170 )?,
22171
22172 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeRunner<'static>>(
22173 raw, decoder,
22174 )?,
22175
22176 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeResolver<'static>>(
22177 raw, decoder,
22178 )?,
22179
22180 7 => {
22181 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeDictionary<'static>>(
22182 raw, decoder,
22183 )?
22184 }
22185
22186 8 => ::fidl_next::RawWireUnion::decode_as::<
22187 ___D,
22188 crate::WireExposeConfiguration<'static>,
22189 >(raw, decoder)?,
22190
22191 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
22192 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
22193 }
22194
22195 Ok(())
22196 }
22197}
22198
22199impl<'de> ::core::fmt::Debug for WireOptionalExpose<'de> {
22200 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
22201 self.as_ref().fmt(f)
22202 }
22203}
22204
22205#[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"]
22206#[derive(PartialEq, Clone, Debug, Default)]
22207pub struct OfferService {
22208 pub source: ::core::option::Option<crate::Ref>,
22209
22210 pub source_name: ::core::option::Option<::std::string::String>,
22211
22212 pub target: ::core::option::Option<crate::Ref>,
22213
22214 pub target_name: ::core::option::Option<::std::string::String>,
22215
22216 pub source_instance_filter: ::core::option::Option<::std::vec::Vec<::std::string::String>>,
22217
22218 pub renamed_instances: ::core::option::Option<::std::vec::Vec<crate::NameMapping>>,
22219
22220 pub availability: ::core::option::Option<crate::Availability>,
22221
22222 pub source_dictionary: ::core::option::Option<::std::string::String>,
22223
22224 pub dependency_type: ::core::option::Option<crate::DependencyType>,
22225}
22226
22227impl OfferService {
22228 fn __max_ordinal(&self) -> usize {
22229 if self.dependency_type.is_some() {
22230 return 9;
22231 }
22232
22233 if self.source_dictionary.is_some() {
22234 return 8;
22235 }
22236
22237 if self.availability.is_some() {
22238 return 7;
22239 }
22240
22241 if self.renamed_instances.is_some() {
22242 return 6;
22243 }
22244
22245 if self.source_instance_filter.is_some() {
22246 return 5;
22247 }
22248
22249 if self.target_name.is_some() {
22250 return 4;
22251 }
22252
22253 if self.target.is_some() {
22254 return 3;
22255 }
22256
22257 if self.source_name.is_some() {
22258 return 2;
22259 }
22260
22261 if self.source.is_some() {
22262 return 1;
22263 }
22264
22265 0
22266 }
22267}
22268
22269impl ::fidl_next::Encodable for OfferService {
22270 type Encoded = WireOfferService<'static>;
22271}
22272
22273unsafe impl<___E> ::fidl_next::Encode<___E> for OfferService
22274where
22275 ___E: ::fidl_next::Encoder + ?Sized,
22276{
22277 #[inline]
22278 fn encode(
22279 mut self,
22280 encoder: &mut ___E,
22281 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22282 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22283 ::fidl_next::munge!(let WireOfferService { table } = out);
22284
22285 let max_ord = self.__max_ordinal();
22286
22287 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
22288 ::fidl_next::Wire::zero_padding(&mut out);
22289
22290 let mut preallocated =
22291 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
22292
22293 for i in 1..=max_ord {
22294 match i {
22295 9 => {
22296 if let Some(value) = self.dependency_type.take() {
22297 ::fidl_next::WireEnvelope::encode_value(
22298 value,
22299 preallocated.encoder,
22300 &mut out,
22301 )?;
22302 } else {
22303 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22304 }
22305 }
22306
22307 8 => {
22308 if let Some(value) = self.source_dictionary.take() {
22309 ::fidl_next::WireEnvelope::encode_value(
22310 value,
22311 preallocated.encoder,
22312 &mut out,
22313 )?;
22314 } else {
22315 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22316 }
22317 }
22318
22319 7 => {
22320 if let Some(value) = self.availability.take() {
22321 ::fidl_next::WireEnvelope::encode_value(
22322 value,
22323 preallocated.encoder,
22324 &mut out,
22325 )?;
22326 } else {
22327 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22328 }
22329 }
22330
22331 6 => {
22332 if let Some(value) = self.renamed_instances.take() {
22333 ::fidl_next::WireEnvelope::encode_value(
22334 value,
22335 preallocated.encoder,
22336 &mut out,
22337 )?;
22338 } else {
22339 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22340 }
22341 }
22342
22343 5 => {
22344 if let Some(value) = self.source_instance_filter.take() {
22345 ::fidl_next::WireEnvelope::encode_value(
22346 value,
22347 preallocated.encoder,
22348 &mut out,
22349 )?;
22350 } else {
22351 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22352 }
22353 }
22354
22355 4 => {
22356 if let Some(value) = self.target_name.take() {
22357 ::fidl_next::WireEnvelope::encode_value(
22358 value,
22359 preallocated.encoder,
22360 &mut out,
22361 )?;
22362 } else {
22363 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22364 }
22365 }
22366
22367 3 => {
22368 if let Some(value) = self.target.take() {
22369 ::fidl_next::WireEnvelope::encode_value(
22370 value,
22371 preallocated.encoder,
22372 &mut out,
22373 )?;
22374 } else {
22375 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22376 }
22377 }
22378
22379 2 => {
22380 if let Some(value) = self.source_name.take() {
22381 ::fidl_next::WireEnvelope::encode_value(
22382 value,
22383 preallocated.encoder,
22384 &mut out,
22385 )?;
22386 } else {
22387 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22388 }
22389 }
22390
22391 1 => {
22392 if let Some(value) = self.source.take() {
22393 ::fidl_next::WireEnvelope::encode_value(
22394 value,
22395 preallocated.encoder,
22396 &mut out,
22397 )?;
22398 } else {
22399 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22400 }
22401 }
22402
22403 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
22404 }
22405 unsafe {
22406 preallocated.write_next(out.assume_init_ref());
22407 }
22408 }
22409
22410 ::fidl_next::WireTable::encode_len(table, max_ord);
22411
22412 Ok(())
22413 }
22414}
22415
22416unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferService
22417where
22418 ___E: ::fidl_next::Encoder + ?Sized,
22419{
22420 #[inline]
22421 fn encode_ref(
22422 &self,
22423 encoder: &mut ___E,
22424 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
22425 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
22426 ::fidl_next::munge!(let WireOfferService { table } = out);
22427
22428 let max_ord = self.__max_ordinal();
22429
22430 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
22431 ::fidl_next::Wire::zero_padding(&mut out);
22432
22433 let mut preallocated =
22434 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
22435
22436 for i in 1..=max_ord {
22437 match i {
22438 9 => {
22439 if let Some(value) = &self.dependency_type {
22440 ::fidl_next::WireEnvelope::encode_value(
22441 value,
22442 preallocated.encoder,
22443 &mut out,
22444 )?;
22445 } else {
22446 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22447 }
22448 }
22449
22450 8 => {
22451 if let Some(value) = &self.source_dictionary {
22452 ::fidl_next::WireEnvelope::encode_value(
22453 value,
22454 preallocated.encoder,
22455 &mut out,
22456 )?;
22457 } else {
22458 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22459 }
22460 }
22461
22462 7 => {
22463 if let Some(value) = &self.availability {
22464 ::fidl_next::WireEnvelope::encode_value(
22465 value,
22466 preallocated.encoder,
22467 &mut out,
22468 )?;
22469 } else {
22470 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22471 }
22472 }
22473
22474 6 => {
22475 if let Some(value) = &self.renamed_instances {
22476 ::fidl_next::WireEnvelope::encode_value(
22477 value,
22478 preallocated.encoder,
22479 &mut out,
22480 )?;
22481 } else {
22482 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22483 }
22484 }
22485
22486 5 => {
22487 if let Some(value) = &self.source_instance_filter {
22488 ::fidl_next::WireEnvelope::encode_value(
22489 value,
22490 preallocated.encoder,
22491 &mut out,
22492 )?;
22493 } else {
22494 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22495 }
22496 }
22497
22498 4 => {
22499 if let Some(value) = &self.target_name {
22500 ::fidl_next::WireEnvelope::encode_value(
22501 value,
22502 preallocated.encoder,
22503 &mut out,
22504 )?;
22505 } else {
22506 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22507 }
22508 }
22509
22510 3 => {
22511 if let Some(value) = &self.target {
22512 ::fidl_next::WireEnvelope::encode_value(
22513 value,
22514 preallocated.encoder,
22515 &mut out,
22516 )?;
22517 } else {
22518 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22519 }
22520 }
22521
22522 2 => {
22523 if let Some(value) = &self.source_name {
22524 ::fidl_next::WireEnvelope::encode_value(
22525 value,
22526 preallocated.encoder,
22527 &mut out,
22528 )?;
22529 } else {
22530 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22531 }
22532 }
22533
22534 1 => {
22535 if let Some(value) = &self.source {
22536 ::fidl_next::WireEnvelope::encode_value(
22537 value,
22538 preallocated.encoder,
22539 &mut out,
22540 )?;
22541 } else {
22542 ::fidl_next::WireEnvelope::encode_zero(&mut out)
22543 }
22544 }
22545
22546 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
22547 }
22548 unsafe {
22549 preallocated.write_next(out.assume_init_ref());
22550 }
22551 }
22552
22553 ::fidl_next::WireTable::encode_len(table, max_ord);
22554
22555 Ok(())
22556 }
22557}
22558
22559impl<'de> ::fidl_next::FromWire<WireOfferService<'de>> for OfferService {
22560 #[inline]
22561 fn from_wire(wire_: WireOfferService<'de>) -> Self {
22562 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
22563
22564 let source = wire_.table.get(1);
22565
22566 let source_name = wire_.table.get(2);
22567
22568 let target = wire_.table.get(3);
22569
22570 let target_name = wire_.table.get(4);
22571
22572 let source_instance_filter = wire_.table.get(5);
22573
22574 let renamed_instances = wire_.table.get(6);
22575
22576 let availability = wire_.table.get(7);
22577
22578 let source_dictionary = wire_.table.get(8);
22579
22580 let dependency_type = wire_.table.get(9);
22581
22582 Self {
22583
22584
22585 source: source.map(|envelope| ::fidl_next::FromWire::from_wire(
22586 unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() }
22587 )),
22588
22589
22590 source_name: source_name.map(|envelope| ::fidl_next::FromWire::from_wire(
22591 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
22592 )),
22593
22594
22595 target: target.map(|envelope| ::fidl_next::FromWire::from_wire(
22596 unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() }
22597 )),
22598
22599
22600 target_name: target_name.map(|envelope| ::fidl_next::FromWire::from_wire(
22601 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
22602 )),
22603
22604
22605 source_instance_filter: source_instance_filter.map(|envelope| ::fidl_next::FromWire::from_wire(
22606 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>() }
22607 )),
22608
22609
22610 renamed_instances: renamed_instances.map(|envelope| ::fidl_next::FromWire::from_wire(
22611 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNameMapping<'de>>>() }
22612 )),
22613
22614
22615 availability: availability.map(|envelope| ::fidl_next::FromWire::from_wire(
22616 unsafe { envelope.read_unchecked::<crate::WireAvailability>() }
22617 )),
22618
22619
22620 source_dictionary: source_dictionary.map(|envelope| ::fidl_next::FromWire::from_wire(
22621 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
22622 )),
22623
22624
22625 dependency_type: dependency_type.map(|envelope| ::fidl_next::FromWire::from_wire(
22626 unsafe { envelope.read_unchecked::<crate::WireDependencyType>() }
22627 )),
22628
22629 }
22630 }
22631}
22632
22633impl<'de> ::fidl_next::IntoNatural for WireOfferService<'de> {
22634 type Natural = OfferService;
22635}
22636
22637impl<'de> ::fidl_next::FromWireRef<WireOfferService<'de>> for OfferService {
22638 #[inline]
22639 fn from_wire_ref(wire: &WireOfferService<'de>) -> Self {
22640 Self {
22641
22642
22643 source: wire.table.get(1)
22644 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
22645 unsafe { envelope.deref_unchecked::<crate::WireRef<'de>>() }
22646 )),
22647
22648
22649 source_name: wire.table.get(2)
22650 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
22651 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
22652 )),
22653
22654
22655 target: wire.table.get(3)
22656 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
22657 unsafe { envelope.deref_unchecked::<crate::WireRef<'de>>() }
22658 )),
22659
22660
22661 target_name: wire.table.get(4)
22662 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
22663 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
22664 )),
22665
22666
22667 source_instance_filter: wire.table.get(5)
22668 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
22669 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>() }
22670 )),
22671
22672
22673 renamed_instances: wire.table.get(6)
22674 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
22675 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireNameMapping<'de>>>() }
22676 )),
22677
22678
22679 availability: wire.table.get(7)
22680 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
22681 unsafe { envelope.deref_unchecked::<crate::WireAvailability>() }
22682 )),
22683
22684
22685 source_dictionary: wire.table.get(8)
22686 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
22687 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
22688 )),
22689
22690
22691 dependency_type: wire.table.get(9)
22692 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
22693 unsafe { envelope.deref_unchecked::<crate::WireDependencyType>() }
22694 )),
22695
22696 }
22697 }
22698}
22699
22700#[repr(C)]
22702pub struct WireOfferService<'de> {
22703 table: ::fidl_next::WireTable<'de>,
22704}
22705
22706impl<'de> Drop for WireOfferService<'de> {
22707 fn drop(&mut self) {
22708 let _ = self
22709 .table
22710 .get(1)
22711 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
22712
22713 let _ = self
22714 .table
22715 .get(2)
22716 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
22717
22718 let _ = self
22719 .table
22720 .get(3)
22721 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
22722
22723 let _ = self
22724 .table
22725 .get(4)
22726 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
22727
22728 let _ = self.table.get(5).map(|envelope| unsafe {
22729 envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
22730 });
22731
22732 let _ = self.table.get(6).map(|envelope| unsafe {
22733 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNameMapping<'de>>>()
22734 });
22735
22736 let _ = self
22737 .table
22738 .get(7)
22739 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
22740
22741 let _ = self
22742 .table
22743 .get(8)
22744 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
22745
22746 let _ = self
22747 .table
22748 .get(9)
22749 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDependencyType>() });
22750 }
22751}
22752
22753unsafe impl ::fidl_next::Wire for WireOfferService<'static> {
22754 type Decoded<'de> = WireOfferService<'de>;
22755
22756 #[inline]
22757 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22758 ::fidl_next::munge!(let Self { table } = out);
22759 ::fidl_next::WireTable::zero_padding(table);
22760 }
22761}
22762
22763unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferService<'static>
22764where
22765 ___D: ::fidl_next::Decoder + ?Sized,
22766{
22767 fn decode(
22768 slot: ::fidl_next::Slot<'_, Self>,
22769 decoder: &mut ___D,
22770 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22771 ::fidl_next::munge!(let Self { table } = slot);
22772
22773 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
22774 match ordinal {
22775 0 => unsafe { ::core::hint::unreachable_unchecked() },
22776
22777 1 => {
22778 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
22779 slot.as_mut(),
22780 decoder,
22781 )?;
22782
22783 Ok(())
22784 }
22785
22786 2 => {
22787 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
22788 slot.as_mut(),
22789 decoder,
22790 )?;
22791
22792 let value = unsafe {
22793 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
22794 };
22795
22796 if value.len() > 100 {
22797 return Err(::fidl_next::DecodeError::VectorTooLong {
22798 size: value.len() as u64,
22799 limit: 100,
22800 });
22801 }
22802
22803 Ok(())
22804 }
22805
22806 3 => {
22807 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
22808 slot.as_mut(),
22809 decoder,
22810 )?;
22811
22812 Ok(())
22813 }
22814
22815 4 => {
22816 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
22817 slot.as_mut(),
22818 decoder,
22819 )?;
22820
22821 let value = unsafe {
22822 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
22823 };
22824
22825 if value.len() > 100 {
22826 return Err(::fidl_next::DecodeError::VectorTooLong {
22827 size: value.len() as u64,
22828 limit: 100,
22829 });
22830 }
22831
22832 Ok(())
22833 }
22834
22835 5 => {
22836 ::fidl_next::WireEnvelope::decode_as::<
22837 ___D,
22838 ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
22839 >(slot.as_mut(), decoder)?;
22840
22841 Ok(())
22842 }
22843
22844 6 => {
22845 ::fidl_next::WireEnvelope::decode_as::<
22846 ___D,
22847 ::fidl_next::WireVector<'static, crate::WireNameMapping<'static>>,
22848 >(slot.as_mut(), decoder)?;
22849
22850 Ok(())
22851 }
22852
22853 7 => {
22854 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
22855 slot.as_mut(),
22856 decoder,
22857 )?;
22858
22859 Ok(())
22860 }
22861
22862 8 => {
22863 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
22864 slot.as_mut(),
22865 decoder,
22866 )?;
22867
22868 let value = unsafe {
22869 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
22870 };
22871
22872 if value.len() > 1024 {
22873 return Err(::fidl_next::DecodeError::VectorTooLong {
22874 size: value.len() as u64,
22875 limit: 1024,
22876 });
22877 }
22878
22879 Ok(())
22880 }
22881
22882 9 => {
22883 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
22884 slot.as_mut(),
22885 decoder,
22886 )?;
22887
22888 Ok(())
22889 }
22890
22891 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
22892 }
22893 })
22894 }
22895}
22896
22897impl<'de> WireOfferService<'de> {
22898 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
22899 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
22900 }
22901
22902 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
22903 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
22904 }
22905
22906 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
22907 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
22908 }
22909
22910 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
22911 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
22912 }
22913
22914 pub fn source_instance_filter(
22915 &self,
22916 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>> {
22917 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
22918 }
22919
22920 pub fn renamed_instances(
22921 &self,
22922 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireNameMapping<'de>>> {
22923 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
22924 }
22925
22926 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
22927 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
22928 }
22929
22930 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
22931 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
22932 }
22933
22934 pub fn dependency_type(&self) -> ::core::option::Option<&crate::WireDependencyType> {
22935 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
22936 }
22937}
22938
22939impl<'de> ::core::fmt::Debug for WireOfferService<'de> {
22940 fn fmt(
22941 &self,
22942 f: &mut ::core::fmt::Formatter<'_>,
22943 ) -> ::core::result::Result<(), ::core::fmt::Error> {
22944 f.debug_struct("OfferService")
22945 .field("source", &self.source())
22946 .field("source_name", &self.source_name())
22947 .field("target", &self.target())
22948 .field("target_name", &self.target_name())
22949 .field("source_instance_filter", &self.source_instance_filter())
22950 .field("renamed_instances", &self.renamed_instances())
22951 .field("availability", &self.availability())
22952 .field("source_dictionary", &self.source_dictionary())
22953 .field("dependency_type", &self.dependency_type())
22954 .finish()
22955 }
22956}
22957
22958#[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"]
22959#[derive(PartialEq, Clone, Debug, Default)]
22960pub struct OfferProtocol {
22961 pub source: ::core::option::Option<crate::Ref>,
22962
22963 pub source_name: ::core::option::Option<::std::string::String>,
22964
22965 pub target: ::core::option::Option<crate::Ref>,
22966
22967 pub target_name: ::core::option::Option<::std::string::String>,
22968
22969 pub dependency_type: ::core::option::Option<crate::DependencyType>,
22970
22971 pub availability: ::core::option::Option<crate::Availability>,
22972
22973 pub source_dictionary: ::core::option::Option<::std::string::String>,
22974}
22975
22976impl OfferProtocol {
22977 fn __max_ordinal(&self) -> usize {
22978 if self.source_dictionary.is_some() {
22979 return 7;
22980 }
22981
22982 if self.availability.is_some() {
22983 return 6;
22984 }
22985
22986 if self.dependency_type.is_some() {
22987 return 5;
22988 }
22989
22990 if self.target_name.is_some() {
22991 return 4;
22992 }
22993
22994 if self.target.is_some() {
22995 return 3;
22996 }
22997
22998 if self.source_name.is_some() {
22999 return 2;
23000 }
23001
23002 if self.source.is_some() {
23003 return 1;
23004 }
23005
23006 0
23007 }
23008}
23009
23010impl ::fidl_next::Encodable for OfferProtocol {
23011 type Encoded = WireOfferProtocol<'static>;
23012}
23013
23014unsafe impl<___E> ::fidl_next::Encode<___E> for OfferProtocol
23015where
23016 ___E: ::fidl_next::Encoder + ?Sized,
23017{
23018 #[inline]
23019 fn encode(
23020 mut self,
23021 encoder: &mut ___E,
23022 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23023 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
23024 ::fidl_next::munge!(let WireOfferProtocol { table } = out);
23025
23026 let max_ord = self.__max_ordinal();
23027
23028 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
23029 ::fidl_next::Wire::zero_padding(&mut out);
23030
23031 let mut preallocated =
23032 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
23033
23034 for i in 1..=max_ord {
23035 match i {
23036 7 => {
23037 if let Some(value) = self.source_dictionary.take() {
23038 ::fidl_next::WireEnvelope::encode_value(
23039 value,
23040 preallocated.encoder,
23041 &mut out,
23042 )?;
23043 } else {
23044 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23045 }
23046 }
23047
23048 6 => {
23049 if let Some(value) = self.availability.take() {
23050 ::fidl_next::WireEnvelope::encode_value(
23051 value,
23052 preallocated.encoder,
23053 &mut out,
23054 )?;
23055 } else {
23056 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23057 }
23058 }
23059
23060 5 => {
23061 if let Some(value) = self.dependency_type.take() {
23062 ::fidl_next::WireEnvelope::encode_value(
23063 value,
23064 preallocated.encoder,
23065 &mut out,
23066 )?;
23067 } else {
23068 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23069 }
23070 }
23071
23072 4 => {
23073 if let Some(value) = self.target_name.take() {
23074 ::fidl_next::WireEnvelope::encode_value(
23075 value,
23076 preallocated.encoder,
23077 &mut out,
23078 )?;
23079 } else {
23080 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23081 }
23082 }
23083
23084 3 => {
23085 if let Some(value) = self.target.take() {
23086 ::fidl_next::WireEnvelope::encode_value(
23087 value,
23088 preallocated.encoder,
23089 &mut out,
23090 )?;
23091 } else {
23092 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23093 }
23094 }
23095
23096 2 => {
23097 if let Some(value) = self.source_name.take() {
23098 ::fidl_next::WireEnvelope::encode_value(
23099 value,
23100 preallocated.encoder,
23101 &mut out,
23102 )?;
23103 } else {
23104 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23105 }
23106 }
23107
23108 1 => {
23109 if let Some(value) = self.source.take() {
23110 ::fidl_next::WireEnvelope::encode_value(
23111 value,
23112 preallocated.encoder,
23113 &mut out,
23114 )?;
23115 } else {
23116 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23117 }
23118 }
23119
23120 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
23121 }
23122 unsafe {
23123 preallocated.write_next(out.assume_init_ref());
23124 }
23125 }
23126
23127 ::fidl_next::WireTable::encode_len(table, max_ord);
23128
23129 Ok(())
23130 }
23131}
23132
23133unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferProtocol
23134where
23135 ___E: ::fidl_next::Encoder + ?Sized,
23136{
23137 #[inline]
23138 fn encode_ref(
23139 &self,
23140 encoder: &mut ___E,
23141 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23142 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
23143 ::fidl_next::munge!(let WireOfferProtocol { table } = out);
23144
23145 let max_ord = self.__max_ordinal();
23146
23147 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
23148 ::fidl_next::Wire::zero_padding(&mut out);
23149
23150 let mut preallocated =
23151 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
23152
23153 for i in 1..=max_ord {
23154 match i {
23155 7 => {
23156 if let Some(value) = &self.source_dictionary {
23157 ::fidl_next::WireEnvelope::encode_value(
23158 value,
23159 preallocated.encoder,
23160 &mut out,
23161 )?;
23162 } else {
23163 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23164 }
23165 }
23166
23167 6 => {
23168 if let Some(value) = &self.availability {
23169 ::fidl_next::WireEnvelope::encode_value(
23170 value,
23171 preallocated.encoder,
23172 &mut out,
23173 )?;
23174 } else {
23175 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23176 }
23177 }
23178
23179 5 => {
23180 if let Some(value) = &self.dependency_type {
23181 ::fidl_next::WireEnvelope::encode_value(
23182 value,
23183 preallocated.encoder,
23184 &mut out,
23185 )?;
23186 } else {
23187 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23188 }
23189 }
23190
23191 4 => {
23192 if let Some(value) = &self.target_name {
23193 ::fidl_next::WireEnvelope::encode_value(
23194 value,
23195 preallocated.encoder,
23196 &mut out,
23197 )?;
23198 } else {
23199 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23200 }
23201 }
23202
23203 3 => {
23204 if let Some(value) = &self.target {
23205 ::fidl_next::WireEnvelope::encode_value(
23206 value,
23207 preallocated.encoder,
23208 &mut out,
23209 )?;
23210 } else {
23211 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23212 }
23213 }
23214
23215 2 => {
23216 if let Some(value) = &self.source_name {
23217 ::fidl_next::WireEnvelope::encode_value(
23218 value,
23219 preallocated.encoder,
23220 &mut out,
23221 )?;
23222 } else {
23223 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23224 }
23225 }
23226
23227 1 => {
23228 if let Some(value) = &self.source {
23229 ::fidl_next::WireEnvelope::encode_value(
23230 value,
23231 preallocated.encoder,
23232 &mut out,
23233 )?;
23234 } else {
23235 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23236 }
23237 }
23238
23239 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
23240 }
23241 unsafe {
23242 preallocated.write_next(out.assume_init_ref());
23243 }
23244 }
23245
23246 ::fidl_next::WireTable::encode_len(table, max_ord);
23247
23248 Ok(())
23249 }
23250}
23251
23252impl<'de> ::fidl_next::FromWire<WireOfferProtocol<'de>> for OfferProtocol {
23253 #[inline]
23254 fn from_wire(wire_: WireOfferProtocol<'de>) -> Self {
23255 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
23256
23257 let source = wire_.table.get(1);
23258
23259 let source_name = wire_.table.get(2);
23260
23261 let target = wire_.table.get(3);
23262
23263 let target_name = wire_.table.get(4);
23264
23265 let dependency_type = wire_.table.get(5);
23266
23267 let availability = wire_.table.get(6);
23268
23269 let source_dictionary = wire_.table.get(7);
23270
23271 Self {
23272 source: source.map(|envelope| {
23273 ::fidl_next::FromWire::from_wire(unsafe {
23274 envelope.read_unchecked::<crate::WireRef<'de>>()
23275 })
23276 }),
23277
23278 source_name: source_name.map(|envelope| {
23279 ::fidl_next::FromWire::from_wire(unsafe {
23280 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
23281 })
23282 }),
23283
23284 target: target.map(|envelope| {
23285 ::fidl_next::FromWire::from_wire(unsafe {
23286 envelope.read_unchecked::<crate::WireRef<'de>>()
23287 })
23288 }),
23289
23290 target_name: target_name.map(|envelope| {
23291 ::fidl_next::FromWire::from_wire(unsafe {
23292 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
23293 })
23294 }),
23295
23296 dependency_type: dependency_type.map(|envelope| {
23297 ::fidl_next::FromWire::from_wire(unsafe {
23298 envelope.read_unchecked::<crate::WireDependencyType>()
23299 })
23300 }),
23301
23302 availability: availability.map(|envelope| {
23303 ::fidl_next::FromWire::from_wire(unsafe {
23304 envelope.read_unchecked::<crate::WireAvailability>()
23305 })
23306 }),
23307
23308 source_dictionary: source_dictionary.map(|envelope| {
23309 ::fidl_next::FromWire::from_wire(unsafe {
23310 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
23311 })
23312 }),
23313 }
23314 }
23315}
23316
23317impl<'de> ::fidl_next::IntoNatural for WireOfferProtocol<'de> {
23318 type Natural = OfferProtocol;
23319}
23320
23321impl<'de> ::fidl_next::FromWireRef<WireOfferProtocol<'de>> for OfferProtocol {
23322 #[inline]
23323 fn from_wire_ref(wire: &WireOfferProtocol<'de>) -> Self {
23324 Self {
23325 source: wire.table.get(1).map(|envelope| {
23326 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23327 envelope.deref_unchecked::<crate::WireRef<'de>>()
23328 })
23329 }),
23330
23331 source_name: wire.table.get(2).map(|envelope| {
23332 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23333 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
23334 })
23335 }),
23336
23337 target: wire.table.get(3).map(|envelope| {
23338 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23339 envelope.deref_unchecked::<crate::WireRef<'de>>()
23340 })
23341 }),
23342
23343 target_name: wire.table.get(4).map(|envelope| {
23344 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23345 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
23346 })
23347 }),
23348
23349 dependency_type: wire.table.get(5).map(|envelope| {
23350 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23351 envelope.deref_unchecked::<crate::WireDependencyType>()
23352 })
23353 }),
23354
23355 availability: wire.table.get(6).map(|envelope| {
23356 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23357 envelope.deref_unchecked::<crate::WireAvailability>()
23358 })
23359 }),
23360
23361 source_dictionary: wire.table.get(7).map(|envelope| {
23362 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
23363 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
23364 })
23365 }),
23366 }
23367 }
23368}
23369
23370#[repr(C)]
23372pub struct WireOfferProtocol<'de> {
23373 table: ::fidl_next::WireTable<'de>,
23374}
23375
23376impl<'de> Drop for WireOfferProtocol<'de> {
23377 fn drop(&mut self) {
23378 let _ = self
23379 .table
23380 .get(1)
23381 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
23382
23383 let _ = self
23384 .table
23385 .get(2)
23386 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
23387
23388 let _ = self
23389 .table
23390 .get(3)
23391 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
23392
23393 let _ = self
23394 .table
23395 .get(4)
23396 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
23397
23398 let _ = self
23399 .table
23400 .get(5)
23401 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDependencyType>() });
23402
23403 let _ = self
23404 .table
23405 .get(6)
23406 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
23407
23408 let _ = self
23409 .table
23410 .get(7)
23411 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
23412 }
23413}
23414
23415unsafe impl ::fidl_next::Wire for WireOfferProtocol<'static> {
23416 type Decoded<'de> = WireOfferProtocol<'de>;
23417
23418 #[inline]
23419 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23420 ::fidl_next::munge!(let Self { table } = out);
23421 ::fidl_next::WireTable::zero_padding(table);
23422 }
23423}
23424
23425unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferProtocol<'static>
23426where
23427 ___D: ::fidl_next::Decoder + ?Sized,
23428{
23429 fn decode(
23430 slot: ::fidl_next::Slot<'_, Self>,
23431 decoder: &mut ___D,
23432 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23433 ::fidl_next::munge!(let Self { table } = slot);
23434
23435 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
23436 match ordinal {
23437 0 => unsafe { ::core::hint::unreachable_unchecked() },
23438
23439 1 => {
23440 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
23441 slot.as_mut(),
23442 decoder,
23443 )?;
23444
23445 Ok(())
23446 }
23447
23448 2 => {
23449 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
23450 slot.as_mut(),
23451 decoder,
23452 )?;
23453
23454 let value = unsafe {
23455 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
23456 };
23457
23458 if value.len() > 100 {
23459 return Err(::fidl_next::DecodeError::VectorTooLong {
23460 size: value.len() as u64,
23461 limit: 100,
23462 });
23463 }
23464
23465 Ok(())
23466 }
23467
23468 3 => {
23469 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
23470 slot.as_mut(),
23471 decoder,
23472 )?;
23473
23474 Ok(())
23475 }
23476
23477 4 => {
23478 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
23479 slot.as_mut(),
23480 decoder,
23481 )?;
23482
23483 let value = unsafe {
23484 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
23485 };
23486
23487 if value.len() > 100 {
23488 return Err(::fidl_next::DecodeError::VectorTooLong {
23489 size: value.len() as u64,
23490 limit: 100,
23491 });
23492 }
23493
23494 Ok(())
23495 }
23496
23497 5 => {
23498 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
23499 slot.as_mut(),
23500 decoder,
23501 )?;
23502
23503 Ok(())
23504 }
23505
23506 6 => {
23507 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
23508 slot.as_mut(),
23509 decoder,
23510 )?;
23511
23512 Ok(())
23513 }
23514
23515 7 => {
23516 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
23517 slot.as_mut(),
23518 decoder,
23519 )?;
23520
23521 let value = unsafe {
23522 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
23523 };
23524
23525 if value.len() > 1024 {
23526 return Err(::fidl_next::DecodeError::VectorTooLong {
23527 size: value.len() as u64,
23528 limit: 1024,
23529 });
23530 }
23531
23532 Ok(())
23533 }
23534
23535 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
23536 }
23537 })
23538 }
23539}
23540
23541impl<'de> WireOfferProtocol<'de> {
23542 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
23543 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
23544 }
23545
23546 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
23547 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
23548 }
23549
23550 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
23551 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
23552 }
23553
23554 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
23555 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
23556 }
23557
23558 pub fn dependency_type(&self) -> ::core::option::Option<&crate::WireDependencyType> {
23559 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
23560 }
23561
23562 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
23563 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
23564 }
23565
23566 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
23567 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
23568 }
23569}
23570
23571impl<'de> ::core::fmt::Debug for WireOfferProtocol<'de> {
23572 fn fmt(
23573 &self,
23574 f: &mut ::core::fmt::Formatter<'_>,
23575 ) -> ::core::result::Result<(), ::core::fmt::Error> {
23576 f.debug_struct("OfferProtocol")
23577 .field("source", &self.source())
23578 .field("source_name", &self.source_name())
23579 .field("target", &self.target())
23580 .field("target_name", &self.target_name())
23581 .field("dependency_type", &self.dependency_type())
23582 .field("availability", &self.availability())
23583 .field("source_dictionary", &self.source_dictionary())
23584 .finish()
23585 }
23586}
23587
23588#[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"]
23589#[derive(PartialEq, Clone, Debug, Default)]
23590pub struct OfferDirectory {
23591 pub source: ::core::option::Option<crate::Ref>,
23592
23593 pub source_name: ::core::option::Option<::std::string::String>,
23594
23595 pub target: ::core::option::Option<crate::Ref>,
23596
23597 pub target_name: ::core::option::Option<::std::string::String>,
23598
23599 pub rights: ::core::option::Option<::fidl_next_fuchsia_io::Operations>,
23600
23601 pub subdir: ::core::option::Option<::std::string::String>,
23602
23603 pub dependency_type: ::core::option::Option<crate::DependencyType>,
23604
23605 pub availability: ::core::option::Option<crate::Availability>,
23606
23607 pub source_dictionary: ::core::option::Option<::std::string::String>,
23608}
23609
23610impl OfferDirectory {
23611 fn __max_ordinal(&self) -> usize {
23612 if self.source_dictionary.is_some() {
23613 return 9;
23614 }
23615
23616 if self.availability.is_some() {
23617 return 8;
23618 }
23619
23620 if self.dependency_type.is_some() {
23621 return 7;
23622 }
23623
23624 if self.subdir.is_some() {
23625 return 6;
23626 }
23627
23628 if self.rights.is_some() {
23629 return 5;
23630 }
23631
23632 if self.target_name.is_some() {
23633 return 4;
23634 }
23635
23636 if self.target.is_some() {
23637 return 3;
23638 }
23639
23640 if self.source_name.is_some() {
23641 return 2;
23642 }
23643
23644 if self.source.is_some() {
23645 return 1;
23646 }
23647
23648 0
23649 }
23650}
23651
23652impl ::fidl_next::Encodable for OfferDirectory {
23653 type Encoded = WireOfferDirectory<'static>;
23654}
23655
23656unsafe impl<___E> ::fidl_next::Encode<___E> for OfferDirectory
23657where
23658 ___E: ::fidl_next::Encoder + ?Sized,
23659{
23660 #[inline]
23661 fn encode(
23662 mut self,
23663 encoder: &mut ___E,
23664 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23665 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
23666 ::fidl_next::munge!(let WireOfferDirectory { table } = out);
23667
23668 let max_ord = self.__max_ordinal();
23669
23670 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
23671 ::fidl_next::Wire::zero_padding(&mut out);
23672
23673 let mut preallocated =
23674 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
23675
23676 for i in 1..=max_ord {
23677 match i {
23678 9 => {
23679 if let Some(value) = self.source_dictionary.take() {
23680 ::fidl_next::WireEnvelope::encode_value(
23681 value,
23682 preallocated.encoder,
23683 &mut out,
23684 )?;
23685 } else {
23686 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23687 }
23688 }
23689
23690 8 => {
23691 if let Some(value) = self.availability.take() {
23692 ::fidl_next::WireEnvelope::encode_value(
23693 value,
23694 preallocated.encoder,
23695 &mut out,
23696 )?;
23697 } else {
23698 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23699 }
23700 }
23701
23702 7 => {
23703 if let Some(value) = self.dependency_type.take() {
23704 ::fidl_next::WireEnvelope::encode_value(
23705 value,
23706 preallocated.encoder,
23707 &mut out,
23708 )?;
23709 } else {
23710 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23711 }
23712 }
23713
23714 6 => {
23715 if let Some(value) = self.subdir.take() {
23716 ::fidl_next::WireEnvelope::encode_value(
23717 value,
23718 preallocated.encoder,
23719 &mut out,
23720 )?;
23721 } else {
23722 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23723 }
23724 }
23725
23726 5 => {
23727 if let Some(value) = self.rights.take() {
23728 ::fidl_next::WireEnvelope::encode_value(
23729 value,
23730 preallocated.encoder,
23731 &mut out,
23732 )?;
23733 } else {
23734 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23735 }
23736 }
23737
23738 4 => {
23739 if let Some(value) = self.target_name.take() {
23740 ::fidl_next::WireEnvelope::encode_value(
23741 value,
23742 preallocated.encoder,
23743 &mut out,
23744 )?;
23745 } else {
23746 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23747 }
23748 }
23749
23750 3 => {
23751 if let Some(value) = self.target.take() {
23752 ::fidl_next::WireEnvelope::encode_value(
23753 value,
23754 preallocated.encoder,
23755 &mut out,
23756 )?;
23757 } else {
23758 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23759 }
23760 }
23761
23762 2 => {
23763 if let Some(value) = self.source_name.take() {
23764 ::fidl_next::WireEnvelope::encode_value(
23765 value,
23766 preallocated.encoder,
23767 &mut out,
23768 )?;
23769 } else {
23770 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23771 }
23772 }
23773
23774 1 => {
23775 if let Some(value) = self.source.take() {
23776 ::fidl_next::WireEnvelope::encode_value(
23777 value,
23778 preallocated.encoder,
23779 &mut out,
23780 )?;
23781 } else {
23782 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23783 }
23784 }
23785
23786 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
23787 }
23788 unsafe {
23789 preallocated.write_next(out.assume_init_ref());
23790 }
23791 }
23792
23793 ::fidl_next::WireTable::encode_len(table, max_ord);
23794
23795 Ok(())
23796 }
23797}
23798
23799unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferDirectory
23800where
23801 ___E: ::fidl_next::Encoder + ?Sized,
23802{
23803 #[inline]
23804 fn encode_ref(
23805 &self,
23806 encoder: &mut ___E,
23807 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
23808 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
23809 ::fidl_next::munge!(let WireOfferDirectory { table } = out);
23810
23811 let max_ord = self.__max_ordinal();
23812
23813 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
23814 ::fidl_next::Wire::zero_padding(&mut out);
23815
23816 let mut preallocated =
23817 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
23818
23819 for i in 1..=max_ord {
23820 match i {
23821 9 => {
23822 if let Some(value) = &self.source_dictionary {
23823 ::fidl_next::WireEnvelope::encode_value(
23824 value,
23825 preallocated.encoder,
23826 &mut out,
23827 )?;
23828 } else {
23829 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23830 }
23831 }
23832
23833 8 => {
23834 if let Some(value) = &self.availability {
23835 ::fidl_next::WireEnvelope::encode_value(
23836 value,
23837 preallocated.encoder,
23838 &mut out,
23839 )?;
23840 } else {
23841 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23842 }
23843 }
23844
23845 7 => {
23846 if let Some(value) = &self.dependency_type {
23847 ::fidl_next::WireEnvelope::encode_value(
23848 value,
23849 preallocated.encoder,
23850 &mut out,
23851 )?;
23852 } else {
23853 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23854 }
23855 }
23856
23857 6 => {
23858 if let Some(value) = &self.subdir {
23859 ::fidl_next::WireEnvelope::encode_value(
23860 value,
23861 preallocated.encoder,
23862 &mut out,
23863 )?;
23864 } else {
23865 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23866 }
23867 }
23868
23869 5 => {
23870 if let Some(value) = &self.rights {
23871 ::fidl_next::WireEnvelope::encode_value(
23872 value,
23873 preallocated.encoder,
23874 &mut out,
23875 )?;
23876 } else {
23877 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23878 }
23879 }
23880
23881 4 => {
23882 if let Some(value) = &self.target_name {
23883 ::fidl_next::WireEnvelope::encode_value(
23884 value,
23885 preallocated.encoder,
23886 &mut out,
23887 )?;
23888 } else {
23889 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23890 }
23891 }
23892
23893 3 => {
23894 if let Some(value) = &self.target {
23895 ::fidl_next::WireEnvelope::encode_value(
23896 value,
23897 preallocated.encoder,
23898 &mut out,
23899 )?;
23900 } else {
23901 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23902 }
23903 }
23904
23905 2 => {
23906 if let Some(value) = &self.source_name {
23907 ::fidl_next::WireEnvelope::encode_value(
23908 value,
23909 preallocated.encoder,
23910 &mut out,
23911 )?;
23912 } else {
23913 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23914 }
23915 }
23916
23917 1 => {
23918 if let Some(value) = &self.source {
23919 ::fidl_next::WireEnvelope::encode_value(
23920 value,
23921 preallocated.encoder,
23922 &mut out,
23923 )?;
23924 } else {
23925 ::fidl_next::WireEnvelope::encode_zero(&mut out)
23926 }
23927 }
23928
23929 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
23930 }
23931 unsafe {
23932 preallocated.write_next(out.assume_init_ref());
23933 }
23934 }
23935
23936 ::fidl_next::WireTable::encode_len(table, max_ord);
23937
23938 Ok(())
23939 }
23940}
23941
23942impl<'de> ::fidl_next::FromWire<WireOfferDirectory<'de>> for OfferDirectory {
23943 #[inline]
23944 fn from_wire(wire_: WireOfferDirectory<'de>) -> Self {
23945 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
23946
23947 let source = wire_.table.get(1);
23948
23949 let source_name = wire_.table.get(2);
23950
23951 let target = wire_.table.get(3);
23952
23953 let target_name = wire_.table.get(4);
23954
23955 let rights = wire_.table.get(5);
23956
23957 let subdir = wire_.table.get(6);
23958
23959 let dependency_type = wire_.table.get(7);
23960
23961 let availability = wire_.table.get(8);
23962
23963 let source_dictionary = wire_.table.get(9);
23964
23965 Self {
23966 source: source.map(|envelope| {
23967 ::fidl_next::FromWire::from_wire(unsafe {
23968 envelope.read_unchecked::<crate::WireRef<'de>>()
23969 })
23970 }),
23971
23972 source_name: source_name.map(|envelope| {
23973 ::fidl_next::FromWire::from_wire(unsafe {
23974 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
23975 })
23976 }),
23977
23978 target: target.map(|envelope| {
23979 ::fidl_next::FromWire::from_wire(unsafe {
23980 envelope.read_unchecked::<crate::WireRef<'de>>()
23981 })
23982 }),
23983
23984 target_name: target_name.map(|envelope| {
23985 ::fidl_next::FromWire::from_wire(unsafe {
23986 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
23987 })
23988 }),
23989
23990 rights: rights.map(|envelope| {
23991 ::fidl_next::FromWire::from_wire(unsafe {
23992 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
23993 })
23994 }),
23995
23996 subdir: subdir.map(|envelope| {
23997 ::fidl_next::FromWire::from_wire(unsafe {
23998 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
23999 })
24000 }),
24001
24002 dependency_type: dependency_type.map(|envelope| {
24003 ::fidl_next::FromWire::from_wire(unsafe {
24004 envelope.read_unchecked::<crate::WireDependencyType>()
24005 })
24006 }),
24007
24008 availability: availability.map(|envelope| {
24009 ::fidl_next::FromWire::from_wire(unsafe {
24010 envelope.read_unchecked::<crate::WireAvailability>()
24011 })
24012 }),
24013
24014 source_dictionary: source_dictionary.map(|envelope| {
24015 ::fidl_next::FromWire::from_wire(unsafe {
24016 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24017 })
24018 }),
24019 }
24020 }
24021}
24022
24023impl<'de> ::fidl_next::IntoNatural for WireOfferDirectory<'de> {
24024 type Natural = OfferDirectory;
24025}
24026
24027impl<'de> ::fidl_next::FromWireRef<WireOfferDirectory<'de>> for OfferDirectory {
24028 #[inline]
24029 fn from_wire_ref(wire: &WireOfferDirectory<'de>) -> Self {
24030 Self {
24031 source: wire.table.get(1).map(|envelope| {
24032 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24033 envelope.deref_unchecked::<crate::WireRef<'de>>()
24034 })
24035 }),
24036
24037 source_name: wire.table.get(2).map(|envelope| {
24038 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24039 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
24040 })
24041 }),
24042
24043 target: wire.table.get(3).map(|envelope| {
24044 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24045 envelope.deref_unchecked::<crate::WireRef<'de>>()
24046 })
24047 }),
24048
24049 target_name: wire.table.get(4).map(|envelope| {
24050 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24051 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
24052 })
24053 }),
24054
24055 rights: wire.table.get(5).map(|envelope| {
24056 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24057 envelope.deref_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
24058 })
24059 }),
24060
24061 subdir: wire.table.get(6).map(|envelope| {
24062 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24063 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
24064 })
24065 }),
24066
24067 dependency_type: wire.table.get(7).map(|envelope| {
24068 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24069 envelope.deref_unchecked::<crate::WireDependencyType>()
24070 })
24071 }),
24072
24073 availability: wire.table.get(8).map(|envelope| {
24074 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24075 envelope.deref_unchecked::<crate::WireAvailability>()
24076 })
24077 }),
24078
24079 source_dictionary: wire.table.get(9).map(|envelope| {
24080 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24081 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
24082 })
24083 }),
24084 }
24085 }
24086}
24087
24088#[repr(C)]
24090pub struct WireOfferDirectory<'de> {
24091 table: ::fidl_next::WireTable<'de>,
24092}
24093
24094impl<'de> Drop for WireOfferDirectory<'de> {
24095 fn drop(&mut self) {
24096 let _ = self
24097 .table
24098 .get(1)
24099 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
24100
24101 let _ = self
24102 .table
24103 .get(2)
24104 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
24105
24106 let _ = self
24107 .table
24108 .get(3)
24109 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
24110
24111 let _ = self
24112 .table
24113 .get(4)
24114 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
24115
24116 let _ = self.table.get(5).map(|envelope| unsafe {
24117 envelope.read_unchecked::<::fidl_next_fuchsia_io::WireOperations>()
24118 });
24119
24120 let _ = self
24121 .table
24122 .get(6)
24123 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
24124
24125 let _ = self
24126 .table
24127 .get(7)
24128 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDependencyType>() });
24129
24130 let _ = self
24131 .table
24132 .get(8)
24133 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
24134
24135 let _ = self
24136 .table
24137 .get(9)
24138 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
24139 }
24140}
24141
24142unsafe impl ::fidl_next::Wire for WireOfferDirectory<'static> {
24143 type Decoded<'de> = WireOfferDirectory<'de>;
24144
24145 #[inline]
24146 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24147 ::fidl_next::munge!(let Self { table } = out);
24148 ::fidl_next::WireTable::zero_padding(table);
24149 }
24150}
24151
24152unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferDirectory<'static>
24153where
24154 ___D: ::fidl_next::Decoder + ?Sized,
24155{
24156 fn decode(
24157 slot: ::fidl_next::Slot<'_, Self>,
24158 decoder: &mut ___D,
24159 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24160 ::fidl_next::munge!(let Self { table } = slot);
24161
24162 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
24163 match ordinal {
24164 0 => unsafe { ::core::hint::unreachable_unchecked() },
24165
24166 1 => {
24167 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
24168 slot.as_mut(),
24169 decoder,
24170 )?;
24171
24172 Ok(())
24173 }
24174
24175 2 => {
24176 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
24177 slot.as_mut(),
24178 decoder,
24179 )?;
24180
24181 let value = unsafe {
24182 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24183 };
24184
24185 if value.len() > 100 {
24186 return Err(::fidl_next::DecodeError::VectorTooLong {
24187 size: value.len() as u64,
24188 limit: 100,
24189 });
24190 }
24191
24192 Ok(())
24193 }
24194
24195 3 => {
24196 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
24197 slot.as_mut(),
24198 decoder,
24199 )?;
24200
24201 Ok(())
24202 }
24203
24204 4 => {
24205 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
24206 slot.as_mut(),
24207 decoder,
24208 )?;
24209
24210 let value = unsafe {
24211 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24212 };
24213
24214 if value.len() > 100 {
24215 return Err(::fidl_next::DecodeError::VectorTooLong {
24216 size: value.len() as u64,
24217 limit: 100,
24218 });
24219 }
24220
24221 Ok(())
24222 }
24223
24224 5 => {
24225 ::fidl_next::WireEnvelope::decode_as::<
24226 ___D,
24227 ::fidl_next_fuchsia_io::WireOperations,
24228 >(slot.as_mut(), decoder)?;
24229
24230 Ok(())
24231 }
24232
24233 6 => {
24234 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
24235 slot.as_mut(),
24236 decoder,
24237 )?;
24238
24239 let value = unsafe {
24240 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24241 };
24242
24243 if value.len() > 1024 {
24244 return Err(::fidl_next::DecodeError::VectorTooLong {
24245 size: value.len() as u64,
24246 limit: 1024,
24247 });
24248 }
24249
24250 Ok(())
24251 }
24252
24253 7 => {
24254 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
24255 slot.as_mut(),
24256 decoder,
24257 )?;
24258
24259 Ok(())
24260 }
24261
24262 8 => {
24263 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
24264 slot.as_mut(),
24265 decoder,
24266 )?;
24267
24268 Ok(())
24269 }
24270
24271 9 => {
24272 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
24273 slot.as_mut(),
24274 decoder,
24275 )?;
24276
24277 let value = unsafe {
24278 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24279 };
24280
24281 if value.len() > 1024 {
24282 return Err(::fidl_next::DecodeError::VectorTooLong {
24283 size: value.len() as u64,
24284 limit: 1024,
24285 });
24286 }
24287
24288 Ok(())
24289 }
24290
24291 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
24292 }
24293 })
24294 }
24295}
24296
24297impl<'de> WireOfferDirectory<'de> {
24298 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
24299 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
24300 }
24301
24302 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
24303 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
24304 }
24305
24306 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
24307 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
24308 }
24309
24310 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
24311 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
24312 }
24313
24314 pub fn rights(&self) -> ::core::option::Option<&::fidl_next_fuchsia_io::WireOperations> {
24315 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
24316 }
24317
24318 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
24319 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
24320 }
24321
24322 pub fn dependency_type(&self) -> ::core::option::Option<&crate::WireDependencyType> {
24323 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
24324 }
24325
24326 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
24327 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
24328 }
24329
24330 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
24331 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
24332 }
24333}
24334
24335impl<'de> ::core::fmt::Debug for WireOfferDirectory<'de> {
24336 fn fmt(
24337 &self,
24338 f: &mut ::core::fmt::Formatter<'_>,
24339 ) -> ::core::result::Result<(), ::core::fmt::Error> {
24340 f.debug_struct("OfferDirectory")
24341 .field("source", &self.source())
24342 .field("source_name", &self.source_name())
24343 .field("target", &self.target())
24344 .field("target_name", &self.target_name())
24345 .field("rights", &self.rights())
24346 .field("subdir", &self.subdir())
24347 .field("dependency_type", &self.dependency_type())
24348 .field("availability", &self.availability())
24349 .field("source_dictionary", &self.source_dictionary())
24350 .finish()
24351 }
24352}
24353
24354#[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"]
24355#[derive(PartialEq, Clone, Debug, Default)]
24356pub struct OfferStorage {
24357 pub source_name: ::core::option::Option<::std::string::String>,
24358
24359 pub source: ::core::option::Option<crate::Ref>,
24360
24361 pub target: ::core::option::Option<crate::Ref>,
24362
24363 pub target_name: ::core::option::Option<::std::string::String>,
24364
24365 pub availability: ::core::option::Option<crate::Availability>,
24366}
24367
24368impl OfferStorage {
24369 fn __max_ordinal(&self) -> usize {
24370 if self.availability.is_some() {
24371 return 5;
24372 }
24373
24374 if self.target_name.is_some() {
24375 return 4;
24376 }
24377
24378 if self.target.is_some() {
24379 return 3;
24380 }
24381
24382 if self.source.is_some() {
24383 return 2;
24384 }
24385
24386 if self.source_name.is_some() {
24387 return 1;
24388 }
24389
24390 0
24391 }
24392}
24393
24394impl ::fidl_next::Encodable for OfferStorage {
24395 type Encoded = WireOfferStorage<'static>;
24396}
24397
24398unsafe impl<___E> ::fidl_next::Encode<___E> for OfferStorage
24399where
24400 ___E: ::fidl_next::Encoder + ?Sized,
24401{
24402 #[inline]
24403 fn encode(
24404 mut self,
24405 encoder: &mut ___E,
24406 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24407 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24408 ::fidl_next::munge!(let WireOfferStorage { table } = out);
24409
24410 let max_ord = self.__max_ordinal();
24411
24412 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
24413 ::fidl_next::Wire::zero_padding(&mut out);
24414
24415 let mut preallocated =
24416 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
24417
24418 for i in 1..=max_ord {
24419 match i {
24420 5 => {
24421 if let Some(value) = self.availability.take() {
24422 ::fidl_next::WireEnvelope::encode_value(
24423 value,
24424 preallocated.encoder,
24425 &mut out,
24426 )?;
24427 } else {
24428 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24429 }
24430 }
24431
24432 4 => {
24433 if let Some(value) = self.target_name.take() {
24434 ::fidl_next::WireEnvelope::encode_value(
24435 value,
24436 preallocated.encoder,
24437 &mut out,
24438 )?;
24439 } else {
24440 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24441 }
24442 }
24443
24444 3 => {
24445 if let Some(value) = self.target.take() {
24446 ::fidl_next::WireEnvelope::encode_value(
24447 value,
24448 preallocated.encoder,
24449 &mut out,
24450 )?;
24451 } else {
24452 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24453 }
24454 }
24455
24456 2 => {
24457 if let Some(value) = self.source.take() {
24458 ::fidl_next::WireEnvelope::encode_value(
24459 value,
24460 preallocated.encoder,
24461 &mut out,
24462 )?;
24463 } else {
24464 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24465 }
24466 }
24467
24468 1 => {
24469 if let Some(value) = self.source_name.take() {
24470 ::fidl_next::WireEnvelope::encode_value(
24471 value,
24472 preallocated.encoder,
24473 &mut out,
24474 )?;
24475 } else {
24476 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24477 }
24478 }
24479
24480 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
24481 }
24482 unsafe {
24483 preallocated.write_next(out.assume_init_ref());
24484 }
24485 }
24486
24487 ::fidl_next::WireTable::encode_len(table, max_ord);
24488
24489 Ok(())
24490 }
24491}
24492
24493unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferStorage
24494where
24495 ___E: ::fidl_next::Encoder + ?Sized,
24496{
24497 #[inline]
24498 fn encode_ref(
24499 &self,
24500 encoder: &mut ___E,
24501 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24502 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24503 ::fidl_next::munge!(let WireOfferStorage { table } = out);
24504
24505 let max_ord = self.__max_ordinal();
24506
24507 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
24508 ::fidl_next::Wire::zero_padding(&mut out);
24509
24510 let mut preallocated =
24511 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
24512
24513 for i in 1..=max_ord {
24514 match i {
24515 5 => {
24516 if let Some(value) = &self.availability {
24517 ::fidl_next::WireEnvelope::encode_value(
24518 value,
24519 preallocated.encoder,
24520 &mut out,
24521 )?;
24522 } else {
24523 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24524 }
24525 }
24526
24527 4 => {
24528 if let Some(value) = &self.target_name {
24529 ::fidl_next::WireEnvelope::encode_value(
24530 value,
24531 preallocated.encoder,
24532 &mut out,
24533 )?;
24534 } else {
24535 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24536 }
24537 }
24538
24539 3 => {
24540 if let Some(value) = &self.target {
24541 ::fidl_next::WireEnvelope::encode_value(
24542 value,
24543 preallocated.encoder,
24544 &mut out,
24545 )?;
24546 } else {
24547 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24548 }
24549 }
24550
24551 2 => {
24552 if let Some(value) = &self.source {
24553 ::fidl_next::WireEnvelope::encode_value(
24554 value,
24555 preallocated.encoder,
24556 &mut out,
24557 )?;
24558 } else {
24559 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24560 }
24561 }
24562
24563 1 => {
24564 if let Some(value) = &self.source_name {
24565 ::fidl_next::WireEnvelope::encode_value(
24566 value,
24567 preallocated.encoder,
24568 &mut out,
24569 )?;
24570 } else {
24571 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24572 }
24573 }
24574
24575 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
24576 }
24577 unsafe {
24578 preallocated.write_next(out.assume_init_ref());
24579 }
24580 }
24581
24582 ::fidl_next::WireTable::encode_len(table, max_ord);
24583
24584 Ok(())
24585 }
24586}
24587
24588impl<'de> ::fidl_next::FromWire<WireOfferStorage<'de>> for OfferStorage {
24589 #[inline]
24590 fn from_wire(wire_: WireOfferStorage<'de>) -> Self {
24591 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
24592
24593 let source_name = wire_.table.get(1);
24594
24595 let source = wire_.table.get(2);
24596
24597 let target = wire_.table.get(3);
24598
24599 let target_name = wire_.table.get(4);
24600
24601 let availability = wire_.table.get(5);
24602
24603 Self {
24604 source_name: source_name.map(|envelope| {
24605 ::fidl_next::FromWire::from_wire(unsafe {
24606 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24607 })
24608 }),
24609
24610 source: source.map(|envelope| {
24611 ::fidl_next::FromWire::from_wire(unsafe {
24612 envelope.read_unchecked::<crate::WireRef<'de>>()
24613 })
24614 }),
24615
24616 target: target.map(|envelope| {
24617 ::fidl_next::FromWire::from_wire(unsafe {
24618 envelope.read_unchecked::<crate::WireRef<'de>>()
24619 })
24620 }),
24621
24622 target_name: target_name.map(|envelope| {
24623 ::fidl_next::FromWire::from_wire(unsafe {
24624 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24625 })
24626 }),
24627
24628 availability: availability.map(|envelope| {
24629 ::fidl_next::FromWire::from_wire(unsafe {
24630 envelope.read_unchecked::<crate::WireAvailability>()
24631 })
24632 }),
24633 }
24634 }
24635}
24636
24637impl<'de> ::fidl_next::IntoNatural for WireOfferStorage<'de> {
24638 type Natural = OfferStorage;
24639}
24640
24641impl<'de> ::fidl_next::FromWireRef<WireOfferStorage<'de>> for OfferStorage {
24642 #[inline]
24643 fn from_wire_ref(wire: &WireOfferStorage<'de>) -> Self {
24644 Self {
24645 source_name: wire.table.get(1).map(|envelope| {
24646 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24647 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
24648 })
24649 }),
24650
24651 source: wire.table.get(2).map(|envelope| {
24652 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24653 envelope.deref_unchecked::<crate::WireRef<'de>>()
24654 })
24655 }),
24656
24657 target: wire.table.get(3).map(|envelope| {
24658 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24659 envelope.deref_unchecked::<crate::WireRef<'de>>()
24660 })
24661 }),
24662
24663 target_name: wire.table.get(4).map(|envelope| {
24664 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24665 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
24666 })
24667 }),
24668
24669 availability: wire.table.get(5).map(|envelope| {
24670 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
24671 envelope.deref_unchecked::<crate::WireAvailability>()
24672 })
24673 }),
24674 }
24675 }
24676}
24677
24678#[repr(C)]
24680pub struct WireOfferStorage<'de> {
24681 table: ::fidl_next::WireTable<'de>,
24682}
24683
24684impl<'de> Drop for WireOfferStorage<'de> {
24685 fn drop(&mut self) {
24686 let _ = self
24687 .table
24688 .get(1)
24689 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
24690
24691 let _ = self
24692 .table
24693 .get(2)
24694 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
24695
24696 let _ = self
24697 .table
24698 .get(3)
24699 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
24700
24701 let _ = self
24702 .table
24703 .get(4)
24704 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
24705
24706 let _ = self
24707 .table
24708 .get(5)
24709 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
24710 }
24711}
24712
24713unsafe impl ::fidl_next::Wire for WireOfferStorage<'static> {
24714 type Decoded<'de> = WireOfferStorage<'de>;
24715
24716 #[inline]
24717 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24718 ::fidl_next::munge!(let Self { table } = out);
24719 ::fidl_next::WireTable::zero_padding(table);
24720 }
24721}
24722
24723unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferStorage<'static>
24724where
24725 ___D: ::fidl_next::Decoder + ?Sized,
24726{
24727 fn decode(
24728 slot: ::fidl_next::Slot<'_, Self>,
24729 decoder: &mut ___D,
24730 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24731 ::fidl_next::munge!(let Self { table } = slot);
24732
24733 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
24734 match ordinal {
24735 0 => unsafe { ::core::hint::unreachable_unchecked() },
24736
24737 1 => {
24738 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
24739 slot.as_mut(),
24740 decoder,
24741 )?;
24742
24743 let value = unsafe {
24744 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24745 };
24746
24747 if value.len() > 100 {
24748 return Err(::fidl_next::DecodeError::VectorTooLong {
24749 size: value.len() as u64,
24750 limit: 100,
24751 });
24752 }
24753
24754 Ok(())
24755 }
24756
24757 2 => {
24758 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
24759 slot.as_mut(),
24760 decoder,
24761 )?;
24762
24763 Ok(())
24764 }
24765
24766 3 => {
24767 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
24768 slot.as_mut(),
24769 decoder,
24770 )?;
24771
24772 Ok(())
24773 }
24774
24775 4 => {
24776 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
24777 slot.as_mut(),
24778 decoder,
24779 )?;
24780
24781 let value = unsafe {
24782 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24783 };
24784
24785 if value.len() > 100 {
24786 return Err(::fidl_next::DecodeError::VectorTooLong {
24787 size: value.len() as u64,
24788 limit: 100,
24789 });
24790 }
24791
24792 Ok(())
24793 }
24794
24795 5 => {
24796 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
24797 slot.as_mut(),
24798 decoder,
24799 )?;
24800
24801 Ok(())
24802 }
24803
24804 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
24805 }
24806 })
24807 }
24808}
24809
24810impl<'de> WireOfferStorage<'de> {
24811 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
24812 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
24813 }
24814
24815 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
24816 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
24817 }
24818
24819 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
24820 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
24821 }
24822
24823 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
24824 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
24825 }
24826
24827 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
24828 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
24829 }
24830}
24831
24832impl<'de> ::core::fmt::Debug for WireOfferStorage<'de> {
24833 fn fmt(
24834 &self,
24835 f: &mut ::core::fmt::Formatter<'_>,
24836 ) -> ::core::result::Result<(), ::core::fmt::Error> {
24837 f.debug_struct("OfferStorage")
24838 .field("source_name", &self.source_name())
24839 .field("source", &self.source())
24840 .field("target", &self.target())
24841 .field("target_name", &self.target_name())
24842 .field("availability", &self.availability())
24843 .finish()
24844 }
24845}
24846
24847#[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"]
24848#[derive(PartialEq, Clone, Debug, Default)]
24849pub struct OfferRunner {
24850 pub source: ::core::option::Option<crate::Ref>,
24851
24852 pub source_name: ::core::option::Option<::std::string::String>,
24853
24854 pub target: ::core::option::Option<crate::Ref>,
24855
24856 pub target_name: ::core::option::Option<::std::string::String>,
24857
24858 pub source_dictionary: ::core::option::Option<::std::string::String>,
24859}
24860
24861impl OfferRunner {
24862 fn __max_ordinal(&self) -> usize {
24863 if self.source_dictionary.is_some() {
24864 return 5;
24865 }
24866
24867 if self.target_name.is_some() {
24868 return 4;
24869 }
24870
24871 if self.target.is_some() {
24872 return 3;
24873 }
24874
24875 if self.source_name.is_some() {
24876 return 2;
24877 }
24878
24879 if self.source.is_some() {
24880 return 1;
24881 }
24882
24883 0
24884 }
24885}
24886
24887impl ::fidl_next::Encodable for OfferRunner {
24888 type Encoded = WireOfferRunner<'static>;
24889}
24890
24891unsafe impl<___E> ::fidl_next::Encode<___E> for OfferRunner
24892where
24893 ___E: ::fidl_next::Encoder + ?Sized,
24894{
24895 #[inline]
24896 fn encode(
24897 mut self,
24898 encoder: &mut ___E,
24899 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24900 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24901 ::fidl_next::munge!(let WireOfferRunner { table } = out);
24902
24903 let max_ord = self.__max_ordinal();
24904
24905 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
24906 ::fidl_next::Wire::zero_padding(&mut out);
24907
24908 let mut preallocated =
24909 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
24910
24911 for i in 1..=max_ord {
24912 match i {
24913 5 => {
24914 if let Some(value) = self.source_dictionary.take() {
24915 ::fidl_next::WireEnvelope::encode_value(
24916 value,
24917 preallocated.encoder,
24918 &mut out,
24919 )?;
24920 } else {
24921 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24922 }
24923 }
24924
24925 4 => {
24926 if let Some(value) = self.target_name.take() {
24927 ::fidl_next::WireEnvelope::encode_value(
24928 value,
24929 preallocated.encoder,
24930 &mut out,
24931 )?;
24932 } else {
24933 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24934 }
24935 }
24936
24937 3 => {
24938 if let Some(value) = self.target.take() {
24939 ::fidl_next::WireEnvelope::encode_value(
24940 value,
24941 preallocated.encoder,
24942 &mut out,
24943 )?;
24944 } else {
24945 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24946 }
24947 }
24948
24949 2 => {
24950 if let Some(value) = self.source_name.take() {
24951 ::fidl_next::WireEnvelope::encode_value(
24952 value,
24953 preallocated.encoder,
24954 &mut out,
24955 )?;
24956 } else {
24957 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24958 }
24959 }
24960
24961 1 => {
24962 if let Some(value) = self.source.take() {
24963 ::fidl_next::WireEnvelope::encode_value(
24964 value,
24965 preallocated.encoder,
24966 &mut out,
24967 )?;
24968 } else {
24969 ::fidl_next::WireEnvelope::encode_zero(&mut out)
24970 }
24971 }
24972
24973 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
24974 }
24975 unsafe {
24976 preallocated.write_next(out.assume_init_ref());
24977 }
24978 }
24979
24980 ::fidl_next::WireTable::encode_len(table, max_ord);
24981
24982 Ok(())
24983 }
24984}
24985
24986unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferRunner
24987where
24988 ___E: ::fidl_next::Encoder + ?Sized,
24989{
24990 #[inline]
24991 fn encode_ref(
24992 &self,
24993 encoder: &mut ___E,
24994 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
24995 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
24996 ::fidl_next::munge!(let WireOfferRunner { table } = out);
24997
24998 let max_ord = self.__max_ordinal();
24999
25000 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
25001 ::fidl_next::Wire::zero_padding(&mut out);
25002
25003 let mut preallocated =
25004 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
25005
25006 for i in 1..=max_ord {
25007 match i {
25008 5 => {
25009 if let Some(value) = &self.source_dictionary {
25010 ::fidl_next::WireEnvelope::encode_value(
25011 value,
25012 preallocated.encoder,
25013 &mut out,
25014 )?;
25015 } else {
25016 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25017 }
25018 }
25019
25020 4 => {
25021 if let Some(value) = &self.target_name {
25022 ::fidl_next::WireEnvelope::encode_value(
25023 value,
25024 preallocated.encoder,
25025 &mut out,
25026 )?;
25027 } else {
25028 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25029 }
25030 }
25031
25032 3 => {
25033 if let Some(value) = &self.target {
25034 ::fidl_next::WireEnvelope::encode_value(
25035 value,
25036 preallocated.encoder,
25037 &mut out,
25038 )?;
25039 } else {
25040 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25041 }
25042 }
25043
25044 2 => {
25045 if let Some(value) = &self.source_name {
25046 ::fidl_next::WireEnvelope::encode_value(
25047 value,
25048 preallocated.encoder,
25049 &mut out,
25050 )?;
25051 } else {
25052 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25053 }
25054 }
25055
25056 1 => {
25057 if let Some(value) = &self.source {
25058 ::fidl_next::WireEnvelope::encode_value(
25059 value,
25060 preallocated.encoder,
25061 &mut out,
25062 )?;
25063 } else {
25064 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25065 }
25066 }
25067
25068 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
25069 }
25070 unsafe {
25071 preallocated.write_next(out.assume_init_ref());
25072 }
25073 }
25074
25075 ::fidl_next::WireTable::encode_len(table, max_ord);
25076
25077 Ok(())
25078 }
25079}
25080
25081impl<'de> ::fidl_next::FromWire<WireOfferRunner<'de>> for OfferRunner {
25082 #[inline]
25083 fn from_wire(wire_: WireOfferRunner<'de>) -> Self {
25084 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
25085
25086 let source = wire_.table.get(1);
25087
25088 let source_name = wire_.table.get(2);
25089
25090 let target = wire_.table.get(3);
25091
25092 let target_name = wire_.table.get(4);
25093
25094 let source_dictionary = wire_.table.get(5);
25095
25096 Self {
25097 source: source.map(|envelope| {
25098 ::fidl_next::FromWire::from_wire(unsafe {
25099 envelope.read_unchecked::<crate::WireRef<'de>>()
25100 })
25101 }),
25102
25103 source_name: source_name.map(|envelope| {
25104 ::fidl_next::FromWire::from_wire(unsafe {
25105 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25106 })
25107 }),
25108
25109 target: target.map(|envelope| {
25110 ::fidl_next::FromWire::from_wire(unsafe {
25111 envelope.read_unchecked::<crate::WireRef<'de>>()
25112 })
25113 }),
25114
25115 target_name: target_name.map(|envelope| {
25116 ::fidl_next::FromWire::from_wire(unsafe {
25117 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25118 })
25119 }),
25120
25121 source_dictionary: source_dictionary.map(|envelope| {
25122 ::fidl_next::FromWire::from_wire(unsafe {
25123 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25124 })
25125 }),
25126 }
25127 }
25128}
25129
25130impl<'de> ::fidl_next::IntoNatural for WireOfferRunner<'de> {
25131 type Natural = OfferRunner;
25132}
25133
25134impl<'de> ::fidl_next::FromWireRef<WireOfferRunner<'de>> for OfferRunner {
25135 #[inline]
25136 fn from_wire_ref(wire: &WireOfferRunner<'de>) -> Self {
25137 Self {
25138 source: wire.table.get(1).map(|envelope| {
25139 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25140 envelope.deref_unchecked::<crate::WireRef<'de>>()
25141 })
25142 }),
25143
25144 source_name: wire.table.get(2).map(|envelope| {
25145 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25146 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
25147 })
25148 }),
25149
25150 target: wire.table.get(3).map(|envelope| {
25151 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25152 envelope.deref_unchecked::<crate::WireRef<'de>>()
25153 })
25154 }),
25155
25156 target_name: wire.table.get(4).map(|envelope| {
25157 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25158 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
25159 })
25160 }),
25161
25162 source_dictionary: wire.table.get(5).map(|envelope| {
25163 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25164 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
25165 })
25166 }),
25167 }
25168 }
25169}
25170
25171#[repr(C)]
25173pub struct WireOfferRunner<'de> {
25174 table: ::fidl_next::WireTable<'de>,
25175}
25176
25177impl<'de> Drop for WireOfferRunner<'de> {
25178 fn drop(&mut self) {
25179 let _ = self
25180 .table
25181 .get(1)
25182 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
25183
25184 let _ = self
25185 .table
25186 .get(2)
25187 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
25188
25189 let _ = self
25190 .table
25191 .get(3)
25192 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
25193
25194 let _ = self
25195 .table
25196 .get(4)
25197 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
25198
25199 let _ = self
25200 .table
25201 .get(5)
25202 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
25203 }
25204}
25205
25206unsafe impl ::fidl_next::Wire for WireOfferRunner<'static> {
25207 type Decoded<'de> = WireOfferRunner<'de>;
25208
25209 #[inline]
25210 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25211 ::fidl_next::munge!(let Self { table } = out);
25212 ::fidl_next::WireTable::zero_padding(table);
25213 }
25214}
25215
25216unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferRunner<'static>
25217where
25218 ___D: ::fidl_next::Decoder + ?Sized,
25219{
25220 fn decode(
25221 slot: ::fidl_next::Slot<'_, Self>,
25222 decoder: &mut ___D,
25223 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25224 ::fidl_next::munge!(let Self { table } = slot);
25225
25226 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
25227 match ordinal {
25228 0 => unsafe { ::core::hint::unreachable_unchecked() },
25229
25230 1 => {
25231 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
25232 slot.as_mut(),
25233 decoder,
25234 )?;
25235
25236 Ok(())
25237 }
25238
25239 2 => {
25240 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
25241 slot.as_mut(),
25242 decoder,
25243 )?;
25244
25245 let value = unsafe {
25246 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
25247 };
25248
25249 if value.len() > 100 {
25250 return Err(::fidl_next::DecodeError::VectorTooLong {
25251 size: value.len() as u64,
25252 limit: 100,
25253 });
25254 }
25255
25256 Ok(())
25257 }
25258
25259 3 => {
25260 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
25261 slot.as_mut(),
25262 decoder,
25263 )?;
25264
25265 Ok(())
25266 }
25267
25268 4 => {
25269 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
25270 slot.as_mut(),
25271 decoder,
25272 )?;
25273
25274 let value = unsafe {
25275 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
25276 };
25277
25278 if value.len() > 100 {
25279 return Err(::fidl_next::DecodeError::VectorTooLong {
25280 size: value.len() as u64,
25281 limit: 100,
25282 });
25283 }
25284
25285 Ok(())
25286 }
25287
25288 5 => {
25289 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
25290 slot.as_mut(),
25291 decoder,
25292 )?;
25293
25294 let value = unsafe {
25295 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
25296 };
25297
25298 if value.len() > 1024 {
25299 return Err(::fidl_next::DecodeError::VectorTooLong {
25300 size: value.len() as u64,
25301 limit: 1024,
25302 });
25303 }
25304
25305 Ok(())
25306 }
25307
25308 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
25309 }
25310 })
25311 }
25312}
25313
25314impl<'de> WireOfferRunner<'de> {
25315 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
25316 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
25317 }
25318
25319 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
25320 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
25321 }
25322
25323 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
25324 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
25325 }
25326
25327 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
25328 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
25329 }
25330
25331 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
25332 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
25333 }
25334}
25335
25336impl<'de> ::core::fmt::Debug for WireOfferRunner<'de> {
25337 fn fmt(
25338 &self,
25339 f: &mut ::core::fmt::Formatter<'_>,
25340 ) -> ::core::result::Result<(), ::core::fmt::Error> {
25341 f.debug_struct("OfferRunner")
25342 .field("source", &self.source())
25343 .field("source_name", &self.source_name())
25344 .field("target", &self.target())
25345 .field("target_name", &self.target_name())
25346 .field("source_dictionary", &self.source_dictionary())
25347 .finish()
25348 }
25349}
25350
25351#[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"]
25352#[derive(PartialEq, Clone, Debug, Default)]
25353pub struct OfferResolver {
25354 pub source: ::core::option::Option<crate::Ref>,
25355
25356 pub source_name: ::core::option::Option<::std::string::String>,
25357
25358 pub target: ::core::option::Option<crate::Ref>,
25359
25360 pub target_name: ::core::option::Option<::std::string::String>,
25361
25362 pub source_dictionary: ::core::option::Option<::std::string::String>,
25363}
25364
25365impl OfferResolver {
25366 fn __max_ordinal(&self) -> usize {
25367 if self.source_dictionary.is_some() {
25368 return 5;
25369 }
25370
25371 if self.target_name.is_some() {
25372 return 4;
25373 }
25374
25375 if self.target.is_some() {
25376 return 3;
25377 }
25378
25379 if self.source_name.is_some() {
25380 return 2;
25381 }
25382
25383 if self.source.is_some() {
25384 return 1;
25385 }
25386
25387 0
25388 }
25389}
25390
25391impl ::fidl_next::Encodable for OfferResolver {
25392 type Encoded = WireOfferResolver<'static>;
25393}
25394
25395unsafe impl<___E> ::fidl_next::Encode<___E> for OfferResolver
25396where
25397 ___E: ::fidl_next::Encoder + ?Sized,
25398{
25399 #[inline]
25400 fn encode(
25401 mut self,
25402 encoder: &mut ___E,
25403 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25404 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
25405 ::fidl_next::munge!(let WireOfferResolver { table } = out);
25406
25407 let max_ord = self.__max_ordinal();
25408
25409 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
25410 ::fidl_next::Wire::zero_padding(&mut out);
25411
25412 let mut preallocated =
25413 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
25414
25415 for i in 1..=max_ord {
25416 match i {
25417 5 => {
25418 if let Some(value) = self.source_dictionary.take() {
25419 ::fidl_next::WireEnvelope::encode_value(
25420 value,
25421 preallocated.encoder,
25422 &mut out,
25423 )?;
25424 } else {
25425 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25426 }
25427 }
25428
25429 4 => {
25430 if let Some(value) = self.target_name.take() {
25431 ::fidl_next::WireEnvelope::encode_value(
25432 value,
25433 preallocated.encoder,
25434 &mut out,
25435 )?;
25436 } else {
25437 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25438 }
25439 }
25440
25441 3 => {
25442 if let Some(value) = self.target.take() {
25443 ::fidl_next::WireEnvelope::encode_value(
25444 value,
25445 preallocated.encoder,
25446 &mut out,
25447 )?;
25448 } else {
25449 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25450 }
25451 }
25452
25453 2 => {
25454 if let Some(value) = self.source_name.take() {
25455 ::fidl_next::WireEnvelope::encode_value(
25456 value,
25457 preallocated.encoder,
25458 &mut out,
25459 )?;
25460 } else {
25461 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25462 }
25463 }
25464
25465 1 => {
25466 if let Some(value) = self.source.take() {
25467 ::fidl_next::WireEnvelope::encode_value(
25468 value,
25469 preallocated.encoder,
25470 &mut out,
25471 )?;
25472 } else {
25473 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25474 }
25475 }
25476
25477 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
25478 }
25479 unsafe {
25480 preallocated.write_next(out.assume_init_ref());
25481 }
25482 }
25483
25484 ::fidl_next::WireTable::encode_len(table, max_ord);
25485
25486 Ok(())
25487 }
25488}
25489
25490unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferResolver
25491where
25492 ___E: ::fidl_next::Encoder + ?Sized,
25493{
25494 #[inline]
25495 fn encode_ref(
25496 &self,
25497 encoder: &mut ___E,
25498 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25499 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
25500 ::fidl_next::munge!(let WireOfferResolver { table } = out);
25501
25502 let max_ord = self.__max_ordinal();
25503
25504 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
25505 ::fidl_next::Wire::zero_padding(&mut out);
25506
25507 let mut preallocated =
25508 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
25509
25510 for i in 1..=max_ord {
25511 match i {
25512 5 => {
25513 if let Some(value) = &self.source_dictionary {
25514 ::fidl_next::WireEnvelope::encode_value(
25515 value,
25516 preallocated.encoder,
25517 &mut out,
25518 )?;
25519 } else {
25520 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25521 }
25522 }
25523
25524 4 => {
25525 if let Some(value) = &self.target_name {
25526 ::fidl_next::WireEnvelope::encode_value(
25527 value,
25528 preallocated.encoder,
25529 &mut out,
25530 )?;
25531 } else {
25532 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25533 }
25534 }
25535
25536 3 => {
25537 if let Some(value) = &self.target {
25538 ::fidl_next::WireEnvelope::encode_value(
25539 value,
25540 preallocated.encoder,
25541 &mut out,
25542 )?;
25543 } else {
25544 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25545 }
25546 }
25547
25548 2 => {
25549 if let Some(value) = &self.source_name {
25550 ::fidl_next::WireEnvelope::encode_value(
25551 value,
25552 preallocated.encoder,
25553 &mut out,
25554 )?;
25555 } else {
25556 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25557 }
25558 }
25559
25560 1 => {
25561 if let Some(value) = &self.source {
25562 ::fidl_next::WireEnvelope::encode_value(
25563 value,
25564 preallocated.encoder,
25565 &mut out,
25566 )?;
25567 } else {
25568 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25569 }
25570 }
25571
25572 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
25573 }
25574 unsafe {
25575 preallocated.write_next(out.assume_init_ref());
25576 }
25577 }
25578
25579 ::fidl_next::WireTable::encode_len(table, max_ord);
25580
25581 Ok(())
25582 }
25583}
25584
25585impl<'de> ::fidl_next::FromWire<WireOfferResolver<'de>> for OfferResolver {
25586 #[inline]
25587 fn from_wire(wire_: WireOfferResolver<'de>) -> Self {
25588 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
25589
25590 let source = wire_.table.get(1);
25591
25592 let source_name = wire_.table.get(2);
25593
25594 let target = wire_.table.get(3);
25595
25596 let target_name = wire_.table.get(4);
25597
25598 let source_dictionary = wire_.table.get(5);
25599
25600 Self {
25601 source: source.map(|envelope| {
25602 ::fidl_next::FromWire::from_wire(unsafe {
25603 envelope.read_unchecked::<crate::WireRef<'de>>()
25604 })
25605 }),
25606
25607 source_name: source_name.map(|envelope| {
25608 ::fidl_next::FromWire::from_wire(unsafe {
25609 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25610 })
25611 }),
25612
25613 target: target.map(|envelope| {
25614 ::fidl_next::FromWire::from_wire(unsafe {
25615 envelope.read_unchecked::<crate::WireRef<'de>>()
25616 })
25617 }),
25618
25619 target_name: target_name.map(|envelope| {
25620 ::fidl_next::FromWire::from_wire(unsafe {
25621 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25622 })
25623 }),
25624
25625 source_dictionary: source_dictionary.map(|envelope| {
25626 ::fidl_next::FromWire::from_wire(unsafe {
25627 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25628 })
25629 }),
25630 }
25631 }
25632}
25633
25634impl<'de> ::fidl_next::IntoNatural for WireOfferResolver<'de> {
25635 type Natural = OfferResolver;
25636}
25637
25638impl<'de> ::fidl_next::FromWireRef<WireOfferResolver<'de>> for OfferResolver {
25639 #[inline]
25640 fn from_wire_ref(wire: &WireOfferResolver<'de>) -> Self {
25641 Self {
25642 source: wire.table.get(1).map(|envelope| {
25643 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25644 envelope.deref_unchecked::<crate::WireRef<'de>>()
25645 })
25646 }),
25647
25648 source_name: wire.table.get(2).map(|envelope| {
25649 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25650 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
25651 })
25652 }),
25653
25654 target: wire.table.get(3).map(|envelope| {
25655 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25656 envelope.deref_unchecked::<crate::WireRef<'de>>()
25657 })
25658 }),
25659
25660 target_name: wire.table.get(4).map(|envelope| {
25661 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25662 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
25663 })
25664 }),
25665
25666 source_dictionary: wire.table.get(5).map(|envelope| {
25667 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
25668 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
25669 })
25670 }),
25671 }
25672 }
25673}
25674
25675#[repr(C)]
25677pub struct WireOfferResolver<'de> {
25678 table: ::fidl_next::WireTable<'de>,
25679}
25680
25681impl<'de> Drop for WireOfferResolver<'de> {
25682 fn drop(&mut self) {
25683 let _ = self
25684 .table
25685 .get(1)
25686 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
25687
25688 let _ = self
25689 .table
25690 .get(2)
25691 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
25692
25693 let _ = self
25694 .table
25695 .get(3)
25696 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
25697
25698 let _ = self
25699 .table
25700 .get(4)
25701 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
25702
25703 let _ = self
25704 .table
25705 .get(5)
25706 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
25707 }
25708}
25709
25710unsafe impl ::fidl_next::Wire for WireOfferResolver<'static> {
25711 type Decoded<'de> = WireOfferResolver<'de>;
25712
25713 #[inline]
25714 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25715 ::fidl_next::munge!(let Self { table } = out);
25716 ::fidl_next::WireTable::zero_padding(table);
25717 }
25718}
25719
25720unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferResolver<'static>
25721where
25722 ___D: ::fidl_next::Decoder + ?Sized,
25723{
25724 fn decode(
25725 slot: ::fidl_next::Slot<'_, Self>,
25726 decoder: &mut ___D,
25727 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25728 ::fidl_next::munge!(let Self { table } = slot);
25729
25730 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
25731 match ordinal {
25732 0 => unsafe { ::core::hint::unreachable_unchecked() },
25733
25734 1 => {
25735 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
25736 slot.as_mut(),
25737 decoder,
25738 )?;
25739
25740 Ok(())
25741 }
25742
25743 2 => {
25744 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
25745 slot.as_mut(),
25746 decoder,
25747 )?;
25748
25749 let value = unsafe {
25750 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
25751 };
25752
25753 if value.len() > 100 {
25754 return Err(::fidl_next::DecodeError::VectorTooLong {
25755 size: value.len() as u64,
25756 limit: 100,
25757 });
25758 }
25759
25760 Ok(())
25761 }
25762
25763 3 => {
25764 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
25765 slot.as_mut(),
25766 decoder,
25767 )?;
25768
25769 Ok(())
25770 }
25771
25772 4 => {
25773 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
25774 slot.as_mut(),
25775 decoder,
25776 )?;
25777
25778 let value = unsafe {
25779 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
25780 };
25781
25782 if value.len() > 100 {
25783 return Err(::fidl_next::DecodeError::VectorTooLong {
25784 size: value.len() as u64,
25785 limit: 100,
25786 });
25787 }
25788
25789 Ok(())
25790 }
25791
25792 5 => {
25793 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
25794 slot.as_mut(),
25795 decoder,
25796 )?;
25797
25798 let value = unsafe {
25799 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
25800 };
25801
25802 if value.len() > 1024 {
25803 return Err(::fidl_next::DecodeError::VectorTooLong {
25804 size: value.len() as u64,
25805 limit: 1024,
25806 });
25807 }
25808
25809 Ok(())
25810 }
25811
25812 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
25813 }
25814 })
25815 }
25816}
25817
25818impl<'de> WireOfferResolver<'de> {
25819 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
25820 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
25821 }
25822
25823 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
25824 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
25825 }
25826
25827 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
25828 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
25829 }
25830
25831 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
25832 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
25833 }
25834
25835 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
25836 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
25837 }
25838}
25839
25840impl<'de> ::core::fmt::Debug for WireOfferResolver<'de> {
25841 fn fmt(
25842 &self,
25843 f: &mut ::core::fmt::Formatter<'_>,
25844 ) -> ::core::result::Result<(), ::core::fmt::Error> {
25845 f.debug_struct("OfferResolver")
25846 .field("source", &self.source())
25847 .field("source_name", &self.source_name())
25848 .field("target", &self.target())
25849 .field("target_name", &self.target_name())
25850 .field("source_dictionary", &self.source_dictionary())
25851 .finish()
25852 }
25853}
25854
25855#[doc = " Declares an event stream offered by a component.\n"]
25856#[derive(PartialEq, Clone, Debug, Default)]
25857pub struct OfferEventStream {
25858 pub source: ::core::option::Option<crate::Ref>,
25859
25860 pub source_name: ::core::option::Option<::std::string::String>,
25861
25862 pub scope: ::core::option::Option<::std::vec::Vec<crate::Ref>>,
25863
25864 pub target: ::core::option::Option<crate::Ref>,
25865
25866 pub target_name: ::core::option::Option<::std::string::String>,
25867
25868 pub availability: ::core::option::Option<crate::Availability>,
25869}
25870
25871impl OfferEventStream {
25872 fn __max_ordinal(&self) -> usize {
25873 if self.availability.is_some() {
25874 return 7;
25875 }
25876
25877 if self.target_name.is_some() {
25878 return 5;
25879 }
25880
25881 if self.target.is_some() {
25882 return 4;
25883 }
25884
25885 if self.scope.is_some() {
25886 return 3;
25887 }
25888
25889 if self.source_name.is_some() {
25890 return 2;
25891 }
25892
25893 if self.source.is_some() {
25894 return 1;
25895 }
25896
25897 0
25898 }
25899}
25900
25901impl ::fidl_next::Encodable for OfferEventStream {
25902 type Encoded = WireOfferEventStream<'static>;
25903}
25904
25905unsafe impl<___E> ::fidl_next::Encode<___E> for OfferEventStream
25906where
25907 ___E: ::fidl_next::Encoder + ?Sized,
25908{
25909 #[inline]
25910 fn encode(
25911 mut self,
25912 encoder: &mut ___E,
25913 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
25914 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
25915 ::fidl_next::munge!(let WireOfferEventStream { table } = out);
25916
25917 let max_ord = self.__max_ordinal();
25918
25919 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
25920 ::fidl_next::Wire::zero_padding(&mut out);
25921
25922 let mut preallocated =
25923 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
25924
25925 for i in 1..=max_ord {
25926 match i {
25927 7 => {
25928 if let Some(value) = self.availability.take() {
25929 ::fidl_next::WireEnvelope::encode_value(
25930 value,
25931 preallocated.encoder,
25932 &mut out,
25933 )?;
25934 } else {
25935 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25936 }
25937 }
25938
25939 5 => {
25940 if let Some(value) = self.target_name.take() {
25941 ::fidl_next::WireEnvelope::encode_value(
25942 value,
25943 preallocated.encoder,
25944 &mut out,
25945 )?;
25946 } else {
25947 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25948 }
25949 }
25950
25951 4 => {
25952 if let Some(value) = self.target.take() {
25953 ::fidl_next::WireEnvelope::encode_value(
25954 value,
25955 preallocated.encoder,
25956 &mut out,
25957 )?;
25958 } else {
25959 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25960 }
25961 }
25962
25963 3 => {
25964 if let Some(value) = self.scope.take() {
25965 ::fidl_next::WireEnvelope::encode_value(
25966 value,
25967 preallocated.encoder,
25968 &mut out,
25969 )?;
25970 } else {
25971 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25972 }
25973 }
25974
25975 2 => {
25976 if let Some(value) = self.source_name.take() {
25977 ::fidl_next::WireEnvelope::encode_value(
25978 value,
25979 preallocated.encoder,
25980 &mut out,
25981 )?;
25982 } else {
25983 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25984 }
25985 }
25986
25987 1 => {
25988 if let Some(value) = self.source.take() {
25989 ::fidl_next::WireEnvelope::encode_value(
25990 value,
25991 preallocated.encoder,
25992 &mut out,
25993 )?;
25994 } else {
25995 ::fidl_next::WireEnvelope::encode_zero(&mut out)
25996 }
25997 }
25998
25999 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
26000 }
26001 unsafe {
26002 preallocated.write_next(out.assume_init_ref());
26003 }
26004 }
26005
26006 ::fidl_next::WireTable::encode_len(table, max_ord);
26007
26008 Ok(())
26009 }
26010}
26011
26012unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferEventStream
26013where
26014 ___E: ::fidl_next::Encoder + ?Sized,
26015{
26016 #[inline]
26017 fn encode_ref(
26018 &self,
26019 encoder: &mut ___E,
26020 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26021 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
26022 ::fidl_next::munge!(let WireOfferEventStream { table } = out);
26023
26024 let max_ord = self.__max_ordinal();
26025
26026 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
26027 ::fidl_next::Wire::zero_padding(&mut out);
26028
26029 let mut preallocated =
26030 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
26031
26032 for i in 1..=max_ord {
26033 match i {
26034 7 => {
26035 if let Some(value) = &self.availability {
26036 ::fidl_next::WireEnvelope::encode_value(
26037 value,
26038 preallocated.encoder,
26039 &mut out,
26040 )?;
26041 } else {
26042 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26043 }
26044 }
26045
26046 5 => {
26047 if let Some(value) = &self.target_name {
26048 ::fidl_next::WireEnvelope::encode_value(
26049 value,
26050 preallocated.encoder,
26051 &mut out,
26052 )?;
26053 } else {
26054 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26055 }
26056 }
26057
26058 4 => {
26059 if let Some(value) = &self.target {
26060 ::fidl_next::WireEnvelope::encode_value(
26061 value,
26062 preallocated.encoder,
26063 &mut out,
26064 )?;
26065 } else {
26066 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26067 }
26068 }
26069
26070 3 => {
26071 if let Some(value) = &self.scope {
26072 ::fidl_next::WireEnvelope::encode_value(
26073 value,
26074 preallocated.encoder,
26075 &mut out,
26076 )?;
26077 } else {
26078 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26079 }
26080 }
26081
26082 2 => {
26083 if let Some(value) = &self.source_name {
26084 ::fidl_next::WireEnvelope::encode_value(
26085 value,
26086 preallocated.encoder,
26087 &mut out,
26088 )?;
26089 } else {
26090 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26091 }
26092 }
26093
26094 1 => {
26095 if let Some(value) = &self.source {
26096 ::fidl_next::WireEnvelope::encode_value(
26097 value,
26098 preallocated.encoder,
26099 &mut out,
26100 )?;
26101 } else {
26102 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26103 }
26104 }
26105
26106 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
26107 }
26108 unsafe {
26109 preallocated.write_next(out.assume_init_ref());
26110 }
26111 }
26112
26113 ::fidl_next::WireTable::encode_len(table, max_ord);
26114
26115 Ok(())
26116 }
26117}
26118
26119impl<'de> ::fidl_next::FromWire<WireOfferEventStream<'de>> for OfferEventStream {
26120 #[inline]
26121 fn from_wire(wire_: WireOfferEventStream<'de>) -> Self {
26122 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
26123
26124 let source = wire_.table.get(1);
26125
26126 let source_name = wire_.table.get(2);
26127
26128 let scope = wire_.table.get(3);
26129
26130 let target = wire_.table.get(4);
26131
26132 let target_name = wire_.table.get(5);
26133
26134 let availability = wire_.table.get(7);
26135
26136 Self {
26137 source: source.map(|envelope| {
26138 ::fidl_next::FromWire::from_wire(unsafe {
26139 envelope.read_unchecked::<crate::WireRef<'de>>()
26140 })
26141 }),
26142
26143 source_name: source_name.map(|envelope| {
26144 ::fidl_next::FromWire::from_wire(unsafe {
26145 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26146 })
26147 }),
26148
26149 scope: scope.map(|envelope| {
26150 ::fidl_next::FromWire::from_wire(unsafe {
26151 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireRef<'de>>>()
26152 })
26153 }),
26154
26155 target: target.map(|envelope| {
26156 ::fidl_next::FromWire::from_wire(unsafe {
26157 envelope.read_unchecked::<crate::WireRef<'de>>()
26158 })
26159 }),
26160
26161 target_name: target_name.map(|envelope| {
26162 ::fidl_next::FromWire::from_wire(unsafe {
26163 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26164 })
26165 }),
26166
26167 availability: availability.map(|envelope| {
26168 ::fidl_next::FromWire::from_wire(unsafe {
26169 envelope.read_unchecked::<crate::WireAvailability>()
26170 })
26171 }),
26172 }
26173 }
26174}
26175
26176impl<'de> ::fidl_next::IntoNatural for WireOfferEventStream<'de> {
26177 type Natural = OfferEventStream;
26178}
26179
26180impl<'de> ::fidl_next::FromWireRef<WireOfferEventStream<'de>> for OfferEventStream {
26181 #[inline]
26182 fn from_wire_ref(wire: &WireOfferEventStream<'de>) -> Self {
26183 Self {
26184 source: wire.table.get(1).map(|envelope| {
26185 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26186 envelope.deref_unchecked::<crate::WireRef<'de>>()
26187 })
26188 }),
26189
26190 source_name: wire.table.get(2).map(|envelope| {
26191 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26192 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
26193 })
26194 }),
26195
26196 scope: wire.table.get(3).map(|envelope| {
26197 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26198 envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireRef<'de>>>()
26199 })
26200 }),
26201
26202 target: wire.table.get(4).map(|envelope| {
26203 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26204 envelope.deref_unchecked::<crate::WireRef<'de>>()
26205 })
26206 }),
26207
26208 target_name: wire.table.get(5).map(|envelope| {
26209 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26210 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
26211 })
26212 }),
26213
26214 availability: wire.table.get(7).map(|envelope| {
26215 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26216 envelope.deref_unchecked::<crate::WireAvailability>()
26217 })
26218 }),
26219 }
26220 }
26221}
26222
26223#[repr(C)]
26225pub struct WireOfferEventStream<'de> {
26226 table: ::fidl_next::WireTable<'de>,
26227}
26228
26229impl<'de> Drop for WireOfferEventStream<'de> {
26230 fn drop(&mut self) {
26231 let _ = self
26232 .table
26233 .get(1)
26234 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
26235
26236 let _ = self
26237 .table
26238 .get(2)
26239 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
26240
26241 let _ = self.table.get(3).map(|envelope| unsafe {
26242 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireRef<'de>>>()
26243 });
26244
26245 let _ = self
26246 .table
26247 .get(4)
26248 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
26249
26250 let _ = self
26251 .table
26252 .get(5)
26253 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
26254
26255 let _ = self
26256 .table
26257 .get(7)
26258 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
26259 }
26260}
26261
26262unsafe impl ::fidl_next::Wire for WireOfferEventStream<'static> {
26263 type Decoded<'de> = WireOfferEventStream<'de>;
26264
26265 #[inline]
26266 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26267 ::fidl_next::munge!(let Self { table } = out);
26268 ::fidl_next::WireTable::zero_padding(table);
26269 }
26270}
26271
26272unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferEventStream<'static>
26273where
26274 ___D: ::fidl_next::Decoder + ?Sized,
26275{
26276 fn decode(
26277 slot: ::fidl_next::Slot<'_, Self>,
26278 decoder: &mut ___D,
26279 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26280 ::fidl_next::munge!(let Self { table } = slot);
26281
26282 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
26283 match ordinal {
26284 0 => unsafe { ::core::hint::unreachable_unchecked() },
26285
26286 1 => {
26287 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
26288 slot.as_mut(),
26289 decoder,
26290 )?;
26291
26292 Ok(())
26293 }
26294
26295 2 => {
26296 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
26297 slot.as_mut(),
26298 decoder,
26299 )?;
26300
26301 let value = unsafe {
26302 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26303 };
26304
26305 if value.len() > 100 {
26306 return Err(::fidl_next::DecodeError::VectorTooLong {
26307 size: value.len() as u64,
26308 limit: 100,
26309 });
26310 }
26311
26312 Ok(())
26313 }
26314
26315 3 => {
26316 ::fidl_next::WireEnvelope::decode_as::<
26317 ___D,
26318 ::fidl_next::WireVector<'static, crate::WireRef<'static>>,
26319 >(slot.as_mut(), decoder)?;
26320
26321 Ok(())
26322 }
26323
26324 4 => {
26325 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
26326 slot.as_mut(),
26327 decoder,
26328 )?;
26329
26330 Ok(())
26331 }
26332
26333 5 => {
26334 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
26335 slot.as_mut(),
26336 decoder,
26337 )?;
26338
26339 let value = unsafe {
26340 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26341 };
26342
26343 if value.len() > 100 {
26344 return Err(::fidl_next::DecodeError::VectorTooLong {
26345 size: value.len() as u64,
26346 limit: 100,
26347 });
26348 }
26349
26350 Ok(())
26351 }
26352
26353 7 => {
26354 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
26355 slot.as_mut(),
26356 decoder,
26357 )?;
26358
26359 Ok(())
26360 }
26361
26362 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
26363 }
26364 })
26365 }
26366}
26367
26368impl<'de> WireOfferEventStream<'de> {
26369 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
26370 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26371 }
26372
26373 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
26374 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
26375 }
26376
26377 pub fn scope(
26378 &self,
26379 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireRef<'de>>> {
26380 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
26381 }
26382
26383 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
26384 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
26385 }
26386
26387 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
26388 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
26389 }
26390
26391 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
26392 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
26393 }
26394}
26395
26396impl<'de> ::core::fmt::Debug for WireOfferEventStream<'de> {
26397 fn fmt(
26398 &self,
26399 f: &mut ::core::fmt::Formatter<'_>,
26400 ) -> ::core::result::Result<(), ::core::fmt::Error> {
26401 f.debug_struct("OfferEventStream")
26402 .field("source", &self.source())
26403 .field("source_name", &self.source_name())
26404 .field("scope", &self.scope())
26405 .field("target", &self.target())
26406 .field("target_name", &self.target_name())
26407 .field("availability", &self.availability())
26408 .finish()
26409 }
26410}
26411
26412#[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"]
26413#[derive(PartialEq, Clone, Debug, Default)]
26414pub struct OfferDictionary {
26415 pub source: ::core::option::Option<crate::Ref>,
26416
26417 pub source_name: ::core::option::Option<::std::string::String>,
26418
26419 pub target: ::core::option::Option<crate::Ref>,
26420
26421 pub target_name: ::core::option::Option<::std::string::String>,
26422
26423 pub dependency_type: ::core::option::Option<crate::DependencyType>,
26424
26425 pub availability: ::core::option::Option<crate::Availability>,
26426
26427 pub source_dictionary: ::core::option::Option<::std::string::String>,
26428}
26429
26430impl OfferDictionary {
26431 fn __max_ordinal(&self) -> usize {
26432 if self.source_dictionary.is_some() {
26433 return 7;
26434 }
26435
26436 if self.availability.is_some() {
26437 return 6;
26438 }
26439
26440 if self.dependency_type.is_some() {
26441 return 5;
26442 }
26443
26444 if self.target_name.is_some() {
26445 return 4;
26446 }
26447
26448 if self.target.is_some() {
26449 return 3;
26450 }
26451
26452 if self.source_name.is_some() {
26453 return 2;
26454 }
26455
26456 if self.source.is_some() {
26457 return 1;
26458 }
26459
26460 0
26461 }
26462}
26463
26464impl ::fidl_next::Encodable for OfferDictionary {
26465 type Encoded = WireOfferDictionary<'static>;
26466}
26467
26468unsafe impl<___E> ::fidl_next::Encode<___E> for OfferDictionary
26469where
26470 ___E: ::fidl_next::Encoder + ?Sized,
26471{
26472 #[inline]
26473 fn encode(
26474 mut self,
26475 encoder: &mut ___E,
26476 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26477 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
26478 ::fidl_next::munge!(let WireOfferDictionary { table } = out);
26479
26480 let max_ord = self.__max_ordinal();
26481
26482 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
26483 ::fidl_next::Wire::zero_padding(&mut out);
26484
26485 let mut preallocated =
26486 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
26487
26488 for i in 1..=max_ord {
26489 match i {
26490 7 => {
26491 if let Some(value) = self.source_dictionary.take() {
26492 ::fidl_next::WireEnvelope::encode_value(
26493 value,
26494 preallocated.encoder,
26495 &mut out,
26496 )?;
26497 } else {
26498 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26499 }
26500 }
26501
26502 6 => {
26503 if let Some(value) = self.availability.take() {
26504 ::fidl_next::WireEnvelope::encode_value(
26505 value,
26506 preallocated.encoder,
26507 &mut out,
26508 )?;
26509 } else {
26510 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26511 }
26512 }
26513
26514 5 => {
26515 if let Some(value) = self.dependency_type.take() {
26516 ::fidl_next::WireEnvelope::encode_value(
26517 value,
26518 preallocated.encoder,
26519 &mut out,
26520 )?;
26521 } else {
26522 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26523 }
26524 }
26525
26526 4 => {
26527 if let Some(value) = self.target_name.take() {
26528 ::fidl_next::WireEnvelope::encode_value(
26529 value,
26530 preallocated.encoder,
26531 &mut out,
26532 )?;
26533 } else {
26534 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26535 }
26536 }
26537
26538 3 => {
26539 if let Some(value) = self.target.take() {
26540 ::fidl_next::WireEnvelope::encode_value(
26541 value,
26542 preallocated.encoder,
26543 &mut out,
26544 )?;
26545 } else {
26546 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26547 }
26548 }
26549
26550 2 => {
26551 if let Some(value) = self.source_name.take() {
26552 ::fidl_next::WireEnvelope::encode_value(
26553 value,
26554 preallocated.encoder,
26555 &mut out,
26556 )?;
26557 } else {
26558 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26559 }
26560 }
26561
26562 1 => {
26563 if let Some(value) = self.source.take() {
26564 ::fidl_next::WireEnvelope::encode_value(
26565 value,
26566 preallocated.encoder,
26567 &mut out,
26568 )?;
26569 } else {
26570 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26571 }
26572 }
26573
26574 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
26575 }
26576 unsafe {
26577 preallocated.write_next(out.assume_init_ref());
26578 }
26579 }
26580
26581 ::fidl_next::WireTable::encode_len(table, max_ord);
26582
26583 Ok(())
26584 }
26585}
26586
26587unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferDictionary
26588where
26589 ___E: ::fidl_next::Encoder + ?Sized,
26590{
26591 #[inline]
26592 fn encode_ref(
26593 &self,
26594 encoder: &mut ___E,
26595 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26596 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
26597 ::fidl_next::munge!(let WireOfferDictionary { table } = out);
26598
26599 let max_ord = self.__max_ordinal();
26600
26601 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
26602 ::fidl_next::Wire::zero_padding(&mut out);
26603
26604 let mut preallocated =
26605 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
26606
26607 for i in 1..=max_ord {
26608 match i {
26609 7 => {
26610 if let Some(value) = &self.source_dictionary {
26611 ::fidl_next::WireEnvelope::encode_value(
26612 value,
26613 preallocated.encoder,
26614 &mut out,
26615 )?;
26616 } else {
26617 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26618 }
26619 }
26620
26621 6 => {
26622 if let Some(value) = &self.availability {
26623 ::fidl_next::WireEnvelope::encode_value(
26624 value,
26625 preallocated.encoder,
26626 &mut out,
26627 )?;
26628 } else {
26629 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26630 }
26631 }
26632
26633 5 => {
26634 if let Some(value) = &self.dependency_type {
26635 ::fidl_next::WireEnvelope::encode_value(
26636 value,
26637 preallocated.encoder,
26638 &mut out,
26639 )?;
26640 } else {
26641 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26642 }
26643 }
26644
26645 4 => {
26646 if let Some(value) = &self.target_name {
26647 ::fidl_next::WireEnvelope::encode_value(
26648 value,
26649 preallocated.encoder,
26650 &mut out,
26651 )?;
26652 } else {
26653 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26654 }
26655 }
26656
26657 3 => {
26658 if let Some(value) = &self.target {
26659 ::fidl_next::WireEnvelope::encode_value(
26660 value,
26661 preallocated.encoder,
26662 &mut out,
26663 )?;
26664 } else {
26665 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26666 }
26667 }
26668
26669 2 => {
26670 if let Some(value) = &self.source_name {
26671 ::fidl_next::WireEnvelope::encode_value(
26672 value,
26673 preallocated.encoder,
26674 &mut out,
26675 )?;
26676 } else {
26677 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26678 }
26679 }
26680
26681 1 => {
26682 if let Some(value) = &self.source {
26683 ::fidl_next::WireEnvelope::encode_value(
26684 value,
26685 preallocated.encoder,
26686 &mut out,
26687 )?;
26688 } else {
26689 ::fidl_next::WireEnvelope::encode_zero(&mut out)
26690 }
26691 }
26692
26693 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
26694 }
26695 unsafe {
26696 preallocated.write_next(out.assume_init_ref());
26697 }
26698 }
26699
26700 ::fidl_next::WireTable::encode_len(table, max_ord);
26701
26702 Ok(())
26703 }
26704}
26705
26706impl<'de> ::fidl_next::FromWire<WireOfferDictionary<'de>> for OfferDictionary {
26707 #[inline]
26708 fn from_wire(wire_: WireOfferDictionary<'de>) -> Self {
26709 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
26710
26711 let source = wire_.table.get(1);
26712
26713 let source_name = wire_.table.get(2);
26714
26715 let target = wire_.table.get(3);
26716
26717 let target_name = wire_.table.get(4);
26718
26719 let dependency_type = wire_.table.get(5);
26720
26721 let availability = wire_.table.get(6);
26722
26723 let source_dictionary = wire_.table.get(7);
26724
26725 Self {
26726 source: source.map(|envelope| {
26727 ::fidl_next::FromWire::from_wire(unsafe {
26728 envelope.read_unchecked::<crate::WireRef<'de>>()
26729 })
26730 }),
26731
26732 source_name: source_name.map(|envelope| {
26733 ::fidl_next::FromWire::from_wire(unsafe {
26734 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26735 })
26736 }),
26737
26738 target: target.map(|envelope| {
26739 ::fidl_next::FromWire::from_wire(unsafe {
26740 envelope.read_unchecked::<crate::WireRef<'de>>()
26741 })
26742 }),
26743
26744 target_name: target_name.map(|envelope| {
26745 ::fidl_next::FromWire::from_wire(unsafe {
26746 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26747 })
26748 }),
26749
26750 dependency_type: dependency_type.map(|envelope| {
26751 ::fidl_next::FromWire::from_wire(unsafe {
26752 envelope.read_unchecked::<crate::WireDependencyType>()
26753 })
26754 }),
26755
26756 availability: availability.map(|envelope| {
26757 ::fidl_next::FromWire::from_wire(unsafe {
26758 envelope.read_unchecked::<crate::WireAvailability>()
26759 })
26760 }),
26761
26762 source_dictionary: source_dictionary.map(|envelope| {
26763 ::fidl_next::FromWire::from_wire(unsafe {
26764 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26765 })
26766 }),
26767 }
26768 }
26769}
26770
26771impl<'de> ::fidl_next::IntoNatural for WireOfferDictionary<'de> {
26772 type Natural = OfferDictionary;
26773}
26774
26775impl<'de> ::fidl_next::FromWireRef<WireOfferDictionary<'de>> for OfferDictionary {
26776 #[inline]
26777 fn from_wire_ref(wire: &WireOfferDictionary<'de>) -> Self {
26778 Self {
26779 source: wire.table.get(1).map(|envelope| {
26780 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26781 envelope.deref_unchecked::<crate::WireRef<'de>>()
26782 })
26783 }),
26784
26785 source_name: wire.table.get(2).map(|envelope| {
26786 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26787 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
26788 })
26789 }),
26790
26791 target: wire.table.get(3).map(|envelope| {
26792 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26793 envelope.deref_unchecked::<crate::WireRef<'de>>()
26794 })
26795 }),
26796
26797 target_name: wire.table.get(4).map(|envelope| {
26798 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26799 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
26800 })
26801 }),
26802
26803 dependency_type: wire.table.get(5).map(|envelope| {
26804 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26805 envelope.deref_unchecked::<crate::WireDependencyType>()
26806 })
26807 }),
26808
26809 availability: wire.table.get(6).map(|envelope| {
26810 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26811 envelope.deref_unchecked::<crate::WireAvailability>()
26812 })
26813 }),
26814
26815 source_dictionary: wire.table.get(7).map(|envelope| {
26816 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
26817 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
26818 })
26819 }),
26820 }
26821 }
26822}
26823
26824#[repr(C)]
26826pub struct WireOfferDictionary<'de> {
26827 table: ::fidl_next::WireTable<'de>,
26828}
26829
26830impl<'de> Drop for WireOfferDictionary<'de> {
26831 fn drop(&mut self) {
26832 let _ = self
26833 .table
26834 .get(1)
26835 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
26836
26837 let _ = self
26838 .table
26839 .get(2)
26840 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
26841
26842 let _ = self
26843 .table
26844 .get(3)
26845 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
26846
26847 let _ = self
26848 .table
26849 .get(4)
26850 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
26851
26852 let _ = self
26853 .table
26854 .get(5)
26855 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireDependencyType>() });
26856
26857 let _ = self
26858 .table
26859 .get(6)
26860 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
26861
26862 let _ = self
26863 .table
26864 .get(7)
26865 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
26866 }
26867}
26868
26869unsafe impl ::fidl_next::Wire for WireOfferDictionary<'static> {
26870 type Decoded<'de> = WireOfferDictionary<'de>;
26871
26872 #[inline]
26873 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26874 ::fidl_next::munge!(let Self { table } = out);
26875 ::fidl_next::WireTable::zero_padding(table);
26876 }
26877}
26878
26879unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferDictionary<'static>
26880where
26881 ___D: ::fidl_next::Decoder + ?Sized,
26882{
26883 fn decode(
26884 slot: ::fidl_next::Slot<'_, Self>,
26885 decoder: &mut ___D,
26886 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26887 ::fidl_next::munge!(let Self { table } = slot);
26888
26889 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
26890 match ordinal {
26891 0 => unsafe { ::core::hint::unreachable_unchecked() },
26892
26893 1 => {
26894 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
26895 slot.as_mut(),
26896 decoder,
26897 )?;
26898
26899 Ok(())
26900 }
26901
26902 2 => {
26903 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
26904 slot.as_mut(),
26905 decoder,
26906 )?;
26907
26908 let value = unsafe {
26909 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26910 };
26911
26912 if value.len() > 100 {
26913 return Err(::fidl_next::DecodeError::VectorTooLong {
26914 size: value.len() as u64,
26915 limit: 100,
26916 });
26917 }
26918
26919 Ok(())
26920 }
26921
26922 3 => {
26923 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
26924 slot.as_mut(),
26925 decoder,
26926 )?;
26927
26928 Ok(())
26929 }
26930
26931 4 => {
26932 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
26933 slot.as_mut(),
26934 decoder,
26935 )?;
26936
26937 let value = unsafe {
26938 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26939 };
26940
26941 if value.len() > 100 {
26942 return Err(::fidl_next::DecodeError::VectorTooLong {
26943 size: value.len() as u64,
26944 limit: 100,
26945 });
26946 }
26947
26948 Ok(())
26949 }
26950
26951 5 => {
26952 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
26953 slot.as_mut(),
26954 decoder,
26955 )?;
26956
26957 Ok(())
26958 }
26959
26960 6 => {
26961 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
26962 slot.as_mut(),
26963 decoder,
26964 )?;
26965
26966 Ok(())
26967 }
26968
26969 7 => {
26970 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
26971 slot.as_mut(),
26972 decoder,
26973 )?;
26974
26975 let value = unsafe {
26976 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26977 };
26978
26979 if value.len() > 1024 {
26980 return Err(::fidl_next::DecodeError::VectorTooLong {
26981 size: value.len() as u64,
26982 limit: 1024,
26983 });
26984 }
26985
26986 Ok(())
26987 }
26988
26989 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
26990 }
26991 })
26992 }
26993}
26994
26995impl<'de> WireOfferDictionary<'de> {
26996 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
26997 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26998 }
26999
27000 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27001 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27002 }
27003
27004 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
27005 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27006 }
27007
27008 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27009 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
27010 }
27011
27012 pub fn dependency_type(&self) -> ::core::option::Option<&crate::WireDependencyType> {
27013 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
27014 }
27015
27016 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
27017 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
27018 }
27019
27020 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27021 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
27022 }
27023}
27024
27025impl<'de> ::core::fmt::Debug for WireOfferDictionary<'de> {
27026 fn fmt(
27027 &self,
27028 f: &mut ::core::fmt::Formatter<'_>,
27029 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27030 f.debug_struct("OfferDictionary")
27031 .field("source", &self.source())
27032 .field("source_name", &self.source_name())
27033 .field("target", &self.target())
27034 .field("target_name", &self.target_name())
27035 .field("dependency_type", &self.dependency_type())
27036 .field("availability", &self.availability())
27037 .field("source_dictionary", &self.source_dictionary())
27038 .finish()
27039 }
27040}
27041
27042#[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"]
27043#[derive(PartialEq, Clone, Debug, Default)]
27044pub struct OfferConfiguration {
27045 pub source: ::core::option::Option<crate::Ref>,
27046
27047 pub source_name: ::core::option::Option<::std::string::String>,
27048
27049 pub target: ::core::option::Option<crate::Ref>,
27050
27051 pub target_name: ::core::option::Option<::std::string::String>,
27052
27053 pub availability: ::core::option::Option<crate::Availability>,
27054
27055 pub source_dictionary: ::core::option::Option<::std::string::String>,
27056}
27057
27058impl OfferConfiguration {
27059 fn __max_ordinal(&self) -> usize {
27060 if self.source_dictionary.is_some() {
27061 return 6;
27062 }
27063
27064 if self.availability.is_some() {
27065 return 5;
27066 }
27067
27068 if self.target_name.is_some() {
27069 return 4;
27070 }
27071
27072 if self.target.is_some() {
27073 return 3;
27074 }
27075
27076 if self.source_name.is_some() {
27077 return 2;
27078 }
27079
27080 if self.source.is_some() {
27081 return 1;
27082 }
27083
27084 0
27085 }
27086}
27087
27088impl ::fidl_next::Encodable for OfferConfiguration {
27089 type Encoded = WireOfferConfiguration<'static>;
27090}
27091
27092unsafe impl<___E> ::fidl_next::Encode<___E> for OfferConfiguration
27093where
27094 ___E: ::fidl_next::Encoder + ?Sized,
27095{
27096 #[inline]
27097 fn encode(
27098 mut self,
27099 encoder: &mut ___E,
27100 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27101 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27102 ::fidl_next::munge!(let WireOfferConfiguration { table } = out);
27103
27104 let max_ord = self.__max_ordinal();
27105
27106 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
27107 ::fidl_next::Wire::zero_padding(&mut out);
27108
27109 let mut preallocated =
27110 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
27111
27112 for i in 1..=max_ord {
27113 match i {
27114 6 => {
27115 if let Some(value) = self.source_dictionary.take() {
27116 ::fidl_next::WireEnvelope::encode_value(
27117 value,
27118 preallocated.encoder,
27119 &mut out,
27120 )?;
27121 } else {
27122 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27123 }
27124 }
27125
27126 5 => {
27127 if let Some(value) = self.availability.take() {
27128 ::fidl_next::WireEnvelope::encode_value(
27129 value,
27130 preallocated.encoder,
27131 &mut out,
27132 )?;
27133 } else {
27134 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27135 }
27136 }
27137
27138 4 => {
27139 if let Some(value) = self.target_name.take() {
27140 ::fidl_next::WireEnvelope::encode_value(
27141 value,
27142 preallocated.encoder,
27143 &mut out,
27144 )?;
27145 } else {
27146 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27147 }
27148 }
27149
27150 3 => {
27151 if let Some(value) = self.target.take() {
27152 ::fidl_next::WireEnvelope::encode_value(
27153 value,
27154 preallocated.encoder,
27155 &mut out,
27156 )?;
27157 } else {
27158 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27159 }
27160 }
27161
27162 2 => {
27163 if let Some(value) = self.source_name.take() {
27164 ::fidl_next::WireEnvelope::encode_value(
27165 value,
27166 preallocated.encoder,
27167 &mut out,
27168 )?;
27169 } else {
27170 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27171 }
27172 }
27173
27174 1 => {
27175 if let Some(value) = self.source.take() {
27176 ::fidl_next::WireEnvelope::encode_value(
27177 value,
27178 preallocated.encoder,
27179 &mut out,
27180 )?;
27181 } else {
27182 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27183 }
27184 }
27185
27186 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
27187 }
27188 unsafe {
27189 preallocated.write_next(out.assume_init_ref());
27190 }
27191 }
27192
27193 ::fidl_next::WireTable::encode_len(table, max_ord);
27194
27195 Ok(())
27196 }
27197}
27198
27199unsafe impl<___E> ::fidl_next::EncodeRef<___E> for OfferConfiguration
27200where
27201 ___E: ::fidl_next::Encoder + ?Sized,
27202{
27203 #[inline]
27204 fn encode_ref(
27205 &self,
27206 encoder: &mut ___E,
27207 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27208 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27209 ::fidl_next::munge!(let WireOfferConfiguration { table } = out);
27210
27211 let max_ord = self.__max_ordinal();
27212
27213 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
27214 ::fidl_next::Wire::zero_padding(&mut out);
27215
27216 let mut preallocated =
27217 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
27218
27219 for i in 1..=max_ord {
27220 match i {
27221 6 => {
27222 if let Some(value) = &self.source_dictionary {
27223 ::fidl_next::WireEnvelope::encode_value(
27224 value,
27225 preallocated.encoder,
27226 &mut out,
27227 )?;
27228 } else {
27229 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27230 }
27231 }
27232
27233 5 => {
27234 if let Some(value) = &self.availability {
27235 ::fidl_next::WireEnvelope::encode_value(
27236 value,
27237 preallocated.encoder,
27238 &mut out,
27239 )?;
27240 } else {
27241 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27242 }
27243 }
27244
27245 4 => {
27246 if let Some(value) = &self.target_name {
27247 ::fidl_next::WireEnvelope::encode_value(
27248 value,
27249 preallocated.encoder,
27250 &mut out,
27251 )?;
27252 } else {
27253 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27254 }
27255 }
27256
27257 3 => {
27258 if let Some(value) = &self.target {
27259 ::fidl_next::WireEnvelope::encode_value(
27260 value,
27261 preallocated.encoder,
27262 &mut out,
27263 )?;
27264 } else {
27265 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27266 }
27267 }
27268
27269 2 => {
27270 if let Some(value) = &self.source_name {
27271 ::fidl_next::WireEnvelope::encode_value(
27272 value,
27273 preallocated.encoder,
27274 &mut out,
27275 )?;
27276 } else {
27277 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27278 }
27279 }
27280
27281 1 => {
27282 if let Some(value) = &self.source {
27283 ::fidl_next::WireEnvelope::encode_value(
27284 value,
27285 preallocated.encoder,
27286 &mut out,
27287 )?;
27288 } else {
27289 ::fidl_next::WireEnvelope::encode_zero(&mut out)
27290 }
27291 }
27292
27293 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
27294 }
27295 unsafe {
27296 preallocated.write_next(out.assume_init_ref());
27297 }
27298 }
27299
27300 ::fidl_next::WireTable::encode_len(table, max_ord);
27301
27302 Ok(())
27303 }
27304}
27305
27306impl<'de> ::fidl_next::FromWire<WireOfferConfiguration<'de>> for OfferConfiguration {
27307 #[inline]
27308 fn from_wire(wire_: WireOfferConfiguration<'de>) -> Self {
27309 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
27310
27311 let source = wire_.table.get(1);
27312
27313 let source_name = wire_.table.get(2);
27314
27315 let target = wire_.table.get(3);
27316
27317 let target_name = wire_.table.get(4);
27318
27319 let availability = wire_.table.get(5);
27320
27321 let source_dictionary = wire_.table.get(6);
27322
27323 Self {
27324 source: source.map(|envelope| {
27325 ::fidl_next::FromWire::from_wire(unsafe {
27326 envelope.read_unchecked::<crate::WireRef<'de>>()
27327 })
27328 }),
27329
27330 source_name: source_name.map(|envelope| {
27331 ::fidl_next::FromWire::from_wire(unsafe {
27332 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27333 })
27334 }),
27335
27336 target: target.map(|envelope| {
27337 ::fidl_next::FromWire::from_wire(unsafe {
27338 envelope.read_unchecked::<crate::WireRef<'de>>()
27339 })
27340 }),
27341
27342 target_name: target_name.map(|envelope| {
27343 ::fidl_next::FromWire::from_wire(unsafe {
27344 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27345 })
27346 }),
27347
27348 availability: availability.map(|envelope| {
27349 ::fidl_next::FromWire::from_wire(unsafe {
27350 envelope.read_unchecked::<crate::WireAvailability>()
27351 })
27352 }),
27353
27354 source_dictionary: source_dictionary.map(|envelope| {
27355 ::fidl_next::FromWire::from_wire(unsafe {
27356 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27357 })
27358 }),
27359 }
27360 }
27361}
27362
27363impl<'de> ::fidl_next::IntoNatural for WireOfferConfiguration<'de> {
27364 type Natural = OfferConfiguration;
27365}
27366
27367impl<'de> ::fidl_next::FromWireRef<WireOfferConfiguration<'de>> for OfferConfiguration {
27368 #[inline]
27369 fn from_wire_ref(wire: &WireOfferConfiguration<'de>) -> Self {
27370 Self {
27371 source: wire.table.get(1).map(|envelope| {
27372 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
27373 envelope.deref_unchecked::<crate::WireRef<'de>>()
27374 })
27375 }),
27376
27377 source_name: wire.table.get(2).map(|envelope| {
27378 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
27379 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
27380 })
27381 }),
27382
27383 target: wire.table.get(3).map(|envelope| {
27384 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
27385 envelope.deref_unchecked::<crate::WireRef<'de>>()
27386 })
27387 }),
27388
27389 target_name: wire.table.get(4).map(|envelope| {
27390 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
27391 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
27392 })
27393 }),
27394
27395 availability: wire.table.get(5).map(|envelope| {
27396 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
27397 envelope.deref_unchecked::<crate::WireAvailability>()
27398 })
27399 }),
27400
27401 source_dictionary: wire.table.get(6).map(|envelope| {
27402 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
27403 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
27404 })
27405 }),
27406 }
27407 }
27408}
27409
27410#[repr(C)]
27412pub struct WireOfferConfiguration<'de> {
27413 table: ::fidl_next::WireTable<'de>,
27414}
27415
27416impl<'de> Drop for WireOfferConfiguration<'de> {
27417 fn drop(&mut self) {
27418 let _ = self
27419 .table
27420 .get(1)
27421 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
27422
27423 let _ = self
27424 .table
27425 .get(2)
27426 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
27427
27428 let _ = self
27429 .table
27430 .get(3)
27431 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
27432
27433 let _ = self
27434 .table
27435 .get(4)
27436 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
27437
27438 let _ = self
27439 .table
27440 .get(5)
27441 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireAvailability>() });
27442
27443 let _ = self
27444 .table
27445 .get(6)
27446 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
27447 }
27448}
27449
27450unsafe impl ::fidl_next::Wire for WireOfferConfiguration<'static> {
27451 type Decoded<'de> = WireOfferConfiguration<'de>;
27452
27453 #[inline]
27454 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27455 ::fidl_next::munge!(let Self { table } = out);
27456 ::fidl_next::WireTable::zero_padding(table);
27457 }
27458}
27459
27460unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferConfiguration<'static>
27461where
27462 ___D: ::fidl_next::Decoder + ?Sized,
27463{
27464 fn decode(
27465 slot: ::fidl_next::Slot<'_, Self>,
27466 decoder: &mut ___D,
27467 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27468 ::fidl_next::munge!(let Self { table } = slot);
27469
27470 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27471 match ordinal {
27472 0 => unsafe { ::core::hint::unreachable_unchecked() },
27473
27474 1 => {
27475 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
27476 slot.as_mut(),
27477 decoder,
27478 )?;
27479
27480 Ok(())
27481 }
27482
27483 2 => {
27484 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
27485 slot.as_mut(),
27486 decoder,
27487 )?;
27488
27489 let value = unsafe {
27490 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27491 };
27492
27493 if value.len() > 100 {
27494 return Err(::fidl_next::DecodeError::VectorTooLong {
27495 size: value.len() as u64,
27496 limit: 100,
27497 });
27498 }
27499
27500 Ok(())
27501 }
27502
27503 3 => {
27504 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
27505 slot.as_mut(),
27506 decoder,
27507 )?;
27508
27509 Ok(())
27510 }
27511
27512 4 => {
27513 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
27514 slot.as_mut(),
27515 decoder,
27516 )?;
27517
27518 let value = unsafe {
27519 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27520 };
27521
27522 if value.len() > 100 {
27523 return Err(::fidl_next::DecodeError::VectorTooLong {
27524 size: value.len() as u64,
27525 limit: 100,
27526 });
27527 }
27528
27529 Ok(())
27530 }
27531
27532 5 => {
27533 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
27534 slot.as_mut(),
27535 decoder,
27536 )?;
27537
27538 Ok(())
27539 }
27540
27541 6 => {
27542 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
27543 slot.as_mut(),
27544 decoder,
27545 )?;
27546
27547 let value = unsafe {
27548 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27549 };
27550
27551 if value.len() > 1024 {
27552 return Err(::fidl_next::DecodeError::VectorTooLong {
27553 size: value.len() as u64,
27554 limit: 1024,
27555 });
27556 }
27557
27558 Ok(())
27559 }
27560
27561 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
27562 }
27563 })
27564 }
27565}
27566
27567impl<'de> WireOfferConfiguration<'de> {
27568 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
27569 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27570 }
27571
27572 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27573 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27574 }
27575
27576 pub fn target(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
27577 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27578 }
27579
27580 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27581 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
27582 }
27583
27584 pub fn availability(&self) -> ::core::option::Option<&crate::WireAvailability> {
27585 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
27586 }
27587
27588 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27589 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
27590 }
27591}
27592
27593impl<'de> ::core::fmt::Debug for WireOfferConfiguration<'de> {
27594 fn fmt(
27595 &self,
27596 f: &mut ::core::fmt::Formatter<'_>,
27597 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27598 f.debug_struct("OfferConfiguration")
27599 .field("source", &self.source())
27600 .field("source_name", &self.source_name())
27601 .field("target", &self.target())
27602 .field("target_name", &self.target_name())
27603 .field("availability", &self.availability())
27604 .field("source_dictionary", &self.source_dictionary())
27605 .finish()
27606 }
27607}
27608
27609#[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"]
27610#[derive(PartialEq, Clone, Debug)]
27611pub enum Offer {
27612 Service(crate::OfferService),
27613
27614 Protocol(crate::OfferProtocol),
27615
27616 Directory(crate::OfferDirectory),
27617
27618 Storage(crate::OfferStorage),
27619
27620 Runner(crate::OfferRunner),
27621
27622 Resolver(crate::OfferResolver),
27623
27624 EventStream(crate::OfferEventStream),
27625
27626 Dictionary(crate::OfferDictionary),
27627
27628 Config(crate::OfferConfiguration),
27629
27630 UnknownOrdinal_(u64),
27631}
27632
27633impl ::fidl_next::Encodable for Offer {
27634 type Encoded = WireOffer<'static>;
27635}
27636
27637unsafe impl<___E> ::fidl_next::Encode<___E> for Offer
27638where
27639 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27640 ___E: ::fidl_next::Encoder,
27641{
27642 #[inline]
27643 fn encode(
27644 self,
27645 encoder: &mut ___E,
27646 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27647 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27648 ::fidl_next::munge!(let WireOffer { raw, _phantom: _ } = out);
27649
27650 match self {
27651 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
27652 ___E,
27653 crate::OfferService,
27654 >(value, 1, encoder, raw)?,
27655
27656 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
27657 ___E,
27658 crate::OfferProtocol,
27659 >(value, 2, encoder, raw)?,
27660
27661 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
27662 ___E,
27663 crate::OfferDirectory,
27664 >(value, 3, encoder, raw)?,
27665
27666 Self::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<
27667 ___E,
27668 crate::OfferStorage,
27669 >(value, 4, encoder, raw)?,
27670
27671 Self::Runner(value) => {
27672 ::fidl_next::RawWireUnion::encode_as::<___E, crate::OfferRunner>(
27673 value, 5, encoder, raw,
27674 )?
27675 }
27676
27677 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
27678 ___E,
27679 crate::OfferResolver,
27680 >(value, 6, encoder, raw)?,
27681
27682 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
27683 ___E,
27684 crate::OfferEventStream,
27685 >(value, 8, encoder, raw)?,
27686
27687 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
27688 ___E,
27689 crate::OfferDictionary,
27690 >(value, 9, encoder, raw)?,
27691
27692 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
27693 ___E,
27694 crate::OfferConfiguration,
27695 >(value, 10, encoder, raw)?,
27696
27697 Self::UnknownOrdinal_(ordinal) => {
27698 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
27699 }
27700 }
27701
27702 Ok(())
27703 }
27704}
27705
27706unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Offer
27707where
27708 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
27709 ___E: ::fidl_next::Encoder,
27710{
27711 #[inline]
27712 fn encode_ref(
27713 &self,
27714 encoder: &mut ___E,
27715 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27716 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27717 ::fidl_next::munge!(let WireOffer { raw, _phantom: _ } = out);
27718
27719 match self {
27720 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
27721 ___E,
27722 &crate::OfferService,
27723 >(value, 1, encoder, raw)?,
27724
27725 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
27726 ___E,
27727 &crate::OfferProtocol,
27728 >(value, 2, encoder, raw)?,
27729
27730 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
27731 ___E,
27732 &crate::OfferDirectory,
27733 >(value, 3, encoder, raw)?,
27734
27735 Self::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<
27736 ___E,
27737 &crate::OfferStorage,
27738 >(value, 4, encoder, raw)?,
27739
27740 Self::Runner(value) => {
27741 ::fidl_next::RawWireUnion::encode_as::<___E, &crate::OfferRunner>(
27742 value, 5, encoder, raw,
27743 )?
27744 }
27745
27746 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
27747 ___E,
27748 &crate::OfferResolver,
27749 >(value, 6, encoder, raw)?,
27750
27751 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
27752 ___E,
27753 &crate::OfferEventStream,
27754 >(value, 8, encoder, raw)?,
27755
27756 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
27757 ___E,
27758 &crate::OfferDictionary,
27759 >(value, 9, encoder, raw)?,
27760
27761 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
27762 ___E,
27763 &crate::OfferConfiguration,
27764 >(value, 10, encoder, raw)?,
27765
27766 Self::UnknownOrdinal_(ordinal) => {
27767 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
27768 }
27769 }
27770
27771 Ok(())
27772 }
27773}
27774
27775impl ::fidl_next::EncodableOption for Offer {
27776 type EncodedOption = WireOptionalOffer<'static>;
27777}
27778
27779unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Offer
27780where
27781 ___E: ?Sized,
27782 Offer: ::fidl_next::Encode<___E>,
27783{
27784 #[inline]
27785 fn encode_option(
27786 this: ::core::option::Option<Self>,
27787 encoder: &mut ___E,
27788 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
27789 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27790 ::fidl_next::munge!(let WireOptionalOffer { raw, _phantom: _ } = &mut *out);
27791
27792 if let Some(inner) = this {
27793 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
27794 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
27795 } else {
27796 ::fidl_next::RawWireUnion::encode_absent(raw);
27797 }
27798
27799 Ok(())
27800 }
27801}
27802
27803unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Offer
27804where
27805 ___E: ?Sized,
27806 Offer: ::fidl_next::EncodeRef<___E>,
27807{
27808 #[inline]
27809 fn encode_option_ref(
27810 this: ::core::option::Option<&Self>,
27811 encoder: &mut ___E,
27812 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
27813 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
27814 ::fidl_next::munge!(let WireOptionalOffer { raw, _phantom: _ } = &mut *out);
27815
27816 if let Some(inner) = this {
27817 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
27818 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
27819 } else {
27820 ::fidl_next::RawWireUnion::encode_absent(raw);
27821 }
27822
27823 Ok(())
27824 }
27825}
27826
27827impl<'de> ::fidl_next::FromWire<WireOffer<'de>> for Offer {
27828 #[inline]
27829 fn from_wire(wire: WireOffer<'de>) -> Self {
27830 let wire = ::core::mem::ManuallyDrop::new(wire);
27831 match wire.raw.ordinal() {
27832 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
27833 wire.raw.get().read_unchecked::<crate::WireOfferService<'de>>()
27834 })),
27835
27836 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
27837 wire.raw.get().read_unchecked::<crate::WireOfferProtocol<'de>>()
27838 })),
27839
27840 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
27841 wire.raw.get().read_unchecked::<crate::WireOfferDirectory<'de>>()
27842 })),
27843
27844 4 => Self::Storage(::fidl_next::FromWire::from_wire(unsafe {
27845 wire.raw.get().read_unchecked::<crate::WireOfferStorage<'de>>()
27846 })),
27847
27848 5 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
27849 wire.raw.get().read_unchecked::<crate::WireOfferRunner<'de>>()
27850 })),
27851
27852 6 => Self::Resolver(::fidl_next::FromWire::from_wire(unsafe {
27853 wire.raw.get().read_unchecked::<crate::WireOfferResolver<'de>>()
27854 })),
27855
27856 8 => Self::EventStream(::fidl_next::FromWire::from_wire(unsafe {
27857 wire.raw.get().read_unchecked::<crate::WireOfferEventStream<'de>>()
27858 })),
27859
27860 9 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
27861 wire.raw.get().read_unchecked::<crate::WireOfferDictionary<'de>>()
27862 })),
27863
27864 10 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
27865 wire.raw.get().read_unchecked::<crate::WireOfferConfiguration<'de>>()
27866 })),
27867
27868 _ => unsafe { ::core::hint::unreachable_unchecked() },
27869 }
27870 }
27871}
27872
27873impl<'de> ::fidl_next::IntoNatural for WireOffer<'de> {
27874 type Natural = Offer;
27875}
27876
27877impl<'de> ::fidl_next::FromWireRef<WireOffer<'de>> for Offer {
27878 #[inline]
27879 fn from_wire_ref(wire: &WireOffer<'de>) -> Self {
27880 match wire.raw.ordinal() {
27881 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
27882 wire.raw.get().deref_unchecked::<crate::WireOfferService<'de>>()
27883 })),
27884
27885 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
27886 wire.raw.get().deref_unchecked::<crate::WireOfferProtocol<'de>>()
27887 })),
27888
27889 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
27890 wire.raw.get().deref_unchecked::<crate::WireOfferDirectory<'de>>()
27891 })),
27892
27893 4 => Self::Storage(::fidl_next::FromWireRef::from_wire_ref(unsafe {
27894 wire.raw.get().deref_unchecked::<crate::WireOfferStorage<'de>>()
27895 })),
27896
27897 5 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
27898 wire.raw.get().deref_unchecked::<crate::WireOfferRunner<'de>>()
27899 })),
27900
27901 6 => Self::Resolver(::fidl_next::FromWireRef::from_wire_ref(unsafe {
27902 wire.raw.get().deref_unchecked::<crate::WireOfferResolver<'de>>()
27903 })),
27904
27905 8 => Self::EventStream(::fidl_next::FromWireRef::from_wire_ref(unsafe {
27906 wire.raw.get().deref_unchecked::<crate::WireOfferEventStream<'de>>()
27907 })),
27908
27909 9 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
27910 wire.raw.get().deref_unchecked::<crate::WireOfferDictionary<'de>>()
27911 })),
27912
27913 10 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
27914 wire.raw.get().deref_unchecked::<crate::WireOfferConfiguration<'de>>()
27915 })),
27916
27917 _ => unsafe { ::core::hint::unreachable_unchecked() },
27918 }
27919 }
27920}
27921
27922impl<'de> ::fidl_next::FromWireOption<WireOptionalOffer<'de>> for Offer {
27923 #[inline]
27924 fn from_wire_option(wire: WireOptionalOffer<'de>) -> ::core::option::Option<Self> {
27925 if let Some(inner) = wire.into_option() {
27926 Some(::fidl_next::FromWire::from_wire(inner))
27927 } else {
27928 None
27929 }
27930 }
27931}
27932
27933impl<'de> ::fidl_next::IntoNatural for WireOptionalOffer<'de> {
27934 type Natural = ::core::option::Option<Offer>;
27935}
27936
27937impl<'de> ::fidl_next::FromWireOption<WireOptionalOffer<'de>> for Box<Offer> {
27938 #[inline]
27939 fn from_wire_option(wire: WireOptionalOffer<'de>) -> ::core::option::Option<Self> {
27940 <Offer as ::fidl_next::FromWireOption<WireOptionalOffer<'de>>>::from_wire_option(wire)
27941 .map(Box::new)
27942 }
27943}
27944
27945impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalOffer<'de>> for Box<Offer> {
27946 #[inline]
27947 fn from_wire_option_ref(wire: &WireOptionalOffer<'de>) -> ::core::option::Option<Self> {
27948 if let Some(inner) = wire.as_ref() {
27949 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
27950 } else {
27951 None
27952 }
27953 }
27954}
27955
27956#[repr(transparent)]
27958pub struct WireOffer<'de> {
27959 raw: ::fidl_next::RawWireUnion,
27960 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
27961}
27962
27963impl<'de> Drop for WireOffer<'de> {
27964 fn drop(&mut self) {
27965 match self.raw.ordinal() {
27966 1 => {
27967 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireOfferService<'de>>() };
27968 }
27969
27970 2 => {
27971 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireOfferProtocol<'de>>() };
27972 }
27973
27974 3 => {
27975 let _ =
27976 unsafe { self.raw.get().read_unchecked::<crate::WireOfferDirectory<'de>>() };
27977 }
27978
27979 4 => {
27980 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireOfferStorage<'de>>() };
27981 }
27982
27983 5 => {
27984 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireOfferRunner<'de>>() };
27985 }
27986
27987 6 => {
27988 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireOfferResolver<'de>>() };
27989 }
27990
27991 8 => {
27992 let _ =
27993 unsafe { self.raw.get().read_unchecked::<crate::WireOfferEventStream<'de>>() };
27994 }
27995
27996 9 => {
27997 let _ =
27998 unsafe { self.raw.get().read_unchecked::<crate::WireOfferDictionary<'de>>() };
27999 }
28000
28001 10 => {
28002 let _ = unsafe {
28003 self.raw.get().read_unchecked::<crate::WireOfferConfiguration<'de>>()
28004 };
28005 }
28006
28007 _ => (),
28008 }
28009 }
28010}
28011
28012unsafe impl ::fidl_next::Wire for WireOffer<'static> {
28013 type Decoded<'de> = WireOffer<'de>;
28014
28015 #[inline]
28016 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28017 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
28018 ::fidl_next::RawWireUnion::zero_padding(raw);
28019 }
28020}
28021
28022pub mod offer {
28023 pub enum Ref<'de> {
28024 Service(&'de crate::WireOfferService<'de>),
28025
28026 Protocol(&'de crate::WireOfferProtocol<'de>),
28027
28028 Directory(&'de crate::WireOfferDirectory<'de>),
28029
28030 Storage(&'de crate::WireOfferStorage<'de>),
28031
28032 Runner(&'de crate::WireOfferRunner<'de>),
28033
28034 Resolver(&'de crate::WireOfferResolver<'de>),
28035
28036 EventStream(&'de crate::WireOfferEventStream<'de>),
28037
28038 Dictionary(&'de crate::WireOfferDictionary<'de>),
28039
28040 Config(&'de crate::WireOfferConfiguration<'de>),
28041
28042 UnknownOrdinal_(u64),
28043 }
28044}
28045
28046impl<'de> WireOffer<'de> {
28047 pub fn as_ref(&self) -> crate::offer::Ref<'_> {
28048 match self.raw.ordinal() {
28049 1 => crate::offer::Ref::Service(unsafe {
28050 self.raw.get().deref_unchecked::<crate::WireOfferService<'_>>()
28051 }),
28052
28053 2 => crate::offer::Ref::Protocol(unsafe {
28054 self.raw.get().deref_unchecked::<crate::WireOfferProtocol<'_>>()
28055 }),
28056
28057 3 => crate::offer::Ref::Directory(unsafe {
28058 self.raw.get().deref_unchecked::<crate::WireOfferDirectory<'_>>()
28059 }),
28060
28061 4 => crate::offer::Ref::Storage(unsafe {
28062 self.raw.get().deref_unchecked::<crate::WireOfferStorage<'_>>()
28063 }),
28064
28065 5 => crate::offer::Ref::Runner(unsafe {
28066 self.raw.get().deref_unchecked::<crate::WireOfferRunner<'_>>()
28067 }),
28068
28069 6 => crate::offer::Ref::Resolver(unsafe {
28070 self.raw.get().deref_unchecked::<crate::WireOfferResolver<'_>>()
28071 }),
28072
28073 8 => crate::offer::Ref::EventStream(unsafe {
28074 self.raw.get().deref_unchecked::<crate::WireOfferEventStream<'_>>()
28075 }),
28076
28077 9 => crate::offer::Ref::Dictionary(unsafe {
28078 self.raw.get().deref_unchecked::<crate::WireOfferDictionary<'_>>()
28079 }),
28080
28081 10 => crate::offer::Ref::Config(unsafe {
28082 self.raw.get().deref_unchecked::<crate::WireOfferConfiguration<'_>>()
28083 }),
28084
28085 unknown => crate::offer::Ref::UnknownOrdinal_(unknown),
28086 }
28087 }
28088}
28089
28090unsafe impl<___D> ::fidl_next::Decode<___D> for WireOffer<'static>
28091where
28092 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
28093 ___D: ::fidl_next::Decoder,
28094{
28095 fn decode(
28096 mut slot: ::fidl_next::Slot<'_, Self>,
28097 decoder: &mut ___D,
28098 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28099 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
28100 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
28101 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferService<'static>>(
28102 raw, decoder,
28103 )?,
28104
28105 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferProtocol<'static>>(
28106 raw, decoder,
28107 )?,
28108
28109 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferDirectory<'static>>(
28110 raw, decoder,
28111 )?,
28112
28113 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferStorage<'static>>(
28114 raw, decoder,
28115 )?,
28116
28117 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferRunner<'static>>(
28118 raw, decoder,
28119 )?,
28120
28121 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferResolver<'static>>(
28122 raw, decoder,
28123 )?,
28124
28125 8 => {
28126 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferEventStream<'static>>(
28127 raw, decoder,
28128 )?
28129 }
28130
28131 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferDictionary<'static>>(
28132 raw, decoder,
28133 )?,
28134
28135 10 => ::fidl_next::RawWireUnion::decode_as::<
28136 ___D,
28137 crate::WireOfferConfiguration<'static>,
28138 >(raw, decoder)?,
28139
28140 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
28141 }
28142
28143 Ok(())
28144 }
28145}
28146
28147impl<'de> ::core::fmt::Debug for WireOffer<'de> {
28148 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
28149 match self.raw.ordinal() {
28150 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferService<'_>>().fmt(f) },
28151 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferProtocol<'_>>().fmt(f) },
28152 3 => unsafe {
28153 self.raw.get().deref_unchecked::<crate::WireOfferDirectory<'_>>().fmt(f)
28154 },
28155 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferStorage<'_>>().fmt(f) },
28156 5 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferRunner<'_>>().fmt(f) },
28157 6 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferResolver<'_>>().fmt(f) },
28158 8 => unsafe {
28159 self.raw.get().deref_unchecked::<crate::WireOfferEventStream<'_>>().fmt(f)
28160 },
28161 9 => unsafe {
28162 self.raw.get().deref_unchecked::<crate::WireOfferDictionary<'_>>().fmt(f)
28163 },
28164 10 => unsafe {
28165 self.raw.get().deref_unchecked::<crate::WireOfferConfiguration<'_>>().fmt(f)
28166 },
28167 _ => unsafe { ::core::hint::unreachable_unchecked() },
28168 }
28169 }
28170}
28171
28172#[repr(transparent)]
28173pub struct WireOptionalOffer<'de> {
28174 raw: ::fidl_next::RawWireUnion,
28175 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
28176}
28177
28178unsafe impl ::fidl_next::Wire for WireOptionalOffer<'static> {
28179 type Decoded<'de> = WireOptionalOffer<'de>;
28180
28181 #[inline]
28182 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28183 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
28184 ::fidl_next::RawWireUnion::zero_padding(raw);
28185 }
28186}
28187
28188impl<'de> WireOptionalOffer<'de> {
28189 pub fn is_some(&self) -> bool {
28190 self.raw.is_some()
28191 }
28192
28193 pub fn is_none(&self) -> bool {
28194 self.raw.is_none()
28195 }
28196
28197 pub fn as_ref(&self) -> ::core::option::Option<&WireOffer<'de>> {
28198 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
28199 }
28200
28201 pub fn into_option(self) -> ::core::option::Option<WireOffer<'de>> {
28202 if self.is_some() {
28203 Some(WireOffer { raw: self.raw, _phantom: ::core::marker::PhantomData })
28204 } else {
28205 None
28206 }
28207 }
28208}
28209
28210unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalOffer<'static>
28211where
28212 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
28213 ___D: ::fidl_next::Decoder,
28214{
28215 fn decode(
28216 mut slot: ::fidl_next::Slot<'_, Self>,
28217 decoder: &mut ___D,
28218 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28219 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
28220 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
28221 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferService<'static>>(
28222 raw, decoder,
28223 )?,
28224
28225 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferProtocol<'static>>(
28226 raw, decoder,
28227 )?,
28228
28229 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferDirectory<'static>>(
28230 raw, decoder,
28231 )?,
28232
28233 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferStorage<'static>>(
28234 raw, decoder,
28235 )?,
28236
28237 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferRunner<'static>>(
28238 raw, decoder,
28239 )?,
28240
28241 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferResolver<'static>>(
28242 raw, decoder,
28243 )?,
28244
28245 8 => {
28246 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferEventStream<'static>>(
28247 raw, decoder,
28248 )?
28249 }
28250
28251 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferDictionary<'static>>(
28252 raw, decoder,
28253 )?,
28254
28255 10 => ::fidl_next::RawWireUnion::decode_as::<
28256 ___D,
28257 crate::WireOfferConfiguration<'static>,
28258 >(raw, decoder)?,
28259
28260 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
28261 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
28262 }
28263
28264 Ok(())
28265 }
28266}
28267
28268impl<'de> ::core::fmt::Debug for WireOptionalOffer<'de> {
28269 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
28270 self.as_ref().fmt(f)
28271 }
28272}
28273
28274#[doc = " A repository of the runners available in an environment.\n"]
28275#[derive(PartialEq, Clone, Debug, Default)]
28276pub struct RunnerRegistration {
28277 pub source_name: ::core::option::Option<::std::string::String>,
28278
28279 pub source: ::core::option::Option<crate::Ref>,
28280
28281 pub target_name: ::core::option::Option<::std::string::String>,
28282}
28283
28284impl RunnerRegistration {
28285 fn __max_ordinal(&self) -> usize {
28286 if self.target_name.is_some() {
28287 return 3;
28288 }
28289
28290 if self.source.is_some() {
28291 return 2;
28292 }
28293
28294 if self.source_name.is_some() {
28295 return 1;
28296 }
28297
28298 0
28299 }
28300}
28301
28302impl ::fidl_next::Encodable for RunnerRegistration {
28303 type Encoded = WireRunnerRegistration<'static>;
28304}
28305
28306unsafe impl<___E> ::fidl_next::Encode<___E> for RunnerRegistration
28307where
28308 ___E: ::fidl_next::Encoder + ?Sized,
28309{
28310 #[inline]
28311 fn encode(
28312 mut self,
28313 encoder: &mut ___E,
28314 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28315 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28316 ::fidl_next::munge!(let WireRunnerRegistration { table } = out);
28317
28318 let max_ord = self.__max_ordinal();
28319
28320 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
28321 ::fidl_next::Wire::zero_padding(&mut out);
28322
28323 let mut preallocated =
28324 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
28325
28326 for i in 1..=max_ord {
28327 match i {
28328 3 => {
28329 if let Some(value) = self.target_name.take() {
28330 ::fidl_next::WireEnvelope::encode_value(
28331 value,
28332 preallocated.encoder,
28333 &mut out,
28334 )?;
28335 } else {
28336 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28337 }
28338 }
28339
28340 2 => {
28341 if let Some(value) = self.source.take() {
28342 ::fidl_next::WireEnvelope::encode_value(
28343 value,
28344 preallocated.encoder,
28345 &mut out,
28346 )?;
28347 } else {
28348 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28349 }
28350 }
28351
28352 1 => {
28353 if let Some(value) = self.source_name.take() {
28354 ::fidl_next::WireEnvelope::encode_value(
28355 value,
28356 preallocated.encoder,
28357 &mut out,
28358 )?;
28359 } else {
28360 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28361 }
28362 }
28363
28364 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
28365 }
28366 unsafe {
28367 preallocated.write_next(out.assume_init_ref());
28368 }
28369 }
28370
28371 ::fidl_next::WireTable::encode_len(table, max_ord);
28372
28373 Ok(())
28374 }
28375}
28376
28377unsafe impl<___E> ::fidl_next::EncodeRef<___E> for RunnerRegistration
28378where
28379 ___E: ::fidl_next::Encoder + ?Sized,
28380{
28381 #[inline]
28382 fn encode_ref(
28383 &self,
28384 encoder: &mut ___E,
28385 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28386 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28387 ::fidl_next::munge!(let WireRunnerRegistration { table } = out);
28388
28389 let max_ord = self.__max_ordinal();
28390
28391 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
28392 ::fidl_next::Wire::zero_padding(&mut out);
28393
28394 let mut preallocated =
28395 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
28396
28397 for i in 1..=max_ord {
28398 match i {
28399 3 => {
28400 if let Some(value) = &self.target_name {
28401 ::fidl_next::WireEnvelope::encode_value(
28402 value,
28403 preallocated.encoder,
28404 &mut out,
28405 )?;
28406 } else {
28407 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28408 }
28409 }
28410
28411 2 => {
28412 if let Some(value) = &self.source {
28413 ::fidl_next::WireEnvelope::encode_value(
28414 value,
28415 preallocated.encoder,
28416 &mut out,
28417 )?;
28418 } else {
28419 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28420 }
28421 }
28422
28423 1 => {
28424 if let Some(value) = &self.source_name {
28425 ::fidl_next::WireEnvelope::encode_value(
28426 value,
28427 preallocated.encoder,
28428 &mut out,
28429 )?;
28430 } else {
28431 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28432 }
28433 }
28434
28435 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
28436 }
28437 unsafe {
28438 preallocated.write_next(out.assume_init_ref());
28439 }
28440 }
28441
28442 ::fidl_next::WireTable::encode_len(table, max_ord);
28443
28444 Ok(())
28445 }
28446}
28447
28448impl<'de> ::fidl_next::FromWire<WireRunnerRegistration<'de>> for RunnerRegistration {
28449 #[inline]
28450 fn from_wire(wire_: WireRunnerRegistration<'de>) -> Self {
28451 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
28452
28453 let source_name = wire_.table.get(1);
28454
28455 let source = wire_.table.get(2);
28456
28457 let target_name = wire_.table.get(3);
28458
28459 Self {
28460 source_name: source_name.map(|envelope| {
28461 ::fidl_next::FromWire::from_wire(unsafe {
28462 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28463 })
28464 }),
28465
28466 source: source.map(|envelope| {
28467 ::fidl_next::FromWire::from_wire(unsafe {
28468 envelope.read_unchecked::<crate::WireRef<'de>>()
28469 })
28470 }),
28471
28472 target_name: target_name.map(|envelope| {
28473 ::fidl_next::FromWire::from_wire(unsafe {
28474 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28475 })
28476 }),
28477 }
28478 }
28479}
28480
28481impl<'de> ::fidl_next::IntoNatural for WireRunnerRegistration<'de> {
28482 type Natural = RunnerRegistration;
28483}
28484
28485impl<'de> ::fidl_next::FromWireRef<WireRunnerRegistration<'de>> for RunnerRegistration {
28486 #[inline]
28487 fn from_wire_ref(wire: &WireRunnerRegistration<'de>) -> Self {
28488 Self {
28489 source_name: wire.table.get(1).map(|envelope| {
28490 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
28491 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
28492 })
28493 }),
28494
28495 source: wire.table.get(2).map(|envelope| {
28496 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
28497 envelope.deref_unchecked::<crate::WireRef<'de>>()
28498 })
28499 }),
28500
28501 target_name: wire.table.get(3).map(|envelope| {
28502 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
28503 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
28504 })
28505 }),
28506 }
28507 }
28508}
28509
28510#[repr(C)]
28512pub struct WireRunnerRegistration<'de> {
28513 table: ::fidl_next::WireTable<'de>,
28514}
28515
28516impl<'de> Drop for WireRunnerRegistration<'de> {
28517 fn drop(&mut self) {
28518 let _ = self
28519 .table
28520 .get(1)
28521 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
28522
28523 let _ = self
28524 .table
28525 .get(2)
28526 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
28527
28528 let _ = self
28529 .table
28530 .get(3)
28531 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
28532 }
28533}
28534
28535unsafe impl ::fidl_next::Wire for WireRunnerRegistration<'static> {
28536 type Decoded<'de> = WireRunnerRegistration<'de>;
28537
28538 #[inline]
28539 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28540 ::fidl_next::munge!(let Self { table } = out);
28541 ::fidl_next::WireTable::zero_padding(table);
28542 }
28543}
28544
28545unsafe impl<___D> ::fidl_next::Decode<___D> for WireRunnerRegistration<'static>
28546where
28547 ___D: ::fidl_next::Decoder + ?Sized,
28548{
28549 fn decode(
28550 slot: ::fidl_next::Slot<'_, Self>,
28551 decoder: &mut ___D,
28552 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28553 ::fidl_next::munge!(let Self { table } = slot);
28554
28555 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28556 match ordinal {
28557 0 => unsafe { ::core::hint::unreachable_unchecked() },
28558
28559 1 => {
28560 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
28561 slot.as_mut(),
28562 decoder,
28563 )?;
28564
28565 let value = unsafe {
28566 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28567 };
28568
28569 if value.len() > 100 {
28570 return Err(::fidl_next::DecodeError::VectorTooLong {
28571 size: value.len() as u64,
28572 limit: 100,
28573 });
28574 }
28575
28576 Ok(())
28577 }
28578
28579 2 => {
28580 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
28581 slot.as_mut(),
28582 decoder,
28583 )?;
28584
28585 Ok(())
28586 }
28587
28588 3 => {
28589 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
28590 slot.as_mut(),
28591 decoder,
28592 )?;
28593
28594 let value = unsafe {
28595 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28596 };
28597
28598 if value.len() > 100 {
28599 return Err(::fidl_next::DecodeError::VectorTooLong {
28600 size: value.len() as u64,
28601 limit: 100,
28602 });
28603 }
28604
28605 Ok(())
28606 }
28607
28608 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
28609 }
28610 })
28611 }
28612}
28613
28614impl<'de> WireRunnerRegistration<'de> {
28615 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28616 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28617 }
28618
28619 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
28620 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28621 }
28622
28623 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28624 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28625 }
28626}
28627
28628impl<'de> ::core::fmt::Debug for WireRunnerRegistration<'de> {
28629 fn fmt(
28630 &self,
28631 f: &mut ::core::fmt::Formatter<'_>,
28632 ) -> ::core::result::Result<(), ::core::fmt::Error> {
28633 f.debug_struct("RunnerRegistration")
28634 .field("source_name", &self.source_name())
28635 .field("source", &self.source())
28636 .field("target_name", &self.target_name())
28637 .finish()
28638 }
28639}
28640
28641#[doc = " A mapping of URL scheme to resolver name.\n"]
28642#[derive(PartialEq, Clone, Debug, Default)]
28643pub struct ResolverRegistration {
28644 pub resolver: ::core::option::Option<::std::string::String>,
28645
28646 pub source: ::core::option::Option<crate::Ref>,
28647
28648 pub scheme: ::core::option::Option<::std::string::String>,
28649}
28650
28651impl ResolverRegistration {
28652 fn __max_ordinal(&self) -> usize {
28653 if self.scheme.is_some() {
28654 return 3;
28655 }
28656
28657 if self.source.is_some() {
28658 return 2;
28659 }
28660
28661 if self.resolver.is_some() {
28662 return 1;
28663 }
28664
28665 0
28666 }
28667}
28668
28669impl ::fidl_next::Encodable for ResolverRegistration {
28670 type Encoded = WireResolverRegistration<'static>;
28671}
28672
28673unsafe impl<___E> ::fidl_next::Encode<___E> for ResolverRegistration
28674where
28675 ___E: ::fidl_next::Encoder + ?Sized,
28676{
28677 #[inline]
28678 fn encode(
28679 mut self,
28680 encoder: &mut ___E,
28681 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28682 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28683 ::fidl_next::munge!(let WireResolverRegistration { table } = out);
28684
28685 let max_ord = self.__max_ordinal();
28686
28687 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
28688 ::fidl_next::Wire::zero_padding(&mut out);
28689
28690 let mut preallocated =
28691 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
28692
28693 for i in 1..=max_ord {
28694 match i {
28695 3 => {
28696 if let Some(value) = self.scheme.take() {
28697 ::fidl_next::WireEnvelope::encode_value(
28698 value,
28699 preallocated.encoder,
28700 &mut out,
28701 )?;
28702 } else {
28703 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28704 }
28705 }
28706
28707 2 => {
28708 if let Some(value) = self.source.take() {
28709 ::fidl_next::WireEnvelope::encode_value(
28710 value,
28711 preallocated.encoder,
28712 &mut out,
28713 )?;
28714 } else {
28715 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28716 }
28717 }
28718
28719 1 => {
28720 if let Some(value) = self.resolver.take() {
28721 ::fidl_next::WireEnvelope::encode_value(
28722 value,
28723 preallocated.encoder,
28724 &mut out,
28725 )?;
28726 } else {
28727 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28728 }
28729 }
28730
28731 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
28732 }
28733 unsafe {
28734 preallocated.write_next(out.assume_init_ref());
28735 }
28736 }
28737
28738 ::fidl_next::WireTable::encode_len(table, max_ord);
28739
28740 Ok(())
28741 }
28742}
28743
28744unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ResolverRegistration
28745where
28746 ___E: ::fidl_next::Encoder + ?Sized,
28747{
28748 #[inline]
28749 fn encode_ref(
28750 &self,
28751 encoder: &mut ___E,
28752 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
28753 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
28754 ::fidl_next::munge!(let WireResolverRegistration { table } = out);
28755
28756 let max_ord = self.__max_ordinal();
28757
28758 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
28759 ::fidl_next::Wire::zero_padding(&mut out);
28760
28761 let mut preallocated =
28762 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
28763
28764 for i in 1..=max_ord {
28765 match i {
28766 3 => {
28767 if let Some(value) = &self.scheme {
28768 ::fidl_next::WireEnvelope::encode_value(
28769 value,
28770 preallocated.encoder,
28771 &mut out,
28772 )?;
28773 } else {
28774 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28775 }
28776 }
28777
28778 2 => {
28779 if let Some(value) = &self.source {
28780 ::fidl_next::WireEnvelope::encode_value(
28781 value,
28782 preallocated.encoder,
28783 &mut out,
28784 )?;
28785 } else {
28786 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28787 }
28788 }
28789
28790 1 => {
28791 if let Some(value) = &self.resolver {
28792 ::fidl_next::WireEnvelope::encode_value(
28793 value,
28794 preallocated.encoder,
28795 &mut out,
28796 )?;
28797 } else {
28798 ::fidl_next::WireEnvelope::encode_zero(&mut out)
28799 }
28800 }
28801
28802 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
28803 }
28804 unsafe {
28805 preallocated.write_next(out.assume_init_ref());
28806 }
28807 }
28808
28809 ::fidl_next::WireTable::encode_len(table, max_ord);
28810
28811 Ok(())
28812 }
28813}
28814
28815impl<'de> ::fidl_next::FromWire<WireResolverRegistration<'de>> for ResolverRegistration {
28816 #[inline]
28817 fn from_wire(wire_: WireResolverRegistration<'de>) -> Self {
28818 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
28819
28820 let resolver = wire_.table.get(1);
28821
28822 let source = wire_.table.get(2);
28823
28824 let scheme = wire_.table.get(3);
28825
28826 Self {
28827 resolver: resolver.map(|envelope| {
28828 ::fidl_next::FromWire::from_wire(unsafe {
28829 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28830 })
28831 }),
28832
28833 source: source.map(|envelope| {
28834 ::fidl_next::FromWire::from_wire(unsafe {
28835 envelope.read_unchecked::<crate::WireRef<'de>>()
28836 })
28837 }),
28838
28839 scheme: scheme.map(|envelope| {
28840 ::fidl_next::FromWire::from_wire(unsafe {
28841 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28842 })
28843 }),
28844 }
28845 }
28846}
28847
28848impl<'de> ::fidl_next::IntoNatural for WireResolverRegistration<'de> {
28849 type Natural = ResolverRegistration;
28850}
28851
28852impl<'de> ::fidl_next::FromWireRef<WireResolverRegistration<'de>> for ResolverRegistration {
28853 #[inline]
28854 fn from_wire_ref(wire: &WireResolverRegistration<'de>) -> Self {
28855 Self {
28856 resolver: wire.table.get(1).map(|envelope| {
28857 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
28858 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
28859 })
28860 }),
28861
28862 source: wire.table.get(2).map(|envelope| {
28863 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
28864 envelope.deref_unchecked::<crate::WireRef<'de>>()
28865 })
28866 }),
28867
28868 scheme: wire.table.get(3).map(|envelope| {
28869 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
28870 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
28871 })
28872 }),
28873 }
28874 }
28875}
28876
28877#[repr(C)]
28879pub struct WireResolverRegistration<'de> {
28880 table: ::fidl_next::WireTable<'de>,
28881}
28882
28883impl<'de> Drop for WireResolverRegistration<'de> {
28884 fn drop(&mut self) {
28885 let _ = self
28886 .table
28887 .get(1)
28888 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
28889
28890 let _ = self
28891 .table
28892 .get(2)
28893 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
28894
28895 let _ = self
28896 .table
28897 .get(3)
28898 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
28899 }
28900}
28901
28902unsafe impl ::fidl_next::Wire for WireResolverRegistration<'static> {
28903 type Decoded<'de> = WireResolverRegistration<'de>;
28904
28905 #[inline]
28906 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28907 ::fidl_next::munge!(let Self { table } = out);
28908 ::fidl_next::WireTable::zero_padding(table);
28909 }
28910}
28911
28912unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolverRegistration<'static>
28913where
28914 ___D: ::fidl_next::Decoder + ?Sized,
28915{
28916 fn decode(
28917 slot: ::fidl_next::Slot<'_, Self>,
28918 decoder: &mut ___D,
28919 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28920 ::fidl_next::munge!(let Self { table } = slot);
28921
28922 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28923 match ordinal {
28924 0 => unsafe { ::core::hint::unreachable_unchecked() },
28925
28926 1 => {
28927 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
28928 slot.as_mut(),
28929 decoder,
28930 )?;
28931
28932 let value = unsafe {
28933 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28934 };
28935
28936 if value.len() > 100 {
28937 return Err(::fidl_next::DecodeError::VectorTooLong {
28938 size: value.len() as u64,
28939 limit: 100,
28940 });
28941 }
28942
28943 Ok(())
28944 }
28945
28946 2 => {
28947 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
28948 slot.as_mut(),
28949 decoder,
28950 )?;
28951
28952 Ok(())
28953 }
28954
28955 3 => {
28956 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
28957 slot.as_mut(),
28958 decoder,
28959 )?;
28960
28961 let value = unsafe {
28962 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28963 };
28964
28965 if value.len() > 100 {
28966 return Err(::fidl_next::DecodeError::VectorTooLong {
28967 size: value.len() as u64,
28968 limit: 100,
28969 });
28970 }
28971
28972 Ok(())
28973 }
28974
28975 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
28976 }
28977 })
28978 }
28979}
28980
28981impl<'de> WireResolverRegistration<'de> {
28982 pub fn resolver(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28983 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28984 }
28985
28986 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
28987 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28988 }
28989
28990 pub fn scheme(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28991 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28992 }
28993}
28994
28995impl<'de> ::core::fmt::Debug for WireResolverRegistration<'de> {
28996 fn fmt(
28997 &self,
28998 f: &mut ::core::fmt::Formatter<'_>,
28999 ) -> ::core::result::Result<(), ::core::fmt::Error> {
29000 f.debug_struct("ResolverRegistration")
29001 .field("resolver", &self.resolver())
29002 .field("source", &self.source())
29003 .field("scheme", &self.scheme())
29004 .finish()
29005 }
29006}
29007
29008#[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"]
29009#[derive(PartialEq, Clone, Debug, Default)]
29010pub struct DebugProtocolRegistration {
29011 pub source: ::core::option::Option<crate::Ref>,
29012
29013 pub source_name: ::core::option::Option<::std::string::String>,
29014
29015 pub target_name: ::core::option::Option<::std::string::String>,
29016}
29017
29018impl DebugProtocolRegistration {
29019 fn __max_ordinal(&self) -> usize {
29020 if self.target_name.is_some() {
29021 return 3;
29022 }
29023
29024 if self.source_name.is_some() {
29025 return 2;
29026 }
29027
29028 if self.source.is_some() {
29029 return 1;
29030 }
29031
29032 0
29033 }
29034}
29035
29036impl ::fidl_next::Encodable for DebugProtocolRegistration {
29037 type Encoded = WireDebugProtocolRegistration<'static>;
29038}
29039
29040unsafe impl<___E> ::fidl_next::Encode<___E> for DebugProtocolRegistration
29041where
29042 ___E: ::fidl_next::Encoder + ?Sized,
29043{
29044 #[inline]
29045 fn encode(
29046 mut self,
29047 encoder: &mut ___E,
29048 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
29049 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
29050 ::fidl_next::munge!(let WireDebugProtocolRegistration { table } = out);
29051
29052 let max_ord = self.__max_ordinal();
29053
29054 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
29055 ::fidl_next::Wire::zero_padding(&mut out);
29056
29057 let mut preallocated =
29058 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
29059
29060 for i in 1..=max_ord {
29061 match i {
29062 3 => {
29063 if let Some(value) = self.target_name.take() {
29064 ::fidl_next::WireEnvelope::encode_value(
29065 value,
29066 preallocated.encoder,
29067 &mut out,
29068 )?;
29069 } else {
29070 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29071 }
29072 }
29073
29074 2 => {
29075 if let Some(value) = self.source_name.take() {
29076 ::fidl_next::WireEnvelope::encode_value(
29077 value,
29078 preallocated.encoder,
29079 &mut out,
29080 )?;
29081 } else {
29082 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29083 }
29084 }
29085
29086 1 => {
29087 if let Some(value) = self.source.take() {
29088 ::fidl_next::WireEnvelope::encode_value(
29089 value,
29090 preallocated.encoder,
29091 &mut out,
29092 )?;
29093 } else {
29094 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29095 }
29096 }
29097
29098 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
29099 }
29100 unsafe {
29101 preallocated.write_next(out.assume_init_ref());
29102 }
29103 }
29104
29105 ::fidl_next::WireTable::encode_len(table, max_ord);
29106
29107 Ok(())
29108 }
29109}
29110
29111unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DebugProtocolRegistration
29112where
29113 ___E: ::fidl_next::Encoder + ?Sized,
29114{
29115 #[inline]
29116 fn encode_ref(
29117 &self,
29118 encoder: &mut ___E,
29119 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
29120 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
29121 ::fidl_next::munge!(let WireDebugProtocolRegistration { table } = out);
29122
29123 let max_ord = self.__max_ordinal();
29124
29125 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
29126 ::fidl_next::Wire::zero_padding(&mut out);
29127
29128 let mut preallocated =
29129 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
29130
29131 for i in 1..=max_ord {
29132 match i {
29133 3 => {
29134 if let Some(value) = &self.target_name {
29135 ::fidl_next::WireEnvelope::encode_value(
29136 value,
29137 preallocated.encoder,
29138 &mut out,
29139 )?;
29140 } else {
29141 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29142 }
29143 }
29144
29145 2 => {
29146 if let Some(value) = &self.source_name {
29147 ::fidl_next::WireEnvelope::encode_value(
29148 value,
29149 preallocated.encoder,
29150 &mut out,
29151 )?;
29152 } else {
29153 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29154 }
29155 }
29156
29157 1 => {
29158 if let Some(value) = &self.source {
29159 ::fidl_next::WireEnvelope::encode_value(
29160 value,
29161 preallocated.encoder,
29162 &mut out,
29163 )?;
29164 } else {
29165 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29166 }
29167 }
29168
29169 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
29170 }
29171 unsafe {
29172 preallocated.write_next(out.assume_init_ref());
29173 }
29174 }
29175
29176 ::fidl_next::WireTable::encode_len(table, max_ord);
29177
29178 Ok(())
29179 }
29180}
29181
29182impl<'de> ::fidl_next::FromWire<WireDebugProtocolRegistration<'de>> for DebugProtocolRegistration {
29183 #[inline]
29184 fn from_wire(wire_: WireDebugProtocolRegistration<'de>) -> Self {
29185 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
29186
29187 let source = wire_.table.get(1);
29188
29189 let source_name = wire_.table.get(2);
29190
29191 let target_name = wire_.table.get(3);
29192
29193 Self {
29194 source: source.map(|envelope| {
29195 ::fidl_next::FromWire::from_wire(unsafe {
29196 envelope.read_unchecked::<crate::WireRef<'de>>()
29197 })
29198 }),
29199
29200 source_name: source_name.map(|envelope| {
29201 ::fidl_next::FromWire::from_wire(unsafe {
29202 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
29203 })
29204 }),
29205
29206 target_name: target_name.map(|envelope| {
29207 ::fidl_next::FromWire::from_wire(unsafe {
29208 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
29209 })
29210 }),
29211 }
29212 }
29213}
29214
29215impl<'de> ::fidl_next::IntoNatural for WireDebugProtocolRegistration<'de> {
29216 type Natural = DebugProtocolRegistration;
29217}
29218
29219impl<'de> ::fidl_next::FromWireRef<WireDebugProtocolRegistration<'de>>
29220 for DebugProtocolRegistration
29221{
29222 #[inline]
29223 fn from_wire_ref(wire: &WireDebugProtocolRegistration<'de>) -> Self {
29224 Self {
29225 source: wire.table.get(1).map(|envelope| {
29226 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
29227 envelope.deref_unchecked::<crate::WireRef<'de>>()
29228 })
29229 }),
29230
29231 source_name: wire.table.get(2).map(|envelope| {
29232 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
29233 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
29234 })
29235 }),
29236
29237 target_name: wire.table.get(3).map(|envelope| {
29238 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
29239 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
29240 })
29241 }),
29242 }
29243 }
29244}
29245
29246#[repr(C)]
29248pub struct WireDebugProtocolRegistration<'de> {
29249 table: ::fidl_next::WireTable<'de>,
29250}
29251
29252impl<'de> Drop for WireDebugProtocolRegistration<'de> {
29253 fn drop(&mut self) {
29254 let _ = self
29255 .table
29256 .get(1)
29257 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireRef<'de>>() });
29258
29259 let _ = self
29260 .table
29261 .get(2)
29262 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
29263
29264 let _ = self
29265 .table
29266 .get(3)
29267 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
29268 }
29269}
29270
29271unsafe impl ::fidl_next::Wire for WireDebugProtocolRegistration<'static> {
29272 type Decoded<'de> = WireDebugProtocolRegistration<'de>;
29273
29274 #[inline]
29275 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29276 ::fidl_next::munge!(let Self { table } = out);
29277 ::fidl_next::WireTable::zero_padding(table);
29278 }
29279}
29280
29281unsafe impl<___D> ::fidl_next::Decode<___D> for WireDebugProtocolRegistration<'static>
29282where
29283 ___D: ::fidl_next::Decoder + ?Sized,
29284{
29285 fn decode(
29286 slot: ::fidl_next::Slot<'_, Self>,
29287 decoder: &mut ___D,
29288 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29289 ::fidl_next::munge!(let Self { table } = slot);
29290
29291 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
29292 match ordinal {
29293 0 => unsafe { ::core::hint::unreachable_unchecked() },
29294
29295 1 => {
29296 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef<'static>>(
29297 slot.as_mut(),
29298 decoder,
29299 )?;
29300
29301 Ok(())
29302 }
29303
29304 2 => {
29305 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
29306 slot.as_mut(),
29307 decoder,
29308 )?;
29309
29310 let value = unsafe {
29311 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
29312 };
29313
29314 if value.len() > 100 {
29315 return Err(::fidl_next::DecodeError::VectorTooLong {
29316 size: value.len() as u64,
29317 limit: 100,
29318 });
29319 }
29320
29321 Ok(())
29322 }
29323
29324 3 => {
29325 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
29326 slot.as_mut(),
29327 decoder,
29328 )?;
29329
29330 let value = unsafe {
29331 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
29332 };
29333
29334 if value.len() > 100 {
29335 return Err(::fidl_next::DecodeError::VectorTooLong {
29336 size: value.len() as u64,
29337 limit: 100,
29338 });
29339 }
29340
29341 Ok(())
29342 }
29343
29344 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
29345 }
29346 })
29347 }
29348}
29349
29350impl<'de> WireDebugProtocolRegistration<'de> {
29351 pub fn source(&self) -> ::core::option::Option<&crate::WireRef<'de>> {
29352 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
29353 }
29354
29355 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
29356 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
29357 }
29358
29359 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
29360 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
29361 }
29362}
29363
29364impl<'de> ::core::fmt::Debug for WireDebugProtocolRegistration<'de> {
29365 fn fmt(
29366 &self,
29367 f: &mut ::core::fmt::Formatter<'_>,
29368 ) -> ::core::result::Result<(), ::core::fmt::Error> {
29369 f.debug_struct("DebugProtocolRegistration")
29370 .field("source", &self.source())
29371 .field("source_name", &self.source_name())
29372 .field("target_name", &self.target_name())
29373 .finish()
29374 }
29375}
29376
29377#[doc = " Declares a capability registered in the debug section of an environment.\n"]
29378#[derive(PartialEq, Clone, Debug)]
29379pub enum DebugRegistration {
29380 Protocol(crate::DebugProtocolRegistration),
29381
29382 UnknownOrdinal_(u64),
29383}
29384
29385impl ::fidl_next::Encodable for DebugRegistration {
29386 type Encoded = WireDebugRegistration<'static>;
29387}
29388
29389unsafe impl<___E> ::fidl_next::Encode<___E> for DebugRegistration
29390where
29391 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
29392 ___E: ::fidl_next::Encoder,
29393{
29394 #[inline]
29395 fn encode(
29396 self,
29397 encoder: &mut ___E,
29398 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
29399 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
29400 ::fidl_next::munge!(let WireDebugRegistration { raw, _phantom: _ } = out);
29401
29402 match self {
29403 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
29404 ___E,
29405 crate::DebugProtocolRegistration,
29406 >(value, 1, encoder, raw)?,
29407
29408 Self::UnknownOrdinal_(ordinal) => {
29409 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
29410 }
29411 }
29412
29413 Ok(())
29414 }
29415}
29416
29417unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DebugRegistration
29418where
29419 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
29420 ___E: ::fidl_next::Encoder,
29421{
29422 #[inline]
29423 fn encode_ref(
29424 &self,
29425 encoder: &mut ___E,
29426 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
29427 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
29428 ::fidl_next::munge!(let WireDebugRegistration { raw, _phantom: _ } = out);
29429
29430 match self {
29431 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
29432 ___E,
29433 &crate::DebugProtocolRegistration,
29434 >(value, 1, encoder, raw)?,
29435
29436 Self::UnknownOrdinal_(ordinal) => {
29437 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
29438 }
29439 }
29440
29441 Ok(())
29442 }
29443}
29444
29445impl ::fidl_next::EncodableOption for DebugRegistration {
29446 type EncodedOption = WireOptionalDebugRegistration<'static>;
29447}
29448
29449unsafe impl<___E> ::fidl_next::EncodeOption<___E> for DebugRegistration
29450where
29451 ___E: ?Sized,
29452 DebugRegistration: ::fidl_next::Encode<___E>,
29453{
29454 #[inline]
29455 fn encode_option(
29456 this: ::core::option::Option<Self>,
29457 encoder: &mut ___E,
29458 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
29459 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
29460 ::fidl_next::munge!(let WireOptionalDebugRegistration { raw, _phantom: _ } = &mut *out);
29461
29462 if let Some(inner) = this {
29463 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
29464 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
29465 } else {
29466 ::fidl_next::RawWireUnion::encode_absent(raw);
29467 }
29468
29469 Ok(())
29470 }
29471}
29472
29473unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for DebugRegistration
29474where
29475 ___E: ?Sized,
29476 DebugRegistration: ::fidl_next::EncodeRef<___E>,
29477{
29478 #[inline]
29479 fn encode_option_ref(
29480 this: ::core::option::Option<&Self>,
29481 encoder: &mut ___E,
29482 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
29483 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
29484 ::fidl_next::munge!(let WireOptionalDebugRegistration { raw, _phantom: _ } = &mut *out);
29485
29486 if let Some(inner) = this {
29487 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
29488 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
29489 } else {
29490 ::fidl_next::RawWireUnion::encode_absent(raw);
29491 }
29492
29493 Ok(())
29494 }
29495}
29496
29497impl<'de> ::fidl_next::FromWire<WireDebugRegistration<'de>> for DebugRegistration {
29498 #[inline]
29499 fn from_wire(wire: WireDebugRegistration<'de>) -> Self {
29500 let wire = ::core::mem::ManuallyDrop::new(wire);
29501 match wire.raw.ordinal() {
29502 1 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
29503 wire.raw.get().read_unchecked::<crate::WireDebugProtocolRegistration<'de>>()
29504 })),
29505
29506 _ => unsafe { ::core::hint::unreachable_unchecked() },
29507 }
29508 }
29509}
29510
29511impl<'de> ::fidl_next::IntoNatural for WireDebugRegistration<'de> {
29512 type Natural = DebugRegistration;
29513}
29514
29515impl<'de> ::fidl_next::FromWireRef<WireDebugRegistration<'de>> for DebugRegistration {
29516 #[inline]
29517 fn from_wire_ref(wire: &WireDebugRegistration<'de>) -> Self {
29518 match wire.raw.ordinal() {
29519 1 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
29520 wire.raw.get().deref_unchecked::<crate::WireDebugProtocolRegistration<'de>>()
29521 })),
29522
29523 _ => unsafe { ::core::hint::unreachable_unchecked() },
29524 }
29525 }
29526}
29527
29528impl<'de> ::fidl_next::FromWireOption<WireOptionalDebugRegistration<'de>> for DebugRegistration {
29529 #[inline]
29530 fn from_wire_option(wire: WireOptionalDebugRegistration<'de>) -> ::core::option::Option<Self> {
29531 if let Some(inner) = wire.into_option() {
29532 Some(::fidl_next::FromWire::from_wire(inner))
29533 } else {
29534 None
29535 }
29536 }
29537}
29538
29539impl<'de> ::fidl_next::IntoNatural for WireOptionalDebugRegistration<'de> {
29540 type Natural = ::core::option::Option<DebugRegistration>;
29541}
29542
29543impl<'de> ::fidl_next::FromWireOption<WireOptionalDebugRegistration<'de>>
29544 for Box<DebugRegistration>
29545{
29546 #[inline]
29547 fn from_wire_option(wire: WireOptionalDebugRegistration<'de>) -> ::core::option::Option<Self> {
29548 <
29549 DebugRegistration as ::fidl_next::FromWireOption<WireOptionalDebugRegistration<'de>>
29550 >::from_wire_option(wire).map(Box::new)
29551 }
29552}
29553
29554impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalDebugRegistration<'de>>
29555 for Box<DebugRegistration>
29556{
29557 #[inline]
29558 fn from_wire_option_ref(
29559 wire: &WireOptionalDebugRegistration<'de>,
29560 ) -> ::core::option::Option<Self> {
29561 if let Some(inner) = wire.as_ref() {
29562 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
29563 } else {
29564 None
29565 }
29566 }
29567}
29568
29569#[repr(transparent)]
29571pub struct WireDebugRegistration<'de> {
29572 raw: ::fidl_next::RawWireUnion,
29573 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
29574}
29575
29576impl<'de> Drop for WireDebugRegistration<'de> {
29577 fn drop(&mut self) {
29578 match self.raw.ordinal() {
29579 1 => {
29580 let _ = unsafe {
29581 self.raw.get().read_unchecked::<crate::WireDebugProtocolRegistration<'de>>()
29582 };
29583 }
29584
29585 _ => (),
29586 }
29587 }
29588}
29589
29590unsafe impl ::fidl_next::Wire for WireDebugRegistration<'static> {
29591 type Decoded<'de> = WireDebugRegistration<'de>;
29592
29593 #[inline]
29594 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29595 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
29596 ::fidl_next::RawWireUnion::zero_padding(raw);
29597 }
29598}
29599
29600pub mod debug_registration {
29601 pub enum Ref<'de> {
29602 Protocol(&'de crate::WireDebugProtocolRegistration<'de>),
29603
29604 UnknownOrdinal_(u64),
29605 }
29606}
29607
29608impl<'de> WireDebugRegistration<'de> {
29609 pub fn as_ref(&self) -> crate::debug_registration::Ref<'_> {
29610 match self.raw.ordinal() {
29611 1 => crate::debug_registration::Ref::Protocol(unsafe {
29612 self.raw.get().deref_unchecked::<crate::WireDebugProtocolRegistration<'_>>()
29613 }),
29614
29615 unknown => crate::debug_registration::Ref::UnknownOrdinal_(unknown),
29616 }
29617 }
29618}
29619
29620unsafe impl<___D> ::fidl_next::Decode<___D> for WireDebugRegistration<'static>
29621where
29622 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
29623 ___D: ::fidl_next::Decoder,
29624{
29625 fn decode(
29626 mut slot: ::fidl_next::Slot<'_, Self>,
29627 decoder: &mut ___D,
29628 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29629 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
29630 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
29631 1 => ::fidl_next::RawWireUnion::decode_as::<
29632 ___D,
29633 crate::WireDebugProtocolRegistration<'static>,
29634 >(raw, decoder)?,
29635
29636 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
29637 }
29638
29639 Ok(())
29640 }
29641}
29642
29643impl<'de> ::core::fmt::Debug for WireDebugRegistration<'de> {
29644 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
29645 match self.raw.ordinal() {
29646 1 => unsafe {
29647 self.raw.get().deref_unchecked::<crate::WireDebugProtocolRegistration<'_>>().fmt(f)
29648 },
29649 _ => unsafe { ::core::hint::unreachable_unchecked() },
29650 }
29651 }
29652}
29653
29654#[repr(transparent)]
29655pub struct WireOptionalDebugRegistration<'de> {
29656 raw: ::fidl_next::RawWireUnion,
29657 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
29658}
29659
29660unsafe impl ::fidl_next::Wire for WireOptionalDebugRegistration<'static> {
29661 type Decoded<'de> = WireOptionalDebugRegistration<'de>;
29662
29663 #[inline]
29664 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29665 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
29666 ::fidl_next::RawWireUnion::zero_padding(raw);
29667 }
29668}
29669
29670impl<'de> WireOptionalDebugRegistration<'de> {
29671 pub fn is_some(&self) -> bool {
29672 self.raw.is_some()
29673 }
29674
29675 pub fn is_none(&self) -> bool {
29676 self.raw.is_none()
29677 }
29678
29679 pub fn as_ref(&self) -> ::core::option::Option<&WireDebugRegistration<'de>> {
29680 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
29681 }
29682
29683 pub fn into_option(self) -> ::core::option::Option<WireDebugRegistration<'de>> {
29684 if self.is_some() {
29685 Some(WireDebugRegistration { raw: self.raw, _phantom: ::core::marker::PhantomData })
29686 } else {
29687 None
29688 }
29689 }
29690}
29691
29692unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDebugRegistration<'static>
29693where
29694 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
29695 ___D: ::fidl_next::Decoder,
29696{
29697 fn decode(
29698 mut slot: ::fidl_next::Slot<'_, Self>,
29699 decoder: &mut ___D,
29700 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29701 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
29702 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
29703 1 => ::fidl_next::RawWireUnion::decode_as::<
29704 ___D,
29705 crate::WireDebugProtocolRegistration<'static>,
29706 >(raw, decoder)?,
29707
29708 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
29709 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
29710 }
29711
29712 Ok(())
29713 }
29714}
29715
29716impl<'de> ::core::fmt::Debug for WireOptionalDebugRegistration<'de> {
29717 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
29718 self.as_ref().fmt(f)
29719 }
29720}
29721
29722#[doc = " Declares an environment which configures a realm.\n"]
29723#[derive(PartialEq, Clone, Debug, Default)]
29724pub struct Environment {
29725 pub name: ::core::option::Option<::std::string::String>,
29726
29727 pub extends: ::core::option::Option<crate::EnvironmentExtends>,
29728
29729 pub runners: ::core::option::Option<::std::vec::Vec<crate::RunnerRegistration>>,
29730
29731 pub resolvers: ::core::option::Option<::std::vec::Vec<crate::ResolverRegistration>>,
29732
29733 pub debug_capabilities: ::core::option::Option<::std::vec::Vec<crate::DebugRegistration>>,
29734
29735 pub stop_timeout_ms: ::core::option::Option<u32>,
29736}
29737
29738impl Environment {
29739 fn __max_ordinal(&self) -> usize {
29740 if self.stop_timeout_ms.is_some() {
29741 return 6;
29742 }
29743
29744 if self.debug_capabilities.is_some() {
29745 return 5;
29746 }
29747
29748 if self.resolvers.is_some() {
29749 return 4;
29750 }
29751
29752 if self.runners.is_some() {
29753 return 3;
29754 }
29755
29756 if self.extends.is_some() {
29757 return 2;
29758 }
29759
29760 if self.name.is_some() {
29761 return 1;
29762 }
29763
29764 0
29765 }
29766}
29767
29768impl ::fidl_next::Encodable for Environment {
29769 type Encoded = WireEnvironment<'static>;
29770}
29771
29772unsafe impl<___E> ::fidl_next::Encode<___E> for Environment
29773where
29774 ___E: ::fidl_next::Encoder + ?Sized,
29775{
29776 #[inline]
29777 fn encode(
29778 mut self,
29779 encoder: &mut ___E,
29780 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
29781 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
29782 ::fidl_next::munge!(let WireEnvironment { table } = out);
29783
29784 let max_ord = self.__max_ordinal();
29785
29786 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
29787 ::fidl_next::Wire::zero_padding(&mut out);
29788
29789 let mut preallocated =
29790 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
29791
29792 for i in 1..=max_ord {
29793 match i {
29794 6 => {
29795 if let Some(value) = self.stop_timeout_ms.take() {
29796 ::fidl_next::WireEnvelope::encode_value(
29797 value,
29798 preallocated.encoder,
29799 &mut out,
29800 )?;
29801 } else {
29802 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29803 }
29804 }
29805
29806 5 => {
29807 if let Some(value) = self.debug_capabilities.take() {
29808 ::fidl_next::WireEnvelope::encode_value(
29809 value,
29810 preallocated.encoder,
29811 &mut out,
29812 )?;
29813 } else {
29814 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29815 }
29816 }
29817
29818 4 => {
29819 if let Some(value) = self.resolvers.take() {
29820 ::fidl_next::WireEnvelope::encode_value(
29821 value,
29822 preallocated.encoder,
29823 &mut out,
29824 )?;
29825 } else {
29826 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29827 }
29828 }
29829
29830 3 => {
29831 if let Some(value) = self.runners.take() {
29832 ::fidl_next::WireEnvelope::encode_value(
29833 value,
29834 preallocated.encoder,
29835 &mut out,
29836 )?;
29837 } else {
29838 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29839 }
29840 }
29841
29842 2 => {
29843 if let Some(value) = self.extends.take() {
29844 ::fidl_next::WireEnvelope::encode_value(
29845 value,
29846 preallocated.encoder,
29847 &mut out,
29848 )?;
29849 } else {
29850 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29851 }
29852 }
29853
29854 1 => {
29855 if let Some(value) = self.name.take() {
29856 ::fidl_next::WireEnvelope::encode_value(
29857 value,
29858 preallocated.encoder,
29859 &mut out,
29860 )?;
29861 } else {
29862 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29863 }
29864 }
29865
29866 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
29867 }
29868 unsafe {
29869 preallocated.write_next(out.assume_init_ref());
29870 }
29871 }
29872
29873 ::fidl_next::WireTable::encode_len(table, max_ord);
29874
29875 Ok(())
29876 }
29877}
29878
29879unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Environment
29880where
29881 ___E: ::fidl_next::Encoder + ?Sized,
29882{
29883 #[inline]
29884 fn encode_ref(
29885 &self,
29886 encoder: &mut ___E,
29887 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
29888 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
29889 ::fidl_next::munge!(let WireEnvironment { table } = out);
29890
29891 let max_ord = self.__max_ordinal();
29892
29893 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
29894 ::fidl_next::Wire::zero_padding(&mut out);
29895
29896 let mut preallocated =
29897 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
29898
29899 for i in 1..=max_ord {
29900 match i {
29901 6 => {
29902 if let Some(value) = &self.stop_timeout_ms {
29903 ::fidl_next::WireEnvelope::encode_value(
29904 value,
29905 preallocated.encoder,
29906 &mut out,
29907 )?;
29908 } else {
29909 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29910 }
29911 }
29912
29913 5 => {
29914 if let Some(value) = &self.debug_capabilities {
29915 ::fidl_next::WireEnvelope::encode_value(
29916 value,
29917 preallocated.encoder,
29918 &mut out,
29919 )?;
29920 } else {
29921 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29922 }
29923 }
29924
29925 4 => {
29926 if let Some(value) = &self.resolvers {
29927 ::fidl_next::WireEnvelope::encode_value(
29928 value,
29929 preallocated.encoder,
29930 &mut out,
29931 )?;
29932 } else {
29933 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29934 }
29935 }
29936
29937 3 => {
29938 if let Some(value) = &self.runners {
29939 ::fidl_next::WireEnvelope::encode_value(
29940 value,
29941 preallocated.encoder,
29942 &mut out,
29943 )?;
29944 } else {
29945 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29946 }
29947 }
29948
29949 2 => {
29950 if let Some(value) = &self.extends {
29951 ::fidl_next::WireEnvelope::encode_value(
29952 value,
29953 preallocated.encoder,
29954 &mut out,
29955 )?;
29956 } else {
29957 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29958 }
29959 }
29960
29961 1 => {
29962 if let Some(value) = &self.name {
29963 ::fidl_next::WireEnvelope::encode_value(
29964 value,
29965 preallocated.encoder,
29966 &mut out,
29967 )?;
29968 } else {
29969 ::fidl_next::WireEnvelope::encode_zero(&mut out)
29970 }
29971 }
29972
29973 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
29974 }
29975 unsafe {
29976 preallocated.write_next(out.assume_init_ref());
29977 }
29978 }
29979
29980 ::fidl_next::WireTable::encode_len(table, max_ord);
29981
29982 Ok(())
29983 }
29984}
29985
29986impl<'de> ::fidl_next::FromWire<WireEnvironment<'de>> for Environment {
29987 #[inline]
29988 fn from_wire(wire_: WireEnvironment<'de>) -> Self {
29989 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
29990
29991 let name = wire_.table.get(1);
29992
29993 let extends = wire_.table.get(2);
29994
29995 let runners = wire_.table.get(3);
29996
29997 let resolvers = wire_.table.get(4);
29998
29999 let debug_capabilities = wire_.table.get(5);
30000
30001 let stop_timeout_ms = wire_.table.get(6);
30002
30003 Self {
30004
30005
30006 name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
30007 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
30008 )),
30009
30010
30011 extends: extends.map(|envelope| ::fidl_next::FromWire::from_wire(
30012 unsafe { envelope.read_unchecked::<crate::WireEnvironmentExtends>() }
30013 )),
30014
30015
30016 runners: runners.map(|envelope| ::fidl_next::FromWire::from_wire(
30017 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireRunnerRegistration<'de>>>() }
30018 )),
30019
30020
30021 resolvers: resolvers.map(|envelope| ::fidl_next::FromWire::from_wire(
30022 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireResolverRegistration<'de>>>() }
30023 )),
30024
30025
30026 debug_capabilities: debug_capabilities.map(|envelope| ::fidl_next::FromWire::from_wire(
30027 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireDebugRegistration<'de>>>() }
30028 )),
30029
30030
30031 stop_timeout_ms: stop_timeout_ms.map(|envelope| ::fidl_next::FromWire::from_wire(
30032 unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() }
30033 )),
30034
30035 }
30036 }
30037}
30038
30039impl<'de> ::fidl_next::IntoNatural for WireEnvironment<'de> {
30040 type Natural = Environment;
30041}
30042
30043impl<'de> ::fidl_next::FromWireRef<WireEnvironment<'de>> for Environment {
30044 #[inline]
30045 fn from_wire_ref(wire: &WireEnvironment<'de>) -> Self {
30046 Self {
30047
30048
30049 name: wire.table.get(1)
30050 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30051 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
30052 )),
30053
30054
30055 extends: wire.table.get(2)
30056 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30057 unsafe { envelope.deref_unchecked::<crate::WireEnvironmentExtends>() }
30058 )),
30059
30060
30061 runners: wire.table.get(3)
30062 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30063 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireRunnerRegistration<'de>>>() }
30064 )),
30065
30066
30067 resolvers: wire.table.get(4)
30068 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30069 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireResolverRegistration<'de>>>() }
30070 )),
30071
30072
30073 debug_capabilities: wire.table.get(5)
30074 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30075 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireDebugRegistration<'de>>>() }
30076 )),
30077
30078
30079 stop_timeout_ms: wire.table.get(6)
30080 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
30081 unsafe { envelope.deref_unchecked::<::fidl_next::WireU32>() }
30082 )),
30083
30084 }
30085 }
30086}
30087
30088#[repr(C)]
30090pub struct WireEnvironment<'de> {
30091 table: ::fidl_next::WireTable<'de>,
30092}
30093
30094impl<'de> Drop for WireEnvironment<'de> {
30095 fn drop(&mut self) {
30096 let _ = self
30097 .table
30098 .get(1)
30099 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
30100
30101 let _ = self
30102 .table
30103 .get(2)
30104 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireEnvironmentExtends>() });
30105
30106 let _ = self.table.get(3).map(|envelope| unsafe {
30107 envelope
30108 .read_unchecked::<::fidl_next::WireVector<'de, crate::WireRunnerRegistration<'de>>>(
30109 )
30110 });
30111
30112 let _ = self.table.get(4)
30113 .map(|envelope| unsafe {
30114 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireResolverRegistration<'de>>>()
30115 });
30116
30117 let _ = self.table.get(5)
30118 .map(|envelope| unsafe {
30119 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireDebugRegistration<'de>>>()
30120 });
30121
30122 let _ = self
30123 .table
30124 .get(6)
30125 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
30126 }
30127}
30128
30129unsafe impl ::fidl_next::Wire for WireEnvironment<'static> {
30130 type Decoded<'de> = WireEnvironment<'de>;
30131
30132 #[inline]
30133 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30134 ::fidl_next::munge!(let Self { table } = out);
30135 ::fidl_next::WireTable::zero_padding(table);
30136 }
30137}
30138
30139unsafe impl<___D> ::fidl_next::Decode<___D> for WireEnvironment<'static>
30140where
30141 ___D: ::fidl_next::Decoder + ?Sized,
30142{
30143 fn decode(
30144 slot: ::fidl_next::Slot<'_, Self>,
30145 decoder: &mut ___D,
30146 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30147 ::fidl_next::munge!(let Self { table } = slot);
30148
30149 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30150 match ordinal {
30151 0 => unsafe { ::core::hint::unreachable_unchecked() },
30152
30153 1 => {
30154 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
30155 slot.as_mut(),
30156 decoder,
30157 )?;
30158
30159 let value = unsafe {
30160 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30161 };
30162
30163 if value.len() > 100 {
30164 return Err(::fidl_next::DecodeError::VectorTooLong {
30165 size: value.len() as u64,
30166 limit: 100,
30167 });
30168 }
30169
30170 Ok(())
30171 }
30172
30173 2 => {
30174 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireEnvironmentExtends>(
30175 slot.as_mut(),
30176 decoder,
30177 )?;
30178
30179 Ok(())
30180 }
30181
30182 3 => {
30183 ::fidl_next::WireEnvelope::decode_as::<
30184 ___D,
30185 ::fidl_next::WireVector<'static, crate::WireRunnerRegistration<'static>>,
30186 >(slot.as_mut(), decoder)?;
30187
30188 Ok(())
30189 }
30190
30191 4 => {
30192 ::fidl_next::WireEnvelope::decode_as::<
30193 ___D,
30194 ::fidl_next::WireVector<'static, crate::WireResolverRegistration<'static>>,
30195 >(slot.as_mut(), decoder)?;
30196
30197 Ok(())
30198 }
30199
30200 5 => {
30201 ::fidl_next::WireEnvelope::decode_as::<
30202 ___D,
30203 ::fidl_next::WireVector<'static, crate::WireDebugRegistration<'static>>,
30204 >(slot.as_mut(), decoder)?;
30205
30206 Ok(())
30207 }
30208
30209 6 => {
30210 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
30211 slot.as_mut(),
30212 decoder,
30213 )?;
30214
30215 Ok(())
30216 }
30217
30218 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
30219 }
30220 })
30221 }
30222}
30223
30224impl<'de> WireEnvironment<'de> {
30225 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30226 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30227 }
30228
30229 pub fn extends(&self) -> ::core::option::Option<&crate::WireEnvironmentExtends> {
30230 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30231 }
30232
30233 pub fn runners(
30234 &self,
30235 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireRunnerRegistration<'de>>>
30236 {
30237 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
30238 }
30239
30240 pub fn resolvers(
30241 &self,
30242 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireResolverRegistration<'de>>>
30243 {
30244 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
30245 }
30246
30247 pub fn debug_capabilities(
30248 &self,
30249 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireDebugRegistration<'de>>>
30250 {
30251 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
30252 }
30253
30254 pub fn stop_timeout_ms(&self) -> ::core::option::Option<&::fidl_next::WireU32> {
30255 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
30256 }
30257}
30258
30259impl<'de> ::core::fmt::Debug for WireEnvironment<'de> {
30260 fn fmt(
30261 &self,
30262 f: &mut ::core::fmt::Formatter<'_>,
30263 ) -> ::core::result::Result<(), ::core::fmt::Error> {
30264 f.debug_struct("Environment")
30265 .field("name", &self.name())
30266 .field("extends", &self.extends())
30267 .field("runners", &self.runners())
30268 .field("resolvers", &self.resolvers())
30269 .field("debug_capabilities", &self.debug_capabilities())
30270 .field("stop_timeout_ms", &self.stop_timeout_ms())
30271 .finish()
30272 }
30273}
30274
30275#[derive(PartialEq, Clone, Debug, Default)]
30276pub struct ConfigSourceCapabilities {}
30277
30278impl ConfigSourceCapabilities {
30279 fn __max_ordinal(&self) -> usize {
30280 0
30281 }
30282}
30283
30284impl ::fidl_next::Encodable for ConfigSourceCapabilities {
30285 type Encoded = WireConfigSourceCapabilities<'static>;
30286}
30287
30288unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigSourceCapabilities
30289where
30290 ___E: ::fidl_next::Encoder + ?Sized,
30291{
30292 #[inline]
30293 fn encode(
30294 mut self,
30295 encoder: &mut ___E,
30296 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
30297 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
30298 ::fidl_next::munge!(let WireConfigSourceCapabilities { table } = out);
30299
30300 let max_ord = self.__max_ordinal();
30301
30302 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
30303 ::fidl_next::Wire::zero_padding(&mut out);
30304
30305 let mut preallocated =
30306 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
30307
30308 for i in 1..=max_ord {
30309 match i {
30310 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
30311 }
30312 unsafe {
30313 preallocated.write_next(out.assume_init_ref());
30314 }
30315 }
30316
30317 ::fidl_next::WireTable::encode_len(table, max_ord);
30318
30319 Ok(())
30320 }
30321}
30322
30323unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigSourceCapabilities
30324where
30325 ___E: ::fidl_next::Encoder + ?Sized,
30326{
30327 #[inline]
30328 fn encode_ref(
30329 &self,
30330 encoder: &mut ___E,
30331 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
30332 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
30333 ::fidl_next::munge!(let WireConfigSourceCapabilities { table } = out);
30334
30335 let max_ord = self.__max_ordinal();
30336
30337 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
30338 ::fidl_next::Wire::zero_padding(&mut out);
30339
30340 let mut preallocated =
30341 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
30342
30343 for i in 1..=max_ord {
30344 match i {
30345 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
30346 }
30347 unsafe {
30348 preallocated.write_next(out.assume_init_ref());
30349 }
30350 }
30351
30352 ::fidl_next::WireTable::encode_len(table, max_ord);
30353
30354 Ok(())
30355 }
30356}
30357
30358impl<'de> ::fidl_next::FromWire<WireConfigSourceCapabilities<'de>> for ConfigSourceCapabilities {
30359 #[inline]
30360 fn from_wire(wire_: WireConfigSourceCapabilities<'de>) -> Self {
30361 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
30362
30363 Self {}
30364 }
30365}
30366
30367impl<'de> ::fidl_next::IntoNatural for WireConfigSourceCapabilities<'de> {
30368 type Natural = ConfigSourceCapabilities;
30369}
30370
30371impl<'de> ::fidl_next::FromWireRef<WireConfigSourceCapabilities<'de>> for ConfigSourceCapabilities {
30372 #[inline]
30373 fn from_wire_ref(wire: &WireConfigSourceCapabilities<'de>) -> Self {
30374 Self {}
30375 }
30376}
30377
30378#[repr(C)]
30380pub struct WireConfigSourceCapabilities<'de> {
30381 table: ::fidl_next::WireTable<'de>,
30382}
30383
30384impl<'de> Drop for WireConfigSourceCapabilities<'de> {
30385 fn drop(&mut self) {}
30386}
30387
30388unsafe impl ::fidl_next::Wire for WireConfigSourceCapabilities<'static> {
30389 type Decoded<'de> = WireConfigSourceCapabilities<'de>;
30390
30391 #[inline]
30392 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30393 ::fidl_next::munge!(let Self { table } = out);
30394 ::fidl_next::WireTable::zero_padding(table);
30395 }
30396}
30397
30398unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigSourceCapabilities<'static>
30399where
30400 ___D: ::fidl_next::Decoder + ?Sized,
30401{
30402 fn decode(
30403 slot: ::fidl_next::Slot<'_, Self>,
30404 decoder: &mut ___D,
30405 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30406 ::fidl_next::munge!(let Self { table } = slot);
30407
30408 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30409 match ordinal {
30410 0 => unsafe { ::core::hint::unreachable_unchecked() },
30411
30412 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
30413 }
30414 })
30415 }
30416}
30417
30418impl<'de> WireConfigSourceCapabilities<'de> {}
30419
30420impl<'de> ::core::fmt::Debug for WireConfigSourceCapabilities<'de> {
30421 fn fmt(
30422 &self,
30423 f: &mut ::core::fmt::Formatter<'_>,
30424 ) -> ::core::result::Result<(), ::core::fmt::Error> {
30425 f.debug_struct("ConfigSourceCapabilities").finish()
30426 }
30427}
30428
30429#[doc = " Strategies available for resolving configuration values.\n"]
30430#[derive(PartialEq, Clone, Debug)]
30431pub enum ConfigValueSource {
30432 PackagePath(::std::string::String),
30433
30434 Capabilities(crate::ConfigSourceCapabilities),
30435
30436 UnknownOrdinal_(u64),
30437}
30438
30439impl ::fidl_next::Encodable for ConfigValueSource {
30440 type Encoded = WireConfigValueSource<'static>;
30441}
30442
30443unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigValueSource
30444where
30445 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
30446 ___E: ::fidl_next::Encoder,
30447{
30448 #[inline]
30449 fn encode(
30450 self,
30451 encoder: &mut ___E,
30452 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
30453 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
30454 ::fidl_next::munge!(let WireConfigValueSource { raw, _phantom: _ } = out);
30455
30456 match self {
30457 Self::PackagePath(value) => ::fidl_next::RawWireUnion::encode_as::<
30458 ___E,
30459 ::std::string::String,
30460 >(value, 1, encoder, raw)?,
30461
30462 Self::Capabilities(value) => ::fidl_next::RawWireUnion::encode_as::<
30463 ___E,
30464 crate::ConfigSourceCapabilities,
30465 >(value, 2, encoder, raw)?,
30466
30467 Self::UnknownOrdinal_(ordinal) => {
30468 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
30469 }
30470 }
30471
30472 Ok(())
30473 }
30474}
30475
30476unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigValueSource
30477where
30478 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
30479 ___E: ::fidl_next::Encoder,
30480{
30481 #[inline]
30482 fn encode_ref(
30483 &self,
30484 encoder: &mut ___E,
30485 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
30486 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
30487 ::fidl_next::munge!(let WireConfigValueSource { raw, _phantom: _ } = out);
30488
30489 match self {
30490 Self::PackagePath(value) => ::fidl_next::RawWireUnion::encode_as::<
30491 ___E,
30492 &::std::string::String,
30493 >(value, 1, encoder, raw)?,
30494
30495 Self::Capabilities(value) => ::fidl_next::RawWireUnion::encode_as::<
30496 ___E,
30497 &crate::ConfigSourceCapabilities,
30498 >(value, 2, encoder, raw)?,
30499
30500 Self::UnknownOrdinal_(ordinal) => {
30501 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
30502 }
30503 }
30504
30505 Ok(())
30506 }
30507}
30508
30509impl ::fidl_next::EncodableOption for ConfigValueSource {
30510 type EncodedOption = WireOptionalConfigValueSource<'static>;
30511}
30512
30513unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ConfigValueSource
30514where
30515 ___E: ?Sized,
30516 ConfigValueSource: ::fidl_next::Encode<___E>,
30517{
30518 #[inline]
30519 fn encode_option(
30520 this: ::core::option::Option<Self>,
30521 encoder: &mut ___E,
30522 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
30523 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
30524 ::fidl_next::munge!(let WireOptionalConfigValueSource { raw, _phantom: _ } = &mut *out);
30525
30526 if let Some(inner) = this {
30527 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
30528 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
30529 } else {
30530 ::fidl_next::RawWireUnion::encode_absent(raw);
30531 }
30532
30533 Ok(())
30534 }
30535}
30536
30537unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ConfigValueSource
30538where
30539 ___E: ?Sized,
30540 ConfigValueSource: ::fidl_next::EncodeRef<___E>,
30541{
30542 #[inline]
30543 fn encode_option_ref(
30544 this: ::core::option::Option<&Self>,
30545 encoder: &mut ___E,
30546 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
30547 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
30548 ::fidl_next::munge!(let WireOptionalConfigValueSource { raw, _phantom: _ } = &mut *out);
30549
30550 if let Some(inner) = this {
30551 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
30552 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
30553 } else {
30554 ::fidl_next::RawWireUnion::encode_absent(raw);
30555 }
30556
30557 Ok(())
30558 }
30559}
30560
30561impl<'de> ::fidl_next::FromWire<WireConfigValueSource<'de>> for ConfigValueSource {
30562 #[inline]
30563 fn from_wire(wire: WireConfigValueSource<'de>) -> Self {
30564 let wire = ::core::mem::ManuallyDrop::new(wire);
30565 match wire.raw.ordinal() {
30566 1 => Self::PackagePath(::fidl_next::FromWire::from_wire(unsafe {
30567 wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
30568 })),
30569
30570 2 => Self::Capabilities(::fidl_next::FromWire::from_wire(unsafe {
30571 wire.raw.get().read_unchecked::<crate::WireConfigSourceCapabilities<'de>>()
30572 })),
30573
30574 _ => unsafe { ::core::hint::unreachable_unchecked() },
30575 }
30576 }
30577}
30578
30579impl<'de> ::fidl_next::IntoNatural for WireConfigValueSource<'de> {
30580 type Natural = ConfigValueSource;
30581}
30582
30583impl<'de> ::fidl_next::FromWireRef<WireConfigValueSource<'de>> for ConfigValueSource {
30584 #[inline]
30585 fn from_wire_ref(wire: &WireConfigValueSource<'de>) -> Self {
30586 match wire.raw.ordinal() {
30587 1 => Self::PackagePath(::fidl_next::FromWireRef::from_wire_ref(unsafe {
30588 wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
30589 })),
30590
30591 2 => Self::Capabilities(::fidl_next::FromWireRef::from_wire_ref(unsafe {
30592 wire.raw.get().deref_unchecked::<crate::WireConfigSourceCapabilities<'de>>()
30593 })),
30594
30595 _ => unsafe { ::core::hint::unreachable_unchecked() },
30596 }
30597 }
30598}
30599
30600impl<'de> ::fidl_next::FromWireOption<WireOptionalConfigValueSource<'de>> for ConfigValueSource {
30601 #[inline]
30602 fn from_wire_option(wire: WireOptionalConfigValueSource<'de>) -> ::core::option::Option<Self> {
30603 if let Some(inner) = wire.into_option() {
30604 Some(::fidl_next::FromWire::from_wire(inner))
30605 } else {
30606 None
30607 }
30608 }
30609}
30610
30611impl<'de> ::fidl_next::IntoNatural for WireOptionalConfigValueSource<'de> {
30612 type Natural = ::core::option::Option<ConfigValueSource>;
30613}
30614
30615impl<'de> ::fidl_next::FromWireOption<WireOptionalConfigValueSource<'de>>
30616 for Box<ConfigValueSource>
30617{
30618 #[inline]
30619 fn from_wire_option(wire: WireOptionalConfigValueSource<'de>) -> ::core::option::Option<Self> {
30620 <
30621 ConfigValueSource as ::fidl_next::FromWireOption<WireOptionalConfigValueSource<'de>>
30622 >::from_wire_option(wire).map(Box::new)
30623 }
30624}
30625
30626impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalConfigValueSource<'de>>
30627 for Box<ConfigValueSource>
30628{
30629 #[inline]
30630 fn from_wire_option_ref(
30631 wire: &WireOptionalConfigValueSource<'de>,
30632 ) -> ::core::option::Option<Self> {
30633 if let Some(inner) = wire.as_ref() {
30634 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
30635 } else {
30636 None
30637 }
30638 }
30639}
30640
30641#[repr(transparent)]
30643pub struct WireConfigValueSource<'de> {
30644 raw: ::fidl_next::RawWireUnion,
30645 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
30646}
30647
30648impl<'de> Drop for WireConfigValueSource<'de> {
30649 fn drop(&mut self) {
30650 match self.raw.ordinal() {
30651 1 => {
30652 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
30653 }
30654
30655 2 => {
30656 let _ = unsafe {
30657 self.raw.get().read_unchecked::<crate::WireConfigSourceCapabilities<'de>>()
30658 };
30659 }
30660
30661 _ => (),
30662 }
30663 }
30664}
30665
30666unsafe impl ::fidl_next::Wire for WireConfigValueSource<'static> {
30667 type Decoded<'de> = WireConfigValueSource<'de>;
30668
30669 #[inline]
30670 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30671 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
30672 ::fidl_next::RawWireUnion::zero_padding(raw);
30673 }
30674}
30675
30676pub mod config_value_source {
30677 pub enum Ref<'de> {
30678 PackagePath(&'de ::fidl_next::WireString<'de>),
30679
30680 Capabilities(&'de crate::WireConfigSourceCapabilities<'de>),
30681
30682 UnknownOrdinal_(u64),
30683 }
30684}
30685
30686impl<'de> WireConfigValueSource<'de> {
30687 pub fn as_ref(&self) -> crate::config_value_source::Ref<'_> {
30688 match self.raw.ordinal() {
30689 1 => crate::config_value_source::Ref::PackagePath(unsafe {
30690 self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
30691 }),
30692
30693 2 => crate::config_value_source::Ref::Capabilities(unsafe {
30694 self.raw.get().deref_unchecked::<crate::WireConfigSourceCapabilities<'_>>()
30695 }),
30696
30697 unknown => crate::config_value_source::Ref::UnknownOrdinal_(unknown),
30698 }
30699 }
30700}
30701
30702unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigValueSource<'static>
30703where
30704 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
30705 ___D: ::fidl_next::Decoder,
30706{
30707 fn decode(
30708 mut slot: ::fidl_next::Slot<'_, Self>,
30709 decoder: &mut ___D,
30710 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30711 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
30712 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
30713 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
30714 raw, decoder,
30715 )?,
30716
30717 2 => ::fidl_next::RawWireUnion::decode_as::<
30718 ___D,
30719 crate::WireConfigSourceCapabilities<'static>,
30720 >(raw, decoder)?,
30721
30722 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
30723 }
30724
30725 Ok(())
30726 }
30727}
30728
30729impl<'de> ::core::fmt::Debug for WireConfigValueSource<'de> {
30730 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
30731 match self.raw.ordinal() {
30732 1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f) },
30733 2 => unsafe {
30734 self.raw.get().deref_unchecked::<crate::WireConfigSourceCapabilities<'_>>().fmt(f)
30735 },
30736 _ => unsafe { ::core::hint::unreachable_unchecked() },
30737 }
30738 }
30739}
30740
30741#[repr(transparent)]
30742pub struct WireOptionalConfigValueSource<'de> {
30743 raw: ::fidl_next::RawWireUnion,
30744 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
30745}
30746
30747unsafe impl ::fidl_next::Wire for WireOptionalConfigValueSource<'static> {
30748 type Decoded<'de> = WireOptionalConfigValueSource<'de>;
30749
30750 #[inline]
30751 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30752 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
30753 ::fidl_next::RawWireUnion::zero_padding(raw);
30754 }
30755}
30756
30757impl<'de> WireOptionalConfigValueSource<'de> {
30758 pub fn is_some(&self) -> bool {
30759 self.raw.is_some()
30760 }
30761
30762 pub fn is_none(&self) -> bool {
30763 self.raw.is_none()
30764 }
30765
30766 pub fn as_ref(&self) -> ::core::option::Option<&WireConfigValueSource<'de>> {
30767 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
30768 }
30769
30770 pub fn into_option(self) -> ::core::option::Option<WireConfigValueSource<'de>> {
30771 if self.is_some() {
30772 Some(WireConfigValueSource { raw: self.raw, _phantom: ::core::marker::PhantomData })
30773 } else {
30774 None
30775 }
30776 }
30777}
30778
30779unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConfigValueSource<'static>
30780where
30781 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
30782 ___D: ::fidl_next::Decoder,
30783{
30784 fn decode(
30785 mut slot: ::fidl_next::Slot<'_, Self>,
30786 decoder: &mut ___D,
30787 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30788 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
30789 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
30790 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
30791 raw, decoder,
30792 )?,
30793
30794 2 => ::fidl_next::RawWireUnion::decode_as::<
30795 ___D,
30796 crate::WireConfigSourceCapabilities<'static>,
30797 >(raw, decoder)?,
30798
30799 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
30800 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
30801 }
30802
30803 Ok(())
30804 }
30805}
30806
30807impl<'de> ::core::fmt::Debug for WireOptionalConfigValueSource<'de> {
30808 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
30809 self.as_ref().fmt(f)
30810 }
30811}
30812
30813#[doc = " The schema of a component\'s configuration interface.\n"]
30814#[derive(PartialEq, Clone, Debug, Default)]
30815pub struct ConfigSchema {
30816 pub fields: ::core::option::Option<::std::vec::Vec<crate::ConfigField>>,
30817
30818 pub checksum: ::core::option::Option<crate::ConfigChecksum>,
30819
30820 pub value_source: ::core::option::Option<crate::ConfigValueSource>,
30821}
30822
30823impl ConfigSchema {
30824 fn __max_ordinal(&self) -> usize {
30825 if self.value_source.is_some() {
30826 return 3;
30827 }
30828
30829 if self.checksum.is_some() {
30830 return 2;
30831 }
30832
30833 if self.fields.is_some() {
30834 return 1;
30835 }
30836
30837 0
30838 }
30839}
30840
30841impl ::fidl_next::Encodable for ConfigSchema {
30842 type Encoded = WireConfigSchema<'static>;
30843}
30844
30845unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigSchema
30846where
30847 ___E: ::fidl_next::Encoder + ?Sized,
30848{
30849 #[inline]
30850 fn encode(
30851 mut self,
30852 encoder: &mut ___E,
30853 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
30854 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
30855 ::fidl_next::munge!(let WireConfigSchema { table } = out);
30856
30857 let max_ord = self.__max_ordinal();
30858
30859 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
30860 ::fidl_next::Wire::zero_padding(&mut out);
30861
30862 let mut preallocated =
30863 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
30864
30865 for i in 1..=max_ord {
30866 match i {
30867 3 => {
30868 if let Some(value) = self.value_source.take() {
30869 ::fidl_next::WireEnvelope::encode_value(
30870 value,
30871 preallocated.encoder,
30872 &mut out,
30873 )?;
30874 } else {
30875 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30876 }
30877 }
30878
30879 2 => {
30880 if let Some(value) = self.checksum.take() {
30881 ::fidl_next::WireEnvelope::encode_value(
30882 value,
30883 preallocated.encoder,
30884 &mut out,
30885 )?;
30886 } else {
30887 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30888 }
30889 }
30890
30891 1 => {
30892 if let Some(value) = self.fields.take() {
30893 ::fidl_next::WireEnvelope::encode_value(
30894 value,
30895 preallocated.encoder,
30896 &mut out,
30897 )?;
30898 } else {
30899 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30900 }
30901 }
30902
30903 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
30904 }
30905 unsafe {
30906 preallocated.write_next(out.assume_init_ref());
30907 }
30908 }
30909
30910 ::fidl_next::WireTable::encode_len(table, max_ord);
30911
30912 Ok(())
30913 }
30914}
30915
30916unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigSchema
30917where
30918 ___E: ::fidl_next::Encoder + ?Sized,
30919{
30920 #[inline]
30921 fn encode_ref(
30922 &self,
30923 encoder: &mut ___E,
30924 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
30925 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
30926 ::fidl_next::munge!(let WireConfigSchema { table } = out);
30927
30928 let max_ord = self.__max_ordinal();
30929
30930 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
30931 ::fidl_next::Wire::zero_padding(&mut out);
30932
30933 let mut preallocated =
30934 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
30935
30936 for i in 1..=max_ord {
30937 match i {
30938 3 => {
30939 if let Some(value) = &self.value_source {
30940 ::fidl_next::WireEnvelope::encode_value(
30941 value,
30942 preallocated.encoder,
30943 &mut out,
30944 )?;
30945 } else {
30946 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30947 }
30948 }
30949
30950 2 => {
30951 if let Some(value) = &self.checksum {
30952 ::fidl_next::WireEnvelope::encode_value(
30953 value,
30954 preallocated.encoder,
30955 &mut out,
30956 )?;
30957 } else {
30958 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30959 }
30960 }
30961
30962 1 => {
30963 if let Some(value) = &self.fields {
30964 ::fidl_next::WireEnvelope::encode_value(
30965 value,
30966 preallocated.encoder,
30967 &mut out,
30968 )?;
30969 } else {
30970 ::fidl_next::WireEnvelope::encode_zero(&mut out)
30971 }
30972 }
30973
30974 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
30975 }
30976 unsafe {
30977 preallocated.write_next(out.assume_init_ref());
30978 }
30979 }
30980
30981 ::fidl_next::WireTable::encode_len(table, max_ord);
30982
30983 Ok(())
30984 }
30985}
30986
30987impl<'de> ::fidl_next::FromWire<WireConfigSchema<'de>> for ConfigSchema {
30988 #[inline]
30989 fn from_wire(wire_: WireConfigSchema<'de>) -> Self {
30990 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
30991
30992 let fields = wire_.table.get(1);
30993
30994 let checksum = wire_.table.get(2);
30995
30996 let value_source = wire_.table.get(3);
30997
30998 Self {
30999
31000
31001 fields: fields.map(|envelope| ::fidl_next::FromWire::from_wire(
31002 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigField<'de>>>() }
31003 )),
31004
31005
31006 checksum: checksum.map(|envelope| ::fidl_next::FromWire::from_wire(
31007 unsafe { envelope.read_unchecked::<crate::WireConfigChecksum<'de>>() }
31008 )),
31009
31010
31011 value_source: value_source.map(|envelope| ::fidl_next::FromWire::from_wire(
31012 unsafe { envelope.read_unchecked::<crate::WireConfigValueSource<'de>>() }
31013 )),
31014
31015 }
31016 }
31017}
31018
31019impl<'de> ::fidl_next::IntoNatural for WireConfigSchema<'de> {
31020 type Natural = ConfigSchema;
31021}
31022
31023impl<'de> ::fidl_next::FromWireRef<WireConfigSchema<'de>> for ConfigSchema {
31024 #[inline]
31025 fn from_wire_ref(wire: &WireConfigSchema<'de>) -> Self {
31026 Self {
31027
31028
31029 fields: wire.table.get(1)
31030 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
31031 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigField<'de>>>() }
31032 )),
31033
31034
31035 checksum: wire.table.get(2)
31036 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
31037 unsafe { envelope.deref_unchecked::<crate::WireConfigChecksum<'de>>() }
31038 )),
31039
31040
31041 value_source: wire.table.get(3)
31042 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
31043 unsafe { envelope.deref_unchecked::<crate::WireConfigValueSource<'de>>() }
31044 )),
31045
31046 }
31047 }
31048}
31049
31050#[repr(C)]
31052pub struct WireConfigSchema<'de> {
31053 table: ::fidl_next::WireTable<'de>,
31054}
31055
31056impl<'de> Drop for WireConfigSchema<'de> {
31057 fn drop(&mut self) {
31058 let _ = self.table.get(1).map(|envelope| unsafe {
31059 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigField<'de>>>()
31060 });
31061
31062 let _ = self
31063 .table
31064 .get(2)
31065 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigChecksum<'de>>() });
31066
31067 let _ = self.table.get(3).map(|envelope| unsafe {
31068 envelope.read_unchecked::<crate::WireConfigValueSource<'de>>()
31069 });
31070 }
31071}
31072
31073unsafe impl ::fidl_next::Wire for WireConfigSchema<'static> {
31074 type Decoded<'de> = WireConfigSchema<'de>;
31075
31076 #[inline]
31077 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31078 ::fidl_next::munge!(let Self { table } = out);
31079 ::fidl_next::WireTable::zero_padding(table);
31080 }
31081}
31082
31083unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigSchema<'static>
31084where
31085 ___D: ::fidl_next::Decoder + ?Sized,
31086{
31087 fn decode(
31088 slot: ::fidl_next::Slot<'_, Self>,
31089 decoder: &mut ___D,
31090 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
31091 ::fidl_next::munge!(let Self { table } = slot);
31092
31093 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
31094 match ordinal {
31095 0 => unsafe { ::core::hint::unreachable_unchecked() },
31096
31097 1 => {
31098 ::fidl_next::WireEnvelope::decode_as::<
31099 ___D,
31100 ::fidl_next::WireVector<'static, crate::WireConfigField<'static>>,
31101 >(slot.as_mut(), decoder)?;
31102
31103 Ok(())
31104 }
31105
31106 2 => {
31107 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigChecksum<'static>>(
31108 slot.as_mut(),
31109 decoder,
31110 )?;
31111
31112 Ok(())
31113 }
31114
31115 3 => {
31116 ::fidl_next::WireEnvelope::decode_as::<
31117 ___D,
31118 crate::WireConfigValueSource<'static>,
31119 >(slot.as_mut(), decoder)?;
31120
31121 Ok(())
31122 }
31123
31124 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
31125 }
31126 })
31127 }
31128}
31129
31130impl<'de> WireConfigSchema<'de> {
31131 pub fn fields(
31132 &self,
31133 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireConfigField<'de>>> {
31134 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
31135 }
31136
31137 pub fn checksum(&self) -> ::core::option::Option<&crate::WireConfigChecksum<'de>> {
31138 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
31139 }
31140
31141 pub fn value_source(&self) -> ::core::option::Option<&crate::WireConfigValueSource<'de>> {
31142 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
31143 }
31144}
31145
31146impl<'de> ::core::fmt::Debug for WireConfigSchema<'de> {
31147 fn fmt(
31148 &self,
31149 f: &mut ::core::fmt::Formatter<'_>,
31150 ) -> ::core::result::Result<(), ::core::fmt::Error> {
31151 f.debug_struct("ConfigSchema")
31152 .field("fields", &self.fields())
31153 .field("checksum", &self.checksum())
31154 .field("value_source", &self.value_source())
31155 .finish()
31156 }
31157}
31158
31159#[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"]
31160#[derive(PartialEq, Clone, Debug, Default)]
31161pub struct Component {
31162 pub program: ::core::option::Option<crate::Program>,
31163
31164 pub uses: ::core::option::Option<::std::vec::Vec<crate::Use>>,
31165
31166 pub exposes: ::core::option::Option<::std::vec::Vec<crate::Expose>>,
31167
31168 pub offers: ::core::option::Option<::std::vec::Vec<crate::Offer>>,
31169
31170 pub capabilities: ::core::option::Option<::std::vec::Vec<crate::Capability>>,
31171
31172 pub children: ::core::option::Option<::std::vec::Vec<crate::Child>>,
31173
31174 pub collections: ::core::option::Option<::std::vec::Vec<crate::Collection>>,
31175
31176 pub environments: ::core::option::Option<::std::vec::Vec<crate::Environment>>,
31177
31178 pub facets: ::core::option::Option<::fidl_next_fuchsia_data::Dictionary>,
31179
31180 pub config: ::core::option::Option<crate::ConfigSchema>,
31181}
31182
31183impl Component {
31184 fn __max_ordinal(&self) -> usize {
31185 if self.config.is_some() {
31186 return 10;
31187 }
31188
31189 if self.facets.is_some() {
31190 return 9;
31191 }
31192
31193 if self.environments.is_some() {
31194 return 8;
31195 }
31196
31197 if self.collections.is_some() {
31198 return 7;
31199 }
31200
31201 if self.children.is_some() {
31202 return 6;
31203 }
31204
31205 if self.capabilities.is_some() {
31206 return 5;
31207 }
31208
31209 if self.offers.is_some() {
31210 return 4;
31211 }
31212
31213 if self.exposes.is_some() {
31214 return 3;
31215 }
31216
31217 if self.uses.is_some() {
31218 return 2;
31219 }
31220
31221 if self.program.is_some() {
31222 return 1;
31223 }
31224
31225 0
31226 }
31227}
31228
31229impl ::fidl_next::Encodable for Component {
31230 type Encoded = WireComponent<'static>;
31231}
31232
31233unsafe impl<___E> ::fidl_next::Encode<___E> for Component
31234where
31235 ___E: ::fidl_next::Encoder + ?Sized,
31236{
31237 #[inline]
31238 fn encode(
31239 mut self,
31240 encoder: &mut ___E,
31241 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
31242 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
31243 ::fidl_next::munge!(let WireComponent { table } = out);
31244
31245 let max_ord = self.__max_ordinal();
31246
31247 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
31248 ::fidl_next::Wire::zero_padding(&mut out);
31249
31250 let mut preallocated =
31251 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
31252
31253 for i in 1..=max_ord {
31254 match i {
31255 10 => {
31256 if let Some(value) = self.config.take() {
31257 ::fidl_next::WireEnvelope::encode_value(
31258 value,
31259 preallocated.encoder,
31260 &mut out,
31261 )?;
31262 } else {
31263 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31264 }
31265 }
31266
31267 9 => {
31268 if let Some(value) = self.facets.take() {
31269 ::fidl_next::WireEnvelope::encode_value(
31270 value,
31271 preallocated.encoder,
31272 &mut out,
31273 )?;
31274 } else {
31275 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31276 }
31277 }
31278
31279 8 => {
31280 if let Some(value) = self.environments.take() {
31281 ::fidl_next::WireEnvelope::encode_value(
31282 value,
31283 preallocated.encoder,
31284 &mut out,
31285 )?;
31286 } else {
31287 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31288 }
31289 }
31290
31291 7 => {
31292 if let Some(value) = self.collections.take() {
31293 ::fidl_next::WireEnvelope::encode_value(
31294 value,
31295 preallocated.encoder,
31296 &mut out,
31297 )?;
31298 } else {
31299 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31300 }
31301 }
31302
31303 6 => {
31304 if let Some(value) = self.children.take() {
31305 ::fidl_next::WireEnvelope::encode_value(
31306 value,
31307 preallocated.encoder,
31308 &mut out,
31309 )?;
31310 } else {
31311 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31312 }
31313 }
31314
31315 5 => {
31316 if let Some(value) = self.capabilities.take() {
31317 ::fidl_next::WireEnvelope::encode_value(
31318 value,
31319 preallocated.encoder,
31320 &mut out,
31321 )?;
31322 } else {
31323 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31324 }
31325 }
31326
31327 4 => {
31328 if let Some(value) = self.offers.take() {
31329 ::fidl_next::WireEnvelope::encode_value(
31330 value,
31331 preallocated.encoder,
31332 &mut out,
31333 )?;
31334 } else {
31335 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31336 }
31337 }
31338
31339 3 => {
31340 if let Some(value) = self.exposes.take() {
31341 ::fidl_next::WireEnvelope::encode_value(
31342 value,
31343 preallocated.encoder,
31344 &mut out,
31345 )?;
31346 } else {
31347 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31348 }
31349 }
31350
31351 2 => {
31352 if let Some(value) = self.uses.take() {
31353 ::fidl_next::WireEnvelope::encode_value(
31354 value,
31355 preallocated.encoder,
31356 &mut out,
31357 )?;
31358 } else {
31359 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31360 }
31361 }
31362
31363 1 => {
31364 if let Some(value) = self.program.take() {
31365 ::fidl_next::WireEnvelope::encode_value(
31366 value,
31367 preallocated.encoder,
31368 &mut out,
31369 )?;
31370 } else {
31371 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31372 }
31373 }
31374
31375 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
31376 }
31377 unsafe {
31378 preallocated.write_next(out.assume_init_ref());
31379 }
31380 }
31381
31382 ::fidl_next::WireTable::encode_len(table, max_ord);
31383
31384 Ok(())
31385 }
31386}
31387
31388unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Component
31389where
31390 ___E: ::fidl_next::Encoder + ?Sized,
31391{
31392 #[inline]
31393 fn encode_ref(
31394 &self,
31395 encoder: &mut ___E,
31396 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
31397 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
31398 ::fidl_next::munge!(let WireComponent { table } = out);
31399
31400 let max_ord = self.__max_ordinal();
31401
31402 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
31403 ::fidl_next::Wire::zero_padding(&mut out);
31404
31405 let mut preallocated =
31406 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
31407
31408 for i in 1..=max_ord {
31409 match i {
31410 10 => {
31411 if let Some(value) = &self.config {
31412 ::fidl_next::WireEnvelope::encode_value(
31413 value,
31414 preallocated.encoder,
31415 &mut out,
31416 )?;
31417 } else {
31418 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31419 }
31420 }
31421
31422 9 => {
31423 if let Some(value) = &self.facets {
31424 ::fidl_next::WireEnvelope::encode_value(
31425 value,
31426 preallocated.encoder,
31427 &mut out,
31428 )?;
31429 } else {
31430 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31431 }
31432 }
31433
31434 8 => {
31435 if let Some(value) = &self.environments {
31436 ::fidl_next::WireEnvelope::encode_value(
31437 value,
31438 preallocated.encoder,
31439 &mut out,
31440 )?;
31441 } else {
31442 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31443 }
31444 }
31445
31446 7 => {
31447 if let Some(value) = &self.collections {
31448 ::fidl_next::WireEnvelope::encode_value(
31449 value,
31450 preallocated.encoder,
31451 &mut out,
31452 )?;
31453 } else {
31454 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31455 }
31456 }
31457
31458 6 => {
31459 if let Some(value) = &self.children {
31460 ::fidl_next::WireEnvelope::encode_value(
31461 value,
31462 preallocated.encoder,
31463 &mut out,
31464 )?;
31465 } else {
31466 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31467 }
31468 }
31469
31470 5 => {
31471 if let Some(value) = &self.capabilities {
31472 ::fidl_next::WireEnvelope::encode_value(
31473 value,
31474 preallocated.encoder,
31475 &mut out,
31476 )?;
31477 } else {
31478 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31479 }
31480 }
31481
31482 4 => {
31483 if let Some(value) = &self.offers {
31484 ::fidl_next::WireEnvelope::encode_value(
31485 value,
31486 preallocated.encoder,
31487 &mut out,
31488 )?;
31489 } else {
31490 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31491 }
31492 }
31493
31494 3 => {
31495 if let Some(value) = &self.exposes {
31496 ::fidl_next::WireEnvelope::encode_value(
31497 value,
31498 preallocated.encoder,
31499 &mut out,
31500 )?;
31501 } else {
31502 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31503 }
31504 }
31505
31506 2 => {
31507 if let Some(value) = &self.uses {
31508 ::fidl_next::WireEnvelope::encode_value(
31509 value,
31510 preallocated.encoder,
31511 &mut out,
31512 )?;
31513 } else {
31514 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31515 }
31516 }
31517
31518 1 => {
31519 if let Some(value) = &self.program {
31520 ::fidl_next::WireEnvelope::encode_value(
31521 value,
31522 preallocated.encoder,
31523 &mut out,
31524 )?;
31525 } else {
31526 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31527 }
31528 }
31529
31530 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
31531 }
31532 unsafe {
31533 preallocated.write_next(out.assume_init_ref());
31534 }
31535 }
31536
31537 ::fidl_next::WireTable::encode_len(table, max_ord);
31538
31539 Ok(())
31540 }
31541}
31542
31543impl<'de> ::fidl_next::FromWire<WireComponent<'de>> for Component {
31544 #[inline]
31545 fn from_wire(wire_: WireComponent<'de>) -> Self {
31546 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
31547
31548 let program = wire_.table.get(1);
31549
31550 let uses = wire_.table.get(2);
31551
31552 let exposes = wire_.table.get(3);
31553
31554 let offers = wire_.table.get(4);
31555
31556 let capabilities = wire_.table.get(5);
31557
31558 let children = wire_.table.get(6);
31559
31560 let collections = wire_.table.get(7);
31561
31562 let environments = wire_.table.get(8);
31563
31564 let facets = wire_.table.get(9);
31565
31566 let config = wire_.table.get(10);
31567
31568 Self {
31569
31570
31571 program: program.map(|envelope| ::fidl_next::FromWire::from_wire(
31572 unsafe { envelope.read_unchecked::<crate::WireProgram<'de>>() }
31573 )),
31574
31575
31576 uses: uses.map(|envelope| ::fidl_next::FromWire::from_wire(
31577 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireUse<'de>>>() }
31578 )),
31579
31580
31581 exposes: exposes.map(|envelope| ::fidl_next::FromWire::from_wire(
31582 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireExpose<'de>>>() }
31583 )),
31584
31585
31586 offers: offers.map(|envelope| ::fidl_next::FromWire::from_wire(
31587 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireOffer<'de>>>() }
31588 )),
31589
31590
31591 capabilities: capabilities.map(|envelope| ::fidl_next::FromWire::from_wire(
31592 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireCapability<'de>>>() }
31593 )),
31594
31595
31596 children: children.map(|envelope| ::fidl_next::FromWire::from_wire(
31597 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireChild<'de>>>() }
31598 )),
31599
31600
31601 collections: collections.map(|envelope| ::fidl_next::FromWire::from_wire(
31602 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireCollection<'de>>>() }
31603 )),
31604
31605
31606 environments: environments.map(|envelope| ::fidl_next::FromWire::from_wire(
31607 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireEnvironment<'de>>>() }
31608 )),
31609
31610
31611 facets: facets.map(|envelope| ::fidl_next::FromWire::from_wire(
31612 unsafe { envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>() }
31613 )),
31614
31615
31616 config: config.map(|envelope| ::fidl_next::FromWire::from_wire(
31617 unsafe { envelope.read_unchecked::<crate::WireConfigSchema<'de>>() }
31618 )),
31619
31620 }
31621 }
31622}
31623
31624impl<'de> ::fidl_next::IntoNatural for WireComponent<'de> {
31625 type Natural = Component;
31626}
31627
31628impl<'de> ::fidl_next::FromWireRef<WireComponent<'de>> for Component {
31629 #[inline]
31630 fn from_wire_ref(wire: &WireComponent<'de>) -> Self {
31631 Self {
31632
31633
31634 program: wire.table.get(1)
31635 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
31636 unsafe { envelope.deref_unchecked::<crate::WireProgram<'de>>() }
31637 )),
31638
31639
31640 uses: wire.table.get(2)
31641 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
31642 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireUse<'de>>>() }
31643 )),
31644
31645
31646 exposes: wire.table.get(3)
31647 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
31648 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireExpose<'de>>>() }
31649 )),
31650
31651
31652 offers: wire.table.get(4)
31653 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
31654 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireOffer<'de>>>() }
31655 )),
31656
31657
31658 capabilities: wire.table.get(5)
31659 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
31660 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireCapability<'de>>>() }
31661 )),
31662
31663
31664 children: wire.table.get(6)
31665 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
31666 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireChild<'de>>>() }
31667 )),
31668
31669
31670 collections: wire.table.get(7)
31671 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
31672 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireCollection<'de>>>() }
31673 )),
31674
31675
31676 environments: wire.table.get(8)
31677 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
31678 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireEnvironment<'de>>>() }
31679 )),
31680
31681
31682 facets: wire.table.get(9)
31683 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
31684 unsafe { envelope.deref_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>() }
31685 )),
31686
31687
31688 config: wire.table.get(10)
31689 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
31690 unsafe { envelope.deref_unchecked::<crate::WireConfigSchema<'de>>() }
31691 )),
31692
31693 }
31694 }
31695}
31696
31697#[repr(C)]
31699pub struct WireComponent<'de> {
31700 table: ::fidl_next::WireTable<'de>,
31701}
31702
31703impl<'de> Drop for WireComponent<'de> {
31704 fn drop(&mut self) {
31705 let _ = self
31706 .table
31707 .get(1)
31708 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireProgram<'de>>() });
31709
31710 let _ = self.table.get(2).map(|envelope| unsafe {
31711 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireUse<'de>>>()
31712 });
31713
31714 let _ = self.table.get(3).map(|envelope| unsafe {
31715 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireExpose<'de>>>()
31716 });
31717
31718 let _ = self.table.get(4).map(|envelope| unsafe {
31719 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireOffer<'de>>>()
31720 });
31721
31722 let _ = self.table.get(5).map(|envelope| unsafe {
31723 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireCapability<'de>>>()
31724 });
31725
31726 let _ = self.table.get(6).map(|envelope| unsafe {
31727 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireChild<'de>>>()
31728 });
31729
31730 let _ = self.table.get(7).map(|envelope| unsafe {
31731 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireCollection<'de>>>()
31732 });
31733
31734 let _ = self.table.get(8).map(|envelope| unsafe {
31735 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireEnvironment<'de>>>()
31736 });
31737
31738 let _ = self.table.get(9).map(|envelope| unsafe {
31739 envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
31740 });
31741
31742 let _ = self
31743 .table
31744 .get(10)
31745 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigSchema<'de>>() });
31746 }
31747}
31748
31749unsafe impl ::fidl_next::Wire for WireComponent<'static> {
31750 type Decoded<'de> = WireComponent<'de>;
31751
31752 #[inline]
31753 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31754 ::fidl_next::munge!(let Self { table } = out);
31755 ::fidl_next::WireTable::zero_padding(table);
31756 }
31757}
31758
31759unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponent<'static>
31760where
31761 ___D: ::fidl_next::Decoder + ?Sized,
31762{
31763 fn decode(
31764 slot: ::fidl_next::Slot<'_, Self>,
31765 decoder: &mut ___D,
31766 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
31767 ::fidl_next::munge!(let Self { table } = slot);
31768
31769 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
31770 match ordinal {
31771 0 => unsafe { ::core::hint::unreachable_unchecked() },
31772
31773 1 => {
31774 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireProgram<'static>>(
31775 slot.as_mut(),
31776 decoder,
31777 )?;
31778
31779 Ok(())
31780 }
31781
31782 2 => {
31783 ::fidl_next::WireEnvelope::decode_as::<
31784 ___D,
31785 ::fidl_next::WireVector<'static, crate::WireUse<'static>>,
31786 >(slot.as_mut(), decoder)?;
31787
31788 Ok(())
31789 }
31790
31791 3 => {
31792 ::fidl_next::WireEnvelope::decode_as::<
31793 ___D,
31794 ::fidl_next::WireVector<'static, crate::WireExpose<'static>>,
31795 >(slot.as_mut(), decoder)?;
31796
31797 Ok(())
31798 }
31799
31800 4 => {
31801 ::fidl_next::WireEnvelope::decode_as::<
31802 ___D,
31803 ::fidl_next::WireVector<'static, crate::WireOffer<'static>>,
31804 >(slot.as_mut(), decoder)?;
31805
31806 Ok(())
31807 }
31808
31809 5 => {
31810 ::fidl_next::WireEnvelope::decode_as::<
31811 ___D,
31812 ::fidl_next::WireVector<'static, crate::WireCapability<'static>>,
31813 >(slot.as_mut(), decoder)?;
31814
31815 Ok(())
31816 }
31817
31818 6 => {
31819 ::fidl_next::WireEnvelope::decode_as::<
31820 ___D,
31821 ::fidl_next::WireVector<'static, crate::WireChild<'static>>,
31822 >(slot.as_mut(), decoder)?;
31823
31824 Ok(())
31825 }
31826
31827 7 => {
31828 ::fidl_next::WireEnvelope::decode_as::<
31829 ___D,
31830 ::fidl_next::WireVector<'static, crate::WireCollection<'static>>,
31831 >(slot.as_mut(), decoder)?;
31832
31833 Ok(())
31834 }
31835
31836 8 => {
31837 ::fidl_next::WireEnvelope::decode_as::<
31838 ___D,
31839 ::fidl_next::WireVector<'static, crate::WireEnvironment<'static>>,
31840 >(slot.as_mut(), decoder)?;
31841
31842 Ok(())
31843 }
31844
31845 9 => {
31846 ::fidl_next::WireEnvelope::decode_as::<
31847 ___D,
31848 ::fidl_next_fuchsia_data::WireDictionary<'static>,
31849 >(slot.as_mut(), decoder)?;
31850
31851 Ok(())
31852 }
31853
31854 10 => {
31855 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigSchema<'static>>(
31856 slot.as_mut(),
31857 decoder,
31858 )?;
31859
31860 Ok(())
31861 }
31862
31863 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
31864 }
31865 })
31866 }
31867}
31868
31869impl<'de> WireComponent<'de> {
31870 pub fn program(&self) -> ::core::option::Option<&crate::WireProgram<'de>> {
31871 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
31872 }
31873
31874 pub fn uses(
31875 &self,
31876 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireUse<'de>>> {
31877 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
31878 }
31879
31880 pub fn exposes(
31881 &self,
31882 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireExpose<'de>>> {
31883 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
31884 }
31885
31886 pub fn offers(
31887 &self,
31888 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireOffer<'de>>> {
31889 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
31890 }
31891
31892 pub fn capabilities(
31893 &self,
31894 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireCapability<'de>>> {
31895 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
31896 }
31897
31898 pub fn children(
31899 &self,
31900 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireChild<'de>>> {
31901 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
31902 }
31903
31904 pub fn collections(
31905 &self,
31906 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireCollection<'de>>> {
31907 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
31908 }
31909
31910 pub fn environments(
31911 &self,
31912 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireEnvironment<'de>>> {
31913 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
31914 }
31915
31916 pub fn facets(&self) -> ::core::option::Option<&::fidl_next_fuchsia_data::WireDictionary<'de>> {
31917 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
31918 }
31919
31920 pub fn config(&self) -> ::core::option::Option<&crate::WireConfigSchema<'de>> {
31921 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
31922 }
31923}
31924
31925impl<'de> ::core::fmt::Debug for WireComponent<'de> {
31926 fn fmt(
31927 &self,
31928 f: &mut ::core::fmt::Formatter<'_>,
31929 ) -> ::core::result::Result<(), ::core::fmt::Error> {
31930 f.debug_struct("Component")
31931 .field("program", &self.program())
31932 .field("uses", &self.uses())
31933 .field("exposes", &self.exposes())
31934 .field("offers", &self.offers())
31935 .field("capabilities", &self.capabilities())
31936 .field("children", &self.children())
31937 .field("collections", &self.collections())
31938 .field("environments", &self.environments())
31939 .field("facets", &self.facets())
31940 .field("config", &self.config())
31941 .finish()
31942 }
31943}
31944
31945#[doc = " An individual configuration value. It is matched against a specific configuration field based\n on its offset within `ValuesData.values`.\n"]
31946#[derive(PartialEq, Clone, Debug, Default)]
31947pub struct ConfigValueSpec {
31948 pub value: ::core::option::Option<crate::ConfigValue>,
31949}
31950
31951impl ConfigValueSpec {
31952 fn __max_ordinal(&self) -> usize {
31953 if self.value.is_some() {
31954 return 1;
31955 }
31956
31957 0
31958 }
31959}
31960
31961impl ::fidl_next::Encodable for ConfigValueSpec {
31962 type Encoded = WireConfigValueSpec<'static>;
31963}
31964
31965unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigValueSpec
31966where
31967 ___E: ::fidl_next::Encoder + ?Sized,
31968{
31969 #[inline]
31970 fn encode(
31971 mut self,
31972 encoder: &mut ___E,
31973 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
31974 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
31975 ::fidl_next::munge!(let WireConfigValueSpec { table } = out);
31976
31977 let max_ord = self.__max_ordinal();
31978
31979 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
31980 ::fidl_next::Wire::zero_padding(&mut out);
31981
31982 let mut preallocated =
31983 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
31984
31985 for i in 1..=max_ord {
31986 match i {
31987 1 => {
31988 if let Some(value) = self.value.take() {
31989 ::fidl_next::WireEnvelope::encode_value(
31990 value,
31991 preallocated.encoder,
31992 &mut out,
31993 )?;
31994 } else {
31995 ::fidl_next::WireEnvelope::encode_zero(&mut out)
31996 }
31997 }
31998
31999 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
32000 }
32001 unsafe {
32002 preallocated.write_next(out.assume_init_ref());
32003 }
32004 }
32005
32006 ::fidl_next::WireTable::encode_len(table, max_ord);
32007
32008 Ok(())
32009 }
32010}
32011
32012unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigValueSpec
32013where
32014 ___E: ::fidl_next::Encoder + ?Sized,
32015{
32016 #[inline]
32017 fn encode_ref(
32018 &self,
32019 encoder: &mut ___E,
32020 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
32021 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
32022 ::fidl_next::munge!(let WireConfigValueSpec { table } = out);
32023
32024 let max_ord = self.__max_ordinal();
32025
32026 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
32027 ::fidl_next::Wire::zero_padding(&mut out);
32028
32029 let mut preallocated =
32030 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
32031
32032 for i in 1..=max_ord {
32033 match i {
32034 1 => {
32035 if let Some(value) = &self.value {
32036 ::fidl_next::WireEnvelope::encode_value(
32037 value,
32038 preallocated.encoder,
32039 &mut out,
32040 )?;
32041 } else {
32042 ::fidl_next::WireEnvelope::encode_zero(&mut out)
32043 }
32044 }
32045
32046 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
32047 }
32048 unsafe {
32049 preallocated.write_next(out.assume_init_ref());
32050 }
32051 }
32052
32053 ::fidl_next::WireTable::encode_len(table, max_ord);
32054
32055 Ok(())
32056 }
32057}
32058
32059impl<'de> ::fidl_next::FromWire<WireConfigValueSpec<'de>> for ConfigValueSpec {
32060 #[inline]
32061 fn from_wire(wire_: WireConfigValueSpec<'de>) -> Self {
32062 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
32063
32064 let value = wire_.table.get(1);
32065
32066 Self {
32067 value: value.map(|envelope| {
32068 ::fidl_next::FromWire::from_wire(unsafe {
32069 envelope.read_unchecked::<crate::WireConfigValue<'de>>()
32070 })
32071 }),
32072 }
32073 }
32074}
32075
32076impl<'de> ::fidl_next::IntoNatural for WireConfigValueSpec<'de> {
32077 type Natural = ConfigValueSpec;
32078}
32079
32080impl<'de> ::fidl_next::FromWireRef<WireConfigValueSpec<'de>> for ConfigValueSpec {
32081 #[inline]
32082 fn from_wire_ref(wire: &WireConfigValueSpec<'de>) -> Self {
32083 Self {
32084 value: wire.table.get(1).map(|envelope| {
32085 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
32086 envelope.deref_unchecked::<crate::WireConfigValue<'de>>()
32087 })
32088 }),
32089 }
32090 }
32091}
32092
32093#[repr(C)]
32095pub struct WireConfigValueSpec<'de> {
32096 table: ::fidl_next::WireTable<'de>,
32097}
32098
32099impl<'de> Drop for WireConfigValueSpec<'de> {
32100 fn drop(&mut self) {
32101 let _ = self
32102 .table
32103 .get(1)
32104 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigValue<'de>>() });
32105 }
32106}
32107
32108unsafe impl ::fidl_next::Wire for WireConfigValueSpec<'static> {
32109 type Decoded<'de> = WireConfigValueSpec<'de>;
32110
32111 #[inline]
32112 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32113 ::fidl_next::munge!(let Self { table } = out);
32114 ::fidl_next::WireTable::zero_padding(table);
32115 }
32116}
32117
32118unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigValueSpec<'static>
32119where
32120 ___D: ::fidl_next::Decoder + ?Sized,
32121{
32122 fn decode(
32123 slot: ::fidl_next::Slot<'_, Self>,
32124 decoder: &mut ___D,
32125 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32126 ::fidl_next::munge!(let Self { table } = slot);
32127
32128 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32129 match ordinal {
32130 0 => unsafe { ::core::hint::unreachable_unchecked() },
32131
32132 1 => {
32133 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigValue<'static>>(
32134 slot.as_mut(),
32135 decoder,
32136 )?;
32137
32138 Ok(())
32139 }
32140
32141 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
32142 }
32143 })
32144 }
32145}
32146
32147impl<'de> WireConfigValueSpec<'de> {
32148 pub fn value(&self) -> ::core::option::Option<&crate::WireConfigValue<'de>> {
32149 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32150 }
32151}
32152
32153impl<'de> ::core::fmt::Debug for WireConfigValueSpec<'de> {
32154 fn fmt(
32155 &self,
32156 f: &mut ::core::fmt::Formatter<'_>,
32157 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32158 f.debug_struct("ConfigValueSpec").field("value", &self.value()).finish()
32159 }
32160}
32161
32162#[doc = " Contents of the configuration value file. Defines the base values for a component\'s config.\n"]
32163#[derive(PartialEq, Clone, Debug, Default)]
32164pub struct ConfigValuesData {
32165 pub values: ::core::option::Option<::std::vec::Vec<crate::ConfigValueSpec>>,
32166
32167 pub checksum: ::core::option::Option<crate::ConfigChecksum>,
32168}
32169
32170impl ConfigValuesData {
32171 fn __max_ordinal(&self) -> usize {
32172 if self.checksum.is_some() {
32173 return 2;
32174 }
32175
32176 if self.values.is_some() {
32177 return 1;
32178 }
32179
32180 0
32181 }
32182}
32183
32184impl ::fidl_next::Encodable for ConfigValuesData {
32185 type Encoded = WireConfigValuesData<'static>;
32186}
32187
32188unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigValuesData
32189where
32190 ___E: ::fidl_next::Encoder + ?Sized,
32191{
32192 #[inline]
32193 fn encode(
32194 mut self,
32195 encoder: &mut ___E,
32196 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
32197 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
32198 ::fidl_next::munge!(let WireConfigValuesData { table } = out);
32199
32200 let max_ord = self.__max_ordinal();
32201
32202 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
32203 ::fidl_next::Wire::zero_padding(&mut out);
32204
32205 let mut preallocated =
32206 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
32207
32208 for i in 1..=max_ord {
32209 match i {
32210 2 => {
32211 if let Some(value) = self.checksum.take() {
32212 ::fidl_next::WireEnvelope::encode_value(
32213 value,
32214 preallocated.encoder,
32215 &mut out,
32216 )?;
32217 } else {
32218 ::fidl_next::WireEnvelope::encode_zero(&mut out)
32219 }
32220 }
32221
32222 1 => {
32223 if let Some(value) = self.values.take() {
32224 ::fidl_next::WireEnvelope::encode_value(
32225 value,
32226 preallocated.encoder,
32227 &mut out,
32228 )?;
32229 } else {
32230 ::fidl_next::WireEnvelope::encode_zero(&mut out)
32231 }
32232 }
32233
32234 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
32235 }
32236 unsafe {
32237 preallocated.write_next(out.assume_init_ref());
32238 }
32239 }
32240
32241 ::fidl_next::WireTable::encode_len(table, max_ord);
32242
32243 Ok(())
32244 }
32245}
32246
32247unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ConfigValuesData
32248where
32249 ___E: ::fidl_next::Encoder + ?Sized,
32250{
32251 #[inline]
32252 fn encode_ref(
32253 &self,
32254 encoder: &mut ___E,
32255 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
32256 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
32257 ::fidl_next::munge!(let WireConfigValuesData { table } = out);
32258
32259 let max_ord = self.__max_ordinal();
32260
32261 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
32262 ::fidl_next::Wire::zero_padding(&mut out);
32263
32264 let mut preallocated =
32265 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
32266
32267 for i in 1..=max_ord {
32268 match i {
32269 2 => {
32270 if let Some(value) = &self.checksum {
32271 ::fidl_next::WireEnvelope::encode_value(
32272 value,
32273 preallocated.encoder,
32274 &mut out,
32275 )?;
32276 } else {
32277 ::fidl_next::WireEnvelope::encode_zero(&mut out)
32278 }
32279 }
32280
32281 1 => {
32282 if let Some(value) = &self.values {
32283 ::fidl_next::WireEnvelope::encode_value(
32284 value,
32285 preallocated.encoder,
32286 &mut out,
32287 )?;
32288 } else {
32289 ::fidl_next::WireEnvelope::encode_zero(&mut out)
32290 }
32291 }
32292
32293 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
32294 }
32295 unsafe {
32296 preallocated.write_next(out.assume_init_ref());
32297 }
32298 }
32299
32300 ::fidl_next::WireTable::encode_len(table, max_ord);
32301
32302 Ok(())
32303 }
32304}
32305
32306impl<'de> ::fidl_next::FromWire<WireConfigValuesData<'de>> for ConfigValuesData {
32307 #[inline]
32308 fn from_wire(wire_: WireConfigValuesData<'de>) -> Self {
32309 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
32310
32311 let values = wire_.table.get(1);
32312
32313 let checksum = wire_.table.get(2);
32314
32315 Self {
32316
32317
32318 values: values.map(|envelope| ::fidl_next::FromWire::from_wire(
32319 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigValueSpec<'de>>>() }
32320 )),
32321
32322
32323 checksum: checksum.map(|envelope| ::fidl_next::FromWire::from_wire(
32324 unsafe { envelope.read_unchecked::<crate::WireConfigChecksum<'de>>() }
32325 )),
32326
32327 }
32328 }
32329}
32330
32331impl<'de> ::fidl_next::IntoNatural for WireConfigValuesData<'de> {
32332 type Natural = ConfigValuesData;
32333}
32334
32335impl<'de> ::fidl_next::FromWireRef<WireConfigValuesData<'de>> for ConfigValuesData {
32336 #[inline]
32337 fn from_wire_ref(wire: &WireConfigValuesData<'de>) -> Self {
32338 Self {
32339
32340
32341 values: wire.table.get(1)
32342 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
32343 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigValueSpec<'de>>>() }
32344 )),
32345
32346
32347 checksum: wire.table.get(2)
32348 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
32349 unsafe { envelope.deref_unchecked::<crate::WireConfigChecksum<'de>>() }
32350 )),
32351
32352 }
32353 }
32354}
32355
32356#[repr(C)]
32358pub struct WireConfigValuesData<'de> {
32359 table: ::fidl_next::WireTable<'de>,
32360}
32361
32362impl<'de> Drop for WireConfigValuesData<'de> {
32363 fn drop(&mut self) {
32364 let _ = self.table.get(1)
32365 .map(|envelope| unsafe {
32366 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireConfigValueSpec<'de>>>()
32367 });
32368
32369 let _ = self
32370 .table
32371 .get(2)
32372 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireConfigChecksum<'de>>() });
32373 }
32374}
32375
32376unsafe impl ::fidl_next::Wire for WireConfigValuesData<'static> {
32377 type Decoded<'de> = WireConfigValuesData<'de>;
32378
32379 #[inline]
32380 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32381 ::fidl_next::munge!(let Self { table } = out);
32382 ::fidl_next::WireTable::zero_padding(table);
32383 }
32384}
32385
32386unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigValuesData<'static>
32387where
32388 ___D: ::fidl_next::Decoder + ?Sized,
32389{
32390 fn decode(
32391 slot: ::fidl_next::Slot<'_, Self>,
32392 decoder: &mut ___D,
32393 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32394 ::fidl_next::munge!(let Self { table } = slot);
32395
32396 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32397 match ordinal {
32398 0 => unsafe { ::core::hint::unreachable_unchecked() },
32399
32400 1 => {
32401 ::fidl_next::WireEnvelope::decode_as::<
32402 ___D,
32403 ::fidl_next::WireVector<'static, crate::WireConfigValueSpec<'static>>,
32404 >(slot.as_mut(), decoder)?;
32405
32406 Ok(())
32407 }
32408
32409 2 => {
32410 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigChecksum<'static>>(
32411 slot.as_mut(),
32412 decoder,
32413 )?;
32414
32415 Ok(())
32416 }
32417
32418 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
32419 }
32420 })
32421 }
32422}
32423
32424impl<'de> WireConfigValuesData<'de> {
32425 pub fn values(
32426 &self,
32427 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::WireConfigValueSpec<'de>>>
32428 {
32429 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32430 }
32431
32432 pub fn checksum(&self) -> ::core::option::Option<&crate::WireConfigChecksum<'de>> {
32433 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
32434 }
32435}
32436
32437impl<'de> ::core::fmt::Debug for WireConfigValuesData<'de> {
32438 fn fmt(
32439 &self,
32440 f: &mut ::core::fmt::Formatter<'_>,
32441 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32442 f.debug_struct("ConfigValuesData")
32443 .field("values", &self.values())
32444 .field("checksum", &self.checksum())
32445 .finish()
32446 }
32447}
32448
32449#[doc = " Indicates the event name to subscribe to with a given event mode.\n"]
32450#[derive(PartialEq, Clone, Debug, Default)]
32451pub struct EventSubscription {
32452 pub event_name: ::core::option::Option<::std::string::String>,
32453}
32454
32455impl EventSubscription {
32456 fn __max_ordinal(&self) -> usize {
32457 if self.event_name.is_some() {
32458 return 1;
32459 }
32460
32461 0
32462 }
32463}
32464
32465impl ::fidl_next::Encodable for EventSubscription {
32466 type Encoded = WireEventSubscription<'static>;
32467}
32468
32469unsafe impl<___E> ::fidl_next::Encode<___E> for EventSubscription
32470where
32471 ___E: ::fidl_next::Encoder + ?Sized,
32472{
32473 #[inline]
32474 fn encode(
32475 mut self,
32476 encoder: &mut ___E,
32477 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
32478 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
32479 ::fidl_next::munge!(let WireEventSubscription { table } = out);
32480
32481 let max_ord = self.__max_ordinal();
32482
32483 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
32484 ::fidl_next::Wire::zero_padding(&mut out);
32485
32486 let mut preallocated =
32487 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
32488
32489 for i in 1..=max_ord {
32490 match i {
32491 1 => {
32492 if let Some(value) = self.event_name.take() {
32493 ::fidl_next::WireEnvelope::encode_value(
32494 value,
32495 preallocated.encoder,
32496 &mut out,
32497 )?;
32498 } else {
32499 ::fidl_next::WireEnvelope::encode_zero(&mut out)
32500 }
32501 }
32502
32503 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
32504 }
32505 unsafe {
32506 preallocated.write_next(out.assume_init_ref());
32507 }
32508 }
32509
32510 ::fidl_next::WireTable::encode_len(table, max_ord);
32511
32512 Ok(())
32513 }
32514}
32515
32516unsafe impl<___E> ::fidl_next::EncodeRef<___E> for EventSubscription
32517where
32518 ___E: ::fidl_next::Encoder + ?Sized,
32519{
32520 #[inline]
32521 fn encode_ref(
32522 &self,
32523 encoder: &mut ___E,
32524 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
32525 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
32526 ::fidl_next::munge!(let WireEventSubscription { table } = out);
32527
32528 let max_ord = self.__max_ordinal();
32529
32530 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
32531 ::fidl_next::Wire::zero_padding(&mut out);
32532
32533 let mut preallocated =
32534 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
32535
32536 for i in 1..=max_ord {
32537 match i {
32538 1 => {
32539 if let Some(value) = &self.event_name {
32540 ::fidl_next::WireEnvelope::encode_value(
32541 value,
32542 preallocated.encoder,
32543 &mut out,
32544 )?;
32545 } else {
32546 ::fidl_next::WireEnvelope::encode_zero(&mut out)
32547 }
32548 }
32549
32550 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
32551 }
32552 unsafe {
32553 preallocated.write_next(out.assume_init_ref());
32554 }
32555 }
32556
32557 ::fidl_next::WireTable::encode_len(table, max_ord);
32558
32559 Ok(())
32560 }
32561}
32562
32563impl<'de> ::fidl_next::FromWire<WireEventSubscription<'de>> for EventSubscription {
32564 #[inline]
32565 fn from_wire(wire_: WireEventSubscription<'de>) -> Self {
32566 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
32567
32568 let event_name = wire_.table.get(1);
32569
32570 Self {
32571 event_name: event_name.map(|envelope| {
32572 ::fidl_next::FromWire::from_wire(unsafe {
32573 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
32574 })
32575 }),
32576 }
32577 }
32578}
32579
32580impl<'de> ::fidl_next::IntoNatural for WireEventSubscription<'de> {
32581 type Natural = EventSubscription;
32582}
32583
32584impl<'de> ::fidl_next::FromWireRef<WireEventSubscription<'de>> for EventSubscription {
32585 #[inline]
32586 fn from_wire_ref(wire: &WireEventSubscription<'de>) -> Self {
32587 Self {
32588 event_name: wire.table.get(1).map(|envelope| {
32589 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
32590 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
32591 })
32592 }),
32593 }
32594 }
32595}
32596
32597#[repr(C)]
32599pub struct WireEventSubscription<'de> {
32600 table: ::fidl_next::WireTable<'de>,
32601}
32602
32603impl<'de> Drop for WireEventSubscription<'de> {
32604 fn drop(&mut self) {
32605 let _ = self
32606 .table
32607 .get(1)
32608 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
32609 }
32610}
32611
32612unsafe impl ::fidl_next::Wire for WireEventSubscription<'static> {
32613 type Decoded<'de> = WireEventSubscription<'de>;
32614
32615 #[inline]
32616 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32617 ::fidl_next::munge!(let Self { table } = out);
32618 ::fidl_next::WireTable::zero_padding(table);
32619 }
32620}
32621
32622unsafe impl<___D> ::fidl_next::Decode<___D> for WireEventSubscription<'static>
32623where
32624 ___D: ::fidl_next::Decoder + ?Sized,
32625{
32626 fn decode(
32627 slot: ::fidl_next::Slot<'_, Self>,
32628 decoder: &mut ___D,
32629 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32630 ::fidl_next::munge!(let Self { table } = slot);
32631
32632 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32633 match ordinal {
32634 0 => unsafe { ::core::hint::unreachable_unchecked() },
32635
32636 1 => {
32637 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
32638 slot.as_mut(),
32639 decoder,
32640 )?;
32641
32642 let value = unsafe {
32643 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
32644 };
32645
32646 if value.len() > 100 {
32647 return Err(::fidl_next::DecodeError::VectorTooLong {
32648 size: value.len() as u64,
32649 limit: 100,
32650 });
32651 }
32652
32653 Ok(())
32654 }
32655
32656 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
32657 }
32658 })
32659 }
32660}
32661
32662impl<'de> WireEventSubscription<'de> {
32663 pub fn event_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
32664 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32665 }
32666}
32667
32668impl<'de> ::core::fmt::Debug for WireEventSubscription<'de> {
32669 fn fmt(
32670 &self,
32671 f: &mut ::core::fmt::Formatter<'_>,
32672 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32673 f.debug_struct("EventSubscription").field("event_name", &self.event_name()).finish()
32674 }
32675}
32676
32677#[derive(PartialEq, Clone, Debug)]
32678pub enum LayoutParameter {
32679 NestedType(crate::ConfigType),
32680
32681 UnknownOrdinal_(u64),
32682}
32683
32684impl ::fidl_next::Encodable for LayoutParameter {
32685 type Encoded = WireLayoutParameter<'static>;
32686}
32687
32688unsafe impl<___E> ::fidl_next::Encode<___E> for LayoutParameter
32689where
32690 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
32691 ___E: ::fidl_next::Encoder,
32692{
32693 #[inline]
32694 fn encode(
32695 self,
32696 encoder: &mut ___E,
32697 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
32698 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
32699 ::fidl_next::munge!(let WireLayoutParameter { raw, _phantom: _ } = out);
32700
32701 match self {
32702 Self::NestedType(value) => ::fidl_next::RawWireUnion::encode_as::<
32703 ___E,
32704 crate::ConfigType,
32705 >(value, 1, encoder, raw)?,
32706
32707 Self::UnknownOrdinal_(ordinal) => {
32708 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
32709 }
32710 }
32711
32712 Ok(())
32713 }
32714}
32715
32716unsafe impl<___E> ::fidl_next::EncodeRef<___E> for LayoutParameter
32717where
32718 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
32719 ___E: ::fidl_next::Encoder,
32720{
32721 #[inline]
32722 fn encode_ref(
32723 &self,
32724 encoder: &mut ___E,
32725 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
32726 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
32727 ::fidl_next::munge!(let WireLayoutParameter { raw, _phantom: _ } = out);
32728
32729 match self {
32730 Self::NestedType(value) => ::fidl_next::RawWireUnion::encode_as::<
32731 ___E,
32732 &crate::ConfigType,
32733 >(value, 1, encoder, raw)?,
32734
32735 Self::UnknownOrdinal_(ordinal) => {
32736 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
32737 }
32738 }
32739
32740 Ok(())
32741 }
32742}
32743
32744impl ::fidl_next::EncodableOption for LayoutParameter {
32745 type EncodedOption = WireOptionalLayoutParameter<'static>;
32746}
32747
32748unsafe impl<___E> ::fidl_next::EncodeOption<___E> for LayoutParameter
32749where
32750 ___E: ?Sized,
32751 LayoutParameter: ::fidl_next::Encode<___E>,
32752{
32753 #[inline]
32754 fn encode_option(
32755 this: ::core::option::Option<Self>,
32756 encoder: &mut ___E,
32757 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
32758 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
32759 ::fidl_next::munge!(let WireOptionalLayoutParameter { raw, _phantom: _ } = &mut *out);
32760
32761 if let Some(inner) = this {
32762 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
32763 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
32764 } else {
32765 ::fidl_next::RawWireUnion::encode_absent(raw);
32766 }
32767
32768 Ok(())
32769 }
32770}
32771
32772unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for LayoutParameter
32773where
32774 ___E: ?Sized,
32775 LayoutParameter: ::fidl_next::EncodeRef<___E>,
32776{
32777 #[inline]
32778 fn encode_option_ref(
32779 this: ::core::option::Option<&Self>,
32780 encoder: &mut ___E,
32781 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
32782 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
32783 ::fidl_next::munge!(let WireOptionalLayoutParameter { raw, _phantom: _ } = &mut *out);
32784
32785 if let Some(inner) = this {
32786 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
32787 ::fidl_next::EncodeRef::encode_ref(inner, encoder, value_out)?;
32788 } else {
32789 ::fidl_next::RawWireUnion::encode_absent(raw);
32790 }
32791
32792 Ok(())
32793 }
32794}
32795
32796impl<'de> ::fidl_next::FromWire<WireLayoutParameter<'de>> for LayoutParameter {
32797 #[inline]
32798 fn from_wire(wire: WireLayoutParameter<'de>) -> Self {
32799 let wire = ::core::mem::ManuallyDrop::new(wire);
32800 match wire.raw.ordinal() {
32801 1 => Self::NestedType(::fidl_next::FromWire::from_wire(unsafe {
32802 wire.raw.get().read_unchecked::<crate::WireConfigType<'de>>()
32803 })),
32804
32805 _ => unsafe { ::core::hint::unreachable_unchecked() },
32806 }
32807 }
32808}
32809
32810impl<'de> ::fidl_next::IntoNatural for WireLayoutParameter<'de> {
32811 type Natural = LayoutParameter;
32812}
32813
32814impl<'de> ::fidl_next::FromWireRef<WireLayoutParameter<'de>> for LayoutParameter {
32815 #[inline]
32816 fn from_wire_ref(wire: &WireLayoutParameter<'de>) -> Self {
32817 match wire.raw.ordinal() {
32818 1 => Self::NestedType(::fidl_next::FromWireRef::from_wire_ref(unsafe {
32819 wire.raw.get().deref_unchecked::<crate::WireConfigType<'de>>()
32820 })),
32821
32822 _ => unsafe { ::core::hint::unreachable_unchecked() },
32823 }
32824 }
32825}
32826
32827impl<'de> ::fidl_next::FromWireOption<WireOptionalLayoutParameter<'de>> for LayoutParameter {
32828 #[inline]
32829 fn from_wire_option(wire: WireOptionalLayoutParameter<'de>) -> ::core::option::Option<Self> {
32830 if let Some(inner) = wire.into_option() {
32831 Some(::fidl_next::FromWire::from_wire(inner))
32832 } else {
32833 None
32834 }
32835 }
32836}
32837
32838impl<'de> ::fidl_next::IntoNatural for WireOptionalLayoutParameter<'de> {
32839 type Natural = ::core::option::Option<LayoutParameter>;
32840}
32841
32842impl<'de> ::fidl_next::FromWireOption<WireOptionalLayoutParameter<'de>> for Box<LayoutParameter> {
32843 #[inline]
32844 fn from_wire_option(wire: WireOptionalLayoutParameter<'de>) -> ::core::option::Option<Self> {
32845 <
32846 LayoutParameter as ::fidl_next::FromWireOption<WireOptionalLayoutParameter<'de>>
32847 >::from_wire_option(wire).map(Box::new)
32848 }
32849}
32850
32851impl<'de> ::fidl_next::FromWireOptionRef<WireOptionalLayoutParameter<'de>>
32852 for Box<LayoutParameter>
32853{
32854 #[inline]
32855 fn from_wire_option_ref(
32856 wire: &WireOptionalLayoutParameter<'de>,
32857 ) -> ::core::option::Option<Self> {
32858 if let Some(inner) = wire.as_ref() {
32859 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
32860 } else {
32861 None
32862 }
32863 }
32864}
32865
32866#[repr(transparent)]
32868pub struct WireLayoutParameter<'de> {
32869 raw: ::fidl_next::RawWireUnion,
32870 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
32871}
32872
32873impl<'de> Drop for WireLayoutParameter<'de> {
32874 fn drop(&mut self) {
32875 match self.raw.ordinal() {
32876 1 => {
32877 let _ = unsafe { self.raw.get().read_unchecked::<crate::WireConfigType<'de>>() };
32878 }
32879
32880 _ => (),
32881 }
32882 }
32883}
32884
32885unsafe impl ::fidl_next::Wire for WireLayoutParameter<'static> {
32886 type Decoded<'de> = WireLayoutParameter<'de>;
32887
32888 #[inline]
32889 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32890 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
32891 ::fidl_next::RawWireUnion::zero_padding(raw);
32892 }
32893}
32894
32895pub mod layout_parameter {
32896 pub enum Ref<'de> {
32897 NestedType(&'de crate::WireConfigType<'de>),
32898
32899 UnknownOrdinal_(u64),
32900 }
32901}
32902
32903impl<'de> WireLayoutParameter<'de> {
32904 pub fn as_ref(&self) -> crate::layout_parameter::Ref<'_> {
32905 match self.raw.ordinal() {
32906 1 => crate::layout_parameter::Ref::NestedType(unsafe {
32907 self.raw.get().deref_unchecked::<crate::WireConfigType<'_>>()
32908 }),
32909
32910 unknown => crate::layout_parameter::Ref::UnknownOrdinal_(unknown),
32911 }
32912 }
32913}
32914
32915unsafe impl<___D> ::fidl_next::Decode<___D> for WireLayoutParameter<'static>
32916where
32917 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
32918 ___D: ::fidl_next::Decoder,
32919{
32920 fn decode(
32921 mut slot: ::fidl_next::Slot<'_, Self>,
32922 decoder: &mut ___D,
32923 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32924 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
32925 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
32926 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigType<'static>>(
32927 raw, decoder,
32928 )?,
32929
32930 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
32931 }
32932
32933 Ok(())
32934 }
32935}
32936
32937impl<'de> ::core::fmt::Debug for WireLayoutParameter<'de> {
32938 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
32939 match self.raw.ordinal() {
32940 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireConfigType<'_>>().fmt(f) },
32941 _ => unsafe { ::core::hint::unreachable_unchecked() },
32942 }
32943 }
32944}
32945
32946#[repr(transparent)]
32947pub struct WireOptionalLayoutParameter<'de> {
32948 raw: ::fidl_next::RawWireUnion,
32949 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
32950}
32951
32952unsafe impl ::fidl_next::Wire for WireOptionalLayoutParameter<'static> {
32953 type Decoded<'de> = WireOptionalLayoutParameter<'de>;
32954
32955 #[inline]
32956 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32957 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
32958 ::fidl_next::RawWireUnion::zero_padding(raw);
32959 }
32960}
32961
32962impl<'de> WireOptionalLayoutParameter<'de> {
32963 pub fn is_some(&self) -> bool {
32964 self.raw.is_some()
32965 }
32966
32967 pub fn is_none(&self) -> bool {
32968 self.raw.is_none()
32969 }
32970
32971 pub fn as_ref(&self) -> ::core::option::Option<&WireLayoutParameter<'de>> {
32972 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
32973 }
32974
32975 pub fn into_option(self) -> ::core::option::Option<WireLayoutParameter<'de>> {
32976 if self.is_some() {
32977 Some(WireLayoutParameter { raw: self.raw, _phantom: ::core::marker::PhantomData })
32978 } else {
32979 None
32980 }
32981 }
32982}
32983
32984unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalLayoutParameter<'static>
32985where
32986 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
32987 ___D: ::fidl_next::Decoder,
32988{
32989 fn decode(
32990 mut slot: ::fidl_next::Slot<'_, Self>,
32991 decoder: &mut ___D,
32992 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32993 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
32994 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
32995 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigType<'static>>(
32996 raw, decoder,
32997 )?,
32998
32999 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
33000 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
33001 }
33002
33003 Ok(())
33004 }
33005}
33006
33007impl<'de> ::core::fmt::Debug for WireOptionalLayoutParameter<'de> {
33008 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
33009 self.as_ref().fmt(f)
33010 }
33011}
33012
33013pub const MAX_MONIKER_LENGTH: u32 = 4096 as u32;
33014
33015#[doc = " The maximum number of EventSubscriptions in an EventStream.\n"]
33016pub const MAX_NUM_EVENT_STREAM_SUBSCRIPTIONS: u64 = 100 as u64;
33017
33018#[derive(PartialEq, Clone, Debug)]
33019pub struct ResolvedConfigField {
33020 pub key: ::std::string::String,
33021
33022 pub value: crate::ConfigValue,
33023}
33024
33025impl ::fidl_next::Encodable for ResolvedConfigField {
33026 type Encoded = WireResolvedConfigField<'static>;
33027}
33028
33029unsafe impl<___E> ::fidl_next::Encode<___E> for ResolvedConfigField
33030where
33031 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
33032 ___E: ::fidl_next::Encoder,
33033{
33034 #[inline]
33035 fn encode(
33036 self,
33037 encoder_: &mut ___E,
33038 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
33039 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
33040 ::fidl_next::munge! {
33041 let Self::Encoded {
33042 key,
33043 value,
33044
33045 } = out_;
33046 }
33047
33048 ::fidl_next::Encode::encode(self.key, encoder_, key)?;
33049
33050 ::fidl_next::Encode::encode(self.value, encoder_, value)?;
33051
33052 Ok(())
33053 }
33054}
33055
33056unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ResolvedConfigField
33057where
33058 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
33059 ___E: ::fidl_next::Encoder,
33060{
33061 #[inline]
33062 fn encode_ref(
33063 &self,
33064 encoder_: &mut ___E,
33065 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
33066 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
33067 ::fidl_next::munge! {
33068 let Self::Encoded {
33069
33070 key,
33071 value,
33072
33073 } = out_;
33074 }
33075
33076 ::fidl_next::EncodeRef::encode_ref(&self.key, encoder_, key)?;
33077
33078 ::fidl_next::EncodeRef::encode_ref(&self.value, encoder_, value)?;
33079
33080 Ok(())
33081 }
33082}
33083
33084impl ::fidl_next::EncodableOption for ResolvedConfigField {
33085 type EncodedOption = ::fidl_next::WireBox<'static, WireResolvedConfigField<'static>>;
33086}
33087
33088unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ResolvedConfigField
33089where
33090 ___E: ::fidl_next::Encoder + ?Sized,
33091 ResolvedConfigField: ::fidl_next::Encode<___E>,
33092{
33093 #[inline]
33094 fn encode_option(
33095 this: ::core::option::Option<Self>,
33096 encoder: &mut ___E,
33097 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
33098 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
33099 if let Some(inner) = this {
33100 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
33101 ::fidl_next::WireBox::encode_present(out);
33102 } else {
33103 ::fidl_next::WireBox::encode_absent(out);
33104 }
33105
33106 Ok(())
33107 }
33108}
33109
33110unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ResolvedConfigField
33111where
33112 ___E: ::fidl_next::Encoder + ?Sized,
33113 ResolvedConfigField: ::fidl_next::EncodeRef<___E>,
33114{
33115 #[inline]
33116 fn encode_option_ref(
33117 this: ::core::option::Option<&Self>,
33118 encoder: &mut ___E,
33119 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
33120 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
33121 if let Some(inner) = this {
33122 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
33123 ::fidl_next::WireBox::encode_present(out);
33124 } else {
33125 ::fidl_next::WireBox::encode_absent(out);
33126 }
33127
33128 Ok(())
33129 }
33130}
33131
33132impl<'de> ::fidl_next::FromWire<WireResolvedConfigField<'de>> for ResolvedConfigField {
33133 #[inline]
33134 fn from_wire(wire: WireResolvedConfigField<'de>) -> Self {
33135 Self {
33136 key: ::fidl_next::FromWire::from_wire(wire.key),
33137
33138 value: ::fidl_next::FromWire::from_wire(wire.value),
33139 }
33140 }
33141}
33142
33143impl<'de> ::fidl_next::IntoNatural for WireResolvedConfigField<'de> {
33144 type Natural = ResolvedConfigField;
33145}
33146
33147impl<'de> ::fidl_next::FromWireRef<WireResolvedConfigField<'de>> for ResolvedConfigField {
33148 #[inline]
33149 fn from_wire_ref(wire: &WireResolvedConfigField<'de>) -> Self {
33150 Self {
33151 key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
33152
33153 value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value),
33154 }
33155 }
33156}
33157
33158#[derive(Debug)]
33160#[repr(C)]
33161pub struct WireResolvedConfigField<'de> {
33162 pub key: ::fidl_next::WireString<'de>,
33163
33164 pub value: crate::WireConfigValue<'de>,
33165}
33166static_assertions::const_assert_eq!(std::mem::size_of::<WireResolvedConfigField<'_>>(), 32);
33167static_assertions::const_assert_eq!(std::mem::align_of::<WireResolvedConfigField<'_>>(), 8);
33168
33169static_assertions::const_assert_eq!(std::mem::offset_of!(WireResolvedConfigField<'_>, key), 0);
33170
33171static_assertions::const_assert_eq!(std::mem::offset_of!(WireResolvedConfigField<'_>, value), 16);
33172
33173unsafe impl ::fidl_next::Wire for WireResolvedConfigField<'static> {
33174 type Decoded<'de> = WireResolvedConfigField<'de>;
33175
33176 #[inline]
33177 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
33178 ::fidl_next::munge! {
33179 let Self {
33180
33181 key,
33182 value,
33183
33184 } = &mut *out_;
33185 }
33186
33187 ::fidl_next::Wire::zero_padding(key);
33188
33189 ::fidl_next::Wire::zero_padding(value);
33190 }
33191}
33192
33193unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolvedConfigField<'static>
33194where
33195 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
33196 ___D: ::fidl_next::Decoder,
33197{
33198 fn decode(
33199 slot_: ::fidl_next::Slot<'_, Self>,
33200 decoder_: &mut ___D,
33201 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33202 ::fidl_next::munge! {
33203 let Self {
33204
33205 mut key,
33206 mut value,
33207
33208 } = slot_;
33209 }
33210
33211 ::fidl_next::Decode::decode(key.as_mut(), decoder_)?;
33212
33213 ::fidl_next::Decode::decode(value.as_mut(), decoder_)?;
33214
33215 Ok(())
33216 }
33217}
33218
33219#[doc = " A configuration that has been completely resolved by component manager.\n"]
33220#[derive(PartialEq, Clone, Debug)]
33221pub struct ResolvedConfig {
33222 pub fields: ::std::vec::Vec<crate::ResolvedConfigField>,
33223
33224 pub checksum: crate::ConfigChecksum,
33225}
33226
33227impl ::fidl_next::Encodable for ResolvedConfig {
33228 type Encoded = WireResolvedConfig<'static>;
33229}
33230
33231unsafe impl<___E> ::fidl_next::Encode<___E> for ResolvedConfig
33232where
33233 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
33234 ___E: ::fidl_next::Encoder,
33235{
33236 #[inline]
33237 fn encode(
33238 self,
33239 encoder_: &mut ___E,
33240 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
33241 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
33242 ::fidl_next::munge! {
33243 let Self::Encoded {
33244 fields,
33245 checksum,
33246
33247 } = out_;
33248 }
33249
33250 ::fidl_next::Encode::encode(self.fields, encoder_, fields)?;
33251
33252 ::fidl_next::Encode::encode(self.checksum, encoder_, checksum)?;
33253
33254 Ok(())
33255 }
33256}
33257
33258unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ResolvedConfig
33259where
33260 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
33261 ___E: ::fidl_next::Encoder,
33262{
33263 #[inline]
33264 fn encode_ref(
33265 &self,
33266 encoder_: &mut ___E,
33267 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
33268 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
33269 ::fidl_next::munge! {
33270 let Self::Encoded {
33271
33272 fields,
33273 checksum,
33274
33275 } = out_;
33276 }
33277
33278 ::fidl_next::EncodeRef::encode_ref(&self.fields, encoder_, fields)?;
33279
33280 ::fidl_next::EncodeRef::encode_ref(&self.checksum, encoder_, checksum)?;
33281
33282 Ok(())
33283 }
33284}
33285
33286impl ::fidl_next::EncodableOption for ResolvedConfig {
33287 type EncodedOption = ::fidl_next::WireBox<'static, WireResolvedConfig<'static>>;
33288}
33289
33290unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ResolvedConfig
33291where
33292 ___E: ::fidl_next::Encoder + ?Sized,
33293 ResolvedConfig: ::fidl_next::Encode<___E>,
33294{
33295 #[inline]
33296 fn encode_option(
33297 this: ::core::option::Option<Self>,
33298 encoder: &mut ___E,
33299 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
33300 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
33301 if let Some(inner) = this {
33302 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
33303 ::fidl_next::WireBox::encode_present(out);
33304 } else {
33305 ::fidl_next::WireBox::encode_absent(out);
33306 }
33307
33308 Ok(())
33309 }
33310}
33311
33312unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ResolvedConfig
33313where
33314 ___E: ::fidl_next::Encoder + ?Sized,
33315 ResolvedConfig: ::fidl_next::EncodeRef<___E>,
33316{
33317 #[inline]
33318 fn encode_option_ref(
33319 this: ::core::option::Option<&Self>,
33320 encoder: &mut ___E,
33321 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
33322 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
33323 if let Some(inner) = this {
33324 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
33325 ::fidl_next::WireBox::encode_present(out);
33326 } else {
33327 ::fidl_next::WireBox::encode_absent(out);
33328 }
33329
33330 Ok(())
33331 }
33332}
33333
33334impl<'de> ::fidl_next::FromWire<WireResolvedConfig<'de>> for ResolvedConfig {
33335 #[inline]
33336 fn from_wire(wire: WireResolvedConfig<'de>) -> Self {
33337 Self {
33338 fields: ::fidl_next::FromWire::from_wire(wire.fields),
33339
33340 checksum: ::fidl_next::FromWire::from_wire(wire.checksum),
33341 }
33342 }
33343}
33344
33345impl<'de> ::fidl_next::IntoNatural for WireResolvedConfig<'de> {
33346 type Natural = ResolvedConfig;
33347}
33348
33349impl<'de> ::fidl_next::FromWireRef<WireResolvedConfig<'de>> for ResolvedConfig {
33350 #[inline]
33351 fn from_wire_ref(wire: &WireResolvedConfig<'de>) -> Self {
33352 Self {
33353 fields: ::fidl_next::FromWireRef::from_wire_ref(&wire.fields),
33354
33355 checksum: ::fidl_next::FromWireRef::from_wire_ref(&wire.checksum),
33356 }
33357 }
33358}
33359
33360#[derive(Debug)]
33362#[repr(C)]
33363pub struct WireResolvedConfig<'de> {
33364 pub fields: ::fidl_next::WireVector<'de, crate::WireResolvedConfigField<'de>>,
33365
33366 pub checksum: crate::WireConfigChecksum<'de>,
33367}
33368static_assertions::const_assert_eq!(std::mem::size_of::<WireResolvedConfig<'_>>(), 32);
33369static_assertions::const_assert_eq!(std::mem::align_of::<WireResolvedConfig<'_>>(), 8);
33370
33371static_assertions::const_assert_eq!(std::mem::offset_of!(WireResolvedConfig<'_>, fields), 0);
33372
33373static_assertions::const_assert_eq!(std::mem::offset_of!(WireResolvedConfig<'_>, checksum), 16);
33374
33375unsafe impl ::fidl_next::Wire for WireResolvedConfig<'static> {
33376 type Decoded<'de> = WireResolvedConfig<'de>;
33377
33378 #[inline]
33379 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
33380 ::fidl_next::munge! {
33381 let Self {
33382
33383 fields,
33384 checksum,
33385
33386 } = &mut *out_;
33387 }
33388
33389 ::fidl_next::Wire::zero_padding(fields);
33390
33391 ::fidl_next::Wire::zero_padding(checksum);
33392 }
33393}
33394
33395unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolvedConfig<'static>
33396where
33397 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
33398 ___D: ::fidl_next::Decoder,
33399{
33400 fn decode(
33401 slot_: ::fidl_next::Slot<'_, Self>,
33402 decoder_: &mut ___D,
33403 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33404 ::fidl_next::munge! {
33405 let Self {
33406
33407 mut fields,
33408 mut checksum,
33409
33410 } = slot_;
33411 }
33412
33413 ::fidl_next::Decode::decode(fields.as_mut(), decoder_)?;
33414
33415 ::fidl_next::Decode::decode(checksum.as_mut(), decoder_)?;
33416
33417 Ok(())
33418 }
33419}
33420
33421pub mod compat {
33423
33424 impl ::fidl_next::CompatFrom<crate::AllowedOffers>
33425 for ::fidl_fuchsia_component_decl::AllowedOffers
33426 {
33427 fn compat_from(value: crate::AllowedOffers) -> Self {
33428 match value {
33429 crate::AllowedOffers::StaticOnly => Self::StaticOnly,
33430
33431 crate::AllowedOffers::StaticAndDynamic => Self::StaticAndDynamic,
33432 }
33433 }
33434 }
33435
33436 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::AllowedOffers>
33437 for crate::AllowedOffers
33438 {
33439 fn compat_from(value: ::fidl_fuchsia_component_decl::AllowedOffers) -> Self {
33440 match value {
33441 ::fidl_fuchsia_component_decl::AllowedOffers::StaticOnly => Self::StaticOnly,
33442
33443 ::fidl_fuchsia_component_decl::AllowedOffers::StaticAndDynamic => {
33444 Self::StaticAndDynamic
33445 }
33446 }
33447 }
33448 }
33449
33450 impl ::fidl_next::CompatFrom<crate::Availability> for ::fidl_fuchsia_component_decl::Availability {
33451 fn compat_from(value: crate::Availability) -> Self {
33452 match value {
33453 crate::Availability::Required => Self::Required,
33454
33455 crate::Availability::Optional => Self::Optional,
33456
33457 crate::Availability::SameAsTarget => Self::SameAsTarget,
33458
33459 crate::Availability::Transitional => Self::Transitional,
33460 }
33461 }
33462 }
33463
33464 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Availability> for crate::Availability {
33465 fn compat_from(value: ::fidl_fuchsia_component_decl::Availability) -> Self {
33466 match value {
33467 ::fidl_fuchsia_component_decl::Availability::Required => Self::Required,
33468
33469 ::fidl_fuchsia_component_decl::Availability::Optional => Self::Optional,
33470
33471 ::fidl_fuchsia_component_decl::Availability::SameAsTarget => Self::SameAsTarget,
33472
33473 ::fidl_fuchsia_component_decl::Availability::Transitional => Self::Transitional,
33474 }
33475 }
33476 }
33477
33478 impl ::fidl_next::CompatFrom<crate::Service> for ::fidl_fuchsia_component_decl::Service {
33479 fn compat_from(value: crate::Service) -> Self {
33480 Self {
33481 name: ::fidl_next::CompatFrom::compat_from(value.name),
33482
33483 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
33484
33485 __source_breaking: ::fidl::marker::SourceBreaking,
33486 }
33487 }
33488 }
33489
33490 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Service> for crate::Service {
33491 fn compat_from(value: ::fidl_fuchsia_component_decl::Service) -> Self {
33492 Self {
33493 name: ::fidl_next::CompatFrom::compat_from(value.name),
33494
33495 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
33496 }
33497 }
33498 }
33499
33500 impl ::fidl_next::CompatFrom<crate::Directory> for ::fidl_fuchsia_component_decl::Directory {
33501 fn compat_from(value: crate::Directory) -> Self {
33502 Self {
33503 name: ::fidl_next::CompatFrom::compat_from(value.name),
33504
33505 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
33506
33507 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
33508
33509 __source_breaking: ::fidl::marker::SourceBreaking,
33510 }
33511 }
33512 }
33513
33514 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Directory> for crate::Directory {
33515 fn compat_from(value: ::fidl_fuchsia_component_decl::Directory) -> Self {
33516 Self {
33517 name: ::fidl_next::CompatFrom::compat_from(value.name),
33518
33519 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
33520
33521 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
33522 }
33523 }
33524 }
33525
33526 impl ::fidl_next::CompatFrom<crate::ParentRef> for ::fidl_fuchsia_component_decl::ParentRef {
33527 #[inline]
33528 fn compat_from(value: crate::ParentRef) -> Self {
33529 Self {}
33530 }
33531 }
33532
33533 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ParentRef> for crate::ParentRef {
33534 #[inline]
33535 fn compat_from(value: ::fidl_fuchsia_component_decl::ParentRef) -> Self {
33536 Self {}
33537 }
33538 }
33539
33540 impl ::fidl_next::CompatFrom<crate::SelfRef> for ::fidl_fuchsia_component_decl::SelfRef {
33541 #[inline]
33542 fn compat_from(value: crate::SelfRef) -> Self {
33543 Self {}
33544 }
33545 }
33546
33547 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::SelfRef> for crate::SelfRef {
33548 #[inline]
33549 fn compat_from(value: ::fidl_fuchsia_component_decl::SelfRef) -> Self {
33550 Self {}
33551 }
33552 }
33553
33554 impl ::fidl_next::CompatFrom<crate::ChildRef> for ::fidl_fuchsia_component_decl::ChildRef {
33555 #[inline]
33556 fn compat_from(value: crate::ChildRef) -> Self {
33557 Self {
33558 name: ::fidl_next::CompatFrom::compat_from(value.name),
33559
33560 collection: ::fidl_next::CompatFrom::compat_from(value.collection),
33561 }
33562 }
33563 }
33564
33565 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ChildRef> for crate::ChildRef {
33566 #[inline]
33567 fn compat_from(value: ::fidl_fuchsia_component_decl::ChildRef) -> Self {
33568 Self {
33569 name: ::fidl_next::CompatFrom::compat_from(value.name),
33570
33571 collection: ::fidl_next::CompatFrom::compat_from(value.collection),
33572 }
33573 }
33574 }
33575
33576 impl ::fidl_next::CompatFrom<crate::CollectionRef>
33577 for ::fidl_fuchsia_component_decl::CollectionRef
33578 {
33579 #[inline]
33580 fn compat_from(value: crate::CollectionRef) -> Self {
33581 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
33582 }
33583 }
33584
33585 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::CollectionRef>
33586 for crate::CollectionRef
33587 {
33588 #[inline]
33589 fn compat_from(value: ::fidl_fuchsia_component_decl::CollectionRef) -> Self {
33590 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
33591 }
33592 }
33593
33594 impl ::fidl_next::CompatFrom<crate::FrameworkRef> for ::fidl_fuchsia_component_decl::FrameworkRef {
33595 #[inline]
33596 fn compat_from(value: crate::FrameworkRef) -> Self {
33597 Self {}
33598 }
33599 }
33600
33601 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::FrameworkRef> for crate::FrameworkRef {
33602 #[inline]
33603 fn compat_from(value: ::fidl_fuchsia_component_decl::FrameworkRef) -> Self {
33604 Self {}
33605 }
33606 }
33607
33608 impl ::fidl_next::CompatFrom<crate::CapabilityRef>
33609 for ::fidl_fuchsia_component_decl::CapabilityRef
33610 {
33611 #[inline]
33612 fn compat_from(value: crate::CapabilityRef) -> Self {
33613 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
33614 }
33615 }
33616
33617 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::CapabilityRef>
33618 for crate::CapabilityRef
33619 {
33620 #[inline]
33621 fn compat_from(value: ::fidl_fuchsia_component_decl::CapabilityRef) -> Self {
33622 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
33623 }
33624 }
33625
33626 impl ::fidl_next::CompatFrom<crate::DebugRef> for ::fidl_fuchsia_component_decl::DebugRef {
33627 #[inline]
33628 fn compat_from(value: crate::DebugRef) -> Self {
33629 Self {}
33630 }
33631 }
33632
33633 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DebugRef> for crate::DebugRef {
33634 #[inline]
33635 fn compat_from(value: ::fidl_fuchsia_component_decl::DebugRef) -> Self {
33636 Self {}
33637 }
33638 }
33639
33640 impl ::fidl_next::CompatFrom<crate::VoidRef> for ::fidl_fuchsia_component_decl::VoidRef {
33641 #[inline]
33642 fn compat_from(value: crate::VoidRef) -> Self {
33643 Self {}
33644 }
33645 }
33646
33647 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::VoidRef> for crate::VoidRef {
33648 #[inline]
33649 fn compat_from(value: ::fidl_fuchsia_component_decl::VoidRef) -> Self {
33650 Self {}
33651 }
33652 }
33653
33654 impl ::fidl_next::CompatFrom<crate::StorageId> for ::fidl_fuchsia_component_decl::StorageId {
33655 fn compat_from(value: crate::StorageId) -> Self {
33656 match value {
33657 crate::StorageId::StaticInstanceId => Self::StaticInstanceId,
33658
33659 crate::StorageId::StaticInstanceIdOrMoniker => Self::StaticInstanceIdOrMoniker,
33660 }
33661 }
33662 }
33663
33664 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::StorageId> for crate::StorageId {
33665 fn compat_from(value: ::fidl_fuchsia_component_decl::StorageId) -> Self {
33666 match value {
33667 ::fidl_fuchsia_component_decl::StorageId::StaticInstanceId => {
33668 Self::StaticInstanceId
33669 }
33670
33671 ::fidl_fuchsia_component_decl::StorageId::StaticInstanceIdOrMoniker => {
33672 Self::StaticInstanceIdOrMoniker
33673 }
33674 }
33675 }
33676 }
33677
33678 impl ::fidl_next::CompatFrom<crate::Runner> for ::fidl_fuchsia_component_decl::Runner {
33679 fn compat_from(value: crate::Runner) -> Self {
33680 Self {
33681 name: ::fidl_next::CompatFrom::compat_from(value.name),
33682
33683 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
33684
33685 __source_breaking: ::fidl::marker::SourceBreaking,
33686 }
33687 }
33688 }
33689
33690 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Runner> for crate::Runner {
33691 fn compat_from(value: ::fidl_fuchsia_component_decl::Runner) -> Self {
33692 Self {
33693 name: ::fidl_next::CompatFrom::compat_from(value.name),
33694
33695 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
33696 }
33697 }
33698 }
33699
33700 impl ::fidl_next::CompatFrom<crate::Resolver> for ::fidl_fuchsia_component_decl::Resolver {
33701 fn compat_from(value: crate::Resolver) -> Self {
33702 Self {
33703 name: ::fidl_next::CompatFrom::compat_from(value.name),
33704
33705 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
33706
33707 __source_breaking: ::fidl::marker::SourceBreaking,
33708 }
33709 }
33710 }
33711
33712 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Resolver> for crate::Resolver {
33713 fn compat_from(value: ::fidl_fuchsia_component_decl::Resolver) -> Self {
33714 Self {
33715 name: ::fidl_next::CompatFrom::compat_from(value.name),
33716
33717 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
33718 }
33719 }
33720 }
33721
33722 impl ::fidl_next::CompatFrom<crate::EventStream> for ::fidl_fuchsia_component_decl::EventStream {
33723 fn compat_from(value: crate::EventStream) -> Self {
33724 Self {
33725 name: ::fidl_next::CompatFrom::compat_from(value.name),
33726
33727 __source_breaking: ::fidl::marker::SourceBreaking,
33728 }
33729 }
33730 }
33731
33732 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EventStream> for crate::EventStream {
33733 fn compat_from(value: ::fidl_fuchsia_component_decl::EventStream) -> Self {
33734 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
33735 }
33736 }
33737
33738 impl ::fidl_next::CompatFrom<crate::ConfigSingleValue>
33739 for ::fidl_fuchsia_component_decl::ConfigSingleValue
33740 {
33741 fn compat_from(value: crate::ConfigSingleValue) -> Self {
33742 match value {
33743 crate::ConfigSingleValue::Bool(value) => {
33744 Self::Bool(::fidl_next::CompatFrom::compat_from(value))
33745 }
33746
33747 crate::ConfigSingleValue::Uint8(value) => {
33748 Self::Uint8(::fidl_next::CompatFrom::compat_from(value))
33749 }
33750
33751 crate::ConfigSingleValue::Uint16(value) => {
33752 Self::Uint16(::fidl_next::CompatFrom::compat_from(value))
33753 }
33754
33755 crate::ConfigSingleValue::Uint32(value) => {
33756 Self::Uint32(::fidl_next::CompatFrom::compat_from(value))
33757 }
33758
33759 crate::ConfigSingleValue::Uint64(value) => {
33760 Self::Uint64(::fidl_next::CompatFrom::compat_from(value))
33761 }
33762
33763 crate::ConfigSingleValue::Int8(value) => {
33764 Self::Int8(::fidl_next::CompatFrom::compat_from(value))
33765 }
33766
33767 crate::ConfigSingleValue::Int16(value) => {
33768 Self::Int16(::fidl_next::CompatFrom::compat_from(value))
33769 }
33770
33771 crate::ConfigSingleValue::Int32(value) => {
33772 Self::Int32(::fidl_next::CompatFrom::compat_from(value))
33773 }
33774
33775 crate::ConfigSingleValue::Int64(value) => {
33776 Self::Int64(::fidl_next::CompatFrom::compat_from(value))
33777 }
33778
33779 crate::ConfigSingleValue::String(value) => {
33780 Self::String(::fidl_next::CompatFrom::compat_from(value))
33781 }
33782
33783 crate::ConfigSingleValue::UnknownOrdinal_(unknown_ordinal) => {
33784 Self::__SourceBreaking { unknown_ordinal }
33785 }
33786 }
33787 }
33788 }
33789
33790 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigSingleValue>
33791 for crate::ConfigSingleValue
33792 {
33793 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigSingleValue) -> Self {
33794 match value {
33795 ::fidl_fuchsia_component_decl::ConfigSingleValue::Bool(value) => {
33796 Self::Bool(::fidl_next::CompatFrom::compat_from(value))
33797 }
33798
33799 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint8(value) => {
33800 Self::Uint8(::fidl_next::CompatFrom::compat_from(value))
33801 }
33802
33803 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint16(value) => {
33804 Self::Uint16(::fidl_next::CompatFrom::compat_from(value))
33805 }
33806
33807 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint32(value) => {
33808 Self::Uint32(::fidl_next::CompatFrom::compat_from(value))
33809 }
33810
33811 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint64(value) => {
33812 Self::Uint64(::fidl_next::CompatFrom::compat_from(value))
33813 }
33814
33815 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int8(value) => {
33816 Self::Int8(::fidl_next::CompatFrom::compat_from(value))
33817 }
33818
33819 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int16(value) => {
33820 Self::Int16(::fidl_next::CompatFrom::compat_from(value))
33821 }
33822
33823 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int32(value) => {
33824 Self::Int32(::fidl_next::CompatFrom::compat_from(value))
33825 }
33826
33827 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int64(value) => {
33828 Self::Int64(::fidl_next::CompatFrom::compat_from(value))
33829 }
33830
33831 ::fidl_fuchsia_component_decl::ConfigSingleValue::String(value) => {
33832 Self::String(::fidl_next::CompatFrom::compat_from(value))
33833 }
33834
33835 ::fidl_fuchsia_component_decl::ConfigSingleValue::__SourceBreaking {
33836 unknown_ordinal,
33837 } => Self::UnknownOrdinal_(unknown_ordinal),
33838 }
33839 }
33840 }
33841
33842 impl ::fidl_next::CompatFrom<crate::ConfigVectorValue>
33843 for ::fidl_fuchsia_component_decl::ConfigVectorValue
33844 {
33845 fn compat_from(value: crate::ConfigVectorValue) -> Self {
33846 match value {
33847 crate::ConfigVectorValue::BoolVector(value) => {
33848 Self::BoolVector(::fidl_next::CompatFrom::compat_from(value))
33849 }
33850
33851 crate::ConfigVectorValue::Uint8Vector(value) => {
33852 Self::Uint8Vector(::fidl_next::CompatFrom::compat_from(value))
33853 }
33854
33855 crate::ConfigVectorValue::Uint16Vector(value) => {
33856 Self::Uint16Vector(::fidl_next::CompatFrom::compat_from(value))
33857 }
33858
33859 crate::ConfigVectorValue::Uint32Vector(value) => {
33860 Self::Uint32Vector(::fidl_next::CompatFrom::compat_from(value))
33861 }
33862
33863 crate::ConfigVectorValue::Uint64Vector(value) => {
33864 Self::Uint64Vector(::fidl_next::CompatFrom::compat_from(value))
33865 }
33866
33867 crate::ConfigVectorValue::Int8Vector(value) => {
33868 Self::Int8Vector(::fidl_next::CompatFrom::compat_from(value))
33869 }
33870
33871 crate::ConfigVectorValue::Int16Vector(value) => {
33872 Self::Int16Vector(::fidl_next::CompatFrom::compat_from(value))
33873 }
33874
33875 crate::ConfigVectorValue::Int32Vector(value) => {
33876 Self::Int32Vector(::fidl_next::CompatFrom::compat_from(value))
33877 }
33878
33879 crate::ConfigVectorValue::Int64Vector(value) => {
33880 Self::Int64Vector(::fidl_next::CompatFrom::compat_from(value))
33881 }
33882
33883 crate::ConfigVectorValue::StringVector(value) => {
33884 Self::StringVector(::fidl_next::CompatFrom::compat_from(value))
33885 }
33886
33887 crate::ConfigVectorValue::UnknownOrdinal_(unknown_ordinal) => {
33888 Self::__SourceBreaking { unknown_ordinal }
33889 }
33890 }
33891 }
33892 }
33893
33894 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigVectorValue>
33895 for crate::ConfigVectorValue
33896 {
33897 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigVectorValue) -> Self {
33898 match value {
33899 ::fidl_fuchsia_component_decl::ConfigVectorValue::BoolVector(value) => {
33900 Self::BoolVector(::fidl_next::CompatFrom::compat_from(value))
33901 }
33902
33903 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint8Vector(value) => {
33904 Self::Uint8Vector(::fidl_next::CompatFrom::compat_from(value))
33905 }
33906
33907 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint16Vector(value) => {
33908 Self::Uint16Vector(::fidl_next::CompatFrom::compat_from(value))
33909 }
33910
33911 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint32Vector(value) => {
33912 Self::Uint32Vector(::fidl_next::CompatFrom::compat_from(value))
33913 }
33914
33915 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint64Vector(value) => {
33916 Self::Uint64Vector(::fidl_next::CompatFrom::compat_from(value))
33917 }
33918
33919 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int8Vector(value) => {
33920 Self::Int8Vector(::fidl_next::CompatFrom::compat_from(value))
33921 }
33922
33923 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int16Vector(value) => {
33924 Self::Int16Vector(::fidl_next::CompatFrom::compat_from(value))
33925 }
33926
33927 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int32Vector(value) => {
33928 Self::Int32Vector(::fidl_next::CompatFrom::compat_from(value))
33929 }
33930
33931 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int64Vector(value) => {
33932 Self::Int64Vector(::fidl_next::CompatFrom::compat_from(value))
33933 }
33934
33935 ::fidl_fuchsia_component_decl::ConfigVectorValue::StringVector(value) => {
33936 Self::StringVector(::fidl_next::CompatFrom::compat_from(value))
33937 }
33938
33939 ::fidl_fuchsia_component_decl::ConfigVectorValue::__SourceBreaking {
33940 unknown_ordinal,
33941 } => Self::UnknownOrdinal_(unknown_ordinal),
33942 }
33943 }
33944 }
33945
33946 impl ::fidl_next::CompatFrom<crate::ConfigValue> for ::fidl_fuchsia_component_decl::ConfigValue {
33947 fn compat_from(value: crate::ConfigValue) -> Self {
33948 match value {
33949 crate::ConfigValue::Single(value) => {
33950 Self::Single(::fidl_next::CompatFrom::compat_from(value))
33951 }
33952
33953 crate::ConfigValue::Vector(value) => {
33954 Self::Vector(::fidl_next::CompatFrom::compat_from(value))
33955 }
33956
33957 crate::ConfigValue::UnknownOrdinal_(unknown_ordinal) => {
33958 Self::__SourceBreaking { unknown_ordinal }
33959 }
33960 }
33961 }
33962 }
33963
33964 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValue> for crate::ConfigValue {
33965 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValue) -> Self {
33966 match value {
33967 ::fidl_fuchsia_component_decl::ConfigValue::Single(value) => {
33968 Self::Single(::fidl_next::CompatFrom::compat_from(value))
33969 }
33970
33971 ::fidl_fuchsia_component_decl::ConfigValue::Vector(value) => {
33972 Self::Vector(::fidl_next::CompatFrom::compat_from(value))
33973 }
33974
33975 ::fidl_fuchsia_component_decl::ConfigValue::__SourceBreaking {
33976 unknown_ordinal,
33977 } => Self::UnknownOrdinal_(unknown_ordinal),
33978 }
33979 }
33980 }
33981
33982 impl ::fidl_next::CompatFrom<crate::Configuration>
33983 for ::fidl_fuchsia_component_decl::Configuration
33984 {
33985 fn compat_from(value: crate::Configuration) -> Self {
33986 Self {
33987 name: ::fidl_next::CompatFrom::compat_from(value.name),
33988
33989 value: ::fidl_next::CompatFrom::compat_from(value.value),
33990
33991 __source_breaking: ::fidl::marker::SourceBreaking,
33992 }
33993 }
33994 }
33995
33996 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Configuration>
33997 for crate::Configuration
33998 {
33999 fn compat_from(value: ::fidl_fuchsia_component_decl::Configuration) -> Self {
34000 Self {
34001 name: ::fidl_next::CompatFrom::compat_from(value.name),
34002
34003 value: ::fidl_next::CompatFrom::compat_from(value.value),
34004 }
34005 }
34006 }
34007
34008 impl ::fidl_next::CompatFrom<crate::DeliveryType> for ::fidl_fuchsia_component_decl::DeliveryType {
34009 fn compat_from(value: crate::DeliveryType) -> Self {
34010 match value {
34011 crate::DeliveryType::Immediate => Self::Immediate,
34012
34013 crate::DeliveryType::OnReadable => Self::OnReadable,
34014
34015 crate::DeliveryType::UnknownOrdinal_(unknown_ordinal) => {
34016 Self::__SourceBreaking { unknown_ordinal }
34017 }
34018 }
34019 }
34020 }
34021
34022 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DeliveryType> for crate::DeliveryType {
34023 fn compat_from(value: ::fidl_fuchsia_component_decl::DeliveryType) -> Self {
34024 match value {
34025 ::fidl_fuchsia_component_decl::DeliveryType::Immediate => Self::Immediate,
34026
34027 ::fidl_fuchsia_component_decl::DeliveryType::OnReadable => Self::OnReadable,
34028
34029 ::fidl_fuchsia_component_decl::DeliveryType::__SourceBreaking {
34030 unknown_ordinal: value,
34031 } => Self::UnknownOrdinal_(value),
34032 }
34033 }
34034 }
34035
34036 impl ::fidl_next::CompatFrom<crate::Protocol> for ::fidl_fuchsia_component_decl::Protocol {
34037 fn compat_from(value: crate::Protocol) -> Self {
34038 Self {
34039 name: ::fidl_next::CompatFrom::compat_from(value.name),
34040
34041 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
34042
34043 delivery: ::fidl_next::CompatFrom::compat_from(value.delivery),
34044
34045 __source_breaking: ::fidl::marker::SourceBreaking,
34046 }
34047 }
34048 }
34049
34050 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Protocol> for crate::Protocol {
34051 fn compat_from(value: ::fidl_fuchsia_component_decl::Protocol) -> Self {
34052 Self {
34053 name: ::fidl_next::CompatFrom::compat_from(value.name),
34054
34055 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
34056
34057 delivery: ::fidl_next::CompatFrom::compat_from(value.delivery),
34058 }
34059 }
34060 }
34061
34062 impl ::fidl_next::CompatFrom<crate::EnvironmentRef>
34063 for ::fidl_fuchsia_component_decl::EnvironmentRef
34064 {
34065 #[inline]
34066 fn compat_from(value: crate::EnvironmentRef) -> Self {
34067 Self {}
34068 }
34069 }
34070
34071 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EnvironmentRef>
34072 for crate::EnvironmentRef
34073 {
34074 #[inline]
34075 fn compat_from(value: ::fidl_fuchsia_component_decl::EnvironmentRef) -> Self {
34076 Self {}
34077 }
34078 }
34079
34080 impl ::fidl_next::CompatFrom<crate::Ref> for ::fidl_fuchsia_component_decl::Ref {
34081 fn compat_from(value: crate::Ref) -> Self {
34082 match value {
34083 crate::Ref::Parent(value) => {
34084 Self::Parent(::fidl_next::CompatFrom::compat_from(value))
34085 }
34086
34087 crate::Ref::Self_(value) => {
34088 Self::Self_(::fidl_next::CompatFrom::compat_from(value))
34089 }
34090
34091 crate::Ref::Child(value) => {
34092 Self::Child(::fidl_next::CompatFrom::compat_from(value))
34093 }
34094
34095 crate::Ref::Collection(value) => {
34096 Self::Collection(::fidl_next::CompatFrom::compat_from(value))
34097 }
34098
34099 crate::Ref::Framework(value) => {
34100 Self::Framework(::fidl_next::CompatFrom::compat_from(value))
34101 }
34102
34103 crate::Ref::Capability(value) => {
34104 Self::Capability(::fidl_next::CompatFrom::compat_from(value))
34105 }
34106
34107 crate::Ref::Debug(value) => {
34108 Self::Debug(::fidl_next::CompatFrom::compat_from(value))
34109 }
34110
34111 crate::Ref::VoidType(value) => {
34112 Self::VoidType(::fidl_next::CompatFrom::compat_from(value))
34113 }
34114
34115 crate::Ref::Environment(value) => {
34116 Self::Environment(::fidl_next::CompatFrom::compat_from(value))
34117 }
34118
34119 crate::Ref::UnknownOrdinal_(unknown_ordinal) => {
34120 Self::__SourceBreaking { unknown_ordinal }
34121 }
34122 }
34123 }
34124 }
34125
34126 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Ref> for crate::Ref {
34127 fn compat_from(value: ::fidl_fuchsia_component_decl::Ref) -> Self {
34128 match value {
34129 ::fidl_fuchsia_component_decl::Ref::Parent(value) => {
34130 Self::Parent(::fidl_next::CompatFrom::compat_from(value))
34131 }
34132
34133 ::fidl_fuchsia_component_decl::Ref::Self_(value) => {
34134 Self::Self_(::fidl_next::CompatFrom::compat_from(value))
34135 }
34136
34137 ::fidl_fuchsia_component_decl::Ref::Child(value) => {
34138 Self::Child(::fidl_next::CompatFrom::compat_from(value))
34139 }
34140
34141 ::fidl_fuchsia_component_decl::Ref::Collection(value) => {
34142 Self::Collection(::fidl_next::CompatFrom::compat_from(value))
34143 }
34144
34145 ::fidl_fuchsia_component_decl::Ref::Framework(value) => {
34146 Self::Framework(::fidl_next::CompatFrom::compat_from(value))
34147 }
34148
34149 ::fidl_fuchsia_component_decl::Ref::Capability(value) => {
34150 Self::Capability(::fidl_next::CompatFrom::compat_from(value))
34151 }
34152
34153 ::fidl_fuchsia_component_decl::Ref::Debug(value) => {
34154 Self::Debug(::fidl_next::CompatFrom::compat_from(value))
34155 }
34156
34157 ::fidl_fuchsia_component_decl::Ref::VoidType(value) => {
34158 Self::VoidType(::fidl_next::CompatFrom::compat_from(value))
34159 }
34160
34161 ::fidl_fuchsia_component_decl::Ref::Environment(value) => {
34162 Self::Environment(::fidl_next::CompatFrom::compat_from(value))
34163 }
34164
34165 ::fidl_fuchsia_component_decl::Ref::__SourceBreaking { unknown_ordinal } => {
34166 Self::UnknownOrdinal_(unknown_ordinal)
34167 }
34168 }
34169 }
34170 }
34171
34172 impl ::fidl_next::CompatFrom<crate::Storage> for ::fidl_fuchsia_component_decl::Storage {
34173 fn compat_from(value: crate::Storage) -> Self {
34174 Self {
34175 name: ::fidl_next::CompatFrom::compat_from(value.name),
34176
34177 source: ::fidl_next::CompatFrom::compat_from(value.source),
34178
34179 backing_dir: ::fidl_next::CompatFrom::compat_from(value.backing_dir),
34180
34181 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
34182
34183 storage_id: ::fidl_next::CompatFrom::compat_from(value.storage_id),
34184
34185 __source_breaking: ::fidl::marker::SourceBreaking,
34186 }
34187 }
34188 }
34189
34190 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Storage> for crate::Storage {
34191 fn compat_from(value: ::fidl_fuchsia_component_decl::Storage) -> Self {
34192 Self {
34193 name: ::fidl_next::CompatFrom::compat_from(value.name),
34194
34195 source: ::fidl_next::CompatFrom::compat_from(value.source),
34196
34197 backing_dir: ::fidl_next::CompatFrom::compat_from(value.backing_dir),
34198
34199 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
34200
34201 storage_id: ::fidl_next::CompatFrom::compat_from(value.storage_id),
34202 }
34203 }
34204 }
34205
34206 impl ::fidl_next::CompatFrom<crate::Dictionary> for ::fidl_fuchsia_component_decl::Dictionary {
34207 fn compat_from(value: crate::Dictionary) -> Self {
34208 Self {
34209 name: ::fidl_next::CompatFrom::compat_from(value.name),
34210
34211 source: ::fidl_next::CompatFrom::compat_from(value.source),
34212
34213 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34214
34215 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
34216
34217 __source_breaking: ::fidl::marker::SourceBreaking,
34218 }
34219 }
34220 }
34221
34222 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Dictionary> for crate::Dictionary {
34223 fn compat_from(value: ::fidl_fuchsia_component_decl::Dictionary) -> Self {
34224 Self {
34225 name: ::fidl_next::CompatFrom::compat_from(value.name),
34226
34227 source: ::fidl_next::CompatFrom::compat_from(value.source),
34228
34229 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34230
34231 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
34232 }
34233 }
34234 }
34235
34236 impl ::fidl_next::CompatFrom<crate::Capability> for ::fidl_fuchsia_component_decl::Capability {
34237 fn compat_from(value: crate::Capability) -> Self {
34238 match value {
34239 crate::Capability::Service(value) => {
34240 Self::Service(::fidl_next::CompatFrom::compat_from(value))
34241 }
34242
34243 crate::Capability::Protocol(value) => {
34244 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
34245 }
34246
34247 crate::Capability::Directory(value) => {
34248 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
34249 }
34250
34251 crate::Capability::Storage(value) => {
34252 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
34253 }
34254
34255 crate::Capability::Runner(value) => {
34256 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
34257 }
34258
34259 crate::Capability::Resolver(value) => {
34260 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
34261 }
34262
34263 crate::Capability::EventStream(value) => {
34264 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
34265 }
34266
34267 crate::Capability::Dictionary(value) => {
34268 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
34269 }
34270
34271 crate::Capability::Config(value) => {
34272 Self::Config(::fidl_next::CompatFrom::compat_from(value))
34273 }
34274
34275 crate::Capability::UnknownOrdinal_(unknown_ordinal) => {
34276 Self::__SourceBreaking { unknown_ordinal }
34277 }
34278 }
34279 }
34280 }
34281
34282 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Capability> for crate::Capability {
34283 fn compat_from(value: ::fidl_fuchsia_component_decl::Capability) -> Self {
34284 match value {
34285 ::fidl_fuchsia_component_decl::Capability::Service(value) => {
34286 Self::Service(::fidl_next::CompatFrom::compat_from(value))
34287 }
34288
34289 ::fidl_fuchsia_component_decl::Capability::Protocol(value) => {
34290 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
34291 }
34292
34293 ::fidl_fuchsia_component_decl::Capability::Directory(value) => {
34294 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
34295 }
34296
34297 ::fidl_fuchsia_component_decl::Capability::Storage(value) => {
34298 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
34299 }
34300
34301 ::fidl_fuchsia_component_decl::Capability::Runner(value) => {
34302 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
34303 }
34304
34305 ::fidl_fuchsia_component_decl::Capability::Resolver(value) => {
34306 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
34307 }
34308
34309 ::fidl_fuchsia_component_decl::Capability::EventStream(value) => {
34310 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
34311 }
34312
34313 ::fidl_fuchsia_component_decl::Capability::Dictionary(value) => {
34314 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
34315 }
34316
34317 ::fidl_fuchsia_component_decl::Capability::Config(value) => {
34318 Self::Config(::fidl_next::CompatFrom::compat_from(value))
34319 }
34320
34321 ::fidl_fuchsia_component_decl::Capability::__SourceBreaking { unknown_ordinal } => {
34322 Self::UnknownOrdinal_(unknown_ordinal)
34323 }
34324 }
34325 }
34326 }
34327
34328 impl ::fidl_next::CompatFrom<crate::StartupMode> for ::fidl_fuchsia_component_decl::StartupMode {
34329 fn compat_from(value: crate::StartupMode) -> Self {
34330 match value {
34331 crate::StartupMode::Lazy => Self::Lazy,
34332
34333 crate::StartupMode::Eager => Self::Eager,
34334 }
34335 }
34336 }
34337
34338 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::StartupMode> for crate::StartupMode {
34339 fn compat_from(value: ::fidl_fuchsia_component_decl::StartupMode) -> Self {
34340 match value {
34341 ::fidl_fuchsia_component_decl::StartupMode::Lazy => Self::Lazy,
34342
34343 ::fidl_fuchsia_component_decl::StartupMode::Eager => Self::Eager,
34344 }
34345 }
34346 }
34347
34348 impl ::fidl_next::CompatFrom<crate::OnTerminate> for ::fidl_fuchsia_component_decl::OnTerminate {
34349 fn compat_from(value: crate::OnTerminate) -> Self {
34350 match value {
34351 crate::OnTerminate::None => Self::None,
34352
34353 crate::OnTerminate::Reboot => Self::Reboot,
34354 }
34355 }
34356 }
34357
34358 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OnTerminate> for crate::OnTerminate {
34359 fn compat_from(value: ::fidl_fuchsia_component_decl::OnTerminate) -> Self {
34360 match value {
34361 ::fidl_fuchsia_component_decl::OnTerminate::None => Self::None,
34362
34363 ::fidl_fuchsia_component_decl::OnTerminate::Reboot => Self::Reboot,
34364 }
34365 }
34366 }
34367
34368 impl ::fidl_next::CompatFrom<crate::ConfigOverride>
34369 for ::fidl_fuchsia_component_decl::ConfigOverride
34370 {
34371 fn compat_from(value: crate::ConfigOverride) -> Self {
34372 Self {
34373 key: ::fidl_next::CompatFrom::compat_from(value.key),
34374
34375 value: ::fidl_next::CompatFrom::compat_from(value.value),
34376
34377 __source_breaking: ::fidl::marker::SourceBreaking,
34378 }
34379 }
34380 }
34381
34382 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigOverride>
34383 for crate::ConfigOverride
34384 {
34385 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigOverride) -> Self {
34386 Self {
34387 key: ::fidl_next::CompatFrom::compat_from(value.key),
34388
34389 value: ::fidl_next::CompatFrom::compat_from(value.value),
34390 }
34391 }
34392 }
34393
34394 impl ::fidl_next::CompatFrom<crate::Child> for ::fidl_fuchsia_component_decl::Child {
34395 fn compat_from(value: crate::Child) -> Self {
34396 Self {
34397 name: ::fidl_next::CompatFrom::compat_from(value.name),
34398
34399 url: ::fidl_next::CompatFrom::compat_from(value.url),
34400
34401 startup: ::fidl_next::CompatFrom::compat_from(value.startup),
34402
34403 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
34404
34405 on_terminate: ::fidl_next::CompatFrom::compat_from(value.on_terminate),
34406
34407 config_overrides: ::fidl_next::CompatFrom::compat_from(value.config_overrides),
34408
34409 __source_breaking: ::fidl::marker::SourceBreaking,
34410 }
34411 }
34412 }
34413
34414 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Child> for crate::Child {
34415 fn compat_from(value: ::fidl_fuchsia_component_decl::Child) -> Self {
34416 Self {
34417 name: ::fidl_next::CompatFrom::compat_from(value.name),
34418
34419 url: ::fidl_next::CompatFrom::compat_from(value.url),
34420
34421 startup: ::fidl_next::CompatFrom::compat_from(value.startup),
34422
34423 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
34424
34425 on_terminate: ::fidl_next::CompatFrom::compat_from(value.on_terminate),
34426
34427 config_overrides: ::fidl_next::CompatFrom::compat_from(value.config_overrides),
34428 }
34429 }
34430 }
34431
34432 impl ::fidl_next::CompatFrom<crate::Durability> for ::fidl_fuchsia_component_decl::Durability {
34433 fn compat_from(value: crate::Durability) -> Self {
34434 match value {
34435 crate::Durability::Transient => Self::Transient,
34436
34437 crate::Durability::SingleRun => Self::SingleRun,
34438 }
34439 }
34440 }
34441
34442 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Durability> for crate::Durability {
34443 fn compat_from(value: ::fidl_fuchsia_component_decl::Durability) -> Self {
34444 match value {
34445 ::fidl_fuchsia_component_decl::Durability::Transient => Self::Transient,
34446
34447 ::fidl_fuchsia_component_decl::Durability::SingleRun => Self::SingleRun,
34448 }
34449 }
34450 }
34451
34452 impl ::fidl_next::CompatFrom<crate::Collection> for ::fidl_fuchsia_component_decl::Collection {
34453 fn compat_from(value: crate::Collection) -> Self {
34454 Self {
34455 name: ::fidl_next::CompatFrom::compat_from(value.name),
34456
34457 durability: ::fidl_next::CompatFrom::compat_from(value.durability),
34458
34459 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
34460
34461 allowed_offers: ::fidl_next::CompatFrom::compat_from(value.allowed_offers),
34462
34463 allow_long_names: ::fidl_next::CompatFrom::compat_from(value.allow_long_names),
34464
34465 persistent_storage: ::fidl_next::CompatFrom::compat_from(value.persistent_storage),
34466
34467 __source_breaking: ::fidl::marker::SourceBreaking,
34468 }
34469 }
34470 }
34471
34472 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Collection> for crate::Collection {
34473 fn compat_from(value: ::fidl_fuchsia_component_decl::Collection) -> Self {
34474 Self {
34475 name: ::fidl_next::CompatFrom::compat_from(value.name),
34476
34477 durability: ::fidl_next::CompatFrom::compat_from(value.durability),
34478
34479 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
34480
34481 allowed_offers: ::fidl_next::CompatFrom::compat_from(value.allowed_offers),
34482
34483 allow_long_names: ::fidl_next::CompatFrom::compat_from(value.allow_long_names),
34484
34485 persistent_storage: ::fidl_next::CompatFrom::compat_from(value.persistent_storage),
34486 }
34487 }
34488 }
34489
34490 impl ::fidl_next::CompatFrom<crate::DependencyType>
34491 for ::fidl_fuchsia_component_decl::DependencyType
34492 {
34493 fn compat_from(value: crate::DependencyType) -> Self {
34494 match value {
34495 crate::DependencyType::Strong => Self::Strong,
34496
34497 crate::DependencyType::Weak => Self::Weak,
34498 }
34499 }
34500 }
34501
34502 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DependencyType>
34503 for crate::DependencyType
34504 {
34505 fn compat_from(value: ::fidl_fuchsia_component_decl::DependencyType) -> Self {
34506 match value {
34507 ::fidl_fuchsia_component_decl::DependencyType::Strong => Self::Strong,
34508
34509 ::fidl_fuchsia_component_decl::DependencyType::Weak => Self::Weak,
34510 }
34511 }
34512 }
34513
34514 impl ::fidl_next::CompatFrom<crate::NameMapping> for ::fidl_fuchsia_component_decl::NameMapping {
34515 #[inline]
34516 fn compat_from(value: crate::NameMapping) -> Self {
34517 Self {
34518 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34519
34520 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34521 }
34522 }
34523 }
34524
34525 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::NameMapping> for crate::NameMapping {
34526 #[inline]
34527 fn compat_from(value: ::fidl_fuchsia_component_decl::NameMapping) -> Self {
34528 Self {
34529 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34530
34531 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
34532 }
34533 }
34534 }
34535
34536 impl ::fidl_next::CompatFrom<crate::EnvironmentExtends>
34537 for ::fidl_fuchsia_component_decl::EnvironmentExtends
34538 {
34539 fn compat_from(value: crate::EnvironmentExtends) -> Self {
34540 match value {
34541 crate::EnvironmentExtends::None => Self::None,
34542
34543 crate::EnvironmentExtends::Realm => Self::Realm,
34544 }
34545 }
34546 }
34547
34548 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EnvironmentExtends>
34549 for crate::EnvironmentExtends
34550 {
34551 fn compat_from(value: ::fidl_fuchsia_component_decl::EnvironmentExtends) -> Self {
34552 match value {
34553 ::fidl_fuchsia_component_decl::EnvironmentExtends::None => Self::None,
34554
34555 ::fidl_fuchsia_component_decl::EnvironmentExtends::Realm => Self::Realm,
34556 }
34557 }
34558 }
34559
34560 impl ::fidl_next::CompatFrom<crate::ConfigTypeLayout>
34561 for ::fidl_fuchsia_component_decl::ConfigTypeLayout
34562 {
34563 fn compat_from(value: crate::ConfigTypeLayout) -> Self {
34564 match value {
34565 crate::ConfigTypeLayout::Bool => Self::Bool,
34566
34567 crate::ConfigTypeLayout::Uint8 => Self::Uint8,
34568
34569 crate::ConfigTypeLayout::Uint16 => Self::Uint16,
34570
34571 crate::ConfigTypeLayout::Uint32 => Self::Uint32,
34572
34573 crate::ConfigTypeLayout::Uint64 => Self::Uint64,
34574
34575 crate::ConfigTypeLayout::Int8 => Self::Int8,
34576
34577 crate::ConfigTypeLayout::Int16 => Self::Int16,
34578
34579 crate::ConfigTypeLayout::Int32 => Self::Int32,
34580
34581 crate::ConfigTypeLayout::Int64 => Self::Int64,
34582
34583 crate::ConfigTypeLayout::String => Self::String,
34584
34585 crate::ConfigTypeLayout::Vector => Self::Vector,
34586
34587 crate::ConfigTypeLayout::UnknownOrdinal_(unknown_ordinal) => {
34588 Self::__SourceBreaking { unknown_ordinal }
34589 }
34590 }
34591 }
34592 }
34593
34594 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigTypeLayout>
34595 for crate::ConfigTypeLayout
34596 {
34597 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigTypeLayout) -> Self {
34598 match value {
34599 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Bool => Self::Bool,
34600
34601 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint8 => Self::Uint8,
34602
34603 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint16 => Self::Uint16,
34604
34605 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint32 => Self::Uint32,
34606
34607 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint64 => Self::Uint64,
34608
34609 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int8 => Self::Int8,
34610
34611 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int16 => Self::Int16,
34612
34613 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int32 => Self::Int32,
34614
34615 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int64 => Self::Int64,
34616
34617 ::fidl_fuchsia_component_decl::ConfigTypeLayout::String => Self::String,
34618
34619 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Vector => Self::Vector,
34620
34621 ::fidl_fuchsia_component_decl::ConfigTypeLayout::__SourceBreaking {
34622 unknown_ordinal: value,
34623 } => Self::UnknownOrdinal_(value),
34624 }
34625 }
34626 }
34627
34628 impl ::fidl_next::CompatFrom<crate::LayoutConstraint>
34629 for ::fidl_fuchsia_component_decl::LayoutConstraint
34630 {
34631 fn compat_from(value: crate::LayoutConstraint) -> Self {
34632 match value {
34633 crate::LayoutConstraint::MaxSize(value) => {
34634 Self::MaxSize(::fidl_next::CompatFrom::compat_from(value))
34635 }
34636
34637 crate::LayoutConstraint::UnknownOrdinal_(unknown_ordinal) => {
34638 Self::__SourceBreaking { unknown_ordinal }
34639 }
34640 }
34641 }
34642 }
34643
34644 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::LayoutConstraint>
34645 for crate::LayoutConstraint
34646 {
34647 fn compat_from(value: ::fidl_fuchsia_component_decl::LayoutConstraint) -> Self {
34648 match value {
34649 ::fidl_fuchsia_component_decl::LayoutConstraint::MaxSize(value) => {
34650 Self::MaxSize(::fidl_next::CompatFrom::compat_from(value))
34651 }
34652
34653 ::fidl_fuchsia_component_decl::LayoutConstraint::__SourceBreaking {
34654 unknown_ordinal,
34655 } => Self::UnknownOrdinal_(unknown_ordinal),
34656 }
34657 }
34658 }
34659
34660 impl ::fidl_next::CompatFrom<crate::ConfigType> for ::fidl_fuchsia_component_decl::ConfigType {
34661 #[inline]
34662 fn compat_from(value: crate::ConfigType) -> Self {
34663 Self {
34664 layout: ::fidl_next::CompatFrom::compat_from(value.layout),
34665
34666 parameters: ::fidl_next::CompatFrom::compat_from(value.parameters),
34667
34668 constraints: ::fidl_next::CompatFrom::compat_from(value.constraints),
34669 }
34670 }
34671 }
34672
34673 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigType> for crate::ConfigType {
34674 #[inline]
34675 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigType) -> Self {
34676 Self {
34677 layout: ::fidl_next::CompatFrom::compat_from(value.layout),
34678
34679 parameters: ::fidl_next::CompatFrom::compat_from(value.parameters),
34680
34681 constraints: ::fidl_next::CompatFrom::compat_from(value.constraints),
34682 }
34683 }
34684 }
34685
34686 impl ::fidl_next::CompatFrom<crate::ConfigChecksum>
34687 for ::fidl_fuchsia_component_decl::ConfigChecksum
34688 {
34689 fn compat_from(value: crate::ConfigChecksum) -> Self {
34690 match value {
34691 crate::ConfigChecksum::Sha256(value) => {
34692 Self::Sha256(::fidl_next::CompatFrom::compat_from(value))
34693 }
34694
34695 crate::ConfigChecksum::UnknownOrdinal_(unknown_ordinal) => {
34696 Self::__SourceBreaking { unknown_ordinal }
34697 }
34698 }
34699 }
34700 }
34701
34702 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigChecksum>
34703 for crate::ConfigChecksum
34704 {
34705 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigChecksum) -> Self {
34706 match value {
34707 ::fidl_fuchsia_component_decl::ConfigChecksum::Sha256(value) => {
34708 Self::Sha256(::fidl_next::CompatFrom::compat_from(value))
34709 }
34710
34711 ::fidl_fuchsia_component_decl::ConfigChecksum::__SourceBreaking {
34712 unknown_ordinal,
34713 } => Self::UnknownOrdinal_(unknown_ordinal),
34714 }
34715 }
34716 }
34717
34718 impl ::fidl_next::CompatFrom<crate::UseStorage> for ::fidl_fuchsia_component_decl::UseStorage {
34719 fn compat_from(value: crate::UseStorage) -> Self {
34720 Self {
34721 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34722
34723 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
34724
34725 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34726
34727 __source_breaking: ::fidl::marker::SourceBreaking,
34728 }
34729 }
34730 }
34731
34732 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseStorage> for crate::UseStorage {
34733 fn compat_from(value: ::fidl_fuchsia_component_decl::UseStorage) -> Self {
34734 Self {
34735 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34736
34737 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
34738
34739 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34740 }
34741 }
34742 }
34743
34744 impl ::fidl_next::CompatFrom<crate::ConfigMutability>
34745 for ::fidl_fuchsia_component_decl::ConfigMutability
34746 {
34747 fn compat_from(value: crate::ConfigMutability) -> Self {
34748 Self::from_bits_retain(value.bits())
34749 }
34750 }
34751
34752 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigMutability>
34753 for crate::ConfigMutability
34754 {
34755 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigMutability) -> Self {
34756 Self::from_bits_retain(value.bits())
34757 }
34758 }
34759
34760 impl ::fidl_next::CompatFrom<crate::ConfigField> for ::fidl_fuchsia_component_decl::ConfigField {
34761 fn compat_from(value: crate::ConfigField) -> Self {
34762 Self {
34763 key: ::fidl_next::CompatFrom::compat_from(value.key),
34764
34765 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
34766
34767 mutability: ::fidl_next::CompatFrom::compat_from(value.mutability),
34768
34769 __source_breaking: ::fidl::marker::SourceBreaking,
34770 }
34771 }
34772 }
34773
34774 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigField> for crate::ConfigField {
34775 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigField) -> Self {
34776 Self {
34777 key: ::fidl_next::CompatFrom::compat_from(value.key),
34778
34779 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
34780
34781 mutability: ::fidl_next::CompatFrom::compat_from(value.mutability),
34782 }
34783 }
34784 }
34785
34786 impl ::fidl_next::CompatFrom<crate::Program> for ::fidl_fuchsia_component_decl::Program {
34787 fn compat_from(value: crate::Program) -> Self {
34788 Self {
34789 runner: ::fidl_next::CompatFrom::compat_from(value.runner),
34790
34791 info: ::fidl_next::CompatFrom::compat_from(value.info),
34792
34793 __source_breaking: ::fidl::marker::SourceBreaking,
34794 }
34795 }
34796 }
34797
34798 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Program> for crate::Program {
34799 fn compat_from(value: ::fidl_fuchsia_component_decl::Program) -> Self {
34800 Self {
34801 runner: ::fidl_next::CompatFrom::compat_from(value.runner),
34802
34803 info: ::fidl_next::CompatFrom::compat_from(value.info),
34804 }
34805 }
34806 }
34807
34808 impl ::fidl_next::CompatFrom<crate::UseService> for ::fidl_fuchsia_component_decl::UseService {
34809 fn compat_from(value: crate::UseService) -> Self {
34810 Self {
34811 source: ::fidl_next::CompatFrom::compat_from(value.source),
34812
34813 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34814
34815 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
34816
34817 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
34818
34819 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34820
34821 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34822
34823 __source_breaking: ::fidl::marker::SourceBreaking,
34824 }
34825 }
34826 }
34827
34828 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseService> for crate::UseService {
34829 fn compat_from(value: ::fidl_fuchsia_component_decl::UseService) -> Self {
34830 Self {
34831 source: ::fidl_next::CompatFrom::compat_from(value.source),
34832
34833 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34834
34835 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
34836
34837 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
34838
34839 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34840
34841 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34842 }
34843 }
34844 }
34845
34846 impl ::fidl_next::CompatFrom<crate::UseProtocol> for ::fidl_fuchsia_component_decl::UseProtocol {
34847 fn compat_from(value: crate::UseProtocol) -> Self {
34848 Self {
34849 source: ::fidl_next::CompatFrom::compat_from(value.source),
34850
34851 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34852
34853 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
34854
34855 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
34856
34857 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34858
34859 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34860
34861 numbered_handle: ::fidl_next::CompatFrom::compat_from(value.numbered_handle),
34862
34863 __source_breaking: ::fidl::marker::SourceBreaking,
34864 }
34865 }
34866 }
34867
34868 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseProtocol> for crate::UseProtocol {
34869 fn compat_from(value: ::fidl_fuchsia_component_decl::UseProtocol) -> Self {
34870 Self {
34871 source: ::fidl_next::CompatFrom::compat_from(value.source),
34872
34873 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34874
34875 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
34876
34877 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
34878
34879 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34880
34881 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34882
34883 numbered_handle: ::fidl_next::CompatFrom::compat_from(value.numbered_handle),
34884 }
34885 }
34886 }
34887
34888 impl ::fidl_next::CompatFrom<crate::UseDirectory> for ::fidl_fuchsia_component_decl::UseDirectory {
34889 fn compat_from(value: crate::UseDirectory) -> Self {
34890 Self {
34891 source: ::fidl_next::CompatFrom::compat_from(value.source),
34892
34893 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34894
34895 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
34896
34897 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
34898
34899 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
34900
34901 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
34902
34903 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34904
34905 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34906
34907 __source_breaking: ::fidl::marker::SourceBreaking,
34908 }
34909 }
34910 }
34911
34912 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseDirectory> for crate::UseDirectory {
34913 fn compat_from(value: ::fidl_fuchsia_component_decl::UseDirectory) -> Self {
34914 Self {
34915 source: ::fidl_next::CompatFrom::compat_from(value.source),
34916
34917 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34918
34919 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
34920
34921 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
34922
34923 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
34924
34925 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
34926
34927 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34928
34929 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34930 }
34931 }
34932 }
34933
34934 impl ::fidl_next::CompatFrom<crate::UseEventStream>
34935 for ::fidl_fuchsia_component_decl::UseEventStream
34936 {
34937 fn compat_from(value: crate::UseEventStream) -> Self {
34938 Self {
34939 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34940
34941 source: ::fidl_next::CompatFrom::compat_from(value.source),
34942
34943 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
34944
34945 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
34946
34947 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34948
34949 filter: ::fidl_next::CompatFrom::compat_from(value.filter),
34950
34951 __source_breaking: ::fidl::marker::SourceBreaking,
34952 }
34953 }
34954 }
34955
34956 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseEventStream>
34957 for crate::UseEventStream
34958 {
34959 fn compat_from(value: ::fidl_fuchsia_component_decl::UseEventStream) -> Self {
34960 Self {
34961 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34962
34963 source: ::fidl_next::CompatFrom::compat_from(value.source),
34964
34965 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
34966
34967 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
34968
34969 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
34970
34971 filter: ::fidl_next::CompatFrom::compat_from(value.filter),
34972 }
34973 }
34974 }
34975
34976 impl ::fidl_next::CompatFrom<crate::UseRunner> for ::fidl_fuchsia_component_decl::UseRunner {
34977 fn compat_from(value: crate::UseRunner) -> Self {
34978 Self {
34979 source: ::fidl_next::CompatFrom::compat_from(value.source),
34980
34981 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34982
34983 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34984
34985 __source_breaking: ::fidl::marker::SourceBreaking,
34986 }
34987 }
34988 }
34989
34990 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseRunner> for crate::UseRunner {
34991 fn compat_from(value: ::fidl_fuchsia_component_decl::UseRunner) -> Self {
34992 Self {
34993 source: ::fidl_next::CompatFrom::compat_from(value.source),
34994
34995 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
34996
34997 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
34998 }
34999 }
35000 }
35001
35002 impl ::fidl_next::CompatFrom<crate::UseConfiguration>
35003 for ::fidl_fuchsia_component_decl::UseConfiguration
35004 {
35005 fn compat_from(value: crate::UseConfiguration) -> Self {
35006 Self {
35007 source: ::fidl_next::CompatFrom::compat_from(value.source),
35008
35009 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35010
35011 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35012
35013 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35014
35015 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
35016
35017 default: ::fidl_next::CompatFrom::compat_from(value.default),
35018
35019 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35020
35021 __source_breaking: ::fidl::marker::SourceBreaking,
35022 }
35023 }
35024 }
35025
35026 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseConfiguration>
35027 for crate::UseConfiguration
35028 {
35029 fn compat_from(value: ::fidl_fuchsia_component_decl::UseConfiguration) -> Self {
35030 Self {
35031 source: ::fidl_next::CompatFrom::compat_from(value.source),
35032
35033 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35034
35035 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35036
35037 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35038
35039 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
35040
35041 default: ::fidl_next::CompatFrom::compat_from(value.default),
35042
35043 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35044 }
35045 }
35046 }
35047
35048 impl ::fidl_next::CompatFrom<crate::UseDictionary>
35049 for ::fidl_fuchsia_component_decl::UseDictionary
35050 {
35051 fn compat_from(value: crate::UseDictionary) -> Self {
35052 Self {
35053 source: ::fidl_next::CompatFrom::compat_from(value.source),
35054
35055 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35056
35057 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
35058
35059 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
35060
35061 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35062
35063 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35064
35065 __source_breaking: ::fidl::marker::SourceBreaking,
35066 }
35067 }
35068 }
35069
35070 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseDictionary>
35071 for crate::UseDictionary
35072 {
35073 fn compat_from(value: ::fidl_fuchsia_component_decl::UseDictionary) -> Self {
35074 Self {
35075 source: ::fidl_next::CompatFrom::compat_from(value.source),
35076
35077 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35078
35079 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
35080
35081 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
35082
35083 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35084
35085 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35086 }
35087 }
35088 }
35089
35090 impl ::fidl_next::CompatFrom<crate::Use> for ::fidl_fuchsia_component_decl::Use {
35091 fn compat_from(value: crate::Use) -> Self {
35092 match value {
35093 crate::Use::Service(value) => {
35094 Self::Service(::fidl_next::CompatFrom::compat_from(value))
35095 }
35096
35097 crate::Use::Protocol(value) => {
35098 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
35099 }
35100
35101 crate::Use::Directory(value) => {
35102 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
35103 }
35104
35105 crate::Use::Storage(value) => {
35106 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
35107 }
35108
35109 crate::Use::EventStream(value) => {
35110 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
35111 }
35112
35113 crate::Use::Runner(value) => {
35114 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
35115 }
35116
35117 crate::Use::Config(value) => {
35118 Self::Config(::fidl_next::CompatFrom::compat_from(value))
35119 }
35120
35121 crate::Use::Dictionary(value) => {
35122 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
35123 }
35124
35125 crate::Use::UnknownOrdinal_(unknown_ordinal) => {
35126 Self::__SourceBreaking { unknown_ordinal }
35127 }
35128 }
35129 }
35130 }
35131
35132 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Use> for crate::Use {
35133 fn compat_from(value: ::fidl_fuchsia_component_decl::Use) -> Self {
35134 match value {
35135 ::fidl_fuchsia_component_decl::Use::Service(value) => {
35136 Self::Service(::fidl_next::CompatFrom::compat_from(value))
35137 }
35138
35139 ::fidl_fuchsia_component_decl::Use::Protocol(value) => {
35140 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
35141 }
35142
35143 ::fidl_fuchsia_component_decl::Use::Directory(value) => {
35144 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
35145 }
35146
35147 ::fidl_fuchsia_component_decl::Use::Storage(value) => {
35148 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
35149 }
35150
35151 ::fidl_fuchsia_component_decl::Use::EventStream(value) => {
35152 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
35153 }
35154
35155 ::fidl_fuchsia_component_decl::Use::Runner(value) => {
35156 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
35157 }
35158
35159 ::fidl_fuchsia_component_decl::Use::Config(value) => {
35160 Self::Config(::fidl_next::CompatFrom::compat_from(value))
35161 }
35162
35163 ::fidl_fuchsia_component_decl::Use::Dictionary(value) => {
35164 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
35165 }
35166
35167 ::fidl_fuchsia_component_decl::Use::__SourceBreaking { unknown_ordinal } => {
35168 Self::UnknownOrdinal_(unknown_ordinal)
35169 }
35170 }
35171 }
35172 }
35173
35174 impl ::fidl_next::CompatFrom<crate::ExposeService>
35175 for ::fidl_fuchsia_component_decl::ExposeService
35176 {
35177 fn compat_from(value: crate::ExposeService) -> Self {
35178 Self {
35179 source: ::fidl_next::CompatFrom::compat_from(value.source),
35180
35181 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35182
35183 target: ::fidl_next::CompatFrom::compat_from(value.target),
35184
35185 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35186
35187 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35188
35189 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35190
35191 __source_breaking: ::fidl::marker::SourceBreaking,
35192 }
35193 }
35194 }
35195
35196 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeService>
35197 for crate::ExposeService
35198 {
35199 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeService) -> Self {
35200 Self {
35201 source: ::fidl_next::CompatFrom::compat_from(value.source),
35202
35203 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35204
35205 target: ::fidl_next::CompatFrom::compat_from(value.target),
35206
35207 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35208
35209 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35210
35211 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35212 }
35213 }
35214 }
35215
35216 impl ::fidl_next::CompatFrom<crate::ExposeProtocol>
35217 for ::fidl_fuchsia_component_decl::ExposeProtocol
35218 {
35219 fn compat_from(value: crate::ExposeProtocol) -> Self {
35220 Self {
35221 source: ::fidl_next::CompatFrom::compat_from(value.source),
35222
35223 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35224
35225 target: ::fidl_next::CompatFrom::compat_from(value.target),
35226
35227 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35228
35229 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35230
35231 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35232
35233 __source_breaking: ::fidl::marker::SourceBreaking,
35234 }
35235 }
35236 }
35237
35238 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeProtocol>
35239 for crate::ExposeProtocol
35240 {
35241 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeProtocol) -> Self {
35242 Self {
35243 source: ::fidl_next::CompatFrom::compat_from(value.source),
35244
35245 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35246
35247 target: ::fidl_next::CompatFrom::compat_from(value.target),
35248
35249 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35250
35251 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35252
35253 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35254 }
35255 }
35256 }
35257
35258 impl ::fidl_next::CompatFrom<crate::ExposeDirectory>
35259 for ::fidl_fuchsia_component_decl::ExposeDirectory
35260 {
35261 fn compat_from(value: crate::ExposeDirectory) -> Self {
35262 Self {
35263 source: ::fidl_next::CompatFrom::compat_from(value.source),
35264
35265 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35266
35267 target: ::fidl_next::CompatFrom::compat_from(value.target),
35268
35269 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35270
35271 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
35272
35273 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
35274
35275 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35276
35277 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35278
35279 __source_breaking: ::fidl::marker::SourceBreaking,
35280 }
35281 }
35282 }
35283
35284 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeDirectory>
35285 for crate::ExposeDirectory
35286 {
35287 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeDirectory) -> Self {
35288 Self {
35289 source: ::fidl_next::CompatFrom::compat_from(value.source),
35290
35291 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35292
35293 target: ::fidl_next::CompatFrom::compat_from(value.target),
35294
35295 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35296
35297 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
35298
35299 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
35300
35301 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35302
35303 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35304 }
35305 }
35306 }
35307
35308 impl ::fidl_next::CompatFrom<crate::ExposeRunner> for ::fidl_fuchsia_component_decl::ExposeRunner {
35309 fn compat_from(value: crate::ExposeRunner) -> Self {
35310 Self {
35311 source: ::fidl_next::CompatFrom::compat_from(value.source),
35312
35313 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35314
35315 target: ::fidl_next::CompatFrom::compat_from(value.target),
35316
35317 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35318
35319 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35320
35321 __source_breaking: ::fidl::marker::SourceBreaking,
35322 }
35323 }
35324 }
35325
35326 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeRunner> for crate::ExposeRunner {
35327 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeRunner) -> Self {
35328 Self {
35329 source: ::fidl_next::CompatFrom::compat_from(value.source),
35330
35331 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35332
35333 target: ::fidl_next::CompatFrom::compat_from(value.target),
35334
35335 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35336
35337 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35338 }
35339 }
35340 }
35341
35342 impl ::fidl_next::CompatFrom<crate::ExposeResolver>
35343 for ::fidl_fuchsia_component_decl::ExposeResolver
35344 {
35345 fn compat_from(value: crate::ExposeResolver) -> Self {
35346 Self {
35347 source: ::fidl_next::CompatFrom::compat_from(value.source),
35348
35349 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35350
35351 target: ::fidl_next::CompatFrom::compat_from(value.target),
35352
35353 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35354
35355 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35356
35357 __source_breaking: ::fidl::marker::SourceBreaking,
35358 }
35359 }
35360 }
35361
35362 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeResolver>
35363 for crate::ExposeResolver
35364 {
35365 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeResolver) -> Self {
35366 Self {
35367 source: ::fidl_next::CompatFrom::compat_from(value.source),
35368
35369 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35370
35371 target: ::fidl_next::CompatFrom::compat_from(value.target),
35372
35373 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35374
35375 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35376 }
35377 }
35378 }
35379
35380 impl ::fidl_next::CompatFrom<crate::ExposeDictionary>
35381 for ::fidl_fuchsia_component_decl::ExposeDictionary
35382 {
35383 fn compat_from(value: crate::ExposeDictionary) -> Self {
35384 Self {
35385 source: ::fidl_next::CompatFrom::compat_from(value.source),
35386
35387 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35388
35389 target: ::fidl_next::CompatFrom::compat_from(value.target),
35390
35391 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35392
35393 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35394
35395 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35396
35397 __source_breaking: ::fidl::marker::SourceBreaking,
35398 }
35399 }
35400 }
35401
35402 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeDictionary>
35403 for crate::ExposeDictionary
35404 {
35405 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeDictionary) -> Self {
35406 Self {
35407 source: ::fidl_next::CompatFrom::compat_from(value.source),
35408
35409 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35410
35411 target: ::fidl_next::CompatFrom::compat_from(value.target),
35412
35413 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35414
35415 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35416
35417 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35418 }
35419 }
35420 }
35421
35422 impl ::fidl_next::CompatFrom<crate::ExposeConfiguration>
35423 for ::fidl_fuchsia_component_decl::ExposeConfiguration
35424 {
35425 fn compat_from(value: crate::ExposeConfiguration) -> Self {
35426 Self {
35427 source: ::fidl_next::CompatFrom::compat_from(value.source),
35428
35429 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35430
35431 target: ::fidl_next::CompatFrom::compat_from(value.target),
35432
35433 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35434
35435 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35436
35437 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35438
35439 __source_breaking: ::fidl::marker::SourceBreaking,
35440 }
35441 }
35442 }
35443
35444 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeConfiguration>
35445 for crate::ExposeConfiguration
35446 {
35447 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeConfiguration) -> Self {
35448 Self {
35449 source: ::fidl_next::CompatFrom::compat_from(value.source),
35450
35451 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35452
35453 target: ::fidl_next::CompatFrom::compat_from(value.target),
35454
35455 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35456
35457 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35458
35459 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35460 }
35461 }
35462 }
35463
35464 impl ::fidl_next::CompatFrom<crate::Expose> for ::fidl_fuchsia_component_decl::Expose {
35465 fn compat_from(value: crate::Expose) -> Self {
35466 match value {
35467 crate::Expose::Service(value) => {
35468 Self::Service(::fidl_next::CompatFrom::compat_from(value))
35469 }
35470
35471 crate::Expose::Protocol(value) => {
35472 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
35473 }
35474
35475 crate::Expose::Directory(value) => {
35476 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
35477 }
35478
35479 crate::Expose::Runner(value) => {
35480 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
35481 }
35482
35483 crate::Expose::Resolver(value) => {
35484 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
35485 }
35486
35487 crate::Expose::Dictionary(value) => {
35488 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
35489 }
35490
35491 crate::Expose::Config(value) => {
35492 Self::Config(::fidl_next::CompatFrom::compat_from(value))
35493 }
35494
35495 crate::Expose::UnknownOrdinal_(unknown_ordinal) => {
35496 Self::__SourceBreaking { unknown_ordinal }
35497 }
35498 }
35499 }
35500 }
35501
35502 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Expose> for crate::Expose {
35503 fn compat_from(value: ::fidl_fuchsia_component_decl::Expose) -> Self {
35504 match value {
35505 ::fidl_fuchsia_component_decl::Expose::Service(value) => {
35506 Self::Service(::fidl_next::CompatFrom::compat_from(value))
35507 }
35508
35509 ::fidl_fuchsia_component_decl::Expose::Protocol(value) => {
35510 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
35511 }
35512
35513 ::fidl_fuchsia_component_decl::Expose::Directory(value) => {
35514 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
35515 }
35516
35517 ::fidl_fuchsia_component_decl::Expose::Runner(value) => {
35518 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
35519 }
35520
35521 ::fidl_fuchsia_component_decl::Expose::Resolver(value) => {
35522 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
35523 }
35524
35525 ::fidl_fuchsia_component_decl::Expose::Dictionary(value) => {
35526 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
35527 }
35528
35529 ::fidl_fuchsia_component_decl::Expose::Config(value) => {
35530 Self::Config(::fidl_next::CompatFrom::compat_from(value))
35531 }
35532
35533 ::fidl_fuchsia_component_decl::Expose::__SourceBreaking { unknown_ordinal } => {
35534 Self::UnknownOrdinal_(unknown_ordinal)
35535 }
35536 }
35537 }
35538 }
35539
35540 impl ::fidl_next::CompatFrom<crate::OfferService> for ::fidl_fuchsia_component_decl::OfferService {
35541 fn compat_from(value: crate::OfferService) -> Self {
35542 Self {
35543 source: ::fidl_next::CompatFrom::compat_from(value.source),
35544
35545 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35546
35547 target: ::fidl_next::CompatFrom::compat_from(value.target),
35548
35549 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35550
35551 source_instance_filter: ::fidl_next::CompatFrom::compat_from(
35552 value.source_instance_filter,
35553 ),
35554
35555 renamed_instances: ::fidl_next::CompatFrom::compat_from(value.renamed_instances),
35556
35557 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35558
35559 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35560
35561 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
35562
35563 __source_breaking: ::fidl::marker::SourceBreaking,
35564 }
35565 }
35566 }
35567
35568 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferService> for crate::OfferService {
35569 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferService) -> Self {
35570 Self {
35571 source: ::fidl_next::CompatFrom::compat_from(value.source),
35572
35573 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35574
35575 target: ::fidl_next::CompatFrom::compat_from(value.target),
35576
35577 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35578
35579 source_instance_filter: ::fidl_next::CompatFrom::compat_from(
35580 value.source_instance_filter,
35581 ),
35582
35583 renamed_instances: ::fidl_next::CompatFrom::compat_from(value.renamed_instances),
35584
35585 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35586
35587 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35588
35589 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
35590 }
35591 }
35592 }
35593
35594 impl ::fidl_next::CompatFrom<crate::OfferProtocol>
35595 for ::fidl_fuchsia_component_decl::OfferProtocol
35596 {
35597 fn compat_from(value: crate::OfferProtocol) -> Self {
35598 Self {
35599 source: ::fidl_next::CompatFrom::compat_from(value.source),
35600
35601 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35602
35603 target: ::fidl_next::CompatFrom::compat_from(value.target),
35604
35605 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35606
35607 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
35608
35609 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35610
35611 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35612
35613 __source_breaking: ::fidl::marker::SourceBreaking,
35614 }
35615 }
35616 }
35617
35618 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferProtocol>
35619 for crate::OfferProtocol
35620 {
35621 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferProtocol) -> Self {
35622 Self {
35623 source: ::fidl_next::CompatFrom::compat_from(value.source),
35624
35625 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35626
35627 target: ::fidl_next::CompatFrom::compat_from(value.target),
35628
35629 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35630
35631 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
35632
35633 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35634
35635 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35636 }
35637 }
35638 }
35639
35640 impl ::fidl_next::CompatFrom<crate::OfferDirectory>
35641 for ::fidl_fuchsia_component_decl::OfferDirectory
35642 {
35643 fn compat_from(value: crate::OfferDirectory) -> Self {
35644 Self {
35645 source: ::fidl_next::CompatFrom::compat_from(value.source),
35646
35647 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35648
35649 target: ::fidl_next::CompatFrom::compat_from(value.target),
35650
35651 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35652
35653 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
35654
35655 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
35656
35657 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
35658
35659 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35660
35661 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35662
35663 __source_breaking: ::fidl::marker::SourceBreaking,
35664 }
35665 }
35666 }
35667
35668 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferDirectory>
35669 for crate::OfferDirectory
35670 {
35671 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferDirectory) -> Self {
35672 Self {
35673 source: ::fidl_next::CompatFrom::compat_from(value.source),
35674
35675 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35676
35677 target: ::fidl_next::CompatFrom::compat_from(value.target),
35678
35679 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35680
35681 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
35682
35683 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
35684
35685 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
35686
35687 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35688
35689 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35690 }
35691 }
35692 }
35693
35694 impl ::fidl_next::CompatFrom<crate::OfferStorage> for ::fidl_fuchsia_component_decl::OfferStorage {
35695 fn compat_from(value: crate::OfferStorage) -> Self {
35696 Self {
35697 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35698
35699 source: ::fidl_next::CompatFrom::compat_from(value.source),
35700
35701 target: ::fidl_next::CompatFrom::compat_from(value.target),
35702
35703 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35704
35705 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35706
35707 __source_breaking: ::fidl::marker::SourceBreaking,
35708 }
35709 }
35710 }
35711
35712 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferStorage> for crate::OfferStorage {
35713 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferStorage) -> Self {
35714 Self {
35715 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35716
35717 source: ::fidl_next::CompatFrom::compat_from(value.source),
35718
35719 target: ::fidl_next::CompatFrom::compat_from(value.target),
35720
35721 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35722
35723 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35724 }
35725 }
35726 }
35727
35728 impl ::fidl_next::CompatFrom<crate::OfferRunner> for ::fidl_fuchsia_component_decl::OfferRunner {
35729 fn compat_from(value: crate::OfferRunner) -> Self {
35730 Self {
35731 source: ::fidl_next::CompatFrom::compat_from(value.source),
35732
35733 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35734
35735 target: ::fidl_next::CompatFrom::compat_from(value.target),
35736
35737 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35738
35739 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35740
35741 __source_breaking: ::fidl::marker::SourceBreaking,
35742 }
35743 }
35744 }
35745
35746 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferRunner> for crate::OfferRunner {
35747 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferRunner) -> Self {
35748 Self {
35749 source: ::fidl_next::CompatFrom::compat_from(value.source),
35750
35751 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35752
35753 target: ::fidl_next::CompatFrom::compat_from(value.target),
35754
35755 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35756
35757 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35758 }
35759 }
35760 }
35761
35762 impl ::fidl_next::CompatFrom<crate::OfferResolver>
35763 for ::fidl_fuchsia_component_decl::OfferResolver
35764 {
35765 fn compat_from(value: crate::OfferResolver) -> Self {
35766 Self {
35767 source: ::fidl_next::CompatFrom::compat_from(value.source),
35768
35769 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35770
35771 target: ::fidl_next::CompatFrom::compat_from(value.target),
35772
35773 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35774
35775 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35776
35777 __source_breaking: ::fidl::marker::SourceBreaking,
35778 }
35779 }
35780 }
35781
35782 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferResolver>
35783 for crate::OfferResolver
35784 {
35785 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferResolver) -> Self {
35786 Self {
35787 source: ::fidl_next::CompatFrom::compat_from(value.source),
35788
35789 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35790
35791 target: ::fidl_next::CompatFrom::compat_from(value.target),
35792
35793 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35794
35795 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35796 }
35797 }
35798 }
35799
35800 impl ::fidl_next::CompatFrom<crate::OfferEventStream>
35801 for ::fidl_fuchsia_component_decl::OfferEventStream
35802 {
35803 fn compat_from(value: crate::OfferEventStream) -> Self {
35804 Self {
35805 source: ::fidl_next::CompatFrom::compat_from(value.source),
35806
35807 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35808
35809 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
35810
35811 target: ::fidl_next::CompatFrom::compat_from(value.target),
35812
35813 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35814
35815 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35816
35817 __source_breaking: ::fidl::marker::SourceBreaking,
35818 }
35819 }
35820 }
35821
35822 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferEventStream>
35823 for crate::OfferEventStream
35824 {
35825 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferEventStream) -> Self {
35826 Self {
35827 source: ::fidl_next::CompatFrom::compat_from(value.source),
35828
35829 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35830
35831 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
35832
35833 target: ::fidl_next::CompatFrom::compat_from(value.target),
35834
35835 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35836
35837 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35838 }
35839 }
35840 }
35841
35842 impl ::fidl_next::CompatFrom<crate::OfferDictionary>
35843 for ::fidl_fuchsia_component_decl::OfferDictionary
35844 {
35845 fn compat_from(value: crate::OfferDictionary) -> Self {
35846 Self {
35847 source: ::fidl_next::CompatFrom::compat_from(value.source),
35848
35849 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35850
35851 target: ::fidl_next::CompatFrom::compat_from(value.target),
35852
35853 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35854
35855 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
35856
35857 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35858
35859 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35860
35861 __source_breaking: ::fidl::marker::SourceBreaking,
35862 }
35863 }
35864 }
35865
35866 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferDictionary>
35867 for crate::OfferDictionary
35868 {
35869 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferDictionary) -> Self {
35870 Self {
35871 source: ::fidl_next::CompatFrom::compat_from(value.source),
35872
35873 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35874
35875 target: ::fidl_next::CompatFrom::compat_from(value.target),
35876
35877 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35878
35879 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
35880
35881 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35882
35883 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35884 }
35885 }
35886 }
35887
35888 impl ::fidl_next::CompatFrom<crate::OfferConfiguration>
35889 for ::fidl_fuchsia_component_decl::OfferConfiguration
35890 {
35891 fn compat_from(value: crate::OfferConfiguration) -> Self {
35892 Self {
35893 source: ::fidl_next::CompatFrom::compat_from(value.source),
35894
35895 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35896
35897 target: ::fidl_next::CompatFrom::compat_from(value.target),
35898
35899 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35900
35901 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35902
35903 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35904
35905 __source_breaking: ::fidl::marker::SourceBreaking,
35906 }
35907 }
35908 }
35909
35910 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferConfiguration>
35911 for crate::OfferConfiguration
35912 {
35913 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferConfiguration) -> Self {
35914 Self {
35915 source: ::fidl_next::CompatFrom::compat_from(value.source),
35916
35917 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
35918
35919 target: ::fidl_next::CompatFrom::compat_from(value.target),
35920
35921 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
35922
35923 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
35924
35925 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
35926 }
35927 }
35928 }
35929
35930 impl ::fidl_next::CompatFrom<crate::Offer> for ::fidl_fuchsia_component_decl::Offer {
35931 fn compat_from(value: crate::Offer) -> Self {
35932 match value {
35933 crate::Offer::Service(value) => {
35934 Self::Service(::fidl_next::CompatFrom::compat_from(value))
35935 }
35936
35937 crate::Offer::Protocol(value) => {
35938 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
35939 }
35940
35941 crate::Offer::Directory(value) => {
35942 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
35943 }
35944
35945 crate::Offer::Storage(value) => {
35946 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
35947 }
35948
35949 crate::Offer::Runner(value) => {
35950 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
35951 }
35952
35953 crate::Offer::Resolver(value) => {
35954 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
35955 }
35956
35957 crate::Offer::EventStream(value) => {
35958 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
35959 }
35960
35961 crate::Offer::Dictionary(value) => {
35962 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
35963 }
35964
35965 crate::Offer::Config(value) => {
35966 Self::Config(::fidl_next::CompatFrom::compat_from(value))
35967 }
35968
35969 crate::Offer::UnknownOrdinal_(unknown_ordinal) => {
35970 Self::__SourceBreaking { unknown_ordinal }
35971 }
35972 }
35973 }
35974 }
35975
35976 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Offer> for crate::Offer {
35977 fn compat_from(value: ::fidl_fuchsia_component_decl::Offer) -> Self {
35978 match value {
35979 ::fidl_fuchsia_component_decl::Offer::Service(value) => {
35980 Self::Service(::fidl_next::CompatFrom::compat_from(value))
35981 }
35982
35983 ::fidl_fuchsia_component_decl::Offer::Protocol(value) => {
35984 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
35985 }
35986
35987 ::fidl_fuchsia_component_decl::Offer::Directory(value) => {
35988 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
35989 }
35990
35991 ::fidl_fuchsia_component_decl::Offer::Storage(value) => {
35992 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
35993 }
35994
35995 ::fidl_fuchsia_component_decl::Offer::Runner(value) => {
35996 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
35997 }
35998
35999 ::fidl_fuchsia_component_decl::Offer::Resolver(value) => {
36000 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
36001 }
36002
36003 ::fidl_fuchsia_component_decl::Offer::EventStream(value) => {
36004 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
36005 }
36006
36007 ::fidl_fuchsia_component_decl::Offer::Dictionary(value) => {
36008 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
36009 }
36010
36011 ::fidl_fuchsia_component_decl::Offer::Config(value) => {
36012 Self::Config(::fidl_next::CompatFrom::compat_from(value))
36013 }
36014
36015 ::fidl_fuchsia_component_decl::Offer::__SourceBreaking { unknown_ordinal } => {
36016 Self::UnknownOrdinal_(unknown_ordinal)
36017 }
36018 }
36019 }
36020 }
36021
36022 impl ::fidl_next::CompatFrom<crate::RunnerRegistration>
36023 for ::fidl_fuchsia_component_decl::RunnerRegistration
36024 {
36025 fn compat_from(value: crate::RunnerRegistration) -> Self {
36026 Self {
36027 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36028
36029 source: ::fidl_next::CompatFrom::compat_from(value.source),
36030
36031 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
36032
36033 __source_breaking: ::fidl::marker::SourceBreaking,
36034 }
36035 }
36036 }
36037
36038 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::RunnerRegistration>
36039 for crate::RunnerRegistration
36040 {
36041 fn compat_from(value: ::fidl_fuchsia_component_decl::RunnerRegistration) -> Self {
36042 Self {
36043 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36044
36045 source: ::fidl_next::CompatFrom::compat_from(value.source),
36046
36047 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
36048 }
36049 }
36050 }
36051
36052 impl ::fidl_next::CompatFrom<crate::ResolverRegistration>
36053 for ::fidl_fuchsia_component_decl::ResolverRegistration
36054 {
36055 fn compat_from(value: crate::ResolverRegistration) -> Self {
36056 Self {
36057 resolver: ::fidl_next::CompatFrom::compat_from(value.resolver),
36058
36059 source: ::fidl_next::CompatFrom::compat_from(value.source),
36060
36061 scheme: ::fidl_next::CompatFrom::compat_from(value.scheme),
36062
36063 __source_breaking: ::fidl::marker::SourceBreaking,
36064 }
36065 }
36066 }
36067
36068 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ResolverRegistration>
36069 for crate::ResolverRegistration
36070 {
36071 fn compat_from(value: ::fidl_fuchsia_component_decl::ResolverRegistration) -> Self {
36072 Self {
36073 resolver: ::fidl_next::CompatFrom::compat_from(value.resolver),
36074
36075 source: ::fidl_next::CompatFrom::compat_from(value.source),
36076
36077 scheme: ::fidl_next::CompatFrom::compat_from(value.scheme),
36078 }
36079 }
36080 }
36081
36082 impl ::fidl_next::CompatFrom<crate::DebugProtocolRegistration>
36083 for ::fidl_fuchsia_component_decl::DebugProtocolRegistration
36084 {
36085 fn compat_from(value: crate::DebugProtocolRegistration) -> Self {
36086 Self {
36087 source: ::fidl_next::CompatFrom::compat_from(value.source),
36088
36089 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36090
36091 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
36092
36093 __source_breaking: ::fidl::marker::SourceBreaking,
36094 }
36095 }
36096 }
36097
36098 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DebugProtocolRegistration>
36099 for crate::DebugProtocolRegistration
36100 {
36101 fn compat_from(value: ::fidl_fuchsia_component_decl::DebugProtocolRegistration) -> Self {
36102 Self {
36103 source: ::fidl_next::CompatFrom::compat_from(value.source),
36104
36105 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36106
36107 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
36108 }
36109 }
36110 }
36111
36112 impl ::fidl_next::CompatFrom<crate::DebugRegistration>
36113 for ::fidl_fuchsia_component_decl::DebugRegistration
36114 {
36115 fn compat_from(value: crate::DebugRegistration) -> Self {
36116 match value {
36117 crate::DebugRegistration::Protocol(value) => {
36118 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
36119 }
36120
36121 crate::DebugRegistration::UnknownOrdinal_(unknown_ordinal) => {
36122 Self::__SourceBreaking { unknown_ordinal }
36123 }
36124 }
36125 }
36126 }
36127
36128 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DebugRegistration>
36129 for crate::DebugRegistration
36130 {
36131 fn compat_from(value: ::fidl_fuchsia_component_decl::DebugRegistration) -> Self {
36132 match value {
36133 ::fidl_fuchsia_component_decl::DebugRegistration::Protocol(value) => {
36134 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
36135 }
36136
36137 ::fidl_fuchsia_component_decl::DebugRegistration::__SourceBreaking {
36138 unknown_ordinal,
36139 } => Self::UnknownOrdinal_(unknown_ordinal),
36140 }
36141 }
36142 }
36143
36144 impl ::fidl_next::CompatFrom<crate::Environment> for ::fidl_fuchsia_component_decl::Environment {
36145 fn compat_from(value: crate::Environment) -> Self {
36146 Self {
36147 name: ::fidl_next::CompatFrom::compat_from(value.name),
36148
36149 extends: ::fidl_next::CompatFrom::compat_from(value.extends),
36150
36151 runners: ::fidl_next::CompatFrom::compat_from(value.runners),
36152
36153 resolvers: ::fidl_next::CompatFrom::compat_from(value.resolvers),
36154
36155 debug_capabilities: ::fidl_next::CompatFrom::compat_from(value.debug_capabilities),
36156
36157 stop_timeout_ms: ::fidl_next::CompatFrom::compat_from(value.stop_timeout_ms),
36158
36159 __source_breaking: ::fidl::marker::SourceBreaking,
36160 }
36161 }
36162 }
36163
36164 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Environment> for crate::Environment {
36165 fn compat_from(value: ::fidl_fuchsia_component_decl::Environment) -> Self {
36166 Self {
36167 name: ::fidl_next::CompatFrom::compat_from(value.name),
36168
36169 extends: ::fidl_next::CompatFrom::compat_from(value.extends),
36170
36171 runners: ::fidl_next::CompatFrom::compat_from(value.runners),
36172
36173 resolvers: ::fidl_next::CompatFrom::compat_from(value.resolvers),
36174
36175 debug_capabilities: ::fidl_next::CompatFrom::compat_from(value.debug_capabilities),
36176
36177 stop_timeout_ms: ::fidl_next::CompatFrom::compat_from(value.stop_timeout_ms),
36178 }
36179 }
36180 }
36181
36182 impl ::fidl_next::CompatFrom<crate::ConfigSourceCapabilities>
36183 for ::fidl_fuchsia_component_decl::ConfigSourceCapabilities
36184 {
36185 fn compat_from(value: crate::ConfigSourceCapabilities) -> Self {
36186 Self { __source_breaking: ::fidl::marker::SourceBreaking }
36187 }
36188 }
36189
36190 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigSourceCapabilities>
36191 for crate::ConfigSourceCapabilities
36192 {
36193 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigSourceCapabilities) -> Self {
36194 Self {}
36195 }
36196 }
36197
36198 impl ::fidl_next::CompatFrom<crate::ConfigValueSource>
36199 for ::fidl_fuchsia_component_decl::ConfigValueSource
36200 {
36201 fn compat_from(value: crate::ConfigValueSource) -> Self {
36202 match value {
36203 crate::ConfigValueSource::PackagePath(value) => {
36204 Self::PackagePath(::fidl_next::CompatFrom::compat_from(value))
36205 }
36206
36207 crate::ConfigValueSource::Capabilities(value) => {
36208 Self::Capabilities(::fidl_next::CompatFrom::compat_from(value))
36209 }
36210
36211 crate::ConfigValueSource::UnknownOrdinal_(unknown_ordinal) => {
36212 Self::__SourceBreaking { unknown_ordinal }
36213 }
36214 }
36215 }
36216 }
36217
36218 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValueSource>
36219 for crate::ConfigValueSource
36220 {
36221 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValueSource) -> Self {
36222 match value {
36223 ::fidl_fuchsia_component_decl::ConfigValueSource::PackagePath(value) => {
36224 Self::PackagePath(::fidl_next::CompatFrom::compat_from(value))
36225 }
36226
36227 ::fidl_fuchsia_component_decl::ConfigValueSource::Capabilities(value) => {
36228 Self::Capabilities(::fidl_next::CompatFrom::compat_from(value))
36229 }
36230
36231 ::fidl_fuchsia_component_decl::ConfigValueSource::__SourceBreaking {
36232 unknown_ordinal,
36233 } => Self::UnknownOrdinal_(unknown_ordinal),
36234 }
36235 }
36236 }
36237
36238 impl ::fidl_next::CompatFrom<crate::ConfigSchema> for ::fidl_fuchsia_component_decl::ConfigSchema {
36239 fn compat_from(value: crate::ConfigSchema) -> Self {
36240 Self {
36241 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
36242
36243 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
36244
36245 value_source: ::fidl_next::CompatFrom::compat_from(value.value_source),
36246
36247 __source_breaking: ::fidl::marker::SourceBreaking,
36248 }
36249 }
36250 }
36251
36252 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigSchema> for crate::ConfigSchema {
36253 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigSchema) -> Self {
36254 Self {
36255 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
36256
36257 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
36258
36259 value_source: ::fidl_next::CompatFrom::compat_from(value.value_source),
36260 }
36261 }
36262 }
36263
36264 impl ::fidl_next::CompatFrom<crate::Component> for ::fidl_fuchsia_component_decl::Component {
36265 fn compat_from(value: crate::Component) -> Self {
36266 Self {
36267 program: ::fidl_next::CompatFrom::compat_from(value.program),
36268
36269 uses: ::fidl_next::CompatFrom::compat_from(value.uses),
36270
36271 exposes: ::fidl_next::CompatFrom::compat_from(value.exposes),
36272
36273 offers: ::fidl_next::CompatFrom::compat_from(value.offers),
36274
36275 capabilities: ::fidl_next::CompatFrom::compat_from(value.capabilities),
36276
36277 children: ::fidl_next::CompatFrom::compat_from(value.children),
36278
36279 collections: ::fidl_next::CompatFrom::compat_from(value.collections),
36280
36281 environments: ::fidl_next::CompatFrom::compat_from(value.environments),
36282
36283 facets: ::fidl_next::CompatFrom::compat_from(value.facets),
36284
36285 config: ::fidl_next::CompatFrom::compat_from(value.config),
36286
36287 __source_breaking: ::fidl::marker::SourceBreaking,
36288 }
36289 }
36290 }
36291
36292 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Component> for crate::Component {
36293 fn compat_from(value: ::fidl_fuchsia_component_decl::Component) -> Self {
36294 Self {
36295 program: ::fidl_next::CompatFrom::compat_from(value.program),
36296
36297 uses: ::fidl_next::CompatFrom::compat_from(value.uses),
36298
36299 exposes: ::fidl_next::CompatFrom::compat_from(value.exposes),
36300
36301 offers: ::fidl_next::CompatFrom::compat_from(value.offers),
36302
36303 capabilities: ::fidl_next::CompatFrom::compat_from(value.capabilities),
36304
36305 children: ::fidl_next::CompatFrom::compat_from(value.children),
36306
36307 collections: ::fidl_next::CompatFrom::compat_from(value.collections),
36308
36309 environments: ::fidl_next::CompatFrom::compat_from(value.environments),
36310
36311 facets: ::fidl_next::CompatFrom::compat_from(value.facets),
36312
36313 config: ::fidl_next::CompatFrom::compat_from(value.config),
36314 }
36315 }
36316 }
36317
36318 impl ::fidl_next::CompatFrom<crate::ConfigValueSpec>
36319 for ::fidl_fuchsia_component_decl::ConfigValueSpec
36320 {
36321 fn compat_from(value: crate::ConfigValueSpec) -> Self {
36322 Self {
36323 value: ::fidl_next::CompatFrom::compat_from(value.value),
36324
36325 __source_breaking: ::fidl::marker::SourceBreaking,
36326 }
36327 }
36328 }
36329
36330 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValueSpec>
36331 for crate::ConfigValueSpec
36332 {
36333 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValueSpec) -> Self {
36334 Self { value: ::fidl_next::CompatFrom::compat_from(value.value) }
36335 }
36336 }
36337
36338 impl ::fidl_next::CompatFrom<crate::ConfigValuesData>
36339 for ::fidl_fuchsia_component_decl::ConfigValuesData
36340 {
36341 fn compat_from(value: crate::ConfigValuesData) -> Self {
36342 Self {
36343 values: ::fidl_next::CompatFrom::compat_from(value.values),
36344
36345 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
36346
36347 __source_breaking: ::fidl::marker::SourceBreaking,
36348 }
36349 }
36350 }
36351
36352 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValuesData>
36353 for crate::ConfigValuesData
36354 {
36355 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValuesData) -> Self {
36356 Self {
36357 values: ::fidl_next::CompatFrom::compat_from(value.values),
36358
36359 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
36360 }
36361 }
36362 }
36363
36364 impl ::fidl_next::CompatFrom<crate::EventSubscription>
36365 for ::fidl_fuchsia_component_decl::EventSubscription
36366 {
36367 fn compat_from(value: crate::EventSubscription) -> Self {
36368 Self {
36369 event_name: ::fidl_next::CompatFrom::compat_from(value.event_name),
36370
36371 __source_breaking: ::fidl::marker::SourceBreaking,
36372 }
36373 }
36374 }
36375
36376 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EventSubscription>
36377 for crate::EventSubscription
36378 {
36379 fn compat_from(value: ::fidl_fuchsia_component_decl::EventSubscription) -> Self {
36380 Self { event_name: ::fidl_next::CompatFrom::compat_from(value.event_name) }
36381 }
36382 }
36383
36384 impl ::fidl_next::CompatFrom<crate::LayoutParameter>
36385 for ::fidl_fuchsia_component_decl::LayoutParameter
36386 {
36387 fn compat_from(value: crate::LayoutParameter) -> Self {
36388 match value {
36389 crate::LayoutParameter::NestedType(value) => {
36390 Self::NestedType(::fidl_next::CompatFrom::compat_from(value))
36391 }
36392
36393 crate::LayoutParameter::UnknownOrdinal_(unknown_ordinal) => {
36394 Self::__SourceBreaking { unknown_ordinal }
36395 }
36396 }
36397 }
36398 }
36399
36400 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::LayoutParameter>
36401 for crate::LayoutParameter
36402 {
36403 fn compat_from(value: ::fidl_fuchsia_component_decl::LayoutParameter) -> Self {
36404 match value {
36405 ::fidl_fuchsia_component_decl::LayoutParameter::NestedType(value) => {
36406 Self::NestedType(::fidl_next::CompatFrom::compat_from(value))
36407 }
36408
36409 ::fidl_fuchsia_component_decl::LayoutParameter::__SourceBreaking {
36410 unknown_ordinal,
36411 } => Self::UnknownOrdinal_(unknown_ordinal),
36412 }
36413 }
36414 }
36415
36416 impl ::fidl_next::CompatFrom<crate::ResolvedConfigField>
36417 for ::fidl_fuchsia_component_decl::ResolvedConfigField
36418 {
36419 #[inline]
36420 fn compat_from(value: crate::ResolvedConfigField) -> Self {
36421 Self {
36422 key: ::fidl_next::CompatFrom::compat_from(value.key),
36423
36424 value: ::fidl_next::CompatFrom::compat_from(value.value),
36425 }
36426 }
36427 }
36428
36429 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ResolvedConfigField>
36430 for crate::ResolvedConfigField
36431 {
36432 #[inline]
36433 fn compat_from(value: ::fidl_fuchsia_component_decl::ResolvedConfigField) -> Self {
36434 Self {
36435 key: ::fidl_next::CompatFrom::compat_from(value.key),
36436
36437 value: ::fidl_next::CompatFrom::compat_from(value.value),
36438 }
36439 }
36440 }
36441
36442 impl ::fidl_next::CompatFrom<crate::ResolvedConfig>
36443 for ::fidl_fuchsia_component_decl::ResolvedConfig
36444 {
36445 #[inline]
36446 fn compat_from(value: crate::ResolvedConfig) -> Self {
36447 Self {
36448 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
36449
36450 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
36451 }
36452 }
36453 }
36454
36455 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ResolvedConfig>
36456 for crate::ResolvedConfig
36457 {
36458 #[inline]
36459 fn compat_from(value: ::fidl_fuchsia_component_decl::ResolvedConfig) -> Self {
36460 Self {
36461 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
36462
36463 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
36464 }
36465 }
36466 }
36467}