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}
16
17unsafe impl<___E> ::fidl_next::Encode<___E> for AllowedOffers
18where
19 ___E: ?Sized,
20{
21 #[inline]
22 fn encode(
23 &mut self,
24 _: &mut ___E,
25 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
26 ) -> Result<(), ::fidl_next::EncodeError> {
27 ::fidl_next::munge!(let WireAllowedOffers { value } = out);
28 let _ = value.write(::fidl_next::WireU32::from(match *self {
29 Self::StaticOnly => 1,
30
31 Self::StaticAndDynamic => 2,
32 }));
33
34 Ok(())
35 }
36}
37
38impl ::core::convert::From<WireAllowedOffers> for AllowedOffers {
39 fn from(wire: WireAllowedOffers) -> Self {
40 match u32::from(wire.value) {
41 1 => Self::StaticOnly,
42
43 2 => Self::StaticAndDynamic,
44
45 _ => unsafe { ::core::hint::unreachable_unchecked() },
46 }
47 }
48}
49
50impl ::fidl_next::TakeFrom<WireAllowedOffers> for AllowedOffers {
51 #[inline]
52 fn take_from(from: &WireAllowedOffers) -> Self {
53 Self::from(*from)
54 }
55}
56
57#[derive(Clone, Copy, Debug, PartialEq, Eq)]
59#[repr(transparent)]
60pub struct WireAllowedOffers {
61 value: ::fidl_next::WireU32,
62}
63
64unsafe impl ::fidl_next::ZeroPadding for WireAllowedOffers {
65 #[inline]
66 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
67 }
69}
70
71impl WireAllowedOffers {
72 pub const STATIC_ONLY: WireAllowedOffers = WireAllowedOffers { value: ::fidl_next::WireU32(1) };
73
74 pub const STATIC_AND_DYNAMIC: WireAllowedOffers =
75 WireAllowedOffers { value: ::fidl_next::WireU32(2) };
76}
77
78unsafe impl<___D> ::fidl_next::Decode<___D> for WireAllowedOffers
79where
80 ___D: ?Sized,
81{
82 fn decode(
83 slot: ::fidl_next::Slot<'_, Self>,
84 _: &mut ___D,
85 ) -> Result<(), ::fidl_next::DecodeError> {
86 ::fidl_next::munge!(let Self { value } = slot);
87
88 match u32::from(*value) {
89 1 | 2 => (),
90 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
91 }
92
93 Ok(())
94 }
95}
96
97impl ::core::convert::From<AllowedOffers> for WireAllowedOffers {
98 fn from(natural: AllowedOffers) -> Self {
99 match natural {
100 AllowedOffers::StaticOnly => WireAllowedOffers::STATIC_ONLY,
101
102 AllowedOffers::StaticAndDynamic => WireAllowedOffers::STATIC_AND_DYNAMIC,
103 }
104 }
105}
106
107#[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"]
108#[derive(Clone, Copy, Debug, PartialEq, Eq)]
109#[repr(u32)]
110pub enum Availability {
111 Required = 1,
112 Optional = 2,
113 SameAsTarget = 3,
114 Transitional = 4,
115}
116
117impl ::fidl_next::Encodable for Availability {
118 type Encoded = WireAvailability;
119}
120
121unsafe impl<___E> ::fidl_next::Encode<___E> for Availability
122where
123 ___E: ?Sized,
124{
125 #[inline]
126 fn encode(
127 &mut self,
128 _: &mut ___E,
129 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
130 ) -> Result<(), ::fidl_next::EncodeError> {
131 ::fidl_next::munge!(let WireAvailability { value } = out);
132 let _ = value.write(::fidl_next::WireU32::from(match *self {
133 Self::Required => 1,
134
135 Self::Optional => 2,
136
137 Self::SameAsTarget => 3,
138
139 Self::Transitional => 4,
140 }));
141
142 Ok(())
143 }
144}
145
146impl ::core::convert::From<WireAvailability> for Availability {
147 fn from(wire: WireAvailability) -> Self {
148 match u32::from(wire.value) {
149 1 => Self::Required,
150
151 2 => Self::Optional,
152
153 3 => Self::SameAsTarget,
154
155 4 => Self::Transitional,
156
157 _ => unsafe { ::core::hint::unreachable_unchecked() },
158 }
159 }
160}
161
162impl ::fidl_next::TakeFrom<WireAvailability> for Availability {
163 #[inline]
164 fn take_from(from: &WireAvailability) -> Self {
165 Self::from(*from)
166 }
167}
168
169#[derive(Clone, Copy, Debug, PartialEq, Eq)]
171#[repr(transparent)]
172pub struct WireAvailability {
173 value: ::fidl_next::WireU32,
174}
175
176unsafe impl ::fidl_next::ZeroPadding for WireAvailability {
177 #[inline]
178 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
179 }
181}
182
183impl WireAvailability {
184 pub const REQUIRED: WireAvailability = WireAvailability { value: ::fidl_next::WireU32(1) };
185
186 pub const OPTIONAL: WireAvailability = WireAvailability { value: ::fidl_next::WireU32(2) };
187
188 pub const SAME_AS_TARGET: WireAvailability =
189 WireAvailability { value: ::fidl_next::WireU32(3) };
190
191 pub const TRANSITIONAL: WireAvailability = WireAvailability { value: ::fidl_next::WireU32(4) };
192}
193
194unsafe impl<___D> ::fidl_next::Decode<___D> for WireAvailability
195where
196 ___D: ?Sized,
197{
198 fn decode(
199 slot: ::fidl_next::Slot<'_, Self>,
200 _: &mut ___D,
201 ) -> Result<(), ::fidl_next::DecodeError> {
202 ::fidl_next::munge!(let Self { value } = slot);
203
204 match u32::from(*value) {
205 1 | 2 | 3 | 4 => (),
206 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
207 }
208
209 Ok(())
210 }
211}
212
213impl ::core::convert::From<Availability> for WireAvailability {
214 fn from(natural: Availability) -> Self {
215 match natural {
216 Availability::Required => WireAvailability::REQUIRED,
217
218 Availability::Optional => WireAvailability::OPTIONAL,
219
220 Availability::SameAsTarget => WireAvailability::SAME_AS_TARGET,
221
222 Availability::Transitional => WireAvailability::TRANSITIONAL,
223 }
224 }
225}
226
227#[doc = " Config keys can only consist of these many bytes\n"]
228pub const CONFIG_KEY_MAX_SIZE: u32 = 64;
229
230pub const MAX_NAME_LENGTH: u32 = 100;
231
232pub type Name = String;
233
234pub type WireName = ::fidl_next::WireString;
236
237pub const MAX_PATH_LENGTH: u32 = 1024;
238
239#[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"]
240#[derive(Clone, Debug)]
241pub struct Service {
242 pub name: Option<String>,
243
244 pub source_path: Option<String>,
245}
246
247impl Service {
248 fn __max_ordinal(&self) -> usize {
249 if self.name.is_some() {
250 return 1;
251 }
252
253 if self.source_path.is_some() {
254 return 2;
255 }
256
257 0
258 }
259}
260
261impl ::fidl_next::Encodable for Service {
262 type Encoded = WireService;
263}
264
265unsafe impl<___E> ::fidl_next::Encode<___E> for Service
266where
267 ___E: ::fidl_next::Encoder + ?Sized,
268{
269 #[inline]
270 fn encode(
271 &mut self,
272 encoder: &mut ___E,
273 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
274 ) -> Result<(), ::fidl_next::EncodeError> {
275 ::fidl_next::munge!(let WireService { table } = out);
276
277 let max_ord = self.__max_ordinal();
278
279 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
280 ::fidl_next::ZeroPadding::zero_padding(&mut out);
281
282 let mut preallocated =
283 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
284
285 for i in 1..=max_ord {
286 match i {
287 2 => {
288 if let Some(source_path) = &mut self.source_path {
289 ::fidl_next::WireEnvelope::encode_value(
290 source_path,
291 preallocated.encoder,
292 &mut out,
293 )?;
294 } else {
295 ::fidl_next::WireEnvelope::encode_zero(&mut out)
296 }
297 }
298
299 1 => {
300 if let Some(name) = &mut self.name {
301 ::fidl_next::WireEnvelope::encode_value(
302 name,
303 preallocated.encoder,
304 &mut out,
305 )?;
306 } else {
307 ::fidl_next::WireEnvelope::encode_zero(&mut out)
308 }
309 }
310
311 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
312 }
313 unsafe {
314 preallocated.write_next(out.assume_init_ref());
315 }
316 }
317
318 ::fidl_next::WireTable::encode_len(table, max_ord);
319
320 Ok(())
321 }
322}
323
324impl ::fidl_next::TakeFrom<WireService> for Service {
325 #[inline]
326 fn take_from(from: &WireService) -> Self {
327 Self {
328 name: from.name().map(::fidl_next::TakeFrom::take_from),
329
330 source_path: from.source_path().map(::fidl_next::TakeFrom::take_from),
331 }
332 }
333}
334
335#[repr(C)]
337pub struct WireService {
338 table: ::fidl_next::WireTable,
339}
340
341unsafe impl ::fidl_next::ZeroPadding for WireService {
342 #[inline]
343 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
344 ::fidl_next::munge!(let Self { table } = out);
345 ::fidl_next::WireTable::zero_padding(table);
346 }
347}
348
349unsafe impl<___D> ::fidl_next::Decode<___D> for WireService
350where
351 ___D: ::fidl_next::Decoder + ?Sized,
352{
353 fn decode(
354 slot: ::fidl_next::Slot<'_, Self>,
355 decoder: &mut ___D,
356 ) -> Result<(), ::fidl_next::DecodeError> {
357 ::fidl_next::munge!(let Self { table } = slot);
358
359 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
360 match ordinal {
361 0 => unsafe { ::core::hint::unreachable_unchecked() },
362
363 1 => {
364 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
365 slot.as_mut(),
366 decoder,
367 )?;
368
369 let name = unsafe {
370 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
371 };
372
373 if name.len() > 100 {
374 return Err(::fidl_next::DecodeError::VectorTooLong {
375 size: name.len() as u64,
376 limit: 100,
377 });
378 }
379
380 Ok(())
381 }
382
383 2 => {
384 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
385 slot.as_mut(),
386 decoder,
387 )?;
388
389 let source_path = unsafe {
390 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
391 };
392
393 if source_path.len() > 1024 {
394 return Err(::fidl_next::DecodeError::VectorTooLong {
395 size: source_path.len() as u64,
396 limit: 1024,
397 });
398 }
399
400 Ok(())
401 }
402
403 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
404 }
405 })
406 }
407}
408
409impl WireService {
410 pub fn name(&self) -> Option<&::fidl_next::WireString> {
411 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
412 }
413
414 pub fn source_path(&self) -> Option<&::fidl_next::WireString> {
415 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
416 }
417}
418
419impl ::core::fmt::Debug for WireService {
420 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
421 f.debug_struct("Service")
422 .field("name", &self.name())
423 .field("source_path", &self.source_path())
424 .finish()
425 }
426}
427
428#[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"]
429#[derive(Clone, Debug)]
430pub struct Directory {
431 pub name: Option<String>,
432
433 pub source_path: Option<String>,
434
435 pub rights: Option<::fidl_next_fuchsia_io::Operations>,
436}
437
438impl Directory {
439 fn __max_ordinal(&self) -> usize {
440 if self.name.is_some() {
441 return 1;
442 }
443
444 if self.source_path.is_some() {
445 return 2;
446 }
447
448 if self.rights.is_some() {
449 return 3;
450 }
451
452 0
453 }
454}
455
456impl ::fidl_next::Encodable for Directory {
457 type Encoded = WireDirectory;
458}
459
460unsafe impl<___E> ::fidl_next::Encode<___E> for Directory
461where
462 ___E: ::fidl_next::Encoder + ?Sized,
463{
464 #[inline]
465 fn encode(
466 &mut self,
467 encoder: &mut ___E,
468 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
469 ) -> Result<(), ::fidl_next::EncodeError> {
470 ::fidl_next::munge!(let WireDirectory { table } = out);
471
472 let max_ord = self.__max_ordinal();
473
474 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
475 ::fidl_next::ZeroPadding::zero_padding(&mut out);
476
477 let mut preallocated =
478 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
479
480 for i in 1..=max_ord {
481 match i {
482 3 => {
483 if let Some(rights) = &mut self.rights {
484 ::fidl_next::WireEnvelope::encode_value(
485 rights,
486 preallocated.encoder,
487 &mut out,
488 )?;
489 } else {
490 ::fidl_next::WireEnvelope::encode_zero(&mut out)
491 }
492 }
493
494 2 => {
495 if let Some(source_path) = &mut self.source_path {
496 ::fidl_next::WireEnvelope::encode_value(
497 source_path,
498 preallocated.encoder,
499 &mut out,
500 )?;
501 } else {
502 ::fidl_next::WireEnvelope::encode_zero(&mut out)
503 }
504 }
505
506 1 => {
507 if let Some(name) = &mut self.name {
508 ::fidl_next::WireEnvelope::encode_value(
509 name,
510 preallocated.encoder,
511 &mut out,
512 )?;
513 } else {
514 ::fidl_next::WireEnvelope::encode_zero(&mut out)
515 }
516 }
517
518 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
519 }
520 unsafe {
521 preallocated.write_next(out.assume_init_ref());
522 }
523 }
524
525 ::fidl_next::WireTable::encode_len(table, max_ord);
526
527 Ok(())
528 }
529}
530
531impl ::fidl_next::TakeFrom<WireDirectory> for Directory {
532 #[inline]
533 fn take_from(from: &WireDirectory) -> Self {
534 Self {
535 name: from.name().map(::fidl_next::TakeFrom::take_from),
536
537 source_path: from.source_path().map(::fidl_next::TakeFrom::take_from),
538
539 rights: from.rights().map(::fidl_next::TakeFrom::take_from),
540 }
541 }
542}
543
544#[repr(C)]
546pub struct WireDirectory {
547 table: ::fidl_next::WireTable,
548}
549
550unsafe impl ::fidl_next::ZeroPadding for WireDirectory {
551 #[inline]
552 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
553 ::fidl_next::munge!(let Self { table } = out);
554 ::fidl_next::WireTable::zero_padding(table);
555 }
556}
557
558unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectory
559where
560 ___D: ::fidl_next::Decoder + ?Sized,
561{
562 fn decode(
563 slot: ::fidl_next::Slot<'_, Self>,
564 decoder: &mut ___D,
565 ) -> Result<(), ::fidl_next::DecodeError> {
566 ::fidl_next::munge!(let Self { table } = slot);
567
568 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
569 match ordinal {
570 0 => unsafe { ::core::hint::unreachable_unchecked() },
571
572 1 => {
573 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
574 slot.as_mut(),
575 decoder,
576 )?;
577
578 let name = unsafe {
579 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
580 };
581
582 if name.len() > 100 {
583 return Err(::fidl_next::DecodeError::VectorTooLong {
584 size: name.len() as u64,
585 limit: 100,
586 });
587 }
588
589 Ok(())
590 }
591
592 2 => {
593 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
594 slot.as_mut(),
595 decoder,
596 )?;
597
598 let source_path = unsafe {
599 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
600 };
601
602 if source_path.len() > 1024 {
603 return Err(::fidl_next::DecodeError::VectorTooLong {
604 size: source_path.len() as u64,
605 limit: 1024,
606 });
607 }
608
609 Ok(())
610 }
611
612 3 => {
613 ::fidl_next::WireEnvelope::decode_as::<
614 ___D,
615 ::fidl_next_fuchsia_io::WireOperations,
616 >(slot.as_mut(), decoder)?;
617
618 Ok(())
619 }
620
621 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
622 }
623 })
624 }
625}
626
627impl WireDirectory {
628 pub fn name(&self) -> Option<&::fidl_next::WireString> {
629 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
630 }
631
632 pub fn source_path(&self) -> Option<&::fidl_next::WireString> {
633 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
634 }
635
636 pub fn rights(&self) -> Option<&::fidl_next_fuchsia_io::WireOperations> {
637 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
638 }
639}
640
641impl ::core::fmt::Debug for WireDirectory {
642 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
643 f.debug_struct("Directory")
644 .field("name", &self.name())
645 .field("source_path", &self.source_path())
646 .field("rights", &self.rights())
647 .finish()
648 }
649}
650
651#[doc = " A reference to a component\'s parent instance.\n"]
652#[derive(Clone, Debug)]
653#[repr(C)]
654pub struct ParentRef {}
655
656impl ::fidl_next::Encodable for ParentRef {
657 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
658 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
659
660 type Encoded = WireParentRef;
661}
662
663unsafe impl<___E> ::fidl_next::Encode<___E> for ParentRef
664where
665 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
666{
667 #[inline]
668 fn encode(
669 &mut self,
670 encoder: &mut ___E,
671 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
672 ) -> Result<(), ::fidl_next::EncodeError> {
673 ::fidl_next::munge! {
674 let Self::Encoded {
675
676 } = out;
677 }
678
679 Ok(())
680 }
681}
682
683impl ::fidl_next::EncodableOption for Box<ParentRef> {
684 type EncodedOption = ::fidl_next::WireBox<WireParentRef>;
685}
686
687unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ParentRef>
688where
689 ___E: ::fidl_next::Encoder + ?Sized,
690 ParentRef: ::fidl_next::Encode<___E>,
691{
692 #[inline]
693 fn encode_option(
694 this: Option<&mut Self>,
695 encoder: &mut ___E,
696 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
697 ) -> Result<(), ::fidl_next::EncodeError> {
698 if let Some(inner) = this {
699 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
700 ::fidl_next::WireBox::encode_present(out);
701 } else {
702 ::fidl_next::WireBox::encode_absent(out);
703 }
704
705 Ok(())
706 }
707}
708
709impl ::fidl_next::TakeFrom<WireParentRef> for ParentRef {
710 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
711 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
712
713 #[inline]
714 fn take_from(from: &WireParentRef) -> Self {
715 Self {}
716 }
717}
718
719#[derive(Clone, Debug)]
721#[repr(C)]
722pub struct WireParentRef {}
723
724unsafe impl ::fidl_next::ZeroPadding for WireParentRef {
725 #[inline]
726 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
727}
728
729unsafe impl<___D> ::fidl_next::Decode<___D> for WireParentRef
730where
731 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
732{
733 fn decode(
734 slot: ::fidl_next::Slot<'_, Self>,
735 decoder: &mut ___D,
736 ) -> Result<(), ::fidl_next::DecodeError> {
737 ::fidl_next::munge! {
738 let Self {
739
740 } = slot;
741 }
742
743 Ok(())
744 }
745}
746
747#[doc = " A reference to the component itself.\n"]
748#[derive(Clone, Debug)]
749#[repr(C)]
750pub struct SelfRef {}
751
752impl ::fidl_next::Encodable for SelfRef {
753 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
754 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
755
756 type Encoded = WireSelfRef;
757}
758
759unsafe impl<___E> ::fidl_next::Encode<___E> for SelfRef
760where
761 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
762{
763 #[inline]
764 fn encode(
765 &mut self,
766 encoder: &mut ___E,
767 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
768 ) -> Result<(), ::fidl_next::EncodeError> {
769 ::fidl_next::munge! {
770 let Self::Encoded {
771
772 } = out;
773 }
774
775 Ok(())
776 }
777}
778
779impl ::fidl_next::EncodableOption for Box<SelfRef> {
780 type EncodedOption = ::fidl_next::WireBox<WireSelfRef>;
781}
782
783unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<SelfRef>
784where
785 ___E: ::fidl_next::Encoder + ?Sized,
786 SelfRef: ::fidl_next::Encode<___E>,
787{
788 #[inline]
789 fn encode_option(
790 this: Option<&mut Self>,
791 encoder: &mut ___E,
792 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
793 ) -> Result<(), ::fidl_next::EncodeError> {
794 if let Some(inner) = this {
795 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
796 ::fidl_next::WireBox::encode_present(out);
797 } else {
798 ::fidl_next::WireBox::encode_absent(out);
799 }
800
801 Ok(())
802 }
803}
804
805impl ::fidl_next::TakeFrom<WireSelfRef> for SelfRef {
806 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
807 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
808
809 #[inline]
810 fn take_from(from: &WireSelfRef) -> Self {
811 Self {}
812 }
813}
814
815#[derive(Clone, Debug)]
817#[repr(C)]
818pub struct WireSelfRef {}
819
820unsafe impl ::fidl_next::ZeroPadding for WireSelfRef {
821 #[inline]
822 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
823}
824
825unsafe impl<___D> ::fidl_next::Decode<___D> for WireSelfRef
826where
827 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
828{
829 fn decode(
830 slot: ::fidl_next::Slot<'_, Self>,
831 decoder: &mut ___D,
832 ) -> Result<(), ::fidl_next::DecodeError> {
833 ::fidl_next::munge! {
834 let Self {
835
836 } = slot;
837 }
838
839 Ok(())
840 }
841}
842
843pub const MAX_CHILD_NAME_LENGTH: u32 = 1024;
844
845pub type ChildName = String;
846
847pub type WireChildName = ::fidl_next::WireString;
849
850#[doc = " A reference to one of the component\'s child instances.\n"]
851#[derive(Clone, Debug)]
852pub struct ChildRef {
853 pub name: String,
854
855 pub collection: Option<String>,
856}
857
858impl ::fidl_next::Encodable for ChildRef {
859 type Encoded = WireChildRef;
860}
861
862unsafe impl<___E> ::fidl_next::Encode<___E> for ChildRef
863where
864 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
865
866 ___E: ::fidl_next::Encoder,
867{
868 #[inline]
869 fn encode(
870 &mut self,
871 encoder: &mut ___E,
872 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
873 ) -> Result<(), ::fidl_next::EncodeError> {
874 ::fidl_next::munge! {
875 let Self::Encoded {
876 name,
877 collection,
878
879 } = out;
880 }
881
882 ::fidl_next::Encode::encode(&mut self.name, encoder, name)?;
883
884 ::fidl_next::Encode::encode(&mut self.collection, encoder, collection)?;
885
886 Ok(())
887 }
888}
889
890impl ::fidl_next::EncodableOption for Box<ChildRef> {
891 type EncodedOption = ::fidl_next::WireBox<WireChildRef>;
892}
893
894unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ChildRef>
895where
896 ___E: ::fidl_next::Encoder + ?Sized,
897 ChildRef: ::fidl_next::Encode<___E>,
898{
899 #[inline]
900 fn encode_option(
901 this: Option<&mut Self>,
902 encoder: &mut ___E,
903 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
904 ) -> Result<(), ::fidl_next::EncodeError> {
905 if let Some(inner) = this {
906 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
907 ::fidl_next::WireBox::encode_present(out);
908 } else {
909 ::fidl_next::WireBox::encode_absent(out);
910 }
911
912 Ok(())
913 }
914}
915
916impl ::fidl_next::TakeFrom<WireChildRef> for ChildRef {
917 #[inline]
918 fn take_from(from: &WireChildRef) -> Self {
919 Self {
920 name: ::fidl_next::TakeFrom::take_from(&from.name),
921
922 collection: ::fidl_next::TakeFrom::take_from(&from.collection),
923 }
924 }
925}
926
927#[derive(Debug)]
929#[repr(C)]
930pub struct WireChildRef {
931 pub name: ::fidl_next::WireString,
932
933 pub collection: ::fidl_next::WireOptionalString,
934}
935
936unsafe impl ::fidl_next::ZeroPadding for WireChildRef {
937 #[inline]
938 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
939}
940
941unsafe impl<___D> ::fidl_next::Decode<___D> for WireChildRef
942where
943 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
944
945 ___D: ::fidl_next::Decoder,
946{
947 fn decode(
948 slot: ::fidl_next::Slot<'_, Self>,
949 decoder: &mut ___D,
950 ) -> Result<(), ::fidl_next::DecodeError> {
951 ::fidl_next::munge! {
952 let Self {
953 mut name,
954 mut collection,
955
956 } = slot;
957 }
958
959 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
960
961 let name = unsafe { name.deref_unchecked() };
962
963 if name.len() > 1024 {
964 return Err(::fidl_next::DecodeError::VectorTooLong {
965 size: name.len() as u64,
966 limit: 1024,
967 });
968 }
969
970 ::fidl_next::Decode::decode(collection.as_mut(), decoder)?;
971
972 let collection = unsafe { collection.deref_unchecked() };
973
974 if let Some(collection) = collection.as_ref() {
975 if collection.len() > 100 {
976 return Err(::fidl_next::DecodeError::VectorTooLong {
977 size: collection.len() as u64,
978 limit: 100,
979 });
980 }
981 }
982
983 Ok(())
984 }
985}
986
987#[doc = " A reference to one of the component\'s collections.\n"]
988#[derive(Clone, Debug)]
989pub struct CollectionRef {
990 pub name: String,
991}
992
993impl ::fidl_next::Encodable for CollectionRef {
994 type Encoded = WireCollectionRef;
995}
996
997unsafe impl<___E> ::fidl_next::Encode<___E> for CollectionRef
998where
999 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1000
1001 ___E: ::fidl_next::Encoder,
1002{
1003 #[inline]
1004 fn encode(
1005 &mut self,
1006 encoder: &mut ___E,
1007 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1008 ) -> Result<(), ::fidl_next::EncodeError> {
1009 ::fidl_next::munge! {
1010 let Self::Encoded {
1011 name,
1012
1013 } = out;
1014 }
1015
1016 ::fidl_next::Encode::encode(&mut self.name, encoder, name)?;
1017
1018 Ok(())
1019 }
1020}
1021
1022impl ::fidl_next::EncodableOption for Box<CollectionRef> {
1023 type EncodedOption = ::fidl_next::WireBox<WireCollectionRef>;
1024}
1025
1026unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<CollectionRef>
1027where
1028 ___E: ::fidl_next::Encoder + ?Sized,
1029 CollectionRef: ::fidl_next::Encode<___E>,
1030{
1031 #[inline]
1032 fn encode_option(
1033 this: Option<&mut Self>,
1034 encoder: &mut ___E,
1035 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1036 ) -> Result<(), ::fidl_next::EncodeError> {
1037 if let Some(inner) = this {
1038 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1039 ::fidl_next::WireBox::encode_present(out);
1040 } else {
1041 ::fidl_next::WireBox::encode_absent(out);
1042 }
1043
1044 Ok(())
1045 }
1046}
1047
1048impl ::fidl_next::TakeFrom<WireCollectionRef> for CollectionRef {
1049 #[inline]
1050 fn take_from(from: &WireCollectionRef) -> Self {
1051 Self { name: ::fidl_next::TakeFrom::take_from(&from.name) }
1052 }
1053}
1054
1055#[derive(Debug)]
1057#[repr(C)]
1058pub struct WireCollectionRef {
1059 pub name: ::fidl_next::WireString,
1060}
1061
1062unsafe impl ::fidl_next::ZeroPadding for WireCollectionRef {
1063 #[inline]
1064 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1065}
1066
1067unsafe impl<___D> ::fidl_next::Decode<___D> for WireCollectionRef
1068where
1069 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1070
1071 ___D: ::fidl_next::Decoder,
1072{
1073 fn decode(
1074 slot: ::fidl_next::Slot<'_, Self>,
1075 decoder: &mut ___D,
1076 ) -> Result<(), ::fidl_next::DecodeError> {
1077 ::fidl_next::munge! {
1078 let Self {
1079 mut name,
1080
1081 } = slot;
1082 }
1083
1084 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
1085
1086 let name = unsafe { name.deref_unchecked() };
1087
1088 if name.len() > 100 {
1089 return Err(::fidl_next::DecodeError::VectorTooLong {
1090 size: name.len() as u64,
1091 limit: 100,
1092 });
1093 }
1094
1095 Ok(())
1096 }
1097}
1098
1099#[doc = " A reference to the component framework itself.\n"]
1100#[derive(Clone, Debug)]
1101#[repr(C)]
1102pub struct FrameworkRef {}
1103
1104impl ::fidl_next::Encodable for FrameworkRef {
1105 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
1106 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1107
1108 type Encoded = WireFrameworkRef;
1109}
1110
1111unsafe impl<___E> ::fidl_next::Encode<___E> for FrameworkRef
1112where
1113 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1114{
1115 #[inline]
1116 fn encode(
1117 &mut self,
1118 encoder: &mut ___E,
1119 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1120 ) -> Result<(), ::fidl_next::EncodeError> {
1121 ::fidl_next::munge! {
1122 let Self::Encoded {
1123
1124 } = out;
1125 }
1126
1127 Ok(())
1128 }
1129}
1130
1131impl ::fidl_next::EncodableOption for Box<FrameworkRef> {
1132 type EncodedOption = ::fidl_next::WireBox<WireFrameworkRef>;
1133}
1134
1135unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<FrameworkRef>
1136where
1137 ___E: ::fidl_next::Encoder + ?Sized,
1138 FrameworkRef: ::fidl_next::Encode<___E>,
1139{
1140 #[inline]
1141 fn encode_option(
1142 this: Option<&mut Self>,
1143 encoder: &mut ___E,
1144 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1145 ) -> Result<(), ::fidl_next::EncodeError> {
1146 if let Some(inner) = this {
1147 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1148 ::fidl_next::WireBox::encode_present(out);
1149 } else {
1150 ::fidl_next::WireBox::encode_absent(out);
1151 }
1152
1153 Ok(())
1154 }
1155}
1156
1157impl ::fidl_next::TakeFrom<WireFrameworkRef> for FrameworkRef {
1158 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
1159 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1160
1161 #[inline]
1162 fn take_from(from: &WireFrameworkRef) -> Self {
1163 Self {}
1164 }
1165}
1166
1167#[derive(Clone, Debug)]
1169#[repr(C)]
1170pub struct WireFrameworkRef {}
1171
1172unsafe impl ::fidl_next::ZeroPadding for WireFrameworkRef {
1173 #[inline]
1174 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1175}
1176
1177unsafe impl<___D> ::fidl_next::Decode<___D> for WireFrameworkRef
1178where
1179 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1180{
1181 fn decode(
1182 slot: ::fidl_next::Slot<'_, Self>,
1183 decoder: &mut ___D,
1184 ) -> Result<(), ::fidl_next::DecodeError> {
1185 ::fidl_next::munge! {
1186 let Self {
1187
1188 } = slot;
1189 }
1190
1191 Ok(())
1192 }
1193}
1194
1195#[doc = " A reference to a capability declared in this component.\n"]
1196#[derive(Clone, Debug)]
1197pub struct CapabilityRef {
1198 pub name: String,
1199}
1200
1201impl ::fidl_next::Encodable for CapabilityRef {
1202 type Encoded = WireCapabilityRef;
1203}
1204
1205unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityRef
1206where
1207 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1208
1209 ___E: ::fidl_next::Encoder,
1210{
1211 #[inline]
1212 fn encode(
1213 &mut self,
1214 encoder: &mut ___E,
1215 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1216 ) -> Result<(), ::fidl_next::EncodeError> {
1217 ::fidl_next::munge! {
1218 let Self::Encoded {
1219 name,
1220
1221 } = out;
1222 }
1223
1224 ::fidl_next::Encode::encode(&mut self.name, encoder, name)?;
1225
1226 Ok(())
1227 }
1228}
1229
1230impl ::fidl_next::EncodableOption for Box<CapabilityRef> {
1231 type EncodedOption = ::fidl_next::WireBox<WireCapabilityRef>;
1232}
1233
1234unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<CapabilityRef>
1235where
1236 ___E: ::fidl_next::Encoder + ?Sized,
1237 CapabilityRef: ::fidl_next::Encode<___E>,
1238{
1239 #[inline]
1240 fn encode_option(
1241 this: Option<&mut Self>,
1242 encoder: &mut ___E,
1243 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1244 ) -> Result<(), ::fidl_next::EncodeError> {
1245 if let Some(inner) = this {
1246 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1247 ::fidl_next::WireBox::encode_present(out);
1248 } else {
1249 ::fidl_next::WireBox::encode_absent(out);
1250 }
1251
1252 Ok(())
1253 }
1254}
1255
1256impl ::fidl_next::TakeFrom<WireCapabilityRef> for CapabilityRef {
1257 #[inline]
1258 fn take_from(from: &WireCapabilityRef) -> Self {
1259 Self { name: ::fidl_next::TakeFrom::take_from(&from.name) }
1260 }
1261}
1262
1263#[derive(Debug)]
1265#[repr(C)]
1266pub struct WireCapabilityRef {
1267 pub name: ::fidl_next::WireString,
1268}
1269
1270unsafe impl ::fidl_next::ZeroPadding for WireCapabilityRef {
1271 #[inline]
1272 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1273}
1274
1275unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityRef
1276where
1277 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1278
1279 ___D: ::fidl_next::Decoder,
1280{
1281 fn decode(
1282 slot: ::fidl_next::Slot<'_, Self>,
1283 decoder: &mut ___D,
1284 ) -> Result<(), ::fidl_next::DecodeError> {
1285 ::fidl_next::munge! {
1286 let Self {
1287 mut name,
1288
1289 } = slot;
1290 }
1291
1292 ::fidl_next::Decode::decode(name.as_mut(), decoder)?;
1293
1294 let name = unsafe { name.deref_unchecked() };
1295
1296 if name.len() > 100 {
1297 return Err(::fidl_next::DecodeError::VectorTooLong {
1298 size: name.len() as u64,
1299 limit: 100,
1300 });
1301 }
1302
1303 Ok(())
1304 }
1305}
1306
1307#[doc = " A reference to the environment\'s debug capabilities.\n"]
1308#[derive(Clone, Debug)]
1309#[repr(C)]
1310pub struct DebugRef {}
1311
1312impl ::fidl_next::Encodable for DebugRef {
1313 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
1314 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1315
1316 type Encoded = WireDebugRef;
1317}
1318
1319unsafe impl<___E> ::fidl_next::Encode<___E> for DebugRef
1320where
1321 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1322{
1323 #[inline]
1324 fn encode(
1325 &mut self,
1326 encoder: &mut ___E,
1327 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1328 ) -> Result<(), ::fidl_next::EncodeError> {
1329 ::fidl_next::munge! {
1330 let Self::Encoded {
1331
1332 } = out;
1333 }
1334
1335 Ok(())
1336 }
1337}
1338
1339impl ::fidl_next::EncodableOption for Box<DebugRef> {
1340 type EncodedOption = ::fidl_next::WireBox<WireDebugRef>;
1341}
1342
1343unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DebugRef>
1344where
1345 ___E: ::fidl_next::Encoder + ?Sized,
1346 DebugRef: ::fidl_next::Encode<___E>,
1347{
1348 #[inline]
1349 fn encode_option(
1350 this: Option<&mut Self>,
1351 encoder: &mut ___E,
1352 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1353 ) -> Result<(), ::fidl_next::EncodeError> {
1354 if let Some(inner) = this {
1355 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1356 ::fidl_next::WireBox::encode_present(out);
1357 } else {
1358 ::fidl_next::WireBox::encode_absent(out);
1359 }
1360
1361 Ok(())
1362 }
1363}
1364
1365impl ::fidl_next::TakeFrom<WireDebugRef> for DebugRef {
1366 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
1367 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1368
1369 #[inline]
1370 fn take_from(from: &WireDebugRef) -> Self {
1371 Self {}
1372 }
1373}
1374
1375#[derive(Clone, Debug)]
1377#[repr(C)]
1378pub struct WireDebugRef {}
1379
1380unsafe impl ::fidl_next::ZeroPadding for WireDebugRef {
1381 #[inline]
1382 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1383}
1384
1385unsafe impl<___D> ::fidl_next::Decode<___D> for WireDebugRef
1386where
1387 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1388{
1389 fn decode(
1390 slot: ::fidl_next::Slot<'_, Self>,
1391 decoder: &mut ___D,
1392 ) -> Result<(), ::fidl_next::DecodeError> {
1393 ::fidl_next::munge! {
1394 let Self {
1395
1396 } = slot;
1397 }
1398
1399 Ok(())
1400 }
1401}
1402
1403#[doc = " A reference to an intentionally missing offer source.\n"]
1404#[derive(Clone, Debug)]
1405#[repr(C)]
1406pub struct VoidRef {}
1407
1408impl ::fidl_next::Encodable for VoidRef {
1409 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
1410 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1411
1412 type Encoded = WireVoidRef;
1413}
1414
1415unsafe impl<___E> ::fidl_next::Encode<___E> for VoidRef
1416where
1417 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1418{
1419 #[inline]
1420 fn encode(
1421 &mut self,
1422 encoder: &mut ___E,
1423 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1424 ) -> Result<(), ::fidl_next::EncodeError> {
1425 ::fidl_next::munge! {
1426 let Self::Encoded {
1427
1428 } = out;
1429 }
1430
1431 Ok(())
1432 }
1433}
1434
1435impl ::fidl_next::EncodableOption for Box<VoidRef> {
1436 type EncodedOption = ::fidl_next::WireBox<WireVoidRef>;
1437}
1438
1439unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<VoidRef>
1440where
1441 ___E: ::fidl_next::Encoder + ?Sized,
1442 VoidRef: ::fidl_next::Encode<___E>,
1443{
1444 #[inline]
1445 fn encode_option(
1446 this: Option<&mut Self>,
1447 encoder: &mut ___E,
1448 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1449 ) -> Result<(), ::fidl_next::EncodeError> {
1450 if let Some(inner) = this {
1451 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1452 ::fidl_next::WireBox::encode_present(out);
1453 } else {
1454 ::fidl_next::WireBox::encode_absent(out);
1455 }
1456
1457 Ok(())
1458 }
1459}
1460
1461impl ::fidl_next::TakeFrom<WireVoidRef> for VoidRef {
1462 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
1463 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1464
1465 #[inline]
1466 fn take_from(from: &WireVoidRef) -> Self {
1467 Self {}
1468 }
1469}
1470
1471#[derive(Clone, Debug)]
1473#[repr(C)]
1474pub struct WireVoidRef {}
1475
1476unsafe impl ::fidl_next::ZeroPadding for WireVoidRef {
1477 #[inline]
1478 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1479}
1480
1481unsafe impl<___D> ::fidl_next::Decode<___D> for WireVoidRef
1482where
1483 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1484{
1485 fn decode(
1486 slot: ::fidl_next::Slot<'_, Self>,
1487 decoder: &mut ___D,
1488 ) -> Result<(), ::fidl_next::DecodeError> {
1489 ::fidl_next::munge! {
1490 let Self {
1491
1492 } = slot;
1493 }
1494
1495 Ok(())
1496 }
1497}
1498
1499#[doc = " Declares which identifier to use to key a component\'s isolated storage\n directory.\n"]
1500#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1501#[repr(u32)]
1502pub enum StorageId {
1503 StaticInstanceId = 1,
1504 StaticInstanceIdOrMoniker = 2,
1505}
1506
1507impl ::fidl_next::Encodable for StorageId {
1508 type Encoded = WireStorageId;
1509}
1510
1511unsafe impl<___E> ::fidl_next::Encode<___E> for StorageId
1512where
1513 ___E: ?Sized,
1514{
1515 #[inline]
1516 fn encode(
1517 &mut self,
1518 _: &mut ___E,
1519 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1520 ) -> Result<(), ::fidl_next::EncodeError> {
1521 ::fidl_next::munge!(let WireStorageId { value } = out);
1522 let _ = value.write(::fidl_next::WireU32::from(match *self {
1523 Self::StaticInstanceId => 1,
1524
1525 Self::StaticInstanceIdOrMoniker => 2,
1526 }));
1527
1528 Ok(())
1529 }
1530}
1531
1532impl ::core::convert::From<WireStorageId> for StorageId {
1533 fn from(wire: WireStorageId) -> Self {
1534 match u32::from(wire.value) {
1535 1 => Self::StaticInstanceId,
1536
1537 2 => Self::StaticInstanceIdOrMoniker,
1538
1539 _ => unsafe { ::core::hint::unreachable_unchecked() },
1540 }
1541 }
1542}
1543
1544impl ::fidl_next::TakeFrom<WireStorageId> for StorageId {
1545 #[inline]
1546 fn take_from(from: &WireStorageId) -> Self {
1547 Self::from(*from)
1548 }
1549}
1550
1551#[derive(Clone, Copy, Debug, PartialEq, Eq)]
1553#[repr(transparent)]
1554pub struct WireStorageId {
1555 value: ::fidl_next::WireU32,
1556}
1557
1558unsafe impl ::fidl_next::ZeroPadding for WireStorageId {
1559 #[inline]
1560 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1561 }
1563}
1564
1565impl WireStorageId {
1566 pub const STATIC_INSTANCE_ID: WireStorageId = WireStorageId { value: ::fidl_next::WireU32(1) };
1567
1568 pub const STATIC_INSTANCE_ID_OR_MONIKER: WireStorageId =
1569 WireStorageId { value: ::fidl_next::WireU32(2) };
1570}
1571
1572unsafe impl<___D> ::fidl_next::Decode<___D> for WireStorageId
1573where
1574 ___D: ?Sized,
1575{
1576 fn decode(
1577 slot: ::fidl_next::Slot<'_, Self>,
1578 _: &mut ___D,
1579 ) -> Result<(), ::fidl_next::DecodeError> {
1580 ::fidl_next::munge!(let Self { value } = slot);
1581
1582 match u32::from(*value) {
1583 1 | 2 => (),
1584 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
1585 }
1586
1587 Ok(())
1588 }
1589}
1590
1591impl ::core::convert::From<StorageId> for WireStorageId {
1592 fn from(natural: StorageId) -> Self {
1593 match natural {
1594 StorageId::StaticInstanceId => WireStorageId::STATIC_INSTANCE_ID,
1595
1596 StorageId::StaticInstanceIdOrMoniker => WireStorageId::STATIC_INSTANCE_ID_OR_MONIKER,
1597 }
1598 }
1599}
1600
1601#[doc = " Declares a runner capability backed by a service.\n"]
1602#[derive(Clone, Debug)]
1603pub struct Runner {
1604 pub name: Option<String>,
1605
1606 pub source_path: Option<String>,
1607}
1608
1609impl Runner {
1610 fn __max_ordinal(&self) -> usize {
1611 if self.name.is_some() {
1612 return 1;
1613 }
1614
1615 if self.source_path.is_some() {
1616 return 2;
1617 }
1618
1619 0
1620 }
1621}
1622
1623impl ::fidl_next::Encodable for Runner {
1624 type Encoded = WireRunner;
1625}
1626
1627unsafe impl<___E> ::fidl_next::Encode<___E> for Runner
1628where
1629 ___E: ::fidl_next::Encoder + ?Sized,
1630{
1631 #[inline]
1632 fn encode(
1633 &mut self,
1634 encoder: &mut ___E,
1635 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1636 ) -> Result<(), ::fidl_next::EncodeError> {
1637 ::fidl_next::munge!(let WireRunner { table } = out);
1638
1639 let max_ord = self.__max_ordinal();
1640
1641 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1642 ::fidl_next::ZeroPadding::zero_padding(&mut out);
1643
1644 let mut preallocated =
1645 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1646
1647 for i in 1..=max_ord {
1648 match i {
1649 2 => {
1650 if let Some(source_path) = &mut self.source_path {
1651 ::fidl_next::WireEnvelope::encode_value(
1652 source_path,
1653 preallocated.encoder,
1654 &mut out,
1655 )?;
1656 } else {
1657 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1658 }
1659 }
1660
1661 1 => {
1662 if let Some(name) = &mut self.name {
1663 ::fidl_next::WireEnvelope::encode_value(
1664 name,
1665 preallocated.encoder,
1666 &mut out,
1667 )?;
1668 } else {
1669 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1670 }
1671 }
1672
1673 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1674 }
1675 unsafe {
1676 preallocated.write_next(out.assume_init_ref());
1677 }
1678 }
1679
1680 ::fidl_next::WireTable::encode_len(table, max_ord);
1681
1682 Ok(())
1683 }
1684}
1685
1686impl ::fidl_next::TakeFrom<WireRunner> for Runner {
1687 #[inline]
1688 fn take_from(from: &WireRunner) -> Self {
1689 Self {
1690 name: from.name().map(::fidl_next::TakeFrom::take_from),
1691
1692 source_path: from.source_path().map(::fidl_next::TakeFrom::take_from),
1693 }
1694 }
1695}
1696
1697#[repr(C)]
1699pub struct WireRunner {
1700 table: ::fidl_next::WireTable,
1701}
1702
1703unsafe impl ::fidl_next::ZeroPadding for WireRunner {
1704 #[inline]
1705 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1706 ::fidl_next::munge!(let Self { table } = out);
1707 ::fidl_next::WireTable::zero_padding(table);
1708 }
1709}
1710
1711unsafe impl<___D> ::fidl_next::Decode<___D> for WireRunner
1712where
1713 ___D: ::fidl_next::Decoder + ?Sized,
1714{
1715 fn decode(
1716 slot: ::fidl_next::Slot<'_, Self>,
1717 decoder: &mut ___D,
1718 ) -> Result<(), ::fidl_next::DecodeError> {
1719 ::fidl_next::munge!(let Self { table } = slot);
1720
1721 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1722 match ordinal {
1723 0 => unsafe { ::core::hint::unreachable_unchecked() },
1724
1725 1 => {
1726 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
1727 slot.as_mut(),
1728 decoder,
1729 )?;
1730
1731 let name = unsafe {
1732 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
1733 };
1734
1735 if name.len() > 100 {
1736 return Err(::fidl_next::DecodeError::VectorTooLong {
1737 size: name.len() as u64,
1738 limit: 100,
1739 });
1740 }
1741
1742 Ok(())
1743 }
1744
1745 2 => {
1746 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
1747 slot.as_mut(),
1748 decoder,
1749 )?;
1750
1751 let source_path = unsafe {
1752 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
1753 };
1754
1755 if source_path.len() > 1024 {
1756 return Err(::fidl_next::DecodeError::VectorTooLong {
1757 size: source_path.len() as u64,
1758 limit: 1024,
1759 });
1760 }
1761
1762 Ok(())
1763 }
1764
1765 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1766 }
1767 })
1768 }
1769}
1770
1771impl WireRunner {
1772 pub fn name(&self) -> Option<&::fidl_next::WireString> {
1773 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1774 }
1775
1776 pub fn source_path(&self) -> Option<&::fidl_next::WireString> {
1777 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1778 }
1779}
1780
1781impl ::core::fmt::Debug for WireRunner {
1782 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
1783 f.debug_struct("Runner")
1784 .field("name", &self.name())
1785 .field("source_path", &self.source_path())
1786 .finish()
1787 }
1788}
1789
1790#[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"]
1791#[derive(Clone, Debug)]
1792pub struct Resolver {
1793 pub name: Option<String>,
1794
1795 pub source_path: Option<String>,
1796}
1797
1798impl Resolver {
1799 fn __max_ordinal(&self) -> usize {
1800 if self.name.is_some() {
1801 return 1;
1802 }
1803
1804 if self.source_path.is_some() {
1805 return 2;
1806 }
1807
1808 0
1809 }
1810}
1811
1812impl ::fidl_next::Encodable for Resolver {
1813 type Encoded = WireResolver;
1814}
1815
1816unsafe impl<___E> ::fidl_next::Encode<___E> for Resolver
1817where
1818 ___E: ::fidl_next::Encoder + ?Sized,
1819{
1820 #[inline]
1821 fn encode(
1822 &mut self,
1823 encoder: &mut ___E,
1824 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1825 ) -> Result<(), ::fidl_next::EncodeError> {
1826 ::fidl_next::munge!(let WireResolver { table } = out);
1827
1828 let max_ord = self.__max_ordinal();
1829
1830 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1831 ::fidl_next::ZeroPadding::zero_padding(&mut out);
1832
1833 let mut preallocated =
1834 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1835
1836 for i in 1..=max_ord {
1837 match i {
1838 2 => {
1839 if let Some(source_path) = &mut self.source_path {
1840 ::fidl_next::WireEnvelope::encode_value(
1841 source_path,
1842 preallocated.encoder,
1843 &mut out,
1844 )?;
1845 } else {
1846 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1847 }
1848 }
1849
1850 1 => {
1851 if let Some(name) = &mut self.name {
1852 ::fidl_next::WireEnvelope::encode_value(
1853 name,
1854 preallocated.encoder,
1855 &mut out,
1856 )?;
1857 } else {
1858 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1859 }
1860 }
1861
1862 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1863 }
1864 unsafe {
1865 preallocated.write_next(out.assume_init_ref());
1866 }
1867 }
1868
1869 ::fidl_next::WireTable::encode_len(table, max_ord);
1870
1871 Ok(())
1872 }
1873}
1874
1875impl ::fidl_next::TakeFrom<WireResolver> for Resolver {
1876 #[inline]
1877 fn take_from(from: &WireResolver) -> Self {
1878 Self {
1879 name: from.name().map(::fidl_next::TakeFrom::take_from),
1880
1881 source_path: from.source_path().map(::fidl_next::TakeFrom::take_from),
1882 }
1883 }
1884}
1885
1886#[repr(C)]
1888pub struct WireResolver {
1889 table: ::fidl_next::WireTable,
1890}
1891
1892unsafe impl ::fidl_next::ZeroPadding for WireResolver {
1893 #[inline]
1894 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1895 ::fidl_next::munge!(let Self { table } = out);
1896 ::fidl_next::WireTable::zero_padding(table);
1897 }
1898}
1899
1900unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolver
1901where
1902 ___D: ::fidl_next::Decoder + ?Sized,
1903{
1904 fn decode(
1905 slot: ::fidl_next::Slot<'_, Self>,
1906 decoder: &mut ___D,
1907 ) -> Result<(), ::fidl_next::DecodeError> {
1908 ::fidl_next::munge!(let Self { table } = slot);
1909
1910 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1911 match ordinal {
1912 0 => unsafe { ::core::hint::unreachable_unchecked() },
1913
1914 1 => {
1915 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
1916 slot.as_mut(),
1917 decoder,
1918 )?;
1919
1920 let name = unsafe {
1921 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
1922 };
1923
1924 if name.len() > 100 {
1925 return Err(::fidl_next::DecodeError::VectorTooLong {
1926 size: name.len() as u64,
1927 limit: 100,
1928 });
1929 }
1930
1931 Ok(())
1932 }
1933
1934 2 => {
1935 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
1936 slot.as_mut(),
1937 decoder,
1938 )?;
1939
1940 let source_path = unsafe {
1941 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
1942 };
1943
1944 if source_path.len() > 1024 {
1945 return Err(::fidl_next::DecodeError::VectorTooLong {
1946 size: source_path.len() as u64,
1947 limit: 1024,
1948 });
1949 }
1950
1951 Ok(())
1952 }
1953
1954 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1955 }
1956 })
1957 }
1958}
1959
1960impl WireResolver {
1961 pub fn name(&self) -> Option<&::fidl_next::WireString> {
1962 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1963 }
1964
1965 pub fn source_path(&self) -> Option<&::fidl_next::WireString> {
1966 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1967 }
1968}
1969
1970impl ::core::fmt::Debug for WireResolver {
1971 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
1972 f.debug_struct("Resolver")
1973 .field("name", &self.name())
1974 .field("source_path", &self.source_path())
1975 .finish()
1976 }
1977}
1978
1979#[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"]
1980#[derive(Clone, Debug)]
1981pub struct EventStream {
1982 pub name: Option<String>,
1983}
1984
1985impl EventStream {
1986 fn __max_ordinal(&self) -> usize {
1987 if self.name.is_some() {
1988 return 1;
1989 }
1990
1991 0
1992 }
1993}
1994
1995impl ::fidl_next::Encodable for EventStream {
1996 type Encoded = WireEventStream;
1997}
1998
1999unsafe impl<___E> ::fidl_next::Encode<___E> for EventStream
2000where
2001 ___E: ::fidl_next::Encoder + ?Sized,
2002{
2003 #[inline]
2004 fn encode(
2005 &mut self,
2006 encoder: &mut ___E,
2007 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2008 ) -> Result<(), ::fidl_next::EncodeError> {
2009 ::fidl_next::munge!(let WireEventStream { table } = out);
2010
2011 let max_ord = self.__max_ordinal();
2012
2013 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2014 ::fidl_next::ZeroPadding::zero_padding(&mut out);
2015
2016 let mut preallocated =
2017 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2018
2019 for i in 1..=max_ord {
2020 match i {
2021 1 => {
2022 if let Some(name) = &mut self.name {
2023 ::fidl_next::WireEnvelope::encode_value(
2024 name,
2025 preallocated.encoder,
2026 &mut out,
2027 )?;
2028 } else {
2029 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2030 }
2031 }
2032
2033 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2034 }
2035 unsafe {
2036 preallocated.write_next(out.assume_init_ref());
2037 }
2038 }
2039
2040 ::fidl_next::WireTable::encode_len(table, max_ord);
2041
2042 Ok(())
2043 }
2044}
2045
2046impl ::fidl_next::TakeFrom<WireEventStream> for EventStream {
2047 #[inline]
2048 fn take_from(from: &WireEventStream) -> Self {
2049 Self { name: from.name().map(::fidl_next::TakeFrom::take_from) }
2050 }
2051}
2052
2053#[repr(C)]
2055pub struct WireEventStream {
2056 table: ::fidl_next::WireTable,
2057}
2058
2059unsafe impl ::fidl_next::ZeroPadding for WireEventStream {
2060 #[inline]
2061 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2062 ::fidl_next::munge!(let Self { table } = out);
2063 ::fidl_next::WireTable::zero_padding(table);
2064 }
2065}
2066
2067unsafe impl<___D> ::fidl_next::Decode<___D> for WireEventStream
2068where
2069 ___D: ::fidl_next::Decoder + ?Sized,
2070{
2071 fn decode(
2072 slot: ::fidl_next::Slot<'_, Self>,
2073 decoder: &mut ___D,
2074 ) -> Result<(), ::fidl_next::DecodeError> {
2075 ::fidl_next::munge!(let Self { table } = slot);
2076
2077 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2078 match ordinal {
2079 0 => unsafe { ::core::hint::unreachable_unchecked() },
2080
2081 1 => {
2082 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
2083 slot.as_mut(),
2084 decoder,
2085 )?;
2086
2087 let name = unsafe {
2088 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
2089 };
2090
2091 if name.len() > 100 {
2092 return Err(::fidl_next::DecodeError::VectorTooLong {
2093 size: name.len() as u64,
2094 limit: 100,
2095 });
2096 }
2097
2098 Ok(())
2099 }
2100
2101 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2102 }
2103 })
2104 }
2105}
2106
2107impl WireEventStream {
2108 pub fn name(&self) -> Option<&::fidl_next::WireString> {
2109 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2110 }
2111}
2112
2113impl ::core::fmt::Debug for WireEventStream {
2114 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2115 f.debug_struct("EventStream").field("name", &self.name()).finish()
2116 }
2117}
2118
2119#[doc = " A single configuration value.\n"]
2120#[derive(Clone, Debug)]
2121pub enum ConfigSingleValue {
2122 Bool(bool),
2123
2124 Uint8(u8),
2125
2126 Uint16(u16),
2127
2128 Uint32(u32),
2129
2130 Uint64(u64),
2131
2132 Int8(i8),
2133
2134 Int16(i16),
2135
2136 Int32(i32),
2137
2138 Int64(i64),
2139
2140 String(String),
2141
2142 UnknownOrdinal_(u64),
2143}
2144
2145impl ::fidl_next::Encodable for ConfigSingleValue {
2146 type Encoded = WireConfigSingleValue;
2147}
2148
2149unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigSingleValue
2150where
2151 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2152
2153 ___E: ::fidl_next::Encoder,
2154{
2155 #[inline]
2156 fn encode(
2157 &mut self,
2158 encoder: &mut ___E,
2159 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2160 ) -> Result<(), ::fidl_next::EncodeError> {
2161 ::fidl_next::munge!(let WireConfigSingleValue { raw } = out);
2162
2163 match self {
2164 Self::Bool(value) => {
2165 ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw)?
2166 }
2167
2168 Self::Uint8(value) => {
2169 ::fidl_next::RawWireUnion::encode_as::<___E, u8>(value, 2, encoder, raw)?
2170 }
2171
2172 Self::Uint16(value) => {
2173 ::fidl_next::RawWireUnion::encode_as::<___E, u16>(value, 3, encoder, raw)?
2174 }
2175
2176 Self::Uint32(value) => {
2177 ::fidl_next::RawWireUnion::encode_as::<___E, u32>(value, 4, encoder, raw)?
2178 }
2179
2180 Self::Uint64(value) => {
2181 ::fidl_next::RawWireUnion::encode_as::<___E, u64>(value, 5, encoder, raw)?
2182 }
2183
2184 Self::Int8(value) => {
2185 ::fidl_next::RawWireUnion::encode_as::<___E, i8>(value, 6, encoder, raw)?
2186 }
2187
2188 Self::Int16(value) => {
2189 ::fidl_next::RawWireUnion::encode_as::<___E, i16>(value, 7, encoder, raw)?
2190 }
2191
2192 Self::Int32(value) => {
2193 ::fidl_next::RawWireUnion::encode_as::<___E, i32>(value, 8, encoder, raw)?
2194 }
2195
2196 Self::Int64(value) => {
2197 ::fidl_next::RawWireUnion::encode_as::<___E, i64>(value, 9, encoder, raw)?
2198 }
2199
2200 Self::String(value) => {
2201 ::fidl_next::RawWireUnion::encode_as::<___E, String>(value, 10, encoder, raw)?
2202 }
2203
2204 Self::UnknownOrdinal_(ordinal) => {
2205 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
2206 }
2207 }
2208
2209 Ok(())
2210 }
2211}
2212
2213impl ::fidl_next::EncodableOption for Box<ConfigSingleValue> {
2214 type EncodedOption = WireOptionalConfigSingleValue;
2215}
2216
2217unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ConfigSingleValue>
2218where
2219 ___E: ?Sized,
2220 ConfigSingleValue: ::fidl_next::Encode<___E>,
2221{
2222 #[inline]
2223 fn encode_option(
2224 this: Option<&mut Self>,
2225 encoder: &mut ___E,
2226 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2227 ) -> Result<(), ::fidl_next::EncodeError> {
2228 ::fidl_next::munge!(let WireOptionalConfigSingleValue { raw } = &mut *out);
2229
2230 if let Some(inner) = this {
2231 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2232 ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
2233 } else {
2234 ::fidl_next::RawWireUnion::encode_absent(raw);
2235 }
2236
2237 Ok(())
2238 }
2239}
2240
2241impl ::fidl_next::TakeFrom<WireConfigSingleValue> for ConfigSingleValue {
2242 #[inline]
2243 fn take_from(from: &WireConfigSingleValue) -> Self {
2244 match from.raw.ordinal() {
2245 1 => Self::Bool(::fidl_next::TakeFrom::take_from(unsafe {
2246 from.raw.get().deref_unchecked::<bool>()
2247 })),
2248
2249 2 => Self::Uint8(::fidl_next::TakeFrom::take_from(unsafe {
2250 from.raw.get().deref_unchecked::<u8>()
2251 })),
2252
2253 3 => Self::Uint16(::fidl_next::TakeFrom::take_from(unsafe {
2254 from.raw.get().deref_unchecked::<::fidl_next::WireU16>()
2255 })),
2256
2257 4 => Self::Uint32(::fidl_next::TakeFrom::take_from(unsafe {
2258 from.raw.get().deref_unchecked::<::fidl_next::WireU32>()
2259 })),
2260
2261 5 => Self::Uint64(::fidl_next::TakeFrom::take_from(unsafe {
2262 from.raw.get().deref_unchecked::<::fidl_next::WireU64>()
2263 })),
2264
2265 6 => Self::Int8(::fidl_next::TakeFrom::take_from(unsafe {
2266 from.raw.get().deref_unchecked::<i8>()
2267 })),
2268
2269 7 => Self::Int16(::fidl_next::TakeFrom::take_from(unsafe {
2270 from.raw.get().deref_unchecked::<::fidl_next::WireI16>()
2271 })),
2272
2273 8 => Self::Int32(::fidl_next::TakeFrom::take_from(unsafe {
2274 from.raw.get().deref_unchecked::<::fidl_next::WireI32>()
2275 })),
2276
2277 9 => Self::Int64(::fidl_next::TakeFrom::take_from(unsafe {
2278 from.raw.get().deref_unchecked::<::fidl_next::WireI64>()
2279 })),
2280
2281 10 => Self::String(::fidl_next::TakeFrom::take_from(unsafe {
2282 from.raw.get().deref_unchecked::<::fidl_next::WireString>()
2283 })),
2284
2285 _ => unsafe { ::core::hint::unreachable_unchecked() },
2286 }
2287 }
2288}
2289
2290impl ::fidl_next::TakeFrom<WireOptionalConfigSingleValue> for Option<Box<ConfigSingleValue>> {
2291 #[inline]
2292 fn take_from(from: &WireOptionalConfigSingleValue) -> Self {
2293 if let Some(inner) = from.as_ref() {
2294 Some(::fidl_next::TakeFrom::take_from(inner))
2295 } else {
2296 None
2297 }
2298 }
2299}
2300
2301#[repr(transparent)]
2303pub struct WireConfigSingleValue {
2304 raw: ::fidl_next::RawWireUnion,
2305}
2306
2307unsafe impl ::fidl_next::ZeroPadding for WireConfigSingleValue {
2308 #[inline]
2309 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2310 ::fidl_next::munge!(let Self { raw } = out);
2311 ::fidl_next::RawWireUnion::zero_padding(raw);
2312 }
2313}
2314
2315pub mod config_single_value {
2316 pub enum Ref<'union> {
2317 Bool(&'union bool),
2318
2319 Uint8(&'union u8),
2320
2321 Uint16(&'union ::fidl_next::WireU16),
2322
2323 Uint32(&'union ::fidl_next::WireU32),
2324
2325 Uint64(&'union ::fidl_next::WireU64),
2326
2327 Int8(&'union i8),
2328
2329 Int16(&'union ::fidl_next::WireI16),
2330
2331 Int32(&'union ::fidl_next::WireI32),
2332
2333 Int64(&'union ::fidl_next::WireI64),
2334
2335 String(&'union ::fidl_next::WireString),
2336
2337 UnknownOrdinal_(u64),
2338 }
2339}
2340
2341impl WireConfigSingleValue {
2342 pub fn as_ref(&self) -> crate::config_single_value::Ref<'_> {
2343 match self.raw.ordinal() {
2344 1 => crate::config_single_value::Ref::Bool(unsafe {
2345 self.raw.get().deref_unchecked::<bool>()
2346 }),
2347
2348 2 => crate::config_single_value::Ref::Uint8(unsafe {
2349 self.raw.get().deref_unchecked::<u8>()
2350 }),
2351
2352 3 => crate::config_single_value::Ref::Uint16(unsafe {
2353 self.raw.get().deref_unchecked::<::fidl_next::WireU16>()
2354 }),
2355
2356 4 => crate::config_single_value::Ref::Uint32(unsafe {
2357 self.raw.get().deref_unchecked::<::fidl_next::WireU32>()
2358 }),
2359
2360 5 => crate::config_single_value::Ref::Uint64(unsafe {
2361 self.raw.get().deref_unchecked::<::fidl_next::WireU64>()
2362 }),
2363
2364 6 => crate::config_single_value::Ref::Int8(unsafe {
2365 self.raw.get().deref_unchecked::<i8>()
2366 }),
2367
2368 7 => crate::config_single_value::Ref::Int16(unsafe {
2369 self.raw.get().deref_unchecked::<::fidl_next::WireI16>()
2370 }),
2371
2372 8 => crate::config_single_value::Ref::Int32(unsafe {
2373 self.raw.get().deref_unchecked::<::fidl_next::WireI32>()
2374 }),
2375
2376 9 => crate::config_single_value::Ref::Int64(unsafe {
2377 self.raw.get().deref_unchecked::<::fidl_next::WireI64>()
2378 }),
2379
2380 10 => crate::config_single_value::Ref::String(unsafe {
2381 self.raw.get().deref_unchecked::<::fidl_next::WireString>()
2382 }),
2383
2384 unknown => crate::config_single_value::Ref::UnknownOrdinal_(unknown),
2385 }
2386 }
2387}
2388
2389unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigSingleValue
2390where
2391 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2392
2393 ___D: ::fidl_next::Decoder,
2394{
2395 fn decode(
2396 mut slot: ::fidl_next::Slot<'_, Self>,
2397 decoder: &mut ___D,
2398 ) -> Result<(), ::fidl_next::DecodeError> {
2399 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
2400 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
2401 1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder)?,
2402
2403 2 => ::fidl_next::RawWireUnion::decode_as::<___D, u8>(raw, decoder)?,
2404
2405 3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU16>(raw, decoder)?,
2406
2407 4 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
2408
2409 5 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU64>(raw, decoder)?,
2410
2411 6 => ::fidl_next::RawWireUnion::decode_as::<___D, i8>(raw, decoder)?,
2412
2413 7 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI16>(raw, decoder)?,
2414
2415 8 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI32>(raw, decoder)?,
2416
2417 9 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI64>(raw, decoder)?,
2418
2419 10 => {
2420 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString>(raw, decoder)?
2421 }
2422
2423 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
2424 }
2425
2426 Ok(())
2427 }
2428}
2429
2430impl ::core::fmt::Debug for WireConfigSingleValue {
2431 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2432 match self.raw.ordinal() {
2433 1 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) },
2434 2 => unsafe { self.raw.get().deref_unchecked::<u8>().fmt(f) },
2435 3 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU16>().fmt(f) },
2436 4 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU32>().fmt(f) },
2437 5 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU64>().fmt(f) },
2438 6 => unsafe { self.raw.get().deref_unchecked::<i8>().fmt(f) },
2439 7 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI16>().fmt(f) },
2440 8 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI32>().fmt(f) },
2441 9 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI64>().fmt(f) },
2442 10 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString>().fmt(f) },
2443 _ => unsafe { ::core::hint::unreachable_unchecked() },
2444 }
2445 }
2446}
2447
2448#[repr(transparent)]
2449pub struct WireOptionalConfigSingleValue {
2450 raw: ::fidl_next::RawWireUnion,
2451}
2452
2453unsafe impl ::fidl_next::ZeroPadding for WireOptionalConfigSingleValue {
2454 #[inline]
2455 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2456 ::fidl_next::munge!(let Self { raw } = out);
2457 ::fidl_next::RawWireUnion::zero_padding(raw);
2458 }
2459}
2460
2461impl WireOptionalConfigSingleValue {
2462 pub fn is_some(&self) -> bool {
2463 self.raw.is_some()
2464 }
2465
2466 pub fn is_none(&self) -> bool {
2467 self.raw.is_none()
2468 }
2469
2470 pub fn as_ref(&self) -> Option<&WireConfigSingleValue> {
2471 if self.is_some() {
2472 Some(unsafe { &*(self as *const Self).cast() })
2473 } else {
2474 None
2475 }
2476 }
2477}
2478
2479unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConfigSingleValue
2480where
2481 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2482
2483 ___D: ::fidl_next::Decoder,
2484{
2485 fn decode(
2486 mut slot: ::fidl_next::Slot<'_, Self>,
2487 decoder: &mut ___D,
2488 ) -> Result<(), ::fidl_next::DecodeError> {
2489 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
2490 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
2491 1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder)?,
2492
2493 2 => ::fidl_next::RawWireUnion::decode_as::<___D, u8>(raw, decoder)?,
2494
2495 3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU16>(raw, decoder)?,
2496
2497 4 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(raw, decoder)?,
2498
2499 5 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU64>(raw, decoder)?,
2500
2501 6 => ::fidl_next::RawWireUnion::decode_as::<___D, i8>(raw, decoder)?,
2502
2503 7 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI16>(raw, decoder)?,
2504
2505 8 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI32>(raw, decoder)?,
2506
2507 9 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI64>(raw, decoder)?,
2508
2509 10 => {
2510 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString>(raw, decoder)?
2511 }
2512
2513 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
2514 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
2515 }
2516
2517 Ok(())
2518 }
2519}
2520
2521impl ::core::fmt::Debug for WireOptionalConfigSingleValue {
2522 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2523 self.as_ref().fmt(f)
2524 }
2525}
2526
2527#[doc = " A vector configuration value.\n"]
2528#[derive(Clone, Debug)]
2529pub enum ConfigVectorValue {
2530 BoolVector(Vec<bool>),
2531
2532 Uint8Vector(Vec<u8>),
2533
2534 Uint16Vector(Vec<u16>),
2535
2536 Uint32Vector(Vec<u32>),
2537
2538 Uint64Vector(Vec<u64>),
2539
2540 Int8Vector(Vec<i8>),
2541
2542 Int16Vector(Vec<i16>),
2543
2544 Int32Vector(Vec<i32>),
2545
2546 Int64Vector(Vec<i64>),
2547
2548 StringVector(Vec<String>),
2549
2550 UnknownOrdinal_(u64),
2551}
2552
2553impl ::fidl_next::Encodable for ConfigVectorValue {
2554 type Encoded = WireConfigVectorValue;
2555}
2556
2557unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigVectorValue
2558where
2559 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2560
2561 ___E: ::fidl_next::Encoder,
2562{
2563 #[inline]
2564 fn encode(
2565 &mut self,
2566 encoder: &mut ___E,
2567 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2568 ) -> Result<(), ::fidl_next::EncodeError> {
2569 ::fidl_next::munge!(let WireConfigVectorValue { raw } = out);
2570
2571 match self {
2572 Self::BoolVector(value) => {
2573 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<bool>>(value, 1, encoder, raw)?
2574 }
2575
2576 Self::Uint8Vector(value) => {
2577 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u8>>(value, 2, encoder, raw)?
2578 }
2579
2580 Self::Uint16Vector(value) => {
2581 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u16>>(value, 3, encoder, raw)?
2582 }
2583
2584 Self::Uint32Vector(value) => {
2585 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u32>>(value, 4, encoder, raw)?
2586 }
2587
2588 Self::Uint64Vector(value) => {
2589 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<u64>>(value, 5, encoder, raw)?
2590 }
2591
2592 Self::Int8Vector(value) => {
2593 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<i8>>(value, 6, encoder, raw)?
2594 }
2595
2596 Self::Int16Vector(value) => {
2597 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<i16>>(value, 7, encoder, raw)?
2598 }
2599
2600 Self::Int32Vector(value) => {
2601 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<i32>>(value, 8, encoder, raw)?
2602 }
2603
2604 Self::Int64Vector(value) => {
2605 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<i64>>(value, 9, encoder, raw)?
2606 }
2607
2608 Self::StringVector(value) => {
2609 ::fidl_next::RawWireUnion::encode_as::<___E, Vec<String>>(value, 10, encoder, raw)?
2610 }
2611
2612 Self::UnknownOrdinal_(ordinal) => {
2613 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
2614 }
2615 }
2616
2617 Ok(())
2618 }
2619}
2620
2621impl ::fidl_next::EncodableOption for Box<ConfigVectorValue> {
2622 type EncodedOption = WireOptionalConfigVectorValue;
2623}
2624
2625unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ConfigVectorValue>
2626where
2627 ___E: ?Sized,
2628 ConfigVectorValue: ::fidl_next::Encode<___E>,
2629{
2630 #[inline]
2631 fn encode_option(
2632 this: Option<&mut Self>,
2633 encoder: &mut ___E,
2634 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2635 ) -> Result<(), ::fidl_next::EncodeError> {
2636 ::fidl_next::munge!(let WireOptionalConfigVectorValue { raw } = &mut *out);
2637
2638 if let Some(inner) = this {
2639 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2640 ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
2641 } else {
2642 ::fidl_next::RawWireUnion::encode_absent(raw);
2643 }
2644
2645 Ok(())
2646 }
2647}
2648
2649impl ::fidl_next::TakeFrom<WireConfigVectorValue> for ConfigVectorValue {
2650 #[inline]
2651 fn take_from(from: &WireConfigVectorValue) -> Self {
2652 match from.raw.ordinal() {
2653 1 => Self::BoolVector(::fidl_next::TakeFrom::take_from(unsafe {
2654 from.raw.get().deref_unchecked::<::fidl_next::WireVector<bool>>()
2655 })),
2656
2657 2 => Self::Uint8Vector(::fidl_next::TakeFrom::take_from(unsafe {
2658 from.raw.get().deref_unchecked::<::fidl_next::WireVector<u8>>()
2659 })),
2660
2661 3 => Self::Uint16Vector(::fidl_next::TakeFrom::take_from(unsafe {
2662 from.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireU16>>()
2663 })),
2664
2665 4 => Self::Uint32Vector(::fidl_next::TakeFrom::take_from(unsafe {
2666 from.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireU32>>()
2667 })),
2668
2669 5 => Self::Uint64Vector(::fidl_next::TakeFrom::take_from(unsafe {
2670 from.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireU64>>()
2671 })),
2672
2673 6 => Self::Int8Vector(::fidl_next::TakeFrom::take_from(unsafe {
2674 from.raw.get().deref_unchecked::<::fidl_next::WireVector<i8>>()
2675 })),
2676
2677 7 => Self::Int16Vector(::fidl_next::TakeFrom::take_from(unsafe {
2678 from.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireI16>>()
2679 })),
2680
2681 8 => Self::Int32Vector(::fidl_next::TakeFrom::take_from(unsafe {
2682 from.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireI32>>()
2683 })),
2684
2685 9 => Self::Int64Vector(::fidl_next::TakeFrom::take_from(unsafe {
2686 from.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireI64>>()
2687 })),
2688
2689 10 => Self::StringVector(::fidl_next::TakeFrom::take_from(unsafe {
2690 from.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireString>>()
2691 })),
2692
2693 _ => unsafe { ::core::hint::unreachable_unchecked() },
2694 }
2695 }
2696}
2697
2698impl ::fidl_next::TakeFrom<WireOptionalConfigVectorValue> for Option<Box<ConfigVectorValue>> {
2699 #[inline]
2700 fn take_from(from: &WireOptionalConfigVectorValue) -> Self {
2701 if let Some(inner) = from.as_ref() {
2702 Some(::fidl_next::TakeFrom::take_from(inner))
2703 } else {
2704 None
2705 }
2706 }
2707}
2708
2709#[repr(transparent)]
2711pub struct WireConfigVectorValue {
2712 raw: ::fidl_next::RawWireUnion,
2713}
2714
2715unsafe impl ::fidl_next::ZeroPadding for WireConfigVectorValue {
2716 #[inline]
2717 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2718 ::fidl_next::munge!(let Self { raw } = out);
2719 ::fidl_next::RawWireUnion::zero_padding(raw);
2720 }
2721}
2722
2723pub mod config_vector_value {
2724 pub enum Ref<'union> {
2725 BoolVector(&'union ::fidl_next::WireVector<bool>),
2726
2727 Uint8Vector(&'union ::fidl_next::WireVector<u8>),
2728
2729 Uint16Vector(&'union ::fidl_next::WireVector<::fidl_next::WireU16>),
2730
2731 Uint32Vector(&'union ::fidl_next::WireVector<::fidl_next::WireU32>),
2732
2733 Uint64Vector(&'union ::fidl_next::WireVector<::fidl_next::WireU64>),
2734
2735 Int8Vector(&'union ::fidl_next::WireVector<i8>),
2736
2737 Int16Vector(&'union ::fidl_next::WireVector<::fidl_next::WireI16>),
2738
2739 Int32Vector(&'union ::fidl_next::WireVector<::fidl_next::WireI32>),
2740
2741 Int64Vector(&'union ::fidl_next::WireVector<::fidl_next::WireI64>),
2742
2743 StringVector(&'union ::fidl_next::WireVector<::fidl_next::WireString>),
2744
2745 UnknownOrdinal_(u64),
2746 }
2747}
2748
2749impl WireConfigVectorValue {
2750 pub fn as_ref(&self) -> crate::config_vector_value::Ref<'_> {
2751 match self.raw.ordinal() {
2752 1 => crate::config_vector_value::Ref::BoolVector(unsafe {
2753 self.raw.get().deref_unchecked::<::fidl_next::WireVector<bool>>()
2754 }),
2755
2756 2 => crate::config_vector_value::Ref::Uint8Vector(unsafe {
2757 self.raw.get().deref_unchecked::<::fidl_next::WireVector<u8>>()
2758 }),
2759
2760 3 => crate::config_vector_value::Ref::Uint16Vector(unsafe {
2761 self.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireU16>>()
2762 }),
2763
2764 4 => crate::config_vector_value::Ref::Uint32Vector(unsafe {
2765 self.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireU32>>()
2766 }),
2767
2768 5 => crate::config_vector_value::Ref::Uint64Vector(unsafe {
2769 self.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireU64>>()
2770 }),
2771
2772 6 => crate::config_vector_value::Ref::Int8Vector(unsafe {
2773 self.raw.get().deref_unchecked::<::fidl_next::WireVector<i8>>()
2774 }),
2775
2776 7 => crate::config_vector_value::Ref::Int16Vector(unsafe {
2777 self.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireI16>>()
2778 }),
2779
2780 8 => crate::config_vector_value::Ref::Int32Vector(unsafe {
2781 self.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireI32>>()
2782 }),
2783
2784 9 => crate::config_vector_value::Ref::Int64Vector(unsafe {
2785 self.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireI64>>()
2786 }),
2787
2788 10 => crate::config_vector_value::Ref::StringVector(unsafe {
2789 self.raw.get().deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireString>>()
2790 }),
2791
2792 unknown => crate::config_vector_value::Ref::UnknownOrdinal_(unknown),
2793 }
2794 }
2795}
2796
2797unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigVectorValue
2798where
2799 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2800
2801 ___D: ::fidl_next::Decoder,
2802{
2803 fn decode(
2804 mut slot: ::fidl_next::Slot<'_, Self>,
2805 decoder: &mut ___D,
2806 ) -> Result<(), ::fidl_next::DecodeError> {
2807 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
2808 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
2809 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<bool>>(
2810 raw, decoder,
2811 )?,
2812
2813 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<u8>>(
2814 raw, decoder,
2815 )?,
2816
2817 3 => ::fidl_next::RawWireUnion::decode_as::<
2818 ___D,
2819 ::fidl_next::WireVector<::fidl_next::WireU16>,
2820 >(raw, decoder)?,
2821
2822 4 => ::fidl_next::RawWireUnion::decode_as::<
2823 ___D,
2824 ::fidl_next::WireVector<::fidl_next::WireU32>,
2825 >(raw, decoder)?,
2826
2827 5 => ::fidl_next::RawWireUnion::decode_as::<
2828 ___D,
2829 ::fidl_next::WireVector<::fidl_next::WireU64>,
2830 >(raw, decoder)?,
2831
2832 6 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<i8>>(
2833 raw, decoder,
2834 )?,
2835
2836 7 => ::fidl_next::RawWireUnion::decode_as::<
2837 ___D,
2838 ::fidl_next::WireVector<::fidl_next::WireI16>,
2839 >(raw, decoder)?,
2840
2841 8 => ::fidl_next::RawWireUnion::decode_as::<
2842 ___D,
2843 ::fidl_next::WireVector<::fidl_next::WireI32>,
2844 >(raw, decoder)?,
2845
2846 9 => ::fidl_next::RawWireUnion::decode_as::<
2847 ___D,
2848 ::fidl_next::WireVector<::fidl_next::WireI64>,
2849 >(raw, decoder)?,
2850
2851 10 => ::fidl_next::RawWireUnion::decode_as::<
2852 ___D,
2853 ::fidl_next::WireVector<::fidl_next::WireString>,
2854 >(raw, decoder)?,
2855
2856 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
2857 }
2858
2859 Ok(())
2860 }
2861}
2862
2863impl ::core::fmt::Debug for WireConfigVectorValue {
2864 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2865 match self.raw.ordinal() {
2866 1 => unsafe {
2867 self.raw.get().deref_unchecked::<::fidl_next::WireVector<bool>>().fmt(f)
2868 },
2869 2 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireVector<u8>>().fmt(f) },
2870 3 => unsafe {
2871 self.raw
2872 .get()
2873 .deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireU16>>()
2874 .fmt(f)
2875 },
2876 4 => unsafe {
2877 self.raw
2878 .get()
2879 .deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireU32>>()
2880 .fmt(f)
2881 },
2882 5 => unsafe {
2883 self.raw
2884 .get()
2885 .deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireU64>>()
2886 .fmt(f)
2887 },
2888 6 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireVector<i8>>().fmt(f) },
2889 7 => unsafe {
2890 self.raw
2891 .get()
2892 .deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireI16>>()
2893 .fmt(f)
2894 },
2895 8 => unsafe {
2896 self.raw
2897 .get()
2898 .deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireI32>>()
2899 .fmt(f)
2900 },
2901 9 => unsafe {
2902 self.raw
2903 .get()
2904 .deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireI64>>()
2905 .fmt(f)
2906 },
2907 10 => unsafe {
2908 self.raw
2909 .get()
2910 .deref_unchecked::<::fidl_next::WireVector<::fidl_next::WireString>>()
2911 .fmt(f)
2912 },
2913 _ => unsafe { ::core::hint::unreachable_unchecked() },
2914 }
2915 }
2916}
2917
2918#[repr(transparent)]
2919pub struct WireOptionalConfigVectorValue {
2920 raw: ::fidl_next::RawWireUnion,
2921}
2922
2923unsafe impl ::fidl_next::ZeroPadding for WireOptionalConfigVectorValue {
2924 #[inline]
2925 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2926 ::fidl_next::munge!(let Self { raw } = out);
2927 ::fidl_next::RawWireUnion::zero_padding(raw);
2928 }
2929}
2930
2931impl WireOptionalConfigVectorValue {
2932 pub fn is_some(&self) -> bool {
2933 self.raw.is_some()
2934 }
2935
2936 pub fn is_none(&self) -> bool {
2937 self.raw.is_none()
2938 }
2939
2940 pub fn as_ref(&self) -> Option<&WireConfigVectorValue> {
2941 if self.is_some() {
2942 Some(unsafe { &*(self as *const Self).cast() })
2943 } else {
2944 None
2945 }
2946 }
2947}
2948
2949unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConfigVectorValue
2950where
2951 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2952
2953 ___D: ::fidl_next::Decoder,
2954{
2955 fn decode(
2956 mut slot: ::fidl_next::Slot<'_, Self>,
2957 decoder: &mut ___D,
2958 ) -> Result<(), ::fidl_next::DecodeError> {
2959 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
2960 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
2961 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<bool>>(
2962 raw, decoder,
2963 )?,
2964
2965 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<u8>>(
2966 raw, decoder,
2967 )?,
2968
2969 3 => ::fidl_next::RawWireUnion::decode_as::<
2970 ___D,
2971 ::fidl_next::WireVector<::fidl_next::WireU16>,
2972 >(raw, decoder)?,
2973
2974 4 => ::fidl_next::RawWireUnion::decode_as::<
2975 ___D,
2976 ::fidl_next::WireVector<::fidl_next::WireU32>,
2977 >(raw, decoder)?,
2978
2979 5 => ::fidl_next::RawWireUnion::decode_as::<
2980 ___D,
2981 ::fidl_next::WireVector<::fidl_next::WireU64>,
2982 >(raw, decoder)?,
2983
2984 6 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireVector<i8>>(
2985 raw, decoder,
2986 )?,
2987
2988 7 => ::fidl_next::RawWireUnion::decode_as::<
2989 ___D,
2990 ::fidl_next::WireVector<::fidl_next::WireI16>,
2991 >(raw, decoder)?,
2992
2993 8 => ::fidl_next::RawWireUnion::decode_as::<
2994 ___D,
2995 ::fidl_next::WireVector<::fidl_next::WireI32>,
2996 >(raw, decoder)?,
2997
2998 9 => ::fidl_next::RawWireUnion::decode_as::<
2999 ___D,
3000 ::fidl_next::WireVector<::fidl_next::WireI64>,
3001 >(raw, decoder)?,
3002
3003 10 => ::fidl_next::RawWireUnion::decode_as::<
3004 ___D,
3005 ::fidl_next::WireVector<::fidl_next::WireString>,
3006 >(raw, decoder)?,
3007
3008 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
3009 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
3010 }
3011
3012 Ok(())
3013 }
3014}
3015
3016impl ::core::fmt::Debug for WireOptionalConfigVectorValue {
3017 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3018 self.as_ref().fmt(f)
3019 }
3020}
3021
3022#[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"]
3023#[derive(Clone, Debug)]
3024pub enum ConfigValue {
3025 Single(crate::ConfigSingleValue),
3026
3027 Vector(crate::ConfigVectorValue),
3028
3029 UnknownOrdinal_(u64),
3030}
3031
3032impl ::fidl_next::Encodable for ConfigValue {
3033 type Encoded = WireConfigValue;
3034}
3035
3036unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigValue
3037where
3038 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3039
3040 ___E: ::fidl_next::Encoder,
3041{
3042 #[inline]
3043 fn encode(
3044 &mut self,
3045 encoder: &mut ___E,
3046 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3047 ) -> Result<(), ::fidl_next::EncodeError> {
3048 ::fidl_next::munge!(let WireConfigValue { raw } = out);
3049
3050 match self {
3051 Self::Single(value) => ::fidl_next::RawWireUnion::encode_as::<
3052 ___E,
3053 crate::ConfigSingleValue,
3054 >(value, 1, encoder, raw)?,
3055
3056 Self::Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
3057 ___E,
3058 crate::ConfigVectorValue,
3059 >(value, 2, encoder, raw)?,
3060
3061 Self::UnknownOrdinal_(ordinal) => {
3062 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
3063 }
3064 }
3065
3066 Ok(())
3067 }
3068}
3069
3070impl ::fidl_next::EncodableOption for Box<ConfigValue> {
3071 type EncodedOption = WireOptionalConfigValue;
3072}
3073
3074unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ConfigValue>
3075where
3076 ___E: ?Sized,
3077 ConfigValue: ::fidl_next::Encode<___E>,
3078{
3079 #[inline]
3080 fn encode_option(
3081 this: Option<&mut Self>,
3082 encoder: &mut ___E,
3083 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3084 ) -> Result<(), ::fidl_next::EncodeError> {
3085 ::fidl_next::munge!(let WireOptionalConfigValue { raw } = &mut *out);
3086
3087 if let Some(inner) = this {
3088 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
3089 ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
3090 } else {
3091 ::fidl_next::RawWireUnion::encode_absent(raw);
3092 }
3093
3094 Ok(())
3095 }
3096}
3097
3098impl ::fidl_next::TakeFrom<WireConfigValue> for ConfigValue {
3099 #[inline]
3100 fn take_from(from: &WireConfigValue) -> Self {
3101 match from.raw.ordinal() {
3102 1 => Self::Single(::fidl_next::TakeFrom::take_from(unsafe {
3103 from.raw.get().deref_unchecked::<crate::WireConfigSingleValue>()
3104 })),
3105
3106 2 => Self::Vector(::fidl_next::TakeFrom::take_from(unsafe {
3107 from.raw.get().deref_unchecked::<crate::WireConfigVectorValue>()
3108 })),
3109
3110 _ => unsafe { ::core::hint::unreachable_unchecked() },
3111 }
3112 }
3113}
3114
3115impl ::fidl_next::TakeFrom<WireOptionalConfigValue> for Option<Box<ConfigValue>> {
3116 #[inline]
3117 fn take_from(from: &WireOptionalConfigValue) -> Self {
3118 if let Some(inner) = from.as_ref() {
3119 Some(::fidl_next::TakeFrom::take_from(inner))
3120 } else {
3121 None
3122 }
3123 }
3124}
3125
3126#[repr(transparent)]
3128pub struct WireConfigValue {
3129 raw: ::fidl_next::RawWireUnion,
3130}
3131
3132unsafe impl ::fidl_next::ZeroPadding for WireConfigValue {
3133 #[inline]
3134 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3135 ::fidl_next::munge!(let Self { raw } = out);
3136 ::fidl_next::RawWireUnion::zero_padding(raw);
3137 }
3138}
3139
3140pub mod config_value {
3141 pub enum Ref<'union> {
3142 Single(&'union crate::WireConfigSingleValue),
3143
3144 Vector(&'union crate::WireConfigVectorValue),
3145
3146 UnknownOrdinal_(u64),
3147 }
3148}
3149
3150impl WireConfigValue {
3151 pub fn as_ref(&self) -> crate::config_value::Ref<'_> {
3152 match self.raw.ordinal() {
3153 1 => crate::config_value::Ref::Single(unsafe {
3154 self.raw.get().deref_unchecked::<crate::WireConfigSingleValue>()
3155 }),
3156
3157 2 => crate::config_value::Ref::Vector(unsafe {
3158 self.raw.get().deref_unchecked::<crate::WireConfigVectorValue>()
3159 }),
3160
3161 unknown => crate::config_value::Ref::UnknownOrdinal_(unknown),
3162 }
3163 }
3164}
3165
3166unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigValue
3167where
3168 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3169
3170 ___D: ::fidl_next::Decoder,
3171{
3172 fn decode(
3173 mut slot: ::fidl_next::Slot<'_, Self>,
3174 decoder: &mut ___D,
3175 ) -> Result<(), ::fidl_next::DecodeError> {
3176 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
3177 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
3178 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigSingleValue>(
3179 raw, decoder,
3180 )?,
3181
3182 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigVectorValue>(
3183 raw, decoder,
3184 )?,
3185
3186 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
3187 }
3188
3189 Ok(())
3190 }
3191}
3192
3193impl ::core::fmt::Debug for WireConfigValue {
3194 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3195 match self.raw.ordinal() {
3196 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireConfigSingleValue>().fmt(f) },
3197 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireConfigVectorValue>().fmt(f) },
3198 _ => unsafe { ::core::hint::unreachable_unchecked() },
3199 }
3200 }
3201}
3202
3203#[repr(transparent)]
3204pub struct WireOptionalConfigValue {
3205 raw: ::fidl_next::RawWireUnion,
3206}
3207
3208unsafe impl ::fidl_next::ZeroPadding for WireOptionalConfigValue {
3209 #[inline]
3210 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3211 ::fidl_next::munge!(let Self { raw } = out);
3212 ::fidl_next::RawWireUnion::zero_padding(raw);
3213 }
3214}
3215
3216impl WireOptionalConfigValue {
3217 pub fn is_some(&self) -> bool {
3218 self.raw.is_some()
3219 }
3220
3221 pub fn is_none(&self) -> bool {
3222 self.raw.is_none()
3223 }
3224
3225 pub fn as_ref(&self) -> Option<&WireConfigValue> {
3226 if self.is_some() {
3227 Some(unsafe { &*(self as *const Self).cast() })
3228 } else {
3229 None
3230 }
3231 }
3232}
3233
3234unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConfigValue
3235where
3236 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3237
3238 ___D: ::fidl_next::Decoder,
3239{
3240 fn decode(
3241 mut slot: ::fidl_next::Slot<'_, Self>,
3242 decoder: &mut ___D,
3243 ) -> Result<(), ::fidl_next::DecodeError> {
3244 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
3245 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
3246 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigSingleValue>(
3247 raw, decoder,
3248 )?,
3249
3250 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigVectorValue>(
3251 raw, decoder,
3252 )?,
3253
3254 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
3255 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
3256 }
3257
3258 Ok(())
3259 }
3260}
3261
3262impl ::core::fmt::Debug for WireOptionalConfigValue {
3263 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3264 self.as_ref().fmt(f)
3265 }
3266}
3267
3268#[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"]
3269#[derive(Clone, Debug)]
3270pub struct Configuration {
3271 pub name: Option<String>,
3272
3273 pub value: Option<crate::ConfigValue>,
3274}
3275
3276impl Configuration {
3277 fn __max_ordinal(&self) -> usize {
3278 if self.name.is_some() {
3279 return 1;
3280 }
3281
3282 if self.value.is_some() {
3283 return 2;
3284 }
3285
3286 0
3287 }
3288}
3289
3290impl ::fidl_next::Encodable for Configuration {
3291 type Encoded = WireConfiguration;
3292}
3293
3294unsafe impl<___E> ::fidl_next::Encode<___E> for Configuration
3295where
3296 ___E: ::fidl_next::Encoder + ?Sized,
3297{
3298 #[inline]
3299 fn encode(
3300 &mut self,
3301 encoder: &mut ___E,
3302 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3303 ) -> Result<(), ::fidl_next::EncodeError> {
3304 ::fidl_next::munge!(let WireConfiguration { table } = out);
3305
3306 let max_ord = self.__max_ordinal();
3307
3308 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3309 ::fidl_next::ZeroPadding::zero_padding(&mut out);
3310
3311 let mut preallocated =
3312 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3313
3314 for i in 1..=max_ord {
3315 match i {
3316 2 => {
3317 if let Some(value) = &mut self.value {
3318 ::fidl_next::WireEnvelope::encode_value(
3319 value,
3320 preallocated.encoder,
3321 &mut out,
3322 )?;
3323 } else {
3324 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3325 }
3326 }
3327
3328 1 => {
3329 if let Some(name) = &mut self.name {
3330 ::fidl_next::WireEnvelope::encode_value(
3331 name,
3332 preallocated.encoder,
3333 &mut out,
3334 )?;
3335 } else {
3336 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3337 }
3338 }
3339
3340 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3341 }
3342 unsafe {
3343 preallocated.write_next(out.assume_init_ref());
3344 }
3345 }
3346
3347 ::fidl_next::WireTable::encode_len(table, max_ord);
3348
3349 Ok(())
3350 }
3351}
3352
3353impl ::fidl_next::TakeFrom<WireConfiguration> for Configuration {
3354 #[inline]
3355 fn take_from(from: &WireConfiguration) -> Self {
3356 Self {
3357 name: from.name().map(::fidl_next::TakeFrom::take_from),
3358
3359 value: from.value().map(::fidl_next::TakeFrom::take_from),
3360 }
3361 }
3362}
3363
3364#[repr(C)]
3366pub struct WireConfiguration {
3367 table: ::fidl_next::WireTable,
3368}
3369
3370unsafe impl ::fidl_next::ZeroPadding for WireConfiguration {
3371 #[inline]
3372 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3373 ::fidl_next::munge!(let Self { table } = out);
3374 ::fidl_next::WireTable::zero_padding(table);
3375 }
3376}
3377
3378unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfiguration
3379where
3380 ___D: ::fidl_next::Decoder + ?Sized,
3381{
3382 fn decode(
3383 slot: ::fidl_next::Slot<'_, Self>,
3384 decoder: &mut ___D,
3385 ) -> Result<(), ::fidl_next::DecodeError> {
3386 ::fidl_next::munge!(let Self { table } = slot);
3387
3388 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3389 match ordinal {
3390 0 => unsafe { ::core::hint::unreachable_unchecked() },
3391
3392 1 => {
3393 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
3394 slot.as_mut(),
3395 decoder,
3396 )?;
3397
3398 let name = unsafe {
3399 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
3400 };
3401
3402 if name.len() > 100 {
3403 return Err(::fidl_next::DecodeError::VectorTooLong {
3404 size: name.len() as u64,
3405 limit: 100,
3406 });
3407 }
3408
3409 Ok(())
3410 }
3411
3412 2 => {
3413 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigValue>(
3414 slot.as_mut(),
3415 decoder,
3416 )?;
3417
3418 Ok(())
3419 }
3420
3421 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3422 }
3423 })
3424 }
3425}
3426
3427impl WireConfiguration {
3428 pub fn name(&self) -> Option<&::fidl_next::WireString> {
3429 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3430 }
3431
3432 pub fn value(&self) -> Option<&crate::WireConfigValue> {
3433 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3434 }
3435}
3436
3437impl ::core::fmt::Debug for WireConfiguration {
3438 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3439 f.debug_struct("Configuration")
3440 .field("name", &self.name())
3441 .field("value", &self.value())
3442 .finish()
3443 }
3444}
3445
3446#[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"]
3447pub type DictionaryPath = String;
3448
3449pub type WireDictionaryPath = ::fidl_next::WireString;
3451
3452#[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"]
3453#[derive(Clone, Copy, Debug, PartialEq, Eq)]
3454#[repr(u32)]
3455pub enum DeliveryType {
3456 Immediate = 0,
3457 OnReadable = 1,
3458 UnknownOrdinal_(u32),
3459}
3460
3461impl ::fidl_next::Encodable for DeliveryType {
3462 type Encoded = WireDeliveryType;
3463}
3464
3465unsafe impl<___E> ::fidl_next::Encode<___E> for DeliveryType
3466where
3467 ___E: ?Sized,
3468{
3469 #[inline]
3470 fn encode(
3471 &mut self,
3472 _: &mut ___E,
3473 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3474 ) -> Result<(), ::fidl_next::EncodeError> {
3475 ::fidl_next::munge!(let WireDeliveryType { value } = out);
3476 let _ = value.write(::fidl_next::WireU32::from(match *self {
3477 Self::Immediate => 0,
3478
3479 Self::OnReadable => 1,
3480
3481 Self::UnknownOrdinal_(value) => value,
3482 }));
3483
3484 Ok(())
3485 }
3486}
3487
3488impl ::core::convert::From<WireDeliveryType> for DeliveryType {
3489 fn from(wire: WireDeliveryType) -> Self {
3490 match u32::from(wire.value) {
3491 0 => Self::Immediate,
3492
3493 1 => Self::OnReadable,
3494
3495 value => Self::UnknownOrdinal_(value),
3496 }
3497 }
3498}
3499
3500impl ::fidl_next::TakeFrom<WireDeliveryType> for DeliveryType {
3501 #[inline]
3502 fn take_from(from: &WireDeliveryType) -> Self {
3503 Self::from(*from)
3504 }
3505}
3506
3507#[derive(Clone, Copy, Debug, PartialEq, Eq)]
3509#[repr(transparent)]
3510pub struct WireDeliveryType {
3511 value: ::fidl_next::WireU32,
3512}
3513
3514unsafe impl ::fidl_next::ZeroPadding for WireDeliveryType {
3515 #[inline]
3516 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3517 }
3519}
3520
3521impl WireDeliveryType {
3522 pub const IMMEDIATE: WireDeliveryType = WireDeliveryType { value: ::fidl_next::WireU32(0) };
3523
3524 pub const ON_READABLE: WireDeliveryType = WireDeliveryType { value: ::fidl_next::WireU32(1) };
3525}
3526
3527unsafe impl<___D> ::fidl_next::Decode<___D> for WireDeliveryType
3528where
3529 ___D: ?Sized,
3530{
3531 fn decode(
3532 slot: ::fidl_next::Slot<'_, Self>,
3533 _: &mut ___D,
3534 ) -> Result<(), ::fidl_next::DecodeError> {
3535 Ok(())
3536 }
3537}
3538
3539impl ::core::convert::From<DeliveryType> for WireDeliveryType {
3540 fn from(natural: DeliveryType) -> Self {
3541 match natural {
3542 DeliveryType::Immediate => WireDeliveryType::IMMEDIATE,
3543
3544 DeliveryType::OnReadable => WireDeliveryType::ON_READABLE,
3545
3546 DeliveryType::UnknownOrdinal_(value) => {
3547 WireDeliveryType { value: ::fidl_next::WireU32::from(value) }
3548 }
3549 }
3550 }
3551}
3552
3553#[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"]
3554#[derive(Clone, Debug)]
3555pub struct Protocol {
3556 pub name: Option<String>,
3557
3558 pub source_path: Option<String>,
3559
3560 pub delivery: Option<crate::DeliveryType>,
3561}
3562
3563impl Protocol {
3564 fn __max_ordinal(&self) -> usize {
3565 if self.name.is_some() {
3566 return 1;
3567 }
3568
3569 if self.source_path.is_some() {
3570 return 2;
3571 }
3572
3573 if self.delivery.is_some() {
3574 return 3;
3575 }
3576
3577 0
3578 }
3579}
3580
3581impl ::fidl_next::Encodable for Protocol {
3582 type Encoded = WireProtocol;
3583}
3584
3585unsafe impl<___E> ::fidl_next::Encode<___E> for Protocol
3586where
3587 ___E: ::fidl_next::Encoder + ?Sized,
3588{
3589 #[inline]
3590 fn encode(
3591 &mut self,
3592 encoder: &mut ___E,
3593 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3594 ) -> Result<(), ::fidl_next::EncodeError> {
3595 ::fidl_next::munge!(let WireProtocol { table } = out);
3596
3597 let max_ord = self.__max_ordinal();
3598
3599 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3600 ::fidl_next::ZeroPadding::zero_padding(&mut out);
3601
3602 let mut preallocated =
3603 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3604
3605 for i in 1..=max_ord {
3606 match i {
3607 3 => {
3608 if let Some(delivery) = &mut self.delivery {
3609 ::fidl_next::WireEnvelope::encode_value(
3610 delivery,
3611 preallocated.encoder,
3612 &mut out,
3613 )?;
3614 } else {
3615 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3616 }
3617 }
3618
3619 2 => {
3620 if let Some(source_path) = &mut self.source_path {
3621 ::fidl_next::WireEnvelope::encode_value(
3622 source_path,
3623 preallocated.encoder,
3624 &mut out,
3625 )?;
3626 } else {
3627 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3628 }
3629 }
3630
3631 1 => {
3632 if let Some(name) = &mut self.name {
3633 ::fidl_next::WireEnvelope::encode_value(
3634 name,
3635 preallocated.encoder,
3636 &mut out,
3637 )?;
3638 } else {
3639 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3640 }
3641 }
3642
3643 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3644 }
3645 unsafe {
3646 preallocated.write_next(out.assume_init_ref());
3647 }
3648 }
3649
3650 ::fidl_next::WireTable::encode_len(table, max_ord);
3651
3652 Ok(())
3653 }
3654}
3655
3656impl ::fidl_next::TakeFrom<WireProtocol> for Protocol {
3657 #[inline]
3658 fn take_from(from: &WireProtocol) -> Self {
3659 Self {
3660 name: from.name().map(::fidl_next::TakeFrom::take_from),
3661
3662 source_path: from.source_path().map(::fidl_next::TakeFrom::take_from),
3663
3664 delivery: from.delivery().map(::fidl_next::TakeFrom::take_from),
3665 }
3666 }
3667}
3668
3669#[repr(C)]
3671pub struct WireProtocol {
3672 table: ::fidl_next::WireTable,
3673}
3674
3675unsafe impl ::fidl_next::ZeroPadding for WireProtocol {
3676 #[inline]
3677 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3678 ::fidl_next::munge!(let Self { table } = out);
3679 ::fidl_next::WireTable::zero_padding(table);
3680 }
3681}
3682
3683unsafe impl<___D> ::fidl_next::Decode<___D> for WireProtocol
3684where
3685 ___D: ::fidl_next::Decoder + ?Sized,
3686{
3687 fn decode(
3688 slot: ::fidl_next::Slot<'_, Self>,
3689 decoder: &mut ___D,
3690 ) -> Result<(), ::fidl_next::DecodeError> {
3691 ::fidl_next::munge!(let Self { table } = slot);
3692
3693 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3694 match ordinal {
3695 0 => unsafe { ::core::hint::unreachable_unchecked() },
3696
3697 1 => {
3698 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
3699 slot.as_mut(),
3700 decoder,
3701 )?;
3702
3703 let name = unsafe {
3704 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
3705 };
3706
3707 if name.len() > 100 {
3708 return Err(::fidl_next::DecodeError::VectorTooLong {
3709 size: name.len() as u64,
3710 limit: 100,
3711 });
3712 }
3713
3714 Ok(())
3715 }
3716
3717 2 => {
3718 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
3719 slot.as_mut(),
3720 decoder,
3721 )?;
3722
3723 let source_path = unsafe {
3724 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
3725 };
3726
3727 if source_path.len() > 1024 {
3728 return Err(::fidl_next::DecodeError::VectorTooLong {
3729 size: source_path.len() as u64,
3730 limit: 1024,
3731 });
3732 }
3733
3734 Ok(())
3735 }
3736
3737 3 => {
3738 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDeliveryType>(
3739 slot.as_mut(),
3740 decoder,
3741 )?;
3742
3743 Ok(())
3744 }
3745
3746 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3747 }
3748 })
3749 }
3750}
3751
3752impl WireProtocol {
3753 pub fn name(&self) -> Option<&::fidl_next::WireString> {
3754 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3755 }
3756
3757 pub fn source_path(&self) -> Option<&::fidl_next::WireString> {
3758 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3759 }
3760
3761 pub fn delivery(&self) -> Option<&crate::WireDeliveryType> {
3762 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
3763 }
3764}
3765
3766impl ::core::fmt::Debug for WireProtocol {
3767 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3768 f.debug_struct("Protocol")
3769 .field("name", &self.name())
3770 .field("source_path", &self.source_path())
3771 .field("delivery", &self.delivery())
3772 .finish()
3773 }
3774}
3775
3776#[doc = " A reference to the environment.\n"]
3777#[derive(Clone, Debug)]
3778#[repr(C)]
3779pub struct EnvironmentRef {}
3780
3781impl ::fidl_next::Encodable for EnvironmentRef {
3782 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
3783 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
3784
3785 type Encoded = WireEnvironmentRef;
3786}
3787
3788unsafe impl<___E> ::fidl_next::Encode<___E> for EnvironmentRef
3789where
3790 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3791{
3792 #[inline]
3793 fn encode(
3794 &mut self,
3795 encoder: &mut ___E,
3796 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3797 ) -> Result<(), ::fidl_next::EncodeError> {
3798 ::fidl_next::munge! {
3799 let Self::Encoded {
3800
3801 } = out;
3802 }
3803
3804 Ok(())
3805 }
3806}
3807
3808impl ::fidl_next::EncodableOption for Box<EnvironmentRef> {
3809 type EncodedOption = ::fidl_next::WireBox<WireEnvironmentRef>;
3810}
3811
3812unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<EnvironmentRef>
3813where
3814 ___E: ::fidl_next::Encoder + ?Sized,
3815 EnvironmentRef: ::fidl_next::Encode<___E>,
3816{
3817 #[inline]
3818 fn encode_option(
3819 this: Option<&mut Self>,
3820 encoder: &mut ___E,
3821 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3822 ) -> Result<(), ::fidl_next::EncodeError> {
3823 if let Some(inner) = this {
3824 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3825 ::fidl_next::WireBox::encode_present(out);
3826 } else {
3827 ::fidl_next::WireBox::encode_absent(out);
3828 }
3829
3830 Ok(())
3831 }
3832}
3833
3834impl ::fidl_next::TakeFrom<WireEnvironmentRef> for EnvironmentRef {
3835 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> =
3836 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
3837
3838 #[inline]
3839 fn take_from(from: &WireEnvironmentRef) -> Self {
3840 Self {}
3841 }
3842}
3843
3844#[derive(Clone, Debug)]
3846#[repr(C)]
3847pub struct WireEnvironmentRef {}
3848
3849unsafe impl ::fidl_next::ZeroPadding for WireEnvironmentRef {
3850 #[inline]
3851 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
3852}
3853
3854unsafe impl<___D> ::fidl_next::Decode<___D> for WireEnvironmentRef
3855where
3856 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3857{
3858 fn decode(
3859 slot: ::fidl_next::Slot<'_, Self>,
3860 decoder: &mut ___D,
3861 ) -> Result<(), ::fidl_next::DecodeError> {
3862 ::fidl_next::munge! {
3863 let Self {
3864
3865 } = slot;
3866 }
3867
3868 Ok(())
3869 }
3870}
3871
3872#[doc = " A reference to a capability source or destination relative to this\n component.\n"]
3873#[derive(Clone, Debug)]
3874pub enum Ref {
3875 Parent(crate::ParentRef),
3876
3877 Self_(crate::SelfRef),
3878
3879 Child(crate::ChildRef),
3880
3881 Collection(crate::CollectionRef),
3882
3883 Framework(crate::FrameworkRef),
3884
3885 Capability(crate::CapabilityRef),
3886
3887 Debug(crate::DebugRef),
3888
3889 VoidType(crate::VoidRef),
3890
3891 Environment(crate::EnvironmentRef),
3892
3893 UnknownOrdinal_(u64),
3894}
3895
3896impl ::fidl_next::Encodable for Ref {
3897 type Encoded = WireRef;
3898}
3899
3900unsafe impl<___E> ::fidl_next::Encode<___E> for Ref
3901where
3902 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3903
3904 ___E: ::fidl_next::Encoder,
3905{
3906 #[inline]
3907 fn encode(
3908 &mut self,
3909 encoder: &mut ___E,
3910 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3911 ) -> Result<(), ::fidl_next::EncodeError> {
3912 ::fidl_next::munge!(let WireRef { raw } = out);
3913
3914 match self {
3915 Self::Parent(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::ParentRef>(
3916 value, 1, encoder, raw,
3917 )?,
3918
3919 Self::Self_(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::SelfRef>(
3920 value, 2, encoder, raw,
3921 )?,
3922
3923 Self::Child(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::ChildRef>(
3924 value, 3, encoder, raw,
3925 )?,
3926
3927 Self::Collection(value) => ::fidl_next::RawWireUnion::encode_as::<
3928 ___E,
3929 crate::CollectionRef,
3930 >(value, 4, encoder, raw)?,
3931
3932 Self::Framework(value) => ::fidl_next::RawWireUnion::encode_as::<
3933 ___E,
3934 crate::FrameworkRef,
3935 >(value, 5, encoder, raw)?,
3936
3937 Self::Capability(value) => ::fidl_next::RawWireUnion::encode_as::<
3938 ___E,
3939 crate::CapabilityRef,
3940 >(value, 6, encoder, raw)?,
3941
3942 Self::Debug(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::DebugRef>(
3943 value, 7, encoder, raw,
3944 )?,
3945
3946 Self::VoidType(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::VoidRef>(
3947 value, 8, encoder, raw,
3948 )?,
3949
3950 Self::Environment(value) => ::fidl_next::RawWireUnion::encode_as::<
3951 ___E,
3952 crate::EnvironmentRef,
3953 >(value, 9, encoder, raw)?,
3954
3955 Self::UnknownOrdinal_(ordinal) => {
3956 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
3957 }
3958 }
3959
3960 Ok(())
3961 }
3962}
3963
3964impl ::fidl_next::EncodableOption for Box<Ref> {
3965 type EncodedOption = WireOptionalRef;
3966}
3967
3968unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<Ref>
3969where
3970 ___E: ?Sized,
3971 Ref: ::fidl_next::Encode<___E>,
3972{
3973 #[inline]
3974 fn encode_option(
3975 this: Option<&mut Self>,
3976 encoder: &mut ___E,
3977 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3978 ) -> Result<(), ::fidl_next::EncodeError> {
3979 ::fidl_next::munge!(let WireOptionalRef { raw } = &mut *out);
3980
3981 if let Some(inner) = this {
3982 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
3983 ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
3984 } else {
3985 ::fidl_next::RawWireUnion::encode_absent(raw);
3986 }
3987
3988 Ok(())
3989 }
3990}
3991
3992impl ::fidl_next::TakeFrom<WireRef> for Ref {
3993 #[inline]
3994 fn take_from(from: &WireRef) -> Self {
3995 match from.raw.ordinal() {
3996 1 => Self::Parent(::fidl_next::TakeFrom::take_from(unsafe {
3997 from.raw.get().deref_unchecked::<crate::WireParentRef>()
3998 })),
3999
4000 2 => Self::Self_(::fidl_next::TakeFrom::take_from(unsafe {
4001 from.raw.get().deref_unchecked::<crate::WireSelfRef>()
4002 })),
4003
4004 3 => Self::Child(::fidl_next::TakeFrom::take_from(unsafe {
4005 from.raw.get().deref_unchecked::<crate::WireChildRef>()
4006 })),
4007
4008 4 => Self::Collection(::fidl_next::TakeFrom::take_from(unsafe {
4009 from.raw.get().deref_unchecked::<crate::WireCollectionRef>()
4010 })),
4011
4012 5 => Self::Framework(::fidl_next::TakeFrom::take_from(unsafe {
4013 from.raw.get().deref_unchecked::<crate::WireFrameworkRef>()
4014 })),
4015
4016 6 => Self::Capability(::fidl_next::TakeFrom::take_from(unsafe {
4017 from.raw.get().deref_unchecked::<crate::WireCapabilityRef>()
4018 })),
4019
4020 7 => Self::Debug(::fidl_next::TakeFrom::take_from(unsafe {
4021 from.raw.get().deref_unchecked::<crate::WireDebugRef>()
4022 })),
4023
4024 8 => Self::VoidType(::fidl_next::TakeFrom::take_from(unsafe {
4025 from.raw.get().deref_unchecked::<crate::WireVoidRef>()
4026 })),
4027
4028 9 => Self::Environment(::fidl_next::TakeFrom::take_from(unsafe {
4029 from.raw.get().deref_unchecked::<crate::WireEnvironmentRef>()
4030 })),
4031
4032 _ => unsafe { ::core::hint::unreachable_unchecked() },
4033 }
4034 }
4035}
4036
4037impl ::fidl_next::TakeFrom<WireOptionalRef> for Option<Box<Ref>> {
4038 #[inline]
4039 fn take_from(from: &WireOptionalRef) -> Self {
4040 if let Some(inner) = from.as_ref() {
4041 Some(::fidl_next::TakeFrom::take_from(inner))
4042 } else {
4043 None
4044 }
4045 }
4046}
4047
4048#[repr(transparent)]
4050pub struct WireRef {
4051 raw: ::fidl_next::RawWireUnion,
4052}
4053
4054unsafe impl ::fidl_next::ZeroPadding for WireRef {
4055 #[inline]
4056 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4057 ::fidl_next::munge!(let Self { raw } = out);
4058 ::fidl_next::RawWireUnion::zero_padding(raw);
4059 }
4060}
4061
4062pub mod ref_ {
4063 pub enum Ref<'union> {
4064 Parent(&'union crate::WireParentRef),
4065
4066 Self_(&'union crate::WireSelfRef),
4067
4068 Child(&'union crate::WireChildRef),
4069
4070 Collection(&'union crate::WireCollectionRef),
4071
4072 Framework(&'union crate::WireFrameworkRef),
4073
4074 Capability(&'union crate::WireCapabilityRef),
4075
4076 Debug(&'union crate::WireDebugRef),
4077
4078 VoidType(&'union crate::WireVoidRef),
4079
4080 Environment(&'union crate::WireEnvironmentRef),
4081
4082 UnknownOrdinal_(u64),
4083 }
4084}
4085
4086impl WireRef {
4087 pub fn as_ref(&self) -> crate::ref_::Ref<'_> {
4088 match self.raw.ordinal() {
4089 1 => crate::ref_::Ref::Parent(unsafe {
4090 self.raw.get().deref_unchecked::<crate::WireParentRef>()
4091 }),
4092
4093 2 => crate::ref_::Ref::Self_(unsafe {
4094 self.raw.get().deref_unchecked::<crate::WireSelfRef>()
4095 }),
4096
4097 3 => crate::ref_::Ref::Child(unsafe {
4098 self.raw.get().deref_unchecked::<crate::WireChildRef>()
4099 }),
4100
4101 4 => crate::ref_::Ref::Collection(unsafe {
4102 self.raw.get().deref_unchecked::<crate::WireCollectionRef>()
4103 }),
4104
4105 5 => crate::ref_::Ref::Framework(unsafe {
4106 self.raw.get().deref_unchecked::<crate::WireFrameworkRef>()
4107 }),
4108
4109 6 => crate::ref_::Ref::Capability(unsafe {
4110 self.raw.get().deref_unchecked::<crate::WireCapabilityRef>()
4111 }),
4112
4113 7 => crate::ref_::Ref::Debug(unsafe {
4114 self.raw.get().deref_unchecked::<crate::WireDebugRef>()
4115 }),
4116
4117 8 => crate::ref_::Ref::VoidType(unsafe {
4118 self.raw.get().deref_unchecked::<crate::WireVoidRef>()
4119 }),
4120
4121 9 => crate::ref_::Ref::Environment(unsafe {
4122 self.raw.get().deref_unchecked::<crate::WireEnvironmentRef>()
4123 }),
4124
4125 unknown => crate::ref_::Ref::UnknownOrdinal_(unknown),
4126 }
4127 }
4128}
4129
4130unsafe impl<___D> ::fidl_next::Decode<___D> for WireRef
4131where
4132 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4133
4134 ___D: ::fidl_next::Decoder,
4135{
4136 fn decode(
4137 mut slot: ::fidl_next::Slot<'_, Self>,
4138 decoder: &mut ___D,
4139 ) -> Result<(), ::fidl_next::DecodeError> {
4140 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
4141 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
4142 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireParentRef>(raw, decoder)?,
4143
4144 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSelfRef>(raw, decoder)?,
4145
4146 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireChildRef>(raw, decoder)?,
4147
4148 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireCollectionRef>(
4149 raw, decoder,
4150 )?,
4151
4152 5 => {
4153 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFrameworkRef>(raw, decoder)?
4154 }
4155
4156 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireCapabilityRef>(
4157 raw, decoder,
4158 )?,
4159
4160 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDebugRef>(raw, decoder)?,
4161
4162 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireVoidRef>(raw, decoder)?,
4163
4164 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEnvironmentRef>(
4165 raw, decoder,
4166 )?,
4167
4168 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
4169 }
4170
4171 Ok(())
4172 }
4173}
4174
4175impl ::core::fmt::Debug for WireRef {
4176 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4177 match self.raw.ordinal() {
4178 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireParentRef>().fmt(f) },
4179 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireSelfRef>().fmt(f) },
4180 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireChildRef>().fmt(f) },
4181 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireCollectionRef>().fmt(f) },
4182 5 => unsafe { self.raw.get().deref_unchecked::<crate::WireFrameworkRef>().fmt(f) },
4183 6 => unsafe { self.raw.get().deref_unchecked::<crate::WireCapabilityRef>().fmt(f) },
4184 7 => unsafe { self.raw.get().deref_unchecked::<crate::WireDebugRef>().fmt(f) },
4185 8 => unsafe { self.raw.get().deref_unchecked::<crate::WireVoidRef>().fmt(f) },
4186 9 => unsafe { self.raw.get().deref_unchecked::<crate::WireEnvironmentRef>().fmt(f) },
4187 _ => unsafe { ::core::hint::unreachable_unchecked() },
4188 }
4189 }
4190}
4191
4192#[repr(transparent)]
4193pub struct WireOptionalRef {
4194 raw: ::fidl_next::RawWireUnion,
4195}
4196
4197unsafe impl ::fidl_next::ZeroPadding for WireOptionalRef {
4198 #[inline]
4199 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4200 ::fidl_next::munge!(let Self { raw } = out);
4201 ::fidl_next::RawWireUnion::zero_padding(raw);
4202 }
4203}
4204
4205impl WireOptionalRef {
4206 pub fn is_some(&self) -> bool {
4207 self.raw.is_some()
4208 }
4209
4210 pub fn is_none(&self) -> bool {
4211 self.raw.is_none()
4212 }
4213
4214 pub fn as_ref(&self) -> Option<&WireRef> {
4215 if self.is_some() {
4216 Some(unsafe { &*(self as *const Self).cast() })
4217 } else {
4218 None
4219 }
4220 }
4221}
4222
4223unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalRef
4224where
4225 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
4226
4227 ___D: ::fidl_next::Decoder,
4228{
4229 fn decode(
4230 mut slot: ::fidl_next::Slot<'_, Self>,
4231 decoder: &mut ___D,
4232 ) -> Result<(), ::fidl_next::DecodeError> {
4233 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
4234 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
4235 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireParentRef>(raw, decoder)?,
4236
4237 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireSelfRef>(raw, decoder)?,
4238
4239 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireChildRef>(raw, decoder)?,
4240
4241 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireCollectionRef>(
4242 raw, decoder,
4243 )?,
4244
4245 5 => {
4246 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireFrameworkRef>(raw, decoder)?
4247 }
4248
4249 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireCapabilityRef>(
4250 raw, decoder,
4251 )?,
4252
4253 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDebugRef>(raw, decoder)?,
4254
4255 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireVoidRef>(raw, decoder)?,
4256
4257 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEnvironmentRef>(
4258 raw, decoder,
4259 )?,
4260
4261 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
4262 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
4263 }
4264
4265 Ok(())
4266 }
4267}
4268
4269impl ::core::fmt::Debug for WireOptionalRef {
4270 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
4271 self.as_ref().fmt(f)
4272 }
4273}
4274
4275#[doc = " Declares a storage capability backed by a directory from which data, cache,\n or meta storage can be offered.\n"]
4276#[derive(Clone, Debug)]
4277pub struct Storage {
4278 pub name: Option<String>,
4279
4280 pub source: Option<crate::Ref>,
4281
4282 pub backing_dir: Option<String>,
4283
4284 pub subdir: Option<String>,
4285
4286 pub storage_id: Option<crate::StorageId>,
4287}
4288
4289impl Storage {
4290 fn __max_ordinal(&self) -> usize {
4291 if self.name.is_some() {
4292 return 1;
4293 }
4294
4295 if self.source.is_some() {
4296 return 2;
4297 }
4298
4299 if self.backing_dir.is_some() {
4300 return 3;
4301 }
4302
4303 if self.subdir.is_some() {
4304 return 4;
4305 }
4306
4307 if self.storage_id.is_some() {
4308 return 5;
4309 }
4310
4311 0
4312 }
4313}
4314
4315impl ::fidl_next::Encodable for Storage {
4316 type Encoded = WireStorage;
4317}
4318
4319unsafe impl<___E> ::fidl_next::Encode<___E> for Storage
4320where
4321 ___E: ::fidl_next::Encoder + ?Sized,
4322{
4323 #[inline]
4324 fn encode(
4325 &mut self,
4326 encoder: &mut ___E,
4327 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4328 ) -> Result<(), ::fidl_next::EncodeError> {
4329 ::fidl_next::munge!(let WireStorage { table } = out);
4330
4331 let max_ord = self.__max_ordinal();
4332
4333 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4334 ::fidl_next::ZeroPadding::zero_padding(&mut out);
4335
4336 let mut preallocated =
4337 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4338
4339 for i in 1..=max_ord {
4340 match i {
4341 5 => {
4342 if let Some(storage_id) = &mut self.storage_id {
4343 ::fidl_next::WireEnvelope::encode_value(
4344 storage_id,
4345 preallocated.encoder,
4346 &mut out,
4347 )?;
4348 } else {
4349 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4350 }
4351 }
4352
4353 4 => {
4354 if let Some(subdir) = &mut self.subdir {
4355 ::fidl_next::WireEnvelope::encode_value(
4356 subdir,
4357 preallocated.encoder,
4358 &mut out,
4359 )?;
4360 } else {
4361 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4362 }
4363 }
4364
4365 3 => {
4366 if let Some(backing_dir) = &mut self.backing_dir {
4367 ::fidl_next::WireEnvelope::encode_value(
4368 backing_dir,
4369 preallocated.encoder,
4370 &mut out,
4371 )?;
4372 } else {
4373 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4374 }
4375 }
4376
4377 2 => {
4378 if let Some(source) = &mut self.source {
4379 ::fidl_next::WireEnvelope::encode_value(
4380 source,
4381 preallocated.encoder,
4382 &mut out,
4383 )?;
4384 } else {
4385 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4386 }
4387 }
4388
4389 1 => {
4390 if let Some(name) = &mut self.name {
4391 ::fidl_next::WireEnvelope::encode_value(
4392 name,
4393 preallocated.encoder,
4394 &mut out,
4395 )?;
4396 } else {
4397 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4398 }
4399 }
4400
4401 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4402 }
4403 unsafe {
4404 preallocated.write_next(out.assume_init_ref());
4405 }
4406 }
4407
4408 ::fidl_next::WireTable::encode_len(table, max_ord);
4409
4410 Ok(())
4411 }
4412}
4413
4414impl ::fidl_next::TakeFrom<WireStorage> for Storage {
4415 #[inline]
4416 fn take_from(from: &WireStorage) -> Self {
4417 Self {
4418 name: from.name().map(::fidl_next::TakeFrom::take_from),
4419
4420 source: from.source().map(::fidl_next::TakeFrom::take_from),
4421
4422 backing_dir: from.backing_dir().map(::fidl_next::TakeFrom::take_from),
4423
4424 subdir: from.subdir().map(::fidl_next::TakeFrom::take_from),
4425
4426 storage_id: from.storage_id().map(::fidl_next::TakeFrom::take_from),
4427 }
4428 }
4429}
4430
4431#[repr(C)]
4433pub struct WireStorage {
4434 table: ::fidl_next::WireTable,
4435}
4436
4437unsafe impl ::fidl_next::ZeroPadding for WireStorage {
4438 #[inline]
4439 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4440 ::fidl_next::munge!(let Self { table } = out);
4441 ::fidl_next::WireTable::zero_padding(table);
4442 }
4443}
4444
4445unsafe impl<___D> ::fidl_next::Decode<___D> for WireStorage
4446where
4447 ___D: ::fidl_next::Decoder + ?Sized,
4448{
4449 fn decode(
4450 slot: ::fidl_next::Slot<'_, Self>,
4451 decoder: &mut ___D,
4452 ) -> Result<(), ::fidl_next::DecodeError> {
4453 ::fidl_next::munge!(let Self { table } = slot);
4454
4455 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4456 match ordinal {
4457 0 => unsafe { ::core::hint::unreachable_unchecked() },
4458
4459 1 => {
4460 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
4461 slot.as_mut(),
4462 decoder,
4463 )?;
4464
4465 let name = unsafe {
4466 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
4467 };
4468
4469 if name.len() > 100 {
4470 return Err(::fidl_next::DecodeError::VectorTooLong {
4471 size: name.len() as u64,
4472 limit: 100,
4473 });
4474 }
4475
4476 Ok(())
4477 }
4478
4479 2 => {
4480 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
4481 slot.as_mut(),
4482 decoder,
4483 )?;
4484
4485 Ok(())
4486 }
4487
4488 3 => {
4489 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
4490 slot.as_mut(),
4491 decoder,
4492 )?;
4493
4494 let backing_dir = unsafe {
4495 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
4496 };
4497
4498 if backing_dir.len() > 100 {
4499 return Err(::fidl_next::DecodeError::VectorTooLong {
4500 size: backing_dir.len() as u64,
4501 limit: 100,
4502 });
4503 }
4504
4505 Ok(())
4506 }
4507
4508 4 => {
4509 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
4510 slot.as_mut(),
4511 decoder,
4512 )?;
4513
4514 let subdir = unsafe {
4515 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
4516 };
4517
4518 if subdir.len() > 1024 {
4519 return Err(::fidl_next::DecodeError::VectorTooLong {
4520 size: subdir.len() as u64,
4521 limit: 1024,
4522 });
4523 }
4524
4525 Ok(())
4526 }
4527
4528 5 => {
4529 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireStorageId>(
4530 slot.as_mut(),
4531 decoder,
4532 )?;
4533
4534 Ok(())
4535 }
4536
4537 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
4538 }
4539 })
4540 }
4541}
4542
4543impl WireStorage {
4544 pub fn name(&self) -> Option<&::fidl_next::WireString> {
4545 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4546 }
4547
4548 pub fn source(&self) -> Option<&crate::WireRef> {
4549 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4550 }
4551
4552 pub fn backing_dir(&self) -> Option<&::fidl_next::WireString> {
4553 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
4554 }
4555
4556 pub fn subdir(&self) -> Option<&::fidl_next::WireString> {
4557 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
4558 }
4559
4560 pub fn storage_id(&self) -> Option<&crate::WireStorageId> {
4561 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
4562 }
4563}
4564
4565impl ::core::fmt::Debug for WireStorage {
4566 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
4567 f.debug_struct("Storage")
4568 .field("name", &self.name())
4569 .field("source", &self.source())
4570 .field("backing_dir", &self.backing_dir())
4571 .field("subdir", &self.subdir())
4572 .field("storage_id", &self.storage_id())
4573 .finish()
4574 }
4575}
4576
4577#[doc = " Declares a dictionary capability.\n"]
4578#[derive(Clone, Debug)]
4579pub struct Dictionary {
4580 pub name: Option<String>,
4581
4582 pub source: Option<crate::Ref>,
4583
4584 pub source_dictionary: Option<String>,
4585
4586 pub source_path: Option<String>,
4587}
4588
4589impl Dictionary {
4590 fn __max_ordinal(&self) -> usize {
4591 if self.name.is_some() {
4592 return 1;
4593 }
4594
4595 if self.source.is_some() {
4596 return 2;
4597 }
4598
4599 if self.source_dictionary.is_some() {
4600 return 3;
4601 }
4602
4603 if self.source_path.is_some() {
4604 return 4;
4605 }
4606
4607 0
4608 }
4609}
4610
4611impl ::fidl_next::Encodable for Dictionary {
4612 type Encoded = WireDictionary;
4613}
4614
4615unsafe impl<___E> ::fidl_next::Encode<___E> for Dictionary
4616where
4617 ___E: ::fidl_next::Encoder + ?Sized,
4618{
4619 #[inline]
4620 fn encode(
4621 &mut self,
4622 encoder: &mut ___E,
4623 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4624 ) -> Result<(), ::fidl_next::EncodeError> {
4625 ::fidl_next::munge!(let WireDictionary { table } = out);
4626
4627 let max_ord = self.__max_ordinal();
4628
4629 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4630 ::fidl_next::ZeroPadding::zero_padding(&mut out);
4631
4632 let mut preallocated =
4633 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4634
4635 for i in 1..=max_ord {
4636 match i {
4637 4 => {
4638 if let Some(source_path) = &mut self.source_path {
4639 ::fidl_next::WireEnvelope::encode_value(
4640 source_path,
4641 preallocated.encoder,
4642 &mut out,
4643 )?;
4644 } else {
4645 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4646 }
4647 }
4648
4649 3 => {
4650 if let Some(source_dictionary) = &mut self.source_dictionary {
4651 ::fidl_next::WireEnvelope::encode_value(
4652 source_dictionary,
4653 preallocated.encoder,
4654 &mut out,
4655 )?;
4656 } else {
4657 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4658 }
4659 }
4660
4661 2 => {
4662 if let Some(source) = &mut self.source {
4663 ::fidl_next::WireEnvelope::encode_value(
4664 source,
4665 preallocated.encoder,
4666 &mut out,
4667 )?;
4668 } else {
4669 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4670 }
4671 }
4672
4673 1 => {
4674 if let Some(name) = &mut self.name {
4675 ::fidl_next::WireEnvelope::encode_value(
4676 name,
4677 preallocated.encoder,
4678 &mut out,
4679 )?;
4680 } else {
4681 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4682 }
4683 }
4684
4685 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4686 }
4687 unsafe {
4688 preallocated.write_next(out.assume_init_ref());
4689 }
4690 }
4691
4692 ::fidl_next::WireTable::encode_len(table, max_ord);
4693
4694 Ok(())
4695 }
4696}
4697
4698impl ::fidl_next::TakeFrom<WireDictionary> for Dictionary {
4699 #[inline]
4700 fn take_from(from: &WireDictionary) -> Self {
4701 Self {
4702 name: from.name().map(::fidl_next::TakeFrom::take_from),
4703
4704 source: from.source().map(::fidl_next::TakeFrom::take_from),
4705
4706 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
4707
4708 source_path: from.source_path().map(::fidl_next::TakeFrom::take_from),
4709 }
4710 }
4711}
4712
4713#[repr(C)]
4715pub struct WireDictionary {
4716 table: ::fidl_next::WireTable,
4717}
4718
4719unsafe impl ::fidl_next::ZeroPadding for WireDictionary {
4720 #[inline]
4721 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4722 ::fidl_next::munge!(let Self { table } = out);
4723 ::fidl_next::WireTable::zero_padding(table);
4724 }
4725}
4726
4727unsafe impl<___D> ::fidl_next::Decode<___D> for WireDictionary
4728where
4729 ___D: ::fidl_next::Decoder + ?Sized,
4730{
4731 fn decode(
4732 slot: ::fidl_next::Slot<'_, Self>,
4733 decoder: &mut ___D,
4734 ) -> Result<(), ::fidl_next::DecodeError> {
4735 ::fidl_next::munge!(let Self { table } = slot);
4736
4737 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4738 match ordinal {
4739 0 => unsafe { ::core::hint::unreachable_unchecked() },
4740
4741 1 => {
4742 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
4743 slot.as_mut(),
4744 decoder,
4745 )?;
4746
4747 let name = unsafe {
4748 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
4749 };
4750
4751 if name.len() > 100 {
4752 return Err(::fidl_next::DecodeError::VectorTooLong {
4753 size: name.len() as u64,
4754 limit: 100,
4755 });
4756 }
4757
4758 Ok(())
4759 }
4760
4761 2 => {
4762 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
4763 slot.as_mut(),
4764 decoder,
4765 )?;
4766
4767 Ok(())
4768 }
4769
4770 3 => {
4771 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
4772 slot.as_mut(),
4773 decoder,
4774 )?;
4775
4776 let source_dictionary = unsafe {
4777 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
4778 };
4779
4780 if source_dictionary.len() > 1024 {
4781 return Err(::fidl_next::DecodeError::VectorTooLong {
4782 size: source_dictionary.len() as u64,
4783 limit: 1024,
4784 });
4785 }
4786
4787 Ok(())
4788 }
4789
4790 4 => {
4791 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
4792 slot.as_mut(),
4793 decoder,
4794 )?;
4795
4796 let source_path = unsafe {
4797 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
4798 };
4799
4800 if source_path.len() > 1024 {
4801 return Err(::fidl_next::DecodeError::VectorTooLong {
4802 size: source_path.len() as u64,
4803 limit: 1024,
4804 });
4805 }
4806
4807 Ok(())
4808 }
4809
4810 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
4811 }
4812 })
4813 }
4814}
4815
4816impl WireDictionary {
4817 pub fn name(&self) -> Option<&::fidl_next::WireString> {
4818 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4819 }
4820
4821 pub fn source(&self) -> Option<&crate::WireRef> {
4822 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4823 }
4824
4825 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
4826 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
4827 }
4828
4829 pub fn source_path(&self) -> Option<&::fidl_next::WireString> {
4830 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
4831 }
4832}
4833
4834impl ::core::fmt::Debug for WireDictionary {
4835 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
4836 f.debug_struct("Dictionary")
4837 .field("name", &self.name())
4838 .field("source", &self.source())
4839 .field("source_dictionary", &self.source_dictionary())
4840 .field("source_path", &self.source_path())
4841 .finish()
4842 }
4843}
4844
4845#[doc = " Declares a capability defined by this component.\n"]
4846#[derive(Clone, Debug)]
4847pub enum Capability {
4848 Service(crate::Service),
4849
4850 Protocol(crate::Protocol),
4851
4852 Directory(crate::Directory),
4853
4854 Storage(crate::Storage),
4855
4856 Runner(crate::Runner),
4857
4858 Resolver(crate::Resolver),
4859
4860 EventStream(crate::EventStream),
4861
4862 Dictionary(crate::Dictionary),
4863
4864 Config(crate::Configuration),
4865
4866 UnknownOrdinal_(u64),
4867}
4868
4869impl ::fidl_next::Encodable for Capability {
4870 type Encoded = WireCapability;
4871}
4872
4873unsafe impl<___E> ::fidl_next::Encode<___E> for Capability
4874where
4875 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4876
4877 ___E: ::fidl_next::Encoder,
4878{
4879 #[inline]
4880 fn encode(
4881 &mut self,
4882 encoder: &mut ___E,
4883 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4884 ) -> Result<(), ::fidl_next::EncodeError> {
4885 ::fidl_next::munge!(let WireCapability { raw } = out);
4886
4887 match self {
4888 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Service>(
4889 value, 1, encoder, raw,
4890 )?,
4891
4892 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Protocol>(
4893 value, 2, encoder, raw,
4894 )?,
4895
4896 Self::Directory(value) => {
4897 ::fidl_next::RawWireUnion::encode_as::<___E, crate::Directory>(
4898 value, 3, encoder, raw,
4899 )?
4900 }
4901
4902 Self::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Storage>(
4903 value, 4, encoder, raw,
4904 )?,
4905
4906 Self::Runner(value) => {
4907 ::fidl_next::RawWireUnion::encode_as::<___E, crate::Runner>(value, 5, encoder, raw)?
4908 }
4909
4910 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::Resolver>(
4911 value, 6, encoder, raw,
4912 )?,
4913
4914 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
4915 ___E,
4916 crate::EventStream,
4917 >(value, 8, encoder, raw)?,
4918
4919 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
4920 ___E,
4921 crate::Dictionary,
4922 >(value, 9, encoder, raw)?,
4923
4924 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
4925 ___E,
4926 crate::Configuration,
4927 >(value, 10, encoder, raw)?,
4928
4929 Self::UnknownOrdinal_(ordinal) => {
4930 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
4931 }
4932 }
4933
4934 Ok(())
4935 }
4936}
4937
4938impl ::fidl_next::EncodableOption for Box<Capability> {
4939 type EncodedOption = WireOptionalCapability;
4940}
4941
4942unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<Capability>
4943where
4944 ___E: ?Sized,
4945 Capability: ::fidl_next::Encode<___E>,
4946{
4947 #[inline]
4948 fn encode_option(
4949 this: Option<&mut Self>,
4950 encoder: &mut ___E,
4951 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4952 ) -> Result<(), ::fidl_next::EncodeError> {
4953 ::fidl_next::munge!(let WireOptionalCapability { raw } = &mut *out);
4954
4955 if let Some(inner) = this {
4956 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4957 ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
4958 } else {
4959 ::fidl_next::RawWireUnion::encode_absent(raw);
4960 }
4961
4962 Ok(())
4963 }
4964}
4965
4966impl ::fidl_next::TakeFrom<WireCapability> for Capability {
4967 #[inline]
4968 fn take_from(from: &WireCapability) -> Self {
4969 match from.raw.ordinal() {
4970 1 => Self::Service(::fidl_next::TakeFrom::take_from(unsafe {
4971 from.raw.get().deref_unchecked::<crate::WireService>()
4972 })),
4973
4974 2 => Self::Protocol(::fidl_next::TakeFrom::take_from(unsafe {
4975 from.raw.get().deref_unchecked::<crate::WireProtocol>()
4976 })),
4977
4978 3 => Self::Directory(::fidl_next::TakeFrom::take_from(unsafe {
4979 from.raw.get().deref_unchecked::<crate::WireDirectory>()
4980 })),
4981
4982 4 => Self::Storage(::fidl_next::TakeFrom::take_from(unsafe {
4983 from.raw.get().deref_unchecked::<crate::WireStorage>()
4984 })),
4985
4986 5 => Self::Runner(::fidl_next::TakeFrom::take_from(unsafe {
4987 from.raw.get().deref_unchecked::<crate::WireRunner>()
4988 })),
4989
4990 6 => Self::Resolver(::fidl_next::TakeFrom::take_from(unsafe {
4991 from.raw.get().deref_unchecked::<crate::WireResolver>()
4992 })),
4993
4994 8 => Self::EventStream(::fidl_next::TakeFrom::take_from(unsafe {
4995 from.raw.get().deref_unchecked::<crate::WireEventStream>()
4996 })),
4997
4998 9 => Self::Dictionary(::fidl_next::TakeFrom::take_from(unsafe {
4999 from.raw.get().deref_unchecked::<crate::WireDictionary>()
5000 })),
5001
5002 10 => Self::Config(::fidl_next::TakeFrom::take_from(unsafe {
5003 from.raw.get().deref_unchecked::<crate::WireConfiguration>()
5004 })),
5005
5006 _ => unsafe { ::core::hint::unreachable_unchecked() },
5007 }
5008 }
5009}
5010
5011impl ::fidl_next::TakeFrom<WireOptionalCapability> for Option<Box<Capability>> {
5012 #[inline]
5013 fn take_from(from: &WireOptionalCapability) -> Self {
5014 if let Some(inner) = from.as_ref() {
5015 Some(::fidl_next::TakeFrom::take_from(inner))
5016 } else {
5017 None
5018 }
5019 }
5020}
5021
5022#[repr(transparent)]
5024pub struct WireCapability {
5025 raw: ::fidl_next::RawWireUnion,
5026}
5027
5028unsafe impl ::fidl_next::ZeroPadding for WireCapability {
5029 #[inline]
5030 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5031 ::fidl_next::munge!(let Self { raw } = out);
5032 ::fidl_next::RawWireUnion::zero_padding(raw);
5033 }
5034}
5035
5036pub mod capability {
5037 pub enum Ref<'union> {
5038 Service(&'union crate::WireService),
5039
5040 Protocol(&'union crate::WireProtocol),
5041
5042 Directory(&'union crate::WireDirectory),
5043
5044 Storage(&'union crate::WireStorage),
5045
5046 Runner(&'union crate::WireRunner),
5047
5048 Resolver(&'union crate::WireResolver),
5049
5050 EventStream(&'union crate::WireEventStream),
5051
5052 Dictionary(&'union crate::WireDictionary),
5053
5054 Config(&'union crate::WireConfiguration),
5055
5056 UnknownOrdinal_(u64),
5057 }
5058}
5059
5060impl WireCapability {
5061 pub fn as_ref(&self) -> crate::capability::Ref<'_> {
5062 match self.raw.ordinal() {
5063 1 => crate::capability::Ref::Service(unsafe {
5064 self.raw.get().deref_unchecked::<crate::WireService>()
5065 }),
5066
5067 2 => crate::capability::Ref::Protocol(unsafe {
5068 self.raw.get().deref_unchecked::<crate::WireProtocol>()
5069 }),
5070
5071 3 => crate::capability::Ref::Directory(unsafe {
5072 self.raw.get().deref_unchecked::<crate::WireDirectory>()
5073 }),
5074
5075 4 => crate::capability::Ref::Storage(unsafe {
5076 self.raw.get().deref_unchecked::<crate::WireStorage>()
5077 }),
5078
5079 5 => crate::capability::Ref::Runner(unsafe {
5080 self.raw.get().deref_unchecked::<crate::WireRunner>()
5081 }),
5082
5083 6 => crate::capability::Ref::Resolver(unsafe {
5084 self.raw.get().deref_unchecked::<crate::WireResolver>()
5085 }),
5086
5087 8 => crate::capability::Ref::EventStream(unsafe {
5088 self.raw.get().deref_unchecked::<crate::WireEventStream>()
5089 }),
5090
5091 9 => crate::capability::Ref::Dictionary(unsafe {
5092 self.raw.get().deref_unchecked::<crate::WireDictionary>()
5093 }),
5094
5095 10 => crate::capability::Ref::Config(unsafe {
5096 self.raw.get().deref_unchecked::<crate::WireConfiguration>()
5097 }),
5098
5099 unknown => crate::capability::Ref::UnknownOrdinal_(unknown),
5100 }
5101 }
5102}
5103
5104unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapability
5105where
5106 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5107
5108 ___D: ::fidl_next::Decoder,
5109{
5110 fn decode(
5111 mut slot: ::fidl_next::Slot<'_, Self>,
5112 decoder: &mut ___D,
5113 ) -> Result<(), ::fidl_next::DecodeError> {
5114 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
5115 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5116 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireService>(raw, decoder)?,
5117
5118 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireProtocol>(raw, decoder)?,
5119
5120 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectory>(raw, decoder)?,
5121
5122 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireStorage>(raw, decoder)?,
5123
5124 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireRunner>(raw, decoder)?,
5125
5126 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireResolver>(raw, decoder)?,
5127
5128 8 => {
5129 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEventStream>(raw, decoder)?
5130 }
5131
5132 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDictionary>(raw, decoder)?,
5133
5134 10 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfiguration>(
5135 raw, decoder,
5136 )?,
5137
5138 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5139 }
5140
5141 Ok(())
5142 }
5143}
5144
5145impl ::core::fmt::Debug for WireCapability {
5146 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5147 match self.raw.ordinal() {
5148 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireService>().fmt(f) },
5149 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireProtocol>().fmt(f) },
5150 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireDirectory>().fmt(f) },
5151 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireStorage>().fmt(f) },
5152 5 => unsafe { self.raw.get().deref_unchecked::<crate::WireRunner>().fmt(f) },
5153 6 => unsafe { self.raw.get().deref_unchecked::<crate::WireResolver>().fmt(f) },
5154 8 => unsafe { self.raw.get().deref_unchecked::<crate::WireEventStream>().fmt(f) },
5155 9 => unsafe { self.raw.get().deref_unchecked::<crate::WireDictionary>().fmt(f) },
5156 10 => unsafe { self.raw.get().deref_unchecked::<crate::WireConfiguration>().fmt(f) },
5157 _ => unsafe { ::core::hint::unreachable_unchecked() },
5158 }
5159 }
5160}
5161
5162#[repr(transparent)]
5163pub struct WireOptionalCapability {
5164 raw: ::fidl_next::RawWireUnion,
5165}
5166
5167unsafe impl ::fidl_next::ZeroPadding for WireOptionalCapability {
5168 #[inline]
5169 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5170 ::fidl_next::munge!(let Self { raw } = out);
5171 ::fidl_next::RawWireUnion::zero_padding(raw);
5172 }
5173}
5174
5175impl WireOptionalCapability {
5176 pub fn is_some(&self) -> bool {
5177 self.raw.is_some()
5178 }
5179
5180 pub fn is_none(&self) -> bool {
5181 self.raw.is_none()
5182 }
5183
5184 pub fn as_ref(&self) -> Option<&WireCapability> {
5185 if self.is_some() {
5186 Some(unsafe { &*(self as *const Self).cast() })
5187 } else {
5188 None
5189 }
5190 }
5191}
5192
5193unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalCapability
5194where
5195 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5196
5197 ___D: ::fidl_next::Decoder,
5198{
5199 fn decode(
5200 mut slot: ::fidl_next::Slot<'_, Self>,
5201 decoder: &mut ___D,
5202 ) -> Result<(), ::fidl_next::DecodeError> {
5203 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
5204 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5205 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireService>(raw, decoder)?,
5206
5207 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireProtocol>(raw, decoder)?,
5208
5209 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDirectory>(raw, decoder)?,
5210
5211 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireStorage>(raw, decoder)?,
5212
5213 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireRunner>(raw, decoder)?,
5214
5215 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireResolver>(raw, decoder)?,
5216
5217 8 => {
5218 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireEventStream>(raw, decoder)?
5219 }
5220
5221 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDictionary>(raw, decoder)?,
5222
5223 10 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfiguration>(
5224 raw, decoder,
5225 )?,
5226
5227 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
5228 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5229 }
5230
5231 Ok(())
5232 }
5233}
5234
5235impl ::core::fmt::Debug for WireOptionalCapability {
5236 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5237 self.as_ref().fmt(f)
5238 }
5239}
5240
5241#[doc = " Describes under what conditions the component may be started.\n"]
5242#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5243#[repr(u32)]
5244pub enum StartupMode {
5245 Lazy = 0,
5246 Eager = 1,
5247}
5248
5249impl ::fidl_next::Encodable for StartupMode {
5250 type Encoded = WireStartupMode;
5251}
5252
5253unsafe impl<___E> ::fidl_next::Encode<___E> for StartupMode
5254where
5255 ___E: ?Sized,
5256{
5257 #[inline]
5258 fn encode(
5259 &mut self,
5260 _: &mut ___E,
5261 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5262 ) -> Result<(), ::fidl_next::EncodeError> {
5263 ::fidl_next::munge!(let WireStartupMode { value } = out);
5264 let _ = value.write(::fidl_next::WireU32::from(match *self {
5265 Self::Lazy => 0,
5266
5267 Self::Eager => 1,
5268 }));
5269
5270 Ok(())
5271 }
5272}
5273
5274impl ::core::convert::From<WireStartupMode> for StartupMode {
5275 fn from(wire: WireStartupMode) -> Self {
5276 match u32::from(wire.value) {
5277 0 => Self::Lazy,
5278
5279 1 => Self::Eager,
5280
5281 _ => unsafe { ::core::hint::unreachable_unchecked() },
5282 }
5283 }
5284}
5285
5286impl ::fidl_next::TakeFrom<WireStartupMode> for StartupMode {
5287 #[inline]
5288 fn take_from(from: &WireStartupMode) -> Self {
5289 Self::from(*from)
5290 }
5291}
5292
5293#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5295#[repr(transparent)]
5296pub struct WireStartupMode {
5297 value: ::fidl_next::WireU32,
5298}
5299
5300unsafe impl ::fidl_next::ZeroPadding for WireStartupMode {
5301 #[inline]
5302 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5303 }
5305}
5306
5307impl WireStartupMode {
5308 pub const LAZY: WireStartupMode = WireStartupMode { value: ::fidl_next::WireU32(0) };
5309
5310 pub const EAGER: WireStartupMode = WireStartupMode { value: ::fidl_next::WireU32(1) };
5311}
5312
5313unsafe impl<___D> ::fidl_next::Decode<___D> for WireStartupMode
5314where
5315 ___D: ?Sized,
5316{
5317 fn decode(
5318 slot: ::fidl_next::Slot<'_, Self>,
5319 _: &mut ___D,
5320 ) -> Result<(), ::fidl_next::DecodeError> {
5321 ::fidl_next::munge!(let Self { value } = slot);
5322
5323 match u32::from(*value) {
5324 0 | 1 => (),
5325 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
5326 }
5327
5328 Ok(())
5329 }
5330}
5331
5332impl ::core::convert::From<StartupMode> for WireStartupMode {
5333 fn from(natural: StartupMode) -> Self {
5334 match natural {
5335 StartupMode::Lazy => WireStartupMode::LAZY,
5336
5337 StartupMode::Eager => WireStartupMode::EAGER,
5338 }
5339 }
5340}
5341
5342#[doc = " Describes the action to take if this component instance terminates\n unexpectedly.\n"]
5343#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5344#[repr(u32)]
5345pub enum OnTerminate {
5346 None = 0,
5347 Reboot = 1,
5348}
5349
5350impl ::fidl_next::Encodable for OnTerminate {
5351 type Encoded = WireOnTerminate;
5352}
5353
5354unsafe impl<___E> ::fidl_next::Encode<___E> for OnTerminate
5355where
5356 ___E: ?Sized,
5357{
5358 #[inline]
5359 fn encode(
5360 &mut self,
5361 _: &mut ___E,
5362 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5363 ) -> Result<(), ::fidl_next::EncodeError> {
5364 ::fidl_next::munge!(let WireOnTerminate { value } = out);
5365 let _ = value.write(::fidl_next::WireU32::from(match *self {
5366 Self::None => 0,
5367
5368 Self::Reboot => 1,
5369 }));
5370
5371 Ok(())
5372 }
5373}
5374
5375impl ::core::convert::From<WireOnTerminate> for OnTerminate {
5376 fn from(wire: WireOnTerminate) -> Self {
5377 match u32::from(wire.value) {
5378 0 => Self::None,
5379
5380 1 => Self::Reboot,
5381
5382 _ => unsafe { ::core::hint::unreachable_unchecked() },
5383 }
5384 }
5385}
5386
5387impl ::fidl_next::TakeFrom<WireOnTerminate> for OnTerminate {
5388 #[inline]
5389 fn take_from(from: &WireOnTerminate) -> Self {
5390 Self::from(*from)
5391 }
5392}
5393
5394#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5396#[repr(transparent)]
5397pub struct WireOnTerminate {
5398 value: ::fidl_next::WireU32,
5399}
5400
5401unsafe impl ::fidl_next::ZeroPadding for WireOnTerminate {
5402 #[inline]
5403 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
5404 }
5406}
5407
5408impl WireOnTerminate {
5409 pub const NONE: WireOnTerminate = WireOnTerminate { value: ::fidl_next::WireU32(0) };
5410
5411 pub const REBOOT: WireOnTerminate = WireOnTerminate { value: ::fidl_next::WireU32(1) };
5412}
5413
5414unsafe impl<___D> ::fidl_next::Decode<___D> for WireOnTerminate
5415where
5416 ___D: ?Sized,
5417{
5418 fn decode(
5419 slot: ::fidl_next::Slot<'_, Self>,
5420 _: &mut ___D,
5421 ) -> Result<(), ::fidl_next::DecodeError> {
5422 ::fidl_next::munge!(let Self { value } = slot);
5423
5424 match u32::from(*value) {
5425 0 | 1 => (),
5426 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
5427 }
5428
5429 Ok(())
5430 }
5431}
5432
5433impl ::core::convert::From<OnTerminate> for WireOnTerminate {
5434 fn from(natural: OnTerminate) -> Self {
5435 match natural {
5436 OnTerminate::None => WireOnTerminate::NONE,
5437
5438 OnTerminate::Reboot => WireOnTerminate::REBOOT,
5439 }
5440 }
5441}
5442
5443#[doc = " The string identifier for a config field.\n"]
5444pub type ConfigKey = String;
5445
5446pub type WireConfigKey = ::fidl_next::WireString;
5448
5449#[doc = " A directive to override the value of a particular configuration field in the child.\n"]
5450#[derive(Clone, Debug)]
5451pub struct ConfigOverride {
5452 pub key: Option<String>,
5453
5454 pub value: Option<crate::ConfigValue>,
5455}
5456
5457impl ConfigOverride {
5458 fn __max_ordinal(&self) -> usize {
5459 if self.key.is_some() {
5460 return 1;
5461 }
5462
5463 if self.value.is_some() {
5464 return 2;
5465 }
5466
5467 0
5468 }
5469}
5470
5471impl ::fidl_next::Encodable for ConfigOverride {
5472 type Encoded = WireConfigOverride;
5473}
5474
5475unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigOverride
5476where
5477 ___E: ::fidl_next::Encoder + ?Sized,
5478{
5479 #[inline]
5480 fn encode(
5481 &mut self,
5482 encoder: &mut ___E,
5483 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5484 ) -> Result<(), ::fidl_next::EncodeError> {
5485 ::fidl_next::munge!(let WireConfigOverride { table } = out);
5486
5487 let max_ord = self.__max_ordinal();
5488
5489 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5490 ::fidl_next::ZeroPadding::zero_padding(&mut out);
5491
5492 let mut preallocated =
5493 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5494
5495 for i in 1..=max_ord {
5496 match i {
5497 2 => {
5498 if let Some(value) = &mut self.value {
5499 ::fidl_next::WireEnvelope::encode_value(
5500 value,
5501 preallocated.encoder,
5502 &mut out,
5503 )?;
5504 } else {
5505 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5506 }
5507 }
5508
5509 1 => {
5510 if let Some(key) = &mut self.key {
5511 ::fidl_next::WireEnvelope::encode_value(
5512 key,
5513 preallocated.encoder,
5514 &mut out,
5515 )?;
5516 } else {
5517 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5518 }
5519 }
5520
5521 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5522 }
5523 unsafe {
5524 preallocated.write_next(out.assume_init_ref());
5525 }
5526 }
5527
5528 ::fidl_next::WireTable::encode_len(table, max_ord);
5529
5530 Ok(())
5531 }
5532}
5533
5534impl ::fidl_next::TakeFrom<WireConfigOverride> for ConfigOverride {
5535 #[inline]
5536 fn take_from(from: &WireConfigOverride) -> Self {
5537 Self {
5538 key: from.key().map(::fidl_next::TakeFrom::take_from),
5539
5540 value: from.value().map(::fidl_next::TakeFrom::take_from),
5541 }
5542 }
5543}
5544
5545#[repr(C)]
5547pub struct WireConfigOverride {
5548 table: ::fidl_next::WireTable,
5549}
5550
5551unsafe impl ::fidl_next::ZeroPadding for WireConfigOverride {
5552 #[inline]
5553 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5554 ::fidl_next::munge!(let Self { table } = out);
5555 ::fidl_next::WireTable::zero_padding(table);
5556 }
5557}
5558
5559unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigOverride
5560where
5561 ___D: ::fidl_next::Decoder + ?Sized,
5562{
5563 fn decode(
5564 slot: ::fidl_next::Slot<'_, Self>,
5565 decoder: &mut ___D,
5566 ) -> Result<(), ::fidl_next::DecodeError> {
5567 ::fidl_next::munge!(let Self { table } = slot);
5568
5569 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5570 match ordinal {
5571 0 => unsafe { ::core::hint::unreachable_unchecked() },
5572
5573 1 => {
5574 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
5575 slot.as_mut(),
5576 decoder,
5577 )?;
5578
5579 let key = unsafe {
5580 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
5581 };
5582
5583 if key.len() > 64 {
5584 return Err(::fidl_next::DecodeError::VectorTooLong {
5585 size: key.len() as u64,
5586 limit: 64,
5587 });
5588 }
5589
5590 Ok(())
5591 }
5592
5593 2 => {
5594 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigValue>(
5595 slot.as_mut(),
5596 decoder,
5597 )?;
5598
5599 Ok(())
5600 }
5601
5602 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
5603 }
5604 })
5605 }
5606}
5607
5608impl WireConfigOverride {
5609 pub fn key(&self) -> Option<&::fidl_next::WireString> {
5610 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5611 }
5612
5613 pub fn value(&self) -> Option<&crate::WireConfigValue> {
5614 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5615 }
5616}
5617
5618impl ::core::fmt::Debug for WireConfigOverride {
5619 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
5620 f.debug_struct("ConfigOverride")
5621 .field("key", &self.key())
5622 .field("value", &self.value())
5623 .finish()
5624 }
5625}
5626
5627#[doc = " Statically declares a child component instance.\n"]
5628#[derive(Clone, Debug)]
5629pub struct Child {
5630 pub name: Option<String>,
5631
5632 pub url: Option<String>,
5633
5634 pub startup: Option<crate::StartupMode>,
5635
5636 pub environment: Option<String>,
5637
5638 pub on_terminate: Option<crate::OnTerminate>,
5639
5640 pub config_overrides: Option<Vec<crate::ConfigOverride>>,
5641}
5642
5643impl Child {
5644 fn __max_ordinal(&self) -> usize {
5645 if self.name.is_some() {
5646 return 1;
5647 }
5648
5649 if self.url.is_some() {
5650 return 2;
5651 }
5652
5653 if self.startup.is_some() {
5654 return 3;
5655 }
5656
5657 if self.environment.is_some() {
5658 return 4;
5659 }
5660
5661 if self.on_terminate.is_some() {
5662 return 5;
5663 }
5664
5665 if self.config_overrides.is_some() {
5666 return 6;
5667 }
5668
5669 0
5670 }
5671}
5672
5673impl ::fidl_next::Encodable for Child {
5674 type Encoded = WireChild;
5675}
5676
5677unsafe impl<___E> ::fidl_next::Encode<___E> for Child
5678where
5679 ___E: ::fidl_next::Encoder + ?Sized,
5680{
5681 #[inline]
5682 fn encode(
5683 &mut self,
5684 encoder: &mut ___E,
5685 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5686 ) -> Result<(), ::fidl_next::EncodeError> {
5687 ::fidl_next::munge!(let WireChild { table } = out);
5688
5689 let max_ord = self.__max_ordinal();
5690
5691 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5692 ::fidl_next::ZeroPadding::zero_padding(&mut out);
5693
5694 let mut preallocated =
5695 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5696
5697 for i in 1..=max_ord {
5698 match i {
5699 6 => {
5700 if let Some(config_overrides) = &mut self.config_overrides {
5701 ::fidl_next::WireEnvelope::encode_value(
5702 config_overrides,
5703 preallocated.encoder,
5704 &mut out,
5705 )?;
5706 } else {
5707 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5708 }
5709 }
5710
5711 5 => {
5712 if let Some(on_terminate) = &mut self.on_terminate {
5713 ::fidl_next::WireEnvelope::encode_value(
5714 on_terminate,
5715 preallocated.encoder,
5716 &mut out,
5717 )?;
5718 } else {
5719 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5720 }
5721 }
5722
5723 4 => {
5724 if let Some(environment) = &mut self.environment {
5725 ::fidl_next::WireEnvelope::encode_value(
5726 environment,
5727 preallocated.encoder,
5728 &mut out,
5729 )?;
5730 } else {
5731 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5732 }
5733 }
5734
5735 3 => {
5736 if let Some(startup) = &mut self.startup {
5737 ::fidl_next::WireEnvelope::encode_value(
5738 startup,
5739 preallocated.encoder,
5740 &mut out,
5741 )?;
5742 } else {
5743 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5744 }
5745 }
5746
5747 2 => {
5748 if let Some(url) = &mut self.url {
5749 ::fidl_next::WireEnvelope::encode_value(
5750 url,
5751 preallocated.encoder,
5752 &mut out,
5753 )?;
5754 } else {
5755 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5756 }
5757 }
5758
5759 1 => {
5760 if let Some(name) = &mut self.name {
5761 ::fidl_next::WireEnvelope::encode_value(
5762 name,
5763 preallocated.encoder,
5764 &mut out,
5765 )?;
5766 } else {
5767 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5768 }
5769 }
5770
5771 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5772 }
5773 unsafe {
5774 preallocated.write_next(out.assume_init_ref());
5775 }
5776 }
5777
5778 ::fidl_next::WireTable::encode_len(table, max_ord);
5779
5780 Ok(())
5781 }
5782}
5783
5784impl ::fidl_next::TakeFrom<WireChild> for Child {
5785 #[inline]
5786 fn take_from(from: &WireChild) -> Self {
5787 Self {
5788 name: from.name().map(::fidl_next::TakeFrom::take_from),
5789
5790 url: from.url().map(::fidl_next::TakeFrom::take_from),
5791
5792 startup: from.startup().map(::fidl_next::TakeFrom::take_from),
5793
5794 environment: from.environment().map(::fidl_next::TakeFrom::take_from),
5795
5796 on_terminate: from.on_terminate().map(::fidl_next::TakeFrom::take_from),
5797
5798 config_overrides: from.config_overrides().map(::fidl_next::TakeFrom::take_from),
5799 }
5800 }
5801}
5802
5803#[repr(C)]
5805pub struct WireChild {
5806 table: ::fidl_next::WireTable,
5807}
5808
5809unsafe impl ::fidl_next::ZeroPadding for WireChild {
5810 #[inline]
5811 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5812 ::fidl_next::munge!(let Self { table } = out);
5813 ::fidl_next::WireTable::zero_padding(table);
5814 }
5815}
5816
5817unsafe impl<___D> ::fidl_next::Decode<___D> for WireChild
5818where
5819 ___D: ::fidl_next::Decoder + ?Sized,
5820{
5821 fn decode(
5822 slot: ::fidl_next::Slot<'_, Self>,
5823 decoder: &mut ___D,
5824 ) -> Result<(), ::fidl_next::DecodeError> {
5825 ::fidl_next::munge!(let Self { table } = slot);
5826
5827 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5828 match ordinal {
5829 0 => unsafe { ::core::hint::unreachable_unchecked() },
5830
5831 1 => {
5832 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
5833 slot.as_mut(),
5834 decoder,
5835 )?;
5836
5837 let name = unsafe {
5838 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
5839 };
5840
5841 if name.len() > 1024 {
5842 return Err(::fidl_next::DecodeError::VectorTooLong {
5843 size: name.len() as u64,
5844 limit: 1024,
5845 });
5846 }
5847
5848 Ok(())
5849 }
5850
5851 2 => {
5852 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
5853 slot.as_mut(),
5854 decoder,
5855 )?;
5856
5857 let url = unsafe {
5858 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
5859 };
5860
5861 if url.len() > 4096 {
5862 return Err(::fidl_next::DecodeError::VectorTooLong {
5863 size: url.len() as u64,
5864 limit: 4096,
5865 });
5866 }
5867
5868 Ok(())
5869 }
5870
5871 3 => {
5872 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireStartupMode>(
5873 slot.as_mut(),
5874 decoder,
5875 )?;
5876
5877 Ok(())
5878 }
5879
5880 4 => {
5881 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
5882 slot.as_mut(),
5883 decoder,
5884 )?;
5885
5886 let environment = unsafe {
5887 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
5888 };
5889
5890 if environment.len() > 100 {
5891 return Err(::fidl_next::DecodeError::VectorTooLong {
5892 size: environment.len() as u64,
5893 limit: 100,
5894 });
5895 }
5896
5897 Ok(())
5898 }
5899
5900 5 => {
5901 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireOnTerminate>(
5902 slot.as_mut(),
5903 decoder,
5904 )?;
5905
5906 Ok(())
5907 }
5908
5909 6 => {
5910 ::fidl_next::WireEnvelope::decode_as::<
5911 ___D,
5912 ::fidl_next::WireVector<crate::WireConfigOverride>,
5913 >(slot.as_mut(), decoder)?;
5914
5915 Ok(())
5916 }
5917
5918 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
5919 }
5920 })
5921 }
5922}
5923
5924impl WireChild {
5925 pub fn name(&self) -> Option<&::fidl_next::WireString> {
5926 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5927 }
5928
5929 pub fn url(&self) -> Option<&::fidl_next::WireString> {
5930 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5931 }
5932
5933 pub fn startup(&self) -> Option<&crate::WireStartupMode> {
5934 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
5935 }
5936
5937 pub fn environment(&self) -> Option<&::fidl_next::WireString> {
5938 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
5939 }
5940
5941 pub fn on_terminate(&self) -> Option<&crate::WireOnTerminate> {
5942 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
5943 }
5944
5945 pub fn config_overrides(&self) -> Option<&::fidl_next::WireVector<crate::WireConfigOverride>> {
5946 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
5947 }
5948}
5949
5950impl ::core::fmt::Debug for WireChild {
5951 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
5952 f.debug_struct("Child")
5953 .field("name", &self.name())
5954 .field("url", &self.url())
5955 .field("startup", &self.startup())
5956 .field("environment", &self.environment())
5957 .field("on_terminate", &self.on_terminate())
5958 .field("config_overrides", &self.config_overrides())
5959 .finish()
5960 }
5961}
5962
5963#[doc = " The durability of component instances created in a collection.\n"]
5964#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5965#[repr(u32)]
5966pub enum Durability {
5967 Transient = 2,
5968 SingleRun = 3,
5969}
5970
5971impl ::fidl_next::Encodable for Durability {
5972 type Encoded = WireDurability;
5973}
5974
5975unsafe impl<___E> ::fidl_next::Encode<___E> for Durability
5976where
5977 ___E: ?Sized,
5978{
5979 #[inline]
5980 fn encode(
5981 &mut self,
5982 _: &mut ___E,
5983 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5984 ) -> Result<(), ::fidl_next::EncodeError> {
5985 ::fidl_next::munge!(let WireDurability { value } = out);
5986 let _ = value.write(::fidl_next::WireU32::from(match *self {
5987 Self::Transient => 2,
5988
5989 Self::SingleRun => 3,
5990 }));
5991
5992 Ok(())
5993 }
5994}
5995
5996impl ::core::convert::From<WireDurability> for Durability {
5997 fn from(wire: WireDurability) -> Self {
5998 match u32::from(wire.value) {
5999 2 => Self::Transient,
6000
6001 3 => Self::SingleRun,
6002
6003 _ => unsafe { ::core::hint::unreachable_unchecked() },
6004 }
6005 }
6006}
6007
6008impl ::fidl_next::TakeFrom<WireDurability> for Durability {
6009 #[inline]
6010 fn take_from(from: &WireDurability) -> Self {
6011 Self::from(*from)
6012 }
6013}
6014
6015#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6017#[repr(transparent)]
6018pub struct WireDurability {
6019 value: ::fidl_next::WireU32,
6020}
6021
6022unsafe impl ::fidl_next::ZeroPadding for WireDurability {
6023 #[inline]
6024 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
6025 }
6027}
6028
6029impl WireDurability {
6030 pub const TRANSIENT: WireDurability = WireDurability { value: ::fidl_next::WireU32(2) };
6031
6032 pub const SINGLE_RUN: WireDurability = WireDurability { value: ::fidl_next::WireU32(3) };
6033}
6034
6035unsafe impl<___D> ::fidl_next::Decode<___D> for WireDurability
6036where
6037 ___D: ?Sized,
6038{
6039 fn decode(
6040 slot: ::fidl_next::Slot<'_, Self>,
6041 _: &mut ___D,
6042 ) -> Result<(), ::fidl_next::DecodeError> {
6043 ::fidl_next::munge!(let Self { value } = slot);
6044
6045 match u32::from(*value) {
6046 2 | 3 => (),
6047 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
6048 }
6049
6050 Ok(())
6051 }
6052}
6053
6054impl ::core::convert::From<Durability> for WireDurability {
6055 fn from(natural: Durability) -> Self {
6056 match natural {
6057 Durability::Transient => WireDurability::TRANSIENT,
6058
6059 Durability::SingleRun => WireDurability::SINGLE_RUN,
6060 }
6061 }
6062}
6063
6064#[doc = " Statically declares a component instance collection.\n"]
6065#[derive(Clone, Debug)]
6066pub struct Collection {
6067 pub name: Option<String>,
6068
6069 pub durability: Option<crate::Durability>,
6070
6071 pub environment: Option<String>,
6072
6073 pub allowed_offers: Option<crate::AllowedOffers>,
6074
6075 pub allow_long_names: Option<bool>,
6076
6077 pub persistent_storage: Option<bool>,
6078}
6079
6080impl Collection {
6081 fn __max_ordinal(&self) -> usize {
6082 if self.name.is_some() {
6083 return 1;
6084 }
6085
6086 if self.durability.is_some() {
6087 return 2;
6088 }
6089
6090 if self.environment.is_some() {
6091 return 3;
6092 }
6093
6094 if self.allowed_offers.is_some() {
6095 return 4;
6096 }
6097
6098 if self.allow_long_names.is_some() {
6099 return 5;
6100 }
6101
6102 if self.persistent_storage.is_some() {
6103 return 6;
6104 }
6105
6106 0
6107 }
6108}
6109
6110impl ::fidl_next::Encodable for Collection {
6111 type Encoded = WireCollection;
6112}
6113
6114unsafe impl<___E> ::fidl_next::Encode<___E> for Collection
6115where
6116 ___E: ::fidl_next::Encoder + ?Sized,
6117{
6118 #[inline]
6119 fn encode(
6120 &mut self,
6121 encoder: &mut ___E,
6122 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6123 ) -> Result<(), ::fidl_next::EncodeError> {
6124 ::fidl_next::munge!(let WireCollection { table } = out);
6125
6126 let max_ord = self.__max_ordinal();
6127
6128 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
6129 ::fidl_next::ZeroPadding::zero_padding(&mut out);
6130
6131 let mut preallocated =
6132 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
6133
6134 for i in 1..=max_ord {
6135 match i {
6136 6 => {
6137 if let Some(persistent_storage) = &mut self.persistent_storage {
6138 ::fidl_next::WireEnvelope::encode_value(
6139 persistent_storage,
6140 preallocated.encoder,
6141 &mut out,
6142 )?;
6143 } else {
6144 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6145 }
6146 }
6147
6148 5 => {
6149 if let Some(allow_long_names) = &mut self.allow_long_names {
6150 ::fidl_next::WireEnvelope::encode_value(
6151 allow_long_names,
6152 preallocated.encoder,
6153 &mut out,
6154 )?;
6155 } else {
6156 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6157 }
6158 }
6159
6160 4 => {
6161 if let Some(allowed_offers) = &mut self.allowed_offers {
6162 ::fidl_next::WireEnvelope::encode_value(
6163 allowed_offers,
6164 preallocated.encoder,
6165 &mut out,
6166 )?;
6167 } else {
6168 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6169 }
6170 }
6171
6172 3 => {
6173 if let Some(environment) = &mut self.environment {
6174 ::fidl_next::WireEnvelope::encode_value(
6175 environment,
6176 preallocated.encoder,
6177 &mut out,
6178 )?;
6179 } else {
6180 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6181 }
6182 }
6183
6184 2 => {
6185 if let Some(durability) = &mut self.durability {
6186 ::fidl_next::WireEnvelope::encode_value(
6187 durability,
6188 preallocated.encoder,
6189 &mut out,
6190 )?;
6191 } else {
6192 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6193 }
6194 }
6195
6196 1 => {
6197 if let Some(name) = &mut self.name {
6198 ::fidl_next::WireEnvelope::encode_value(
6199 name,
6200 preallocated.encoder,
6201 &mut out,
6202 )?;
6203 } else {
6204 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6205 }
6206 }
6207
6208 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
6209 }
6210 unsafe {
6211 preallocated.write_next(out.assume_init_ref());
6212 }
6213 }
6214
6215 ::fidl_next::WireTable::encode_len(table, max_ord);
6216
6217 Ok(())
6218 }
6219}
6220
6221impl ::fidl_next::TakeFrom<WireCollection> for Collection {
6222 #[inline]
6223 fn take_from(from: &WireCollection) -> Self {
6224 Self {
6225 name: from.name().map(::fidl_next::TakeFrom::take_from),
6226
6227 durability: from.durability().map(::fidl_next::TakeFrom::take_from),
6228
6229 environment: from.environment().map(::fidl_next::TakeFrom::take_from),
6230
6231 allowed_offers: from.allowed_offers().map(::fidl_next::TakeFrom::take_from),
6232
6233 allow_long_names: from.allow_long_names().map(::fidl_next::TakeFrom::take_from),
6234
6235 persistent_storage: from.persistent_storage().map(::fidl_next::TakeFrom::take_from),
6236 }
6237 }
6238}
6239
6240#[repr(C)]
6242pub struct WireCollection {
6243 table: ::fidl_next::WireTable,
6244}
6245
6246unsafe impl ::fidl_next::ZeroPadding for WireCollection {
6247 #[inline]
6248 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6249 ::fidl_next::munge!(let Self { table } = out);
6250 ::fidl_next::WireTable::zero_padding(table);
6251 }
6252}
6253
6254unsafe impl<___D> ::fidl_next::Decode<___D> for WireCollection
6255where
6256 ___D: ::fidl_next::Decoder + ?Sized,
6257{
6258 fn decode(
6259 slot: ::fidl_next::Slot<'_, Self>,
6260 decoder: &mut ___D,
6261 ) -> Result<(), ::fidl_next::DecodeError> {
6262 ::fidl_next::munge!(let Self { table } = slot);
6263
6264 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
6265 match ordinal {
6266 0 => unsafe { ::core::hint::unreachable_unchecked() },
6267
6268 1 => {
6269 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
6270 slot.as_mut(),
6271 decoder,
6272 )?;
6273
6274 let name = unsafe {
6275 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
6276 };
6277
6278 if name.len() > 100 {
6279 return Err(::fidl_next::DecodeError::VectorTooLong {
6280 size: name.len() as u64,
6281 limit: 100,
6282 });
6283 }
6284
6285 Ok(())
6286 }
6287
6288 2 => {
6289 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDurability>(
6290 slot.as_mut(),
6291 decoder,
6292 )?;
6293
6294 Ok(())
6295 }
6296
6297 3 => {
6298 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
6299 slot.as_mut(),
6300 decoder,
6301 )?;
6302
6303 let environment = unsafe {
6304 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
6305 };
6306
6307 if environment.len() > 100 {
6308 return Err(::fidl_next::DecodeError::VectorTooLong {
6309 size: environment.len() as u64,
6310 limit: 100,
6311 });
6312 }
6313
6314 Ok(())
6315 }
6316
6317 4 => {
6318 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAllowedOffers>(
6319 slot.as_mut(),
6320 decoder,
6321 )?;
6322
6323 Ok(())
6324 }
6325
6326 5 => {
6327 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
6328
6329 Ok(())
6330 }
6331
6332 6 => {
6333 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(slot.as_mut(), decoder)?;
6334
6335 Ok(())
6336 }
6337
6338 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
6339 }
6340 })
6341 }
6342}
6343
6344impl WireCollection {
6345 pub fn name(&self) -> Option<&::fidl_next::WireString> {
6346 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
6347 }
6348
6349 pub fn durability(&self) -> Option<&crate::WireDurability> {
6350 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
6351 }
6352
6353 pub fn environment(&self) -> Option<&::fidl_next::WireString> {
6354 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
6355 }
6356
6357 pub fn allowed_offers(&self) -> Option<&crate::WireAllowedOffers> {
6358 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
6359 }
6360
6361 pub fn allow_long_names(&self) -> Option<&bool> {
6362 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
6363 }
6364
6365 pub fn persistent_storage(&self) -> Option<&bool> {
6366 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
6367 }
6368}
6369
6370impl ::core::fmt::Debug for WireCollection {
6371 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
6372 f.debug_struct("Collection")
6373 .field("name", &self.name())
6374 .field("durability", &self.durability())
6375 .field("environment", &self.environment())
6376 .field("allowed_offers", &self.allowed_offers())
6377 .field("allow_long_names", &self.allow_long_names())
6378 .field("persistent_storage", &self.persistent_storage())
6379 .finish()
6380 }
6381}
6382
6383#[doc = " Describes the type of dependency implied by the capability.\n"]
6384#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6385#[repr(u32)]
6386pub enum DependencyType {
6387 Strong = 1,
6388 Weak = 2,
6389}
6390
6391impl ::fidl_next::Encodable for DependencyType {
6392 type Encoded = WireDependencyType;
6393}
6394
6395unsafe impl<___E> ::fidl_next::Encode<___E> for DependencyType
6396where
6397 ___E: ?Sized,
6398{
6399 #[inline]
6400 fn encode(
6401 &mut self,
6402 _: &mut ___E,
6403 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6404 ) -> Result<(), ::fidl_next::EncodeError> {
6405 ::fidl_next::munge!(let WireDependencyType { value } = out);
6406 let _ = value.write(::fidl_next::WireU32::from(match *self {
6407 Self::Strong => 1,
6408
6409 Self::Weak => 2,
6410 }));
6411
6412 Ok(())
6413 }
6414}
6415
6416impl ::core::convert::From<WireDependencyType> for DependencyType {
6417 fn from(wire: WireDependencyType) -> Self {
6418 match u32::from(wire.value) {
6419 1 => Self::Strong,
6420
6421 2 => Self::Weak,
6422
6423 _ => unsafe { ::core::hint::unreachable_unchecked() },
6424 }
6425 }
6426}
6427
6428impl ::fidl_next::TakeFrom<WireDependencyType> for DependencyType {
6429 #[inline]
6430 fn take_from(from: &WireDependencyType) -> Self {
6431 Self::from(*from)
6432 }
6433}
6434
6435#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6437#[repr(transparent)]
6438pub struct WireDependencyType {
6439 value: ::fidl_next::WireU32,
6440}
6441
6442unsafe impl ::fidl_next::ZeroPadding for WireDependencyType {
6443 #[inline]
6444 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
6445 }
6447}
6448
6449impl WireDependencyType {
6450 pub const STRONG: WireDependencyType = WireDependencyType { value: ::fidl_next::WireU32(1) };
6451
6452 pub const WEAK: WireDependencyType = WireDependencyType { value: ::fidl_next::WireU32(2) };
6453}
6454
6455unsafe impl<___D> ::fidl_next::Decode<___D> for WireDependencyType
6456where
6457 ___D: ?Sized,
6458{
6459 fn decode(
6460 slot: ::fidl_next::Slot<'_, Self>,
6461 _: &mut ___D,
6462 ) -> Result<(), ::fidl_next::DecodeError> {
6463 ::fidl_next::munge!(let Self { value } = slot);
6464
6465 match u32::from(*value) {
6466 1 | 2 => (),
6467 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
6468 }
6469
6470 Ok(())
6471 }
6472}
6473
6474impl ::core::convert::From<DependencyType> for WireDependencyType {
6475 fn from(natural: DependencyType) -> Self {
6476 match natural {
6477 DependencyType::Strong => WireDependencyType::STRONG,
6478
6479 DependencyType::Weak => WireDependencyType::WEAK,
6480 }
6481 }
6482}
6483
6484#[doc = " Type used to create a mapping between 2 names. Used to rename service or component instances\n in FIDL declarations.\n"]
6485#[derive(Clone, Debug)]
6486pub struct NameMapping {
6487 pub source_name: String,
6488
6489 pub target_name: String,
6490}
6491
6492impl ::fidl_next::Encodable for NameMapping {
6493 type Encoded = WireNameMapping;
6494}
6495
6496unsafe impl<___E> ::fidl_next::Encode<___E> for NameMapping
6497where
6498 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6499
6500 ___E: ::fidl_next::Encoder,
6501{
6502 #[inline]
6503 fn encode(
6504 &mut self,
6505 encoder: &mut ___E,
6506 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6507 ) -> Result<(), ::fidl_next::EncodeError> {
6508 ::fidl_next::munge! {
6509 let Self::Encoded {
6510 source_name,
6511 target_name,
6512
6513 } = out;
6514 }
6515
6516 ::fidl_next::Encode::encode(&mut self.source_name, encoder, source_name)?;
6517
6518 ::fidl_next::Encode::encode(&mut self.target_name, encoder, target_name)?;
6519
6520 Ok(())
6521 }
6522}
6523
6524impl ::fidl_next::EncodableOption for Box<NameMapping> {
6525 type EncodedOption = ::fidl_next::WireBox<WireNameMapping>;
6526}
6527
6528unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<NameMapping>
6529where
6530 ___E: ::fidl_next::Encoder + ?Sized,
6531 NameMapping: ::fidl_next::Encode<___E>,
6532{
6533 #[inline]
6534 fn encode_option(
6535 this: Option<&mut Self>,
6536 encoder: &mut ___E,
6537 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6538 ) -> Result<(), ::fidl_next::EncodeError> {
6539 if let Some(inner) = this {
6540 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6541 ::fidl_next::WireBox::encode_present(out);
6542 } else {
6543 ::fidl_next::WireBox::encode_absent(out);
6544 }
6545
6546 Ok(())
6547 }
6548}
6549
6550impl ::fidl_next::TakeFrom<WireNameMapping> for NameMapping {
6551 #[inline]
6552 fn take_from(from: &WireNameMapping) -> Self {
6553 Self {
6554 source_name: ::fidl_next::TakeFrom::take_from(&from.source_name),
6555
6556 target_name: ::fidl_next::TakeFrom::take_from(&from.target_name),
6557 }
6558 }
6559}
6560
6561#[derive(Debug)]
6563#[repr(C)]
6564pub struct WireNameMapping {
6565 pub source_name: ::fidl_next::WireString,
6566
6567 pub target_name: ::fidl_next::WireString,
6568}
6569
6570unsafe impl ::fidl_next::ZeroPadding for WireNameMapping {
6571 #[inline]
6572 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6573}
6574
6575unsafe impl<___D> ::fidl_next::Decode<___D> for WireNameMapping
6576where
6577 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6578
6579 ___D: ::fidl_next::Decoder,
6580{
6581 fn decode(
6582 slot: ::fidl_next::Slot<'_, Self>,
6583 decoder: &mut ___D,
6584 ) -> Result<(), ::fidl_next::DecodeError> {
6585 ::fidl_next::munge! {
6586 let Self {
6587 mut source_name,
6588 mut target_name,
6589
6590 } = slot;
6591 }
6592
6593 ::fidl_next::Decode::decode(source_name.as_mut(), decoder)?;
6594
6595 let source_name = unsafe { source_name.deref_unchecked() };
6596
6597 if source_name.len() > 100 {
6598 return Err(::fidl_next::DecodeError::VectorTooLong {
6599 size: source_name.len() as u64,
6600 limit: 100,
6601 });
6602 }
6603
6604 ::fidl_next::Decode::decode(target_name.as_mut(), decoder)?;
6605
6606 let target_name = unsafe { target_name.deref_unchecked() };
6607
6608 if target_name.len() > 100 {
6609 return Err(::fidl_next::DecodeError::VectorTooLong {
6610 size: target_name.len() as u64,
6611 limit: 100,
6612 });
6613 }
6614
6615 Ok(())
6616 }
6617}
6618
6619#[doc = " Specifies how a declared environment\'s initial set of properties are assigned.\n"]
6620#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6621#[repr(u32)]
6622pub enum EnvironmentExtends {
6623 None = 0,
6624 Realm = 1,
6625}
6626
6627impl ::fidl_next::Encodable for EnvironmentExtends {
6628 type Encoded = WireEnvironmentExtends;
6629}
6630
6631unsafe impl<___E> ::fidl_next::Encode<___E> for EnvironmentExtends
6632where
6633 ___E: ?Sized,
6634{
6635 #[inline]
6636 fn encode(
6637 &mut self,
6638 _: &mut ___E,
6639 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6640 ) -> Result<(), ::fidl_next::EncodeError> {
6641 ::fidl_next::munge!(let WireEnvironmentExtends { value } = out);
6642 let _ = value.write(::fidl_next::WireU32::from(match *self {
6643 Self::None => 0,
6644
6645 Self::Realm => 1,
6646 }));
6647
6648 Ok(())
6649 }
6650}
6651
6652impl ::core::convert::From<WireEnvironmentExtends> for EnvironmentExtends {
6653 fn from(wire: WireEnvironmentExtends) -> Self {
6654 match u32::from(wire.value) {
6655 0 => Self::None,
6656
6657 1 => Self::Realm,
6658
6659 _ => unsafe { ::core::hint::unreachable_unchecked() },
6660 }
6661 }
6662}
6663
6664impl ::fidl_next::TakeFrom<WireEnvironmentExtends> for EnvironmentExtends {
6665 #[inline]
6666 fn take_from(from: &WireEnvironmentExtends) -> Self {
6667 Self::from(*from)
6668 }
6669}
6670
6671#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6673#[repr(transparent)]
6674pub struct WireEnvironmentExtends {
6675 value: ::fidl_next::WireU32,
6676}
6677
6678unsafe impl ::fidl_next::ZeroPadding for WireEnvironmentExtends {
6679 #[inline]
6680 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
6681 }
6683}
6684
6685impl WireEnvironmentExtends {
6686 pub const NONE: WireEnvironmentExtends =
6687 WireEnvironmentExtends { value: ::fidl_next::WireU32(0) };
6688
6689 pub const REALM: WireEnvironmentExtends =
6690 WireEnvironmentExtends { value: ::fidl_next::WireU32(1) };
6691}
6692
6693unsafe impl<___D> ::fidl_next::Decode<___D> for WireEnvironmentExtends
6694where
6695 ___D: ?Sized,
6696{
6697 fn decode(
6698 slot: ::fidl_next::Slot<'_, Self>,
6699 _: &mut ___D,
6700 ) -> Result<(), ::fidl_next::DecodeError> {
6701 ::fidl_next::munge!(let Self { value } = slot);
6702
6703 match u32::from(*value) {
6704 0 | 1 => (),
6705 unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
6706 }
6707
6708 Ok(())
6709 }
6710}
6711
6712impl ::core::convert::From<EnvironmentExtends> for WireEnvironmentExtends {
6713 fn from(natural: EnvironmentExtends) -> Self {
6714 match natural {
6715 EnvironmentExtends::None => WireEnvironmentExtends::NONE,
6716
6717 EnvironmentExtends::Realm => WireEnvironmentExtends::REALM,
6718 }
6719 }
6720}
6721
6722pub const MAX_URL_SCHEME_LENGTH: u32 = 100;
6723
6724pub type UrlScheme = String;
6725
6726pub type WireUrlScheme = ::fidl_next::WireString;
6728
6729#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6730#[repr(u32)]
6731pub enum ConfigTypeLayout {
6732 Bool = 1,
6733 Uint8 = 2,
6734 Uint16 = 3,
6735 Uint32 = 4,
6736 Uint64 = 5,
6737 Int8 = 6,
6738 Int16 = 7,
6739 Int32 = 8,
6740 Int64 = 9,
6741 String = 10,
6742 Vector = 11,
6743 UnknownOrdinal_(u32),
6744}
6745
6746impl ::fidl_next::Encodable for ConfigTypeLayout {
6747 type Encoded = WireConfigTypeLayout;
6748}
6749
6750unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigTypeLayout
6751where
6752 ___E: ?Sized,
6753{
6754 #[inline]
6755 fn encode(
6756 &mut self,
6757 _: &mut ___E,
6758 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6759 ) -> Result<(), ::fidl_next::EncodeError> {
6760 ::fidl_next::munge!(let WireConfigTypeLayout { value } = out);
6761 let _ = value.write(::fidl_next::WireU32::from(match *self {
6762 Self::Bool => 1,
6763
6764 Self::Uint8 => 2,
6765
6766 Self::Uint16 => 3,
6767
6768 Self::Uint32 => 4,
6769
6770 Self::Uint64 => 5,
6771
6772 Self::Int8 => 6,
6773
6774 Self::Int16 => 7,
6775
6776 Self::Int32 => 8,
6777
6778 Self::Int64 => 9,
6779
6780 Self::String => 10,
6781
6782 Self::Vector => 11,
6783
6784 Self::UnknownOrdinal_(value) => value,
6785 }));
6786
6787 Ok(())
6788 }
6789}
6790
6791impl ::core::convert::From<WireConfigTypeLayout> for ConfigTypeLayout {
6792 fn from(wire: WireConfigTypeLayout) -> Self {
6793 match u32::from(wire.value) {
6794 1 => Self::Bool,
6795
6796 2 => Self::Uint8,
6797
6798 3 => Self::Uint16,
6799
6800 4 => Self::Uint32,
6801
6802 5 => Self::Uint64,
6803
6804 6 => Self::Int8,
6805
6806 7 => Self::Int16,
6807
6808 8 => Self::Int32,
6809
6810 9 => Self::Int64,
6811
6812 10 => Self::String,
6813
6814 11 => Self::Vector,
6815
6816 value => Self::UnknownOrdinal_(value),
6817 }
6818 }
6819}
6820
6821impl ::fidl_next::TakeFrom<WireConfigTypeLayout> for ConfigTypeLayout {
6822 #[inline]
6823 fn take_from(from: &WireConfigTypeLayout) -> Self {
6824 Self::from(*from)
6825 }
6826}
6827
6828#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6830#[repr(transparent)]
6831pub struct WireConfigTypeLayout {
6832 value: ::fidl_next::WireU32,
6833}
6834
6835unsafe impl ::fidl_next::ZeroPadding for WireConfigTypeLayout {
6836 #[inline]
6837 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
6838 }
6840}
6841
6842impl WireConfigTypeLayout {
6843 pub const BOOL: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(1) };
6844
6845 pub const UINT8: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(2) };
6846
6847 pub const UINT16: WireConfigTypeLayout =
6848 WireConfigTypeLayout { value: ::fidl_next::WireU32(3) };
6849
6850 pub const UINT32: WireConfigTypeLayout =
6851 WireConfigTypeLayout { value: ::fidl_next::WireU32(4) };
6852
6853 pub const UINT64: WireConfigTypeLayout =
6854 WireConfigTypeLayout { value: ::fidl_next::WireU32(5) };
6855
6856 pub const INT8: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(6) };
6857
6858 pub const INT16: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(7) };
6859
6860 pub const INT32: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(8) };
6861
6862 pub const INT64: WireConfigTypeLayout = WireConfigTypeLayout { value: ::fidl_next::WireU32(9) };
6863
6864 pub const STRING: WireConfigTypeLayout =
6865 WireConfigTypeLayout { value: ::fidl_next::WireU32(10) };
6866
6867 pub const VECTOR: WireConfigTypeLayout =
6868 WireConfigTypeLayout { value: ::fidl_next::WireU32(11) };
6869}
6870
6871unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigTypeLayout
6872where
6873 ___D: ?Sized,
6874{
6875 fn decode(
6876 slot: ::fidl_next::Slot<'_, Self>,
6877 _: &mut ___D,
6878 ) -> Result<(), ::fidl_next::DecodeError> {
6879 Ok(())
6880 }
6881}
6882
6883impl ::core::convert::From<ConfigTypeLayout> for WireConfigTypeLayout {
6884 fn from(natural: ConfigTypeLayout) -> Self {
6885 match natural {
6886 ConfigTypeLayout::Bool => WireConfigTypeLayout::BOOL,
6887
6888 ConfigTypeLayout::Uint8 => WireConfigTypeLayout::UINT8,
6889
6890 ConfigTypeLayout::Uint16 => WireConfigTypeLayout::UINT16,
6891
6892 ConfigTypeLayout::Uint32 => WireConfigTypeLayout::UINT32,
6893
6894 ConfigTypeLayout::Uint64 => WireConfigTypeLayout::UINT64,
6895
6896 ConfigTypeLayout::Int8 => WireConfigTypeLayout::INT8,
6897
6898 ConfigTypeLayout::Int16 => WireConfigTypeLayout::INT16,
6899
6900 ConfigTypeLayout::Int32 => WireConfigTypeLayout::INT32,
6901
6902 ConfigTypeLayout::Int64 => WireConfigTypeLayout::INT64,
6903
6904 ConfigTypeLayout::String => WireConfigTypeLayout::STRING,
6905
6906 ConfigTypeLayout::Vector => WireConfigTypeLayout::VECTOR,
6907
6908 ConfigTypeLayout::UnknownOrdinal_(value) => {
6909 WireConfigTypeLayout { value: ::fidl_next::WireU32::from(value) }
6910 }
6911 }
6912 }
6913}
6914
6915#[derive(Clone, Debug)]
6916pub enum LayoutConstraint {
6917 MaxSize(u32),
6918
6919 UnknownOrdinal_(u64),
6920}
6921
6922impl ::fidl_next::Encodable for LayoutConstraint {
6923 type Encoded = WireLayoutConstraint;
6924}
6925
6926unsafe impl<___E> ::fidl_next::Encode<___E> for LayoutConstraint
6927where
6928 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6929{
6930 #[inline]
6931 fn encode(
6932 &mut self,
6933 encoder: &mut ___E,
6934 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6935 ) -> Result<(), ::fidl_next::EncodeError> {
6936 ::fidl_next::munge!(let WireLayoutConstraint { raw } = out);
6937
6938 match self {
6939 Self::MaxSize(value) => {
6940 ::fidl_next::RawWireUnion::encode_as_static::<___E, u32>(value, 1, encoder, raw)?
6941 }
6942
6943 Self::UnknownOrdinal_(ordinal) => {
6944 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
6945 }
6946 }
6947
6948 Ok(())
6949 }
6950}
6951
6952impl ::fidl_next::EncodableOption for Box<LayoutConstraint> {
6953 type EncodedOption = WireOptionalLayoutConstraint;
6954}
6955
6956unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<LayoutConstraint>
6957where
6958 ___E: ?Sized,
6959 LayoutConstraint: ::fidl_next::Encode<___E>,
6960{
6961 #[inline]
6962 fn encode_option(
6963 this: Option<&mut Self>,
6964 encoder: &mut ___E,
6965 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6966 ) -> Result<(), ::fidl_next::EncodeError> {
6967 ::fidl_next::munge!(let WireOptionalLayoutConstraint { raw } = &mut *out);
6968
6969 if let Some(inner) = this {
6970 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
6971 ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
6972 } else {
6973 ::fidl_next::RawWireUnion::encode_absent(raw);
6974 }
6975
6976 Ok(())
6977 }
6978}
6979
6980impl ::fidl_next::TakeFrom<WireLayoutConstraint> for LayoutConstraint {
6981 #[inline]
6982 fn take_from(from: &WireLayoutConstraint) -> Self {
6983 match from.raw.ordinal() {
6984 1 => Self::MaxSize(::fidl_next::TakeFrom::take_from(unsafe {
6985 from.raw.get().deref_unchecked::<::fidl_next::WireU32>()
6986 })),
6987
6988 _ => unsafe { ::core::hint::unreachable_unchecked() },
6989 }
6990 }
6991}
6992
6993impl ::fidl_next::TakeFrom<WireOptionalLayoutConstraint> for Option<Box<LayoutConstraint>> {
6994 #[inline]
6995 fn take_from(from: &WireOptionalLayoutConstraint) -> Self {
6996 if let Some(inner) = from.as_ref() {
6997 Some(::fidl_next::TakeFrom::take_from(inner))
6998 } else {
6999 None
7000 }
7001 }
7002}
7003
7004#[repr(transparent)]
7006pub struct WireLayoutConstraint {
7007 raw: ::fidl_next::RawWireUnion,
7008}
7009
7010unsafe impl ::fidl_next::ZeroPadding for WireLayoutConstraint {
7011 #[inline]
7012 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7013 ::fidl_next::munge!(let Self { raw } = out);
7014 ::fidl_next::RawWireUnion::zero_padding(raw);
7015 }
7016}
7017
7018pub mod layout_constraint {
7019 pub enum Ref<'union> {
7020 MaxSize(&'union ::fidl_next::WireU32),
7021
7022 UnknownOrdinal_(u64),
7023 }
7024}
7025
7026impl WireLayoutConstraint {
7027 pub fn as_ref(&self) -> crate::layout_constraint::Ref<'_> {
7028 match self.raw.ordinal() {
7029 1 => crate::layout_constraint::Ref::MaxSize(unsafe {
7030 self.raw.get().deref_unchecked::<::fidl_next::WireU32>()
7031 }),
7032
7033 unknown => crate::layout_constraint::Ref::UnknownOrdinal_(unknown),
7034 }
7035 }
7036}
7037
7038impl Clone for WireLayoutConstraint {
7039 fn clone(&self) -> Self {
7040 match self.raw.ordinal() {
7041 1 => Self { raw: unsafe { self.raw.clone_unchecked::<::fidl_next::WireU32>() } },
7042
7043 _ => Self { raw: unsafe { self.raw.clone_unchecked::<()>() } },
7044 }
7045 }
7046}
7047
7048unsafe impl<___D> ::fidl_next::Decode<___D> for WireLayoutConstraint
7049where
7050 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7051{
7052 fn decode(
7053 mut slot: ::fidl_next::Slot<'_, Self>,
7054 decoder: &mut ___D,
7055 ) -> Result<(), ::fidl_next::DecodeError> {
7056 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
7057 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7058 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, ::fidl_next::WireU32>(
7059 raw, decoder,
7060 )?,
7061
7062 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
7063 }
7064
7065 Ok(())
7066 }
7067}
7068
7069impl ::core::fmt::Debug for WireLayoutConstraint {
7070 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7071 match self.raw.ordinal() {
7072 1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU32>().fmt(f) },
7073 _ => unsafe { ::core::hint::unreachable_unchecked() },
7074 }
7075 }
7076}
7077
7078#[repr(transparent)]
7079pub struct WireOptionalLayoutConstraint {
7080 raw: ::fidl_next::RawWireUnion,
7081}
7082
7083unsafe impl ::fidl_next::ZeroPadding for WireOptionalLayoutConstraint {
7084 #[inline]
7085 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7086 ::fidl_next::munge!(let Self { raw } = out);
7087 ::fidl_next::RawWireUnion::zero_padding(raw);
7088 }
7089}
7090
7091impl WireOptionalLayoutConstraint {
7092 pub fn is_some(&self) -> bool {
7093 self.raw.is_some()
7094 }
7095
7096 pub fn is_none(&self) -> bool {
7097 self.raw.is_none()
7098 }
7099
7100 pub fn as_ref(&self) -> Option<&WireLayoutConstraint> {
7101 if self.is_some() {
7102 Some(unsafe { &*(self as *const Self).cast() })
7103 } else {
7104 None
7105 }
7106 }
7107}
7108
7109impl Clone for WireOptionalLayoutConstraint {
7110 fn clone(&self) -> Self {
7111 if self.is_none() {
7112 return WireOptionalLayoutConstraint { raw: ::fidl_next::RawWireUnion::absent() };
7113 }
7114
7115 match self.raw.ordinal() {
7116 1 => Self { raw: unsafe { self.raw.clone_unchecked::<::fidl_next::WireU32>() } },
7117
7118 _ => Self { raw: unsafe { self.raw.clone_unchecked::<()>() } },
7119 }
7120 }
7121}
7122
7123unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalLayoutConstraint
7124where
7125 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7126{
7127 fn decode(
7128 mut slot: ::fidl_next::Slot<'_, Self>,
7129 decoder: &mut ___D,
7130 ) -> Result<(), ::fidl_next::DecodeError> {
7131 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
7132 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7133 1 => ::fidl_next::RawWireUnion::decode_as_static::<___D, ::fidl_next::WireU32>(
7134 raw, decoder,
7135 )?,
7136
7137 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
7138 _ => ::fidl_next::RawWireUnion::decode_unknown_static(raw, decoder)?,
7139 }
7140
7141 Ok(())
7142 }
7143}
7144
7145impl ::core::fmt::Debug for WireOptionalLayoutConstraint {
7146 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7147 self.as_ref().fmt(f)
7148 }
7149}
7150
7151#[derive(Clone, Debug)]
7152pub struct ConfigType {
7153 pub layout: crate::ConfigTypeLayout,
7154
7155 pub parameters: Option<Vec<crate::LayoutParameter>>,
7156
7157 pub constraints: Vec<crate::LayoutConstraint>,
7158}
7159
7160impl ::fidl_next::Encodable for ConfigType {
7161 type Encoded = WireConfigType;
7162}
7163
7164unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigType
7165where
7166 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7167
7168 ___E: ::fidl_next::Encoder,
7169{
7170 #[inline]
7171 fn encode(
7172 &mut self,
7173 encoder: &mut ___E,
7174 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7175 ) -> Result<(), ::fidl_next::EncodeError> {
7176 ::fidl_next::munge! {
7177 let Self::Encoded {
7178 layout,
7179 parameters,
7180 constraints,
7181
7182 } = out;
7183 }
7184
7185 ::fidl_next::Encode::encode(&mut self.layout, encoder, layout)?;
7186
7187 ::fidl_next::Encode::encode(&mut self.parameters, encoder, parameters)?;
7188
7189 ::fidl_next::Encode::encode(&mut self.constraints, encoder, constraints)?;
7190
7191 Ok(())
7192 }
7193}
7194
7195impl ::fidl_next::EncodableOption for Box<ConfigType> {
7196 type EncodedOption = ::fidl_next::WireBox<WireConfigType>;
7197}
7198
7199unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ConfigType>
7200where
7201 ___E: ::fidl_next::Encoder + ?Sized,
7202 ConfigType: ::fidl_next::Encode<___E>,
7203{
7204 #[inline]
7205 fn encode_option(
7206 this: Option<&mut Self>,
7207 encoder: &mut ___E,
7208 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7209 ) -> Result<(), ::fidl_next::EncodeError> {
7210 if let Some(inner) = this {
7211 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7212 ::fidl_next::WireBox::encode_present(out);
7213 } else {
7214 ::fidl_next::WireBox::encode_absent(out);
7215 }
7216
7217 Ok(())
7218 }
7219}
7220
7221impl ::fidl_next::TakeFrom<WireConfigType> for ConfigType {
7222 #[inline]
7223 fn take_from(from: &WireConfigType) -> Self {
7224 Self {
7225 layout: ::fidl_next::TakeFrom::take_from(&from.layout),
7226
7227 parameters: ::fidl_next::TakeFrom::take_from(&from.parameters),
7228
7229 constraints: ::fidl_next::TakeFrom::take_from(&from.constraints),
7230 }
7231 }
7232}
7233
7234#[derive(Debug)]
7236#[repr(C)]
7237pub struct WireConfigType {
7238 pub layout: crate::WireConfigTypeLayout,
7239
7240 pub parameters: ::fidl_next::WireOptionalVector<crate::WireLayoutParameter>,
7241
7242 pub constraints: ::fidl_next::WireVector<crate::WireLayoutConstraint>,
7243}
7244
7245unsafe impl ::fidl_next::ZeroPadding for WireConfigType {
7246 #[inline]
7247 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7248 unsafe {
7249 out.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
7250 }
7251 }
7252}
7253
7254unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigType
7255where
7256 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7257
7258 ___D: ::fidl_next::Decoder,
7259{
7260 fn decode(
7261 slot: ::fidl_next::Slot<'_, Self>,
7262 decoder: &mut ___D,
7263 ) -> Result<(), ::fidl_next::DecodeError> {
7264 ::fidl_next::munge! {
7265 let Self {
7266 mut layout,
7267 mut parameters,
7268 mut constraints,
7269
7270 } = slot;
7271 }
7272
7273 ::fidl_next::Decode::decode(layout.as_mut(), decoder)?;
7274
7275 ::fidl_next::Decode::decode(parameters.as_mut(), decoder)?;
7276
7277 ::fidl_next::Decode::decode(constraints.as_mut(), decoder)?;
7278
7279 Ok(())
7280 }
7281}
7282
7283#[doc = " The checksum produced for a configuration interface.\n Two configuration interfaces are the same if their checksums are the same.\n"]
7284#[derive(Clone, Debug)]
7285pub enum ConfigChecksum {
7286 Sha256([u8; 32]),
7287
7288 UnknownOrdinal_(u64),
7289}
7290
7291impl ::fidl_next::Encodable for ConfigChecksum {
7292 type Encoded = WireConfigChecksum;
7293}
7294
7295unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigChecksum
7296where
7297 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7298
7299 ___E: ::fidl_next::Encoder,
7300{
7301 #[inline]
7302 fn encode(
7303 &mut self,
7304 encoder: &mut ___E,
7305 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7306 ) -> Result<(), ::fidl_next::EncodeError> {
7307 ::fidl_next::munge!(let WireConfigChecksum { raw } = out);
7308
7309 match self {
7310 Self::Sha256(value) => {
7311 ::fidl_next::RawWireUnion::encode_as::<___E, [u8; 32]>(value, 1, encoder, raw)?
7312 }
7313
7314 Self::UnknownOrdinal_(ordinal) => {
7315 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
7316 }
7317 }
7318
7319 Ok(())
7320 }
7321}
7322
7323impl ::fidl_next::EncodableOption for Box<ConfigChecksum> {
7324 type EncodedOption = WireOptionalConfigChecksum;
7325}
7326
7327unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ConfigChecksum>
7328where
7329 ___E: ?Sized,
7330 ConfigChecksum: ::fidl_next::Encode<___E>,
7331{
7332 #[inline]
7333 fn encode_option(
7334 this: Option<&mut Self>,
7335 encoder: &mut ___E,
7336 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7337 ) -> Result<(), ::fidl_next::EncodeError> {
7338 ::fidl_next::munge!(let WireOptionalConfigChecksum { raw } = &mut *out);
7339
7340 if let Some(inner) = this {
7341 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7342 ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
7343 } else {
7344 ::fidl_next::RawWireUnion::encode_absent(raw);
7345 }
7346
7347 Ok(())
7348 }
7349}
7350
7351impl ::fidl_next::TakeFrom<WireConfigChecksum> for ConfigChecksum {
7352 #[inline]
7353 fn take_from(from: &WireConfigChecksum) -> Self {
7354 match from.raw.ordinal() {
7355 1 => Self::Sha256(::fidl_next::TakeFrom::take_from(unsafe {
7356 from.raw.get().deref_unchecked::<[u8; 32]>()
7357 })),
7358
7359 _ => unsafe { ::core::hint::unreachable_unchecked() },
7360 }
7361 }
7362}
7363
7364impl ::fidl_next::TakeFrom<WireOptionalConfigChecksum> for Option<Box<ConfigChecksum>> {
7365 #[inline]
7366 fn take_from(from: &WireOptionalConfigChecksum) -> Self {
7367 if let Some(inner) = from.as_ref() {
7368 Some(::fidl_next::TakeFrom::take_from(inner))
7369 } else {
7370 None
7371 }
7372 }
7373}
7374
7375#[repr(transparent)]
7377pub struct WireConfigChecksum {
7378 raw: ::fidl_next::RawWireUnion,
7379}
7380
7381unsafe impl ::fidl_next::ZeroPadding for WireConfigChecksum {
7382 #[inline]
7383 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7384 ::fidl_next::munge!(let Self { raw } = out);
7385 ::fidl_next::RawWireUnion::zero_padding(raw);
7386 }
7387}
7388
7389pub mod config_checksum {
7390 pub enum Ref<'union> {
7391 Sha256(&'union [u8; 32]),
7392
7393 UnknownOrdinal_(u64),
7394 }
7395}
7396
7397impl WireConfigChecksum {
7398 pub fn as_ref(&self) -> crate::config_checksum::Ref<'_> {
7399 match self.raw.ordinal() {
7400 1 => crate::config_checksum::Ref::Sha256(unsafe {
7401 self.raw.get().deref_unchecked::<[u8; 32]>()
7402 }),
7403
7404 unknown => crate::config_checksum::Ref::UnknownOrdinal_(unknown),
7405 }
7406 }
7407}
7408
7409unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigChecksum
7410where
7411 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7412
7413 ___D: ::fidl_next::Decoder,
7414{
7415 fn decode(
7416 mut slot: ::fidl_next::Slot<'_, Self>,
7417 decoder: &mut ___D,
7418 ) -> Result<(), ::fidl_next::DecodeError> {
7419 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
7420 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7421 1 => ::fidl_next::RawWireUnion::decode_as::<___D, [u8; 32]>(raw, decoder)?,
7422
7423 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
7424 }
7425
7426 Ok(())
7427 }
7428}
7429
7430impl ::core::fmt::Debug for WireConfigChecksum {
7431 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7432 match self.raw.ordinal() {
7433 1 => unsafe { self.raw.get().deref_unchecked::<[u8; 32]>().fmt(f) },
7434 _ => unsafe { ::core::hint::unreachable_unchecked() },
7435 }
7436 }
7437}
7438
7439#[repr(transparent)]
7440pub struct WireOptionalConfigChecksum {
7441 raw: ::fidl_next::RawWireUnion,
7442}
7443
7444unsafe impl ::fidl_next::ZeroPadding for WireOptionalConfigChecksum {
7445 #[inline]
7446 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7447 ::fidl_next::munge!(let Self { raw } = out);
7448 ::fidl_next::RawWireUnion::zero_padding(raw);
7449 }
7450}
7451
7452impl WireOptionalConfigChecksum {
7453 pub fn is_some(&self) -> bool {
7454 self.raw.is_some()
7455 }
7456
7457 pub fn is_none(&self) -> bool {
7458 self.raw.is_none()
7459 }
7460
7461 pub fn as_ref(&self) -> Option<&WireConfigChecksum> {
7462 if self.is_some() {
7463 Some(unsafe { &*(self as *const Self).cast() })
7464 } else {
7465 None
7466 }
7467 }
7468}
7469
7470unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConfigChecksum
7471where
7472 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7473
7474 ___D: ::fidl_next::Decoder,
7475{
7476 fn decode(
7477 mut slot: ::fidl_next::Slot<'_, Self>,
7478 decoder: &mut ___D,
7479 ) -> Result<(), ::fidl_next::DecodeError> {
7480 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
7481 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
7482 1 => ::fidl_next::RawWireUnion::decode_as::<___D, [u8; 32]>(raw, decoder)?,
7483
7484 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
7485 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
7486 }
7487
7488 Ok(())
7489 }
7490}
7491
7492impl ::core::fmt::Debug for WireOptionalConfigChecksum {
7493 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
7494 self.as_ref().fmt(f)
7495 }
7496}
7497
7498#[doc = " Declares storage used by a component, which was offered to it.\n"]
7499#[derive(Clone, Debug)]
7500pub struct UseStorage {
7501 pub source_name: Option<String>,
7502
7503 pub target_path: Option<String>,
7504
7505 pub availability: Option<crate::Availability>,
7506}
7507
7508impl UseStorage {
7509 fn __max_ordinal(&self) -> usize {
7510 if self.source_name.is_some() {
7511 return 1;
7512 }
7513
7514 if self.target_path.is_some() {
7515 return 2;
7516 }
7517
7518 if self.availability.is_some() {
7519 return 3;
7520 }
7521
7522 0
7523 }
7524}
7525
7526impl ::fidl_next::Encodable for UseStorage {
7527 type Encoded = WireUseStorage;
7528}
7529
7530unsafe impl<___E> ::fidl_next::Encode<___E> for UseStorage
7531where
7532 ___E: ::fidl_next::Encoder + ?Sized,
7533{
7534 #[inline]
7535 fn encode(
7536 &mut self,
7537 encoder: &mut ___E,
7538 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7539 ) -> Result<(), ::fidl_next::EncodeError> {
7540 ::fidl_next::munge!(let WireUseStorage { table } = out);
7541
7542 let max_ord = self.__max_ordinal();
7543
7544 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7545 ::fidl_next::ZeroPadding::zero_padding(&mut out);
7546
7547 let mut preallocated =
7548 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7549
7550 for i in 1..=max_ord {
7551 match i {
7552 3 => {
7553 if let Some(availability) = &mut self.availability {
7554 ::fidl_next::WireEnvelope::encode_value(
7555 availability,
7556 preallocated.encoder,
7557 &mut out,
7558 )?;
7559 } else {
7560 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7561 }
7562 }
7563
7564 2 => {
7565 if let Some(target_path) = &mut self.target_path {
7566 ::fidl_next::WireEnvelope::encode_value(
7567 target_path,
7568 preallocated.encoder,
7569 &mut out,
7570 )?;
7571 } else {
7572 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7573 }
7574 }
7575
7576 1 => {
7577 if let Some(source_name) = &mut self.source_name {
7578 ::fidl_next::WireEnvelope::encode_value(
7579 source_name,
7580 preallocated.encoder,
7581 &mut out,
7582 )?;
7583 } else {
7584 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7585 }
7586 }
7587
7588 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7589 }
7590 unsafe {
7591 preallocated.write_next(out.assume_init_ref());
7592 }
7593 }
7594
7595 ::fidl_next::WireTable::encode_len(table, max_ord);
7596
7597 Ok(())
7598 }
7599}
7600
7601impl ::fidl_next::TakeFrom<WireUseStorage> for UseStorage {
7602 #[inline]
7603 fn take_from(from: &WireUseStorage) -> Self {
7604 Self {
7605 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
7606
7607 target_path: from.target_path().map(::fidl_next::TakeFrom::take_from),
7608
7609 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
7610 }
7611 }
7612}
7613
7614#[repr(C)]
7616pub struct WireUseStorage {
7617 table: ::fidl_next::WireTable,
7618}
7619
7620unsafe impl ::fidl_next::ZeroPadding for WireUseStorage {
7621 #[inline]
7622 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7623 ::fidl_next::munge!(let Self { table } = out);
7624 ::fidl_next::WireTable::zero_padding(table);
7625 }
7626}
7627
7628unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseStorage
7629where
7630 ___D: ::fidl_next::Decoder + ?Sized,
7631{
7632 fn decode(
7633 slot: ::fidl_next::Slot<'_, Self>,
7634 decoder: &mut ___D,
7635 ) -> Result<(), ::fidl_next::DecodeError> {
7636 ::fidl_next::munge!(let Self { table } = slot);
7637
7638 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
7639 match ordinal {
7640 0 => unsafe { ::core::hint::unreachable_unchecked() },
7641
7642 1 => {
7643 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
7644 slot.as_mut(),
7645 decoder,
7646 )?;
7647
7648 let source_name = unsafe {
7649 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
7650 };
7651
7652 if source_name.len() > 100 {
7653 return Err(::fidl_next::DecodeError::VectorTooLong {
7654 size: source_name.len() as u64,
7655 limit: 100,
7656 });
7657 }
7658
7659 Ok(())
7660 }
7661
7662 2 => {
7663 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
7664 slot.as_mut(),
7665 decoder,
7666 )?;
7667
7668 let target_path = unsafe {
7669 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
7670 };
7671
7672 if target_path.len() > 1024 {
7673 return Err(::fidl_next::DecodeError::VectorTooLong {
7674 size: target_path.len() as u64,
7675 limit: 1024,
7676 });
7677 }
7678
7679 Ok(())
7680 }
7681
7682 3 => {
7683 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
7684 slot.as_mut(),
7685 decoder,
7686 )?;
7687
7688 Ok(())
7689 }
7690
7691 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
7692 }
7693 })
7694 }
7695}
7696
7697impl WireUseStorage {
7698 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
7699 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
7700 }
7701
7702 pub fn target_path(&self) -> Option<&::fidl_next::WireString> {
7703 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
7704 }
7705
7706 pub fn availability(&self) -> Option<&crate::WireAvailability> {
7707 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
7708 }
7709}
7710
7711impl ::core::fmt::Debug for WireUseStorage {
7712 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
7713 f.debug_struct("UseStorage")
7714 .field("source_name", &self.source_name())
7715 .field("target_path", &self.target_path())
7716 .field("availability", &self.availability())
7717 .finish()
7718 }
7719}
7720
7721::fidl_next::bitflags! {
7722 #[doc = " Allowed sources for runtime overrides of a config field\'s value.\n"]#[derive(
7723 Clone,
7724 Copy,
7725 Debug,
7726 PartialEq,
7727 Eq,
7728 Hash,
7729 )]
7730 pub struct ConfigMutability: u32 {
7731 #[doc = " Allow parent components to provide overrides for the configuration field.\n"]const PARENT = 1;
7732 const _ = !0;
7733 }
7734}
7735
7736impl ::fidl_next::Encodable for ConfigMutability {
7737 type Encoded = WireConfigMutability;
7738}
7739
7740unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigMutability
7741where
7742 ___E: ?Sized,
7743{
7744 #[inline]
7745 fn encode(
7746 &mut self,
7747 _: &mut ___E,
7748 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7749 ) -> Result<(), ::fidl_next::EncodeError> {
7750 ::fidl_next::munge!(let WireConfigMutability { value } = out);
7751 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
7752 Ok(())
7753 }
7754}
7755
7756impl ::core::convert::From<WireConfigMutability> for ConfigMutability {
7757 fn from(wire: WireConfigMutability) -> Self {
7758 Self::from_bits_retain(u32::from(wire.value))
7759 }
7760}
7761
7762impl ::fidl_next::TakeFrom<WireConfigMutability> for ConfigMutability {
7763 #[inline]
7764 fn take_from(from: &WireConfigMutability) -> Self {
7765 Self::from(*from)
7766 }
7767}
7768
7769#[derive(Clone, Copy, Debug)]
7771#[repr(transparent)]
7772pub struct WireConfigMutability {
7773 value: ::fidl_next::WireU32,
7774}
7775
7776unsafe impl ::fidl_next::ZeroPadding for WireConfigMutability {
7777 #[inline]
7778 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
7779 }
7781}
7782
7783unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigMutability
7784where
7785 ___D: ?Sized,
7786{
7787 fn decode(
7788 slot: ::fidl_next::Slot<'_, Self>,
7789 _: &mut ___D,
7790 ) -> Result<(), ::fidl_next::DecodeError> {
7791 Ok(())
7792 }
7793}
7794
7795impl ::core::convert::From<ConfigMutability> for WireConfigMutability {
7796 fn from(natural: ConfigMutability) -> Self {
7797 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
7798 }
7799}
7800
7801#[doc = " Declares a single config field (key + type)\n"]
7802#[derive(Clone, Debug)]
7803pub struct ConfigField {
7804 pub key: Option<String>,
7805
7806 pub type_: Option<crate::ConfigType>,
7807
7808 pub mutability: Option<crate::ConfigMutability>,
7809}
7810
7811impl ConfigField {
7812 fn __max_ordinal(&self) -> usize {
7813 if self.key.is_some() {
7814 return 1;
7815 }
7816
7817 if self.type_.is_some() {
7818 return 2;
7819 }
7820
7821 if self.mutability.is_some() {
7822 return 3;
7823 }
7824
7825 0
7826 }
7827}
7828
7829impl ::fidl_next::Encodable for ConfigField {
7830 type Encoded = WireConfigField;
7831}
7832
7833unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigField
7834where
7835 ___E: ::fidl_next::Encoder + ?Sized,
7836{
7837 #[inline]
7838 fn encode(
7839 &mut self,
7840 encoder: &mut ___E,
7841 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7842 ) -> Result<(), ::fidl_next::EncodeError> {
7843 ::fidl_next::munge!(let WireConfigField { table } = out);
7844
7845 let max_ord = self.__max_ordinal();
7846
7847 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7848 ::fidl_next::ZeroPadding::zero_padding(&mut out);
7849
7850 let mut preallocated =
7851 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7852
7853 for i in 1..=max_ord {
7854 match i {
7855 3 => {
7856 if let Some(mutability) = &mut self.mutability {
7857 ::fidl_next::WireEnvelope::encode_value(
7858 mutability,
7859 preallocated.encoder,
7860 &mut out,
7861 )?;
7862 } else {
7863 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7864 }
7865 }
7866
7867 2 => {
7868 if let Some(type_) = &mut self.type_ {
7869 ::fidl_next::WireEnvelope::encode_value(
7870 type_,
7871 preallocated.encoder,
7872 &mut out,
7873 )?;
7874 } else {
7875 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7876 }
7877 }
7878
7879 1 => {
7880 if let Some(key) = &mut self.key {
7881 ::fidl_next::WireEnvelope::encode_value(
7882 key,
7883 preallocated.encoder,
7884 &mut out,
7885 )?;
7886 } else {
7887 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7888 }
7889 }
7890
7891 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7892 }
7893 unsafe {
7894 preallocated.write_next(out.assume_init_ref());
7895 }
7896 }
7897
7898 ::fidl_next::WireTable::encode_len(table, max_ord);
7899
7900 Ok(())
7901 }
7902}
7903
7904impl ::fidl_next::TakeFrom<WireConfigField> for ConfigField {
7905 #[inline]
7906 fn take_from(from: &WireConfigField) -> Self {
7907 Self {
7908 key: from.key().map(::fidl_next::TakeFrom::take_from),
7909
7910 type_: from.type_().map(::fidl_next::TakeFrom::take_from),
7911
7912 mutability: from.mutability().map(::fidl_next::TakeFrom::take_from),
7913 }
7914 }
7915}
7916
7917#[repr(C)]
7919pub struct WireConfigField {
7920 table: ::fidl_next::WireTable,
7921}
7922
7923unsafe impl ::fidl_next::ZeroPadding for WireConfigField {
7924 #[inline]
7925 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7926 ::fidl_next::munge!(let Self { table } = out);
7927 ::fidl_next::WireTable::zero_padding(table);
7928 }
7929}
7930
7931unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigField
7932where
7933 ___D: ::fidl_next::Decoder + ?Sized,
7934{
7935 fn decode(
7936 slot: ::fidl_next::Slot<'_, Self>,
7937 decoder: &mut ___D,
7938 ) -> Result<(), ::fidl_next::DecodeError> {
7939 ::fidl_next::munge!(let Self { table } = slot);
7940
7941 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
7942 match ordinal {
7943 0 => unsafe { ::core::hint::unreachable_unchecked() },
7944
7945 1 => {
7946 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
7947 slot.as_mut(),
7948 decoder,
7949 )?;
7950
7951 let key = unsafe {
7952 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
7953 };
7954
7955 if key.len() > 64 {
7956 return Err(::fidl_next::DecodeError::VectorTooLong {
7957 size: key.len() as u64,
7958 limit: 64,
7959 });
7960 }
7961
7962 Ok(())
7963 }
7964
7965 2 => {
7966 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigType>(
7967 slot.as_mut(),
7968 decoder,
7969 )?;
7970
7971 Ok(())
7972 }
7973
7974 3 => {
7975 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigMutability>(
7976 slot.as_mut(),
7977 decoder,
7978 )?;
7979
7980 Ok(())
7981 }
7982
7983 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
7984 }
7985 })
7986 }
7987}
7988
7989impl WireConfigField {
7990 pub fn key(&self) -> Option<&::fidl_next::WireString> {
7991 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
7992 }
7993
7994 pub fn type_(&self) -> Option<&crate::WireConfigType> {
7995 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
7996 }
7997
7998 pub fn mutability(&self) -> Option<&crate::WireConfigMutability> {
7999 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
8000 }
8001}
8002
8003impl ::core::fmt::Debug for WireConfigField {
8004 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
8005 f.debug_struct("ConfigField")
8006 .field("key", &self.key())
8007 .field("type_", &self.type_())
8008 .field("mutability", &self.mutability())
8009 .finish()
8010 }
8011}
8012
8013#[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"]
8014#[derive(Clone, Debug)]
8015pub struct Program {
8016 pub runner: Option<String>,
8017
8018 pub info: Option<::fidl_next_fuchsia_data::Dictionary>,
8019}
8020
8021impl Program {
8022 fn __max_ordinal(&self) -> usize {
8023 if self.runner.is_some() {
8024 return 1;
8025 }
8026
8027 if self.info.is_some() {
8028 return 2;
8029 }
8030
8031 0
8032 }
8033}
8034
8035impl ::fidl_next::Encodable for Program {
8036 type Encoded = WireProgram;
8037}
8038
8039unsafe impl<___E> ::fidl_next::Encode<___E> for Program
8040where
8041 ___E: ::fidl_next::Encoder + ?Sized,
8042{
8043 #[inline]
8044 fn encode(
8045 &mut self,
8046 encoder: &mut ___E,
8047 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8048 ) -> Result<(), ::fidl_next::EncodeError> {
8049 ::fidl_next::munge!(let WireProgram { table } = out);
8050
8051 let max_ord = self.__max_ordinal();
8052
8053 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8054 ::fidl_next::ZeroPadding::zero_padding(&mut out);
8055
8056 let mut preallocated =
8057 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8058
8059 for i in 1..=max_ord {
8060 match i {
8061 2 => {
8062 if let Some(info) = &mut self.info {
8063 ::fidl_next::WireEnvelope::encode_value(
8064 info,
8065 preallocated.encoder,
8066 &mut out,
8067 )?;
8068 } else {
8069 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8070 }
8071 }
8072
8073 1 => {
8074 if let Some(runner) = &mut self.runner {
8075 ::fidl_next::WireEnvelope::encode_value(
8076 runner,
8077 preallocated.encoder,
8078 &mut out,
8079 )?;
8080 } else {
8081 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8082 }
8083 }
8084
8085 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8086 }
8087 unsafe {
8088 preallocated.write_next(out.assume_init_ref());
8089 }
8090 }
8091
8092 ::fidl_next::WireTable::encode_len(table, max_ord);
8093
8094 Ok(())
8095 }
8096}
8097
8098impl ::fidl_next::TakeFrom<WireProgram> for Program {
8099 #[inline]
8100 fn take_from(from: &WireProgram) -> Self {
8101 Self {
8102 runner: from.runner().map(::fidl_next::TakeFrom::take_from),
8103
8104 info: from.info().map(::fidl_next::TakeFrom::take_from),
8105 }
8106 }
8107}
8108
8109#[repr(C)]
8111pub struct WireProgram {
8112 table: ::fidl_next::WireTable,
8113}
8114
8115unsafe impl ::fidl_next::ZeroPadding for WireProgram {
8116 #[inline]
8117 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8118 ::fidl_next::munge!(let Self { table } = out);
8119 ::fidl_next::WireTable::zero_padding(table);
8120 }
8121}
8122
8123unsafe impl<___D> ::fidl_next::Decode<___D> for WireProgram
8124where
8125 ___D: ::fidl_next::Decoder + ?Sized,
8126{
8127 fn decode(
8128 slot: ::fidl_next::Slot<'_, Self>,
8129 decoder: &mut ___D,
8130 ) -> Result<(), ::fidl_next::DecodeError> {
8131 ::fidl_next::munge!(let Self { table } = slot);
8132
8133 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8134 match ordinal {
8135 0 => unsafe { ::core::hint::unreachable_unchecked() },
8136
8137 1 => {
8138 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
8139 slot.as_mut(),
8140 decoder,
8141 )?;
8142
8143 let runner = unsafe {
8144 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
8145 };
8146
8147 if runner.len() > 100 {
8148 return Err(::fidl_next::DecodeError::VectorTooLong {
8149 size: runner.len() as u64,
8150 limit: 100,
8151 });
8152 }
8153
8154 Ok(())
8155 }
8156
8157 2 => {
8158 ::fidl_next::WireEnvelope::decode_as::<
8159 ___D,
8160 ::fidl_next_fuchsia_data::WireDictionary,
8161 >(slot.as_mut(), decoder)?;
8162
8163 Ok(())
8164 }
8165
8166 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
8167 }
8168 })
8169 }
8170}
8171
8172impl WireProgram {
8173 pub fn runner(&self) -> Option<&::fidl_next::WireString> {
8174 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8175 }
8176
8177 pub fn info(&self) -> Option<&::fidl_next_fuchsia_data::WireDictionary> {
8178 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
8179 }
8180}
8181
8182impl ::core::fmt::Debug for WireProgram {
8183 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
8184 f.debug_struct("Program")
8185 .field("runner", &self.runner())
8186 .field("info", &self.info())
8187 .finish()
8188 }
8189}
8190
8191#[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"]
8192#[derive(Clone, Debug)]
8193pub struct UseService {
8194 pub source: Option<crate::Ref>,
8195
8196 pub source_name: Option<String>,
8197
8198 pub target_path: Option<String>,
8199
8200 pub dependency_type: Option<crate::DependencyType>,
8201
8202 pub availability: Option<crate::Availability>,
8203
8204 pub source_dictionary: Option<String>,
8205}
8206
8207impl UseService {
8208 fn __max_ordinal(&self) -> usize {
8209 if self.source.is_some() {
8210 return 1;
8211 }
8212
8213 if self.source_name.is_some() {
8214 return 2;
8215 }
8216
8217 if self.target_path.is_some() {
8218 return 3;
8219 }
8220
8221 if self.dependency_type.is_some() {
8222 return 4;
8223 }
8224
8225 if self.availability.is_some() {
8226 return 5;
8227 }
8228
8229 if self.source_dictionary.is_some() {
8230 return 6;
8231 }
8232
8233 0
8234 }
8235}
8236
8237impl ::fidl_next::Encodable for UseService {
8238 type Encoded = WireUseService;
8239}
8240
8241unsafe impl<___E> ::fidl_next::Encode<___E> for UseService
8242where
8243 ___E: ::fidl_next::Encoder + ?Sized,
8244{
8245 #[inline]
8246 fn encode(
8247 &mut self,
8248 encoder: &mut ___E,
8249 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8250 ) -> Result<(), ::fidl_next::EncodeError> {
8251 ::fidl_next::munge!(let WireUseService { table } = out);
8252
8253 let max_ord = self.__max_ordinal();
8254
8255 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8256 ::fidl_next::ZeroPadding::zero_padding(&mut out);
8257
8258 let mut preallocated =
8259 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8260
8261 for i in 1..=max_ord {
8262 match i {
8263 6 => {
8264 if let Some(source_dictionary) = &mut self.source_dictionary {
8265 ::fidl_next::WireEnvelope::encode_value(
8266 source_dictionary,
8267 preallocated.encoder,
8268 &mut out,
8269 )?;
8270 } else {
8271 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8272 }
8273 }
8274
8275 5 => {
8276 if let Some(availability) = &mut self.availability {
8277 ::fidl_next::WireEnvelope::encode_value(
8278 availability,
8279 preallocated.encoder,
8280 &mut out,
8281 )?;
8282 } else {
8283 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8284 }
8285 }
8286
8287 4 => {
8288 if let Some(dependency_type) = &mut self.dependency_type {
8289 ::fidl_next::WireEnvelope::encode_value(
8290 dependency_type,
8291 preallocated.encoder,
8292 &mut out,
8293 )?;
8294 } else {
8295 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8296 }
8297 }
8298
8299 3 => {
8300 if let Some(target_path) = &mut self.target_path {
8301 ::fidl_next::WireEnvelope::encode_value(
8302 target_path,
8303 preallocated.encoder,
8304 &mut out,
8305 )?;
8306 } else {
8307 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8308 }
8309 }
8310
8311 2 => {
8312 if let Some(source_name) = &mut self.source_name {
8313 ::fidl_next::WireEnvelope::encode_value(
8314 source_name,
8315 preallocated.encoder,
8316 &mut out,
8317 )?;
8318 } else {
8319 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8320 }
8321 }
8322
8323 1 => {
8324 if let Some(source) = &mut self.source {
8325 ::fidl_next::WireEnvelope::encode_value(
8326 source,
8327 preallocated.encoder,
8328 &mut out,
8329 )?;
8330 } else {
8331 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8332 }
8333 }
8334
8335 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8336 }
8337 unsafe {
8338 preallocated.write_next(out.assume_init_ref());
8339 }
8340 }
8341
8342 ::fidl_next::WireTable::encode_len(table, max_ord);
8343
8344 Ok(())
8345 }
8346}
8347
8348impl ::fidl_next::TakeFrom<WireUseService> for UseService {
8349 #[inline]
8350 fn take_from(from: &WireUseService) -> Self {
8351 Self {
8352 source: from.source().map(::fidl_next::TakeFrom::take_from),
8353
8354 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
8355
8356 target_path: from.target_path().map(::fidl_next::TakeFrom::take_from),
8357
8358 dependency_type: from.dependency_type().map(::fidl_next::TakeFrom::take_from),
8359
8360 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
8361
8362 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
8363 }
8364 }
8365}
8366
8367#[repr(C)]
8369pub struct WireUseService {
8370 table: ::fidl_next::WireTable,
8371}
8372
8373unsafe impl ::fidl_next::ZeroPadding for WireUseService {
8374 #[inline]
8375 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8376 ::fidl_next::munge!(let Self { table } = out);
8377 ::fidl_next::WireTable::zero_padding(table);
8378 }
8379}
8380
8381unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseService
8382where
8383 ___D: ::fidl_next::Decoder + ?Sized,
8384{
8385 fn decode(
8386 slot: ::fidl_next::Slot<'_, Self>,
8387 decoder: &mut ___D,
8388 ) -> Result<(), ::fidl_next::DecodeError> {
8389 ::fidl_next::munge!(let Self { table } = slot);
8390
8391 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8392 match ordinal {
8393 0 => unsafe { ::core::hint::unreachable_unchecked() },
8394
8395 1 => {
8396 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
8397 slot.as_mut(),
8398 decoder,
8399 )?;
8400
8401 Ok(())
8402 }
8403
8404 2 => {
8405 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
8406 slot.as_mut(),
8407 decoder,
8408 )?;
8409
8410 let source_name = unsafe {
8411 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
8412 };
8413
8414 if source_name.len() > 100 {
8415 return Err(::fidl_next::DecodeError::VectorTooLong {
8416 size: source_name.len() as u64,
8417 limit: 100,
8418 });
8419 }
8420
8421 Ok(())
8422 }
8423
8424 3 => {
8425 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
8426 slot.as_mut(),
8427 decoder,
8428 )?;
8429
8430 let target_path = unsafe {
8431 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
8432 };
8433
8434 if target_path.len() > 1024 {
8435 return Err(::fidl_next::DecodeError::VectorTooLong {
8436 size: target_path.len() as u64,
8437 limit: 1024,
8438 });
8439 }
8440
8441 Ok(())
8442 }
8443
8444 4 => {
8445 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
8446 slot.as_mut(),
8447 decoder,
8448 )?;
8449
8450 Ok(())
8451 }
8452
8453 5 => {
8454 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
8455 slot.as_mut(),
8456 decoder,
8457 )?;
8458
8459 Ok(())
8460 }
8461
8462 6 => {
8463 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
8464 slot.as_mut(),
8465 decoder,
8466 )?;
8467
8468 let source_dictionary = unsafe {
8469 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
8470 };
8471
8472 if source_dictionary.len() > 1024 {
8473 return Err(::fidl_next::DecodeError::VectorTooLong {
8474 size: source_dictionary.len() as u64,
8475 limit: 1024,
8476 });
8477 }
8478
8479 Ok(())
8480 }
8481
8482 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
8483 }
8484 })
8485 }
8486}
8487
8488impl WireUseService {
8489 pub fn source(&self) -> Option<&crate::WireRef> {
8490 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8491 }
8492
8493 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
8494 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
8495 }
8496
8497 pub fn target_path(&self) -> Option<&::fidl_next::WireString> {
8498 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
8499 }
8500
8501 pub fn dependency_type(&self) -> Option<&crate::WireDependencyType> {
8502 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
8503 }
8504
8505 pub fn availability(&self) -> Option<&crate::WireAvailability> {
8506 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
8507 }
8508
8509 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
8510 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
8511 }
8512}
8513
8514impl ::core::fmt::Debug for WireUseService {
8515 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
8516 f.debug_struct("UseService")
8517 .field("source", &self.source())
8518 .field("source_name", &self.source_name())
8519 .field("target_path", &self.target_path())
8520 .field("dependency_type", &self.dependency_type())
8521 .field("availability", &self.availability())
8522 .field("source_dictionary", &self.source_dictionary())
8523 .finish()
8524 }
8525}
8526
8527#[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"]
8528#[derive(Clone, Debug)]
8529pub struct UseProtocol {
8530 pub source: Option<crate::Ref>,
8531
8532 pub source_name: Option<String>,
8533
8534 pub target_path: Option<String>,
8535
8536 pub dependency_type: Option<crate::DependencyType>,
8537
8538 pub availability: Option<crate::Availability>,
8539
8540 pub source_dictionary: Option<String>,
8541}
8542
8543impl UseProtocol {
8544 fn __max_ordinal(&self) -> usize {
8545 if self.source.is_some() {
8546 return 1;
8547 }
8548
8549 if self.source_name.is_some() {
8550 return 2;
8551 }
8552
8553 if self.target_path.is_some() {
8554 return 3;
8555 }
8556
8557 if self.dependency_type.is_some() {
8558 return 4;
8559 }
8560
8561 if self.availability.is_some() {
8562 return 5;
8563 }
8564
8565 if self.source_dictionary.is_some() {
8566 return 6;
8567 }
8568
8569 0
8570 }
8571}
8572
8573impl ::fidl_next::Encodable for UseProtocol {
8574 type Encoded = WireUseProtocol;
8575}
8576
8577unsafe impl<___E> ::fidl_next::Encode<___E> for UseProtocol
8578where
8579 ___E: ::fidl_next::Encoder + ?Sized,
8580{
8581 #[inline]
8582 fn encode(
8583 &mut self,
8584 encoder: &mut ___E,
8585 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8586 ) -> Result<(), ::fidl_next::EncodeError> {
8587 ::fidl_next::munge!(let WireUseProtocol { table } = out);
8588
8589 let max_ord = self.__max_ordinal();
8590
8591 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8592 ::fidl_next::ZeroPadding::zero_padding(&mut out);
8593
8594 let mut preallocated =
8595 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8596
8597 for i in 1..=max_ord {
8598 match i {
8599 6 => {
8600 if let Some(source_dictionary) = &mut self.source_dictionary {
8601 ::fidl_next::WireEnvelope::encode_value(
8602 source_dictionary,
8603 preallocated.encoder,
8604 &mut out,
8605 )?;
8606 } else {
8607 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8608 }
8609 }
8610
8611 5 => {
8612 if let Some(availability) = &mut self.availability {
8613 ::fidl_next::WireEnvelope::encode_value(
8614 availability,
8615 preallocated.encoder,
8616 &mut out,
8617 )?;
8618 } else {
8619 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8620 }
8621 }
8622
8623 4 => {
8624 if let Some(dependency_type) = &mut self.dependency_type {
8625 ::fidl_next::WireEnvelope::encode_value(
8626 dependency_type,
8627 preallocated.encoder,
8628 &mut out,
8629 )?;
8630 } else {
8631 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8632 }
8633 }
8634
8635 3 => {
8636 if let Some(target_path) = &mut self.target_path {
8637 ::fidl_next::WireEnvelope::encode_value(
8638 target_path,
8639 preallocated.encoder,
8640 &mut out,
8641 )?;
8642 } else {
8643 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8644 }
8645 }
8646
8647 2 => {
8648 if let Some(source_name) = &mut self.source_name {
8649 ::fidl_next::WireEnvelope::encode_value(
8650 source_name,
8651 preallocated.encoder,
8652 &mut out,
8653 )?;
8654 } else {
8655 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8656 }
8657 }
8658
8659 1 => {
8660 if let Some(source) = &mut self.source {
8661 ::fidl_next::WireEnvelope::encode_value(
8662 source,
8663 preallocated.encoder,
8664 &mut out,
8665 )?;
8666 } else {
8667 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8668 }
8669 }
8670
8671 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8672 }
8673 unsafe {
8674 preallocated.write_next(out.assume_init_ref());
8675 }
8676 }
8677
8678 ::fidl_next::WireTable::encode_len(table, max_ord);
8679
8680 Ok(())
8681 }
8682}
8683
8684impl ::fidl_next::TakeFrom<WireUseProtocol> for UseProtocol {
8685 #[inline]
8686 fn take_from(from: &WireUseProtocol) -> Self {
8687 Self {
8688 source: from.source().map(::fidl_next::TakeFrom::take_from),
8689
8690 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
8691
8692 target_path: from.target_path().map(::fidl_next::TakeFrom::take_from),
8693
8694 dependency_type: from.dependency_type().map(::fidl_next::TakeFrom::take_from),
8695
8696 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
8697
8698 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
8699 }
8700 }
8701}
8702
8703#[repr(C)]
8705pub struct WireUseProtocol {
8706 table: ::fidl_next::WireTable,
8707}
8708
8709unsafe impl ::fidl_next::ZeroPadding for WireUseProtocol {
8710 #[inline]
8711 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
8712 ::fidl_next::munge!(let Self { table } = out);
8713 ::fidl_next::WireTable::zero_padding(table);
8714 }
8715}
8716
8717unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseProtocol
8718where
8719 ___D: ::fidl_next::Decoder + ?Sized,
8720{
8721 fn decode(
8722 slot: ::fidl_next::Slot<'_, Self>,
8723 decoder: &mut ___D,
8724 ) -> Result<(), ::fidl_next::DecodeError> {
8725 ::fidl_next::munge!(let Self { table } = slot);
8726
8727 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
8728 match ordinal {
8729 0 => unsafe { ::core::hint::unreachable_unchecked() },
8730
8731 1 => {
8732 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
8733 slot.as_mut(),
8734 decoder,
8735 )?;
8736
8737 Ok(())
8738 }
8739
8740 2 => {
8741 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
8742 slot.as_mut(),
8743 decoder,
8744 )?;
8745
8746 let source_name = unsafe {
8747 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
8748 };
8749
8750 if source_name.len() > 100 {
8751 return Err(::fidl_next::DecodeError::VectorTooLong {
8752 size: source_name.len() as u64,
8753 limit: 100,
8754 });
8755 }
8756
8757 Ok(())
8758 }
8759
8760 3 => {
8761 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
8762 slot.as_mut(),
8763 decoder,
8764 )?;
8765
8766 let target_path = unsafe {
8767 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
8768 };
8769
8770 if target_path.len() > 1024 {
8771 return Err(::fidl_next::DecodeError::VectorTooLong {
8772 size: target_path.len() as u64,
8773 limit: 1024,
8774 });
8775 }
8776
8777 Ok(())
8778 }
8779
8780 4 => {
8781 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
8782 slot.as_mut(),
8783 decoder,
8784 )?;
8785
8786 Ok(())
8787 }
8788
8789 5 => {
8790 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
8791 slot.as_mut(),
8792 decoder,
8793 )?;
8794
8795 Ok(())
8796 }
8797
8798 6 => {
8799 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
8800 slot.as_mut(),
8801 decoder,
8802 )?;
8803
8804 let source_dictionary = unsafe {
8805 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
8806 };
8807
8808 if source_dictionary.len() > 1024 {
8809 return Err(::fidl_next::DecodeError::VectorTooLong {
8810 size: source_dictionary.len() as u64,
8811 limit: 1024,
8812 });
8813 }
8814
8815 Ok(())
8816 }
8817
8818 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
8819 }
8820 })
8821 }
8822}
8823
8824impl WireUseProtocol {
8825 pub fn source(&self) -> Option<&crate::WireRef> {
8826 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
8827 }
8828
8829 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
8830 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
8831 }
8832
8833 pub fn target_path(&self) -> Option<&::fidl_next::WireString> {
8834 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
8835 }
8836
8837 pub fn dependency_type(&self) -> Option<&crate::WireDependencyType> {
8838 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
8839 }
8840
8841 pub fn availability(&self) -> Option<&crate::WireAvailability> {
8842 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
8843 }
8844
8845 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
8846 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
8847 }
8848}
8849
8850impl ::core::fmt::Debug for WireUseProtocol {
8851 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
8852 f.debug_struct("UseProtocol")
8853 .field("source", &self.source())
8854 .field("source_name", &self.source_name())
8855 .field("target_path", &self.target_path())
8856 .field("dependency_type", &self.dependency_type())
8857 .field("availability", &self.availability())
8858 .field("source_dictionary", &self.source_dictionary())
8859 .finish()
8860 }
8861}
8862
8863#[doc = " Declares a directory used by a component, which was offered to it.\n"]
8864#[derive(Clone, Debug)]
8865pub struct UseDirectory {
8866 pub source: Option<crate::Ref>,
8867
8868 pub source_name: Option<String>,
8869
8870 pub target_path: Option<String>,
8871
8872 pub rights: Option<::fidl_next_fuchsia_io::Operations>,
8873
8874 pub subdir: Option<String>,
8875
8876 pub dependency_type: Option<crate::DependencyType>,
8877
8878 pub availability: Option<crate::Availability>,
8879
8880 pub source_dictionary: Option<String>,
8881}
8882
8883impl UseDirectory {
8884 fn __max_ordinal(&self) -> usize {
8885 if self.source.is_some() {
8886 return 1;
8887 }
8888
8889 if self.source_name.is_some() {
8890 return 2;
8891 }
8892
8893 if self.target_path.is_some() {
8894 return 3;
8895 }
8896
8897 if self.rights.is_some() {
8898 return 4;
8899 }
8900
8901 if self.subdir.is_some() {
8902 return 5;
8903 }
8904
8905 if self.dependency_type.is_some() {
8906 return 6;
8907 }
8908
8909 if self.availability.is_some() {
8910 return 7;
8911 }
8912
8913 if self.source_dictionary.is_some() {
8914 return 8;
8915 }
8916
8917 0
8918 }
8919}
8920
8921impl ::fidl_next::Encodable for UseDirectory {
8922 type Encoded = WireUseDirectory;
8923}
8924
8925unsafe impl<___E> ::fidl_next::Encode<___E> for UseDirectory
8926where
8927 ___E: ::fidl_next::Encoder + ?Sized,
8928{
8929 #[inline]
8930 fn encode(
8931 &mut self,
8932 encoder: &mut ___E,
8933 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8934 ) -> Result<(), ::fidl_next::EncodeError> {
8935 ::fidl_next::munge!(let WireUseDirectory { table } = out);
8936
8937 let max_ord = self.__max_ordinal();
8938
8939 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8940 ::fidl_next::ZeroPadding::zero_padding(&mut out);
8941
8942 let mut preallocated =
8943 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8944
8945 for i in 1..=max_ord {
8946 match i {
8947 8 => {
8948 if let Some(source_dictionary) = &mut self.source_dictionary {
8949 ::fidl_next::WireEnvelope::encode_value(
8950 source_dictionary,
8951 preallocated.encoder,
8952 &mut out,
8953 )?;
8954 } else {
8955 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8956 }
8957 }
8958
8959 7 => {
8960 if let Some(availability) = &mut self.availability {
8961 ::fidl_next::WireEnvelope::encode_value(
8962 availability,
8963 preallocated.encoder,
8964 &mut out,
8965 )?;
8966 } else {
8967 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8968 }
8969 }
8970
8971 6 => {
8972 if let Some(dependency_type) = &mut self.dependency_type {
8973 ::fidl_next::WireEnvelope::encode_value(
8974 dependency_type,
8975 preallocated.encoder,
8976 &mut out,
8977 )?;
8978 } else {
8979 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8980 }
8981 }
8982
8983 5 => {
8984 if let Some(subdir) = &mut self.subdir {
8985 ::fidl_next::WireEnvelope::encode_value(
8986 subdir,
8987 preallocated.encoder,
8988 &mut out,
8989 )?;
8990 } else {
8991 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8992 }
8993 }
8994
8995 4 => {
8996 if let Some(rights) = &mut self.rights {
8997 ::fidl_next::WireEnvelope::encode_value(
8998 rights,
8999 preallocated.encoder,
9000 &mut out,
9001 )?;
9002 } else {
9003 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9004 }
9005 }
9006
9007 3 => {
9008 if let Some(target_path) = &mut self.target_path {
9009 ::fidl_next::WireEnvelope::encode_value(
9010 target_path,
9011 preallocated.encoder,
9012 &mut out,
9013 )?;
9014 } else {
9015 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9016 }
9017 }
9018
9019 2 => {
9020 if let Some(source_name) = &mut self.source_name {
9021 ::fidl_next::WireEnvelope::encode_value(
9022 source_name,
9023 preallocated.encoder,
9024 &mut out,
9025 )?;
9026 } else {
9027 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9028 }
9029 }
9030
9031 1 => {
9032 if let Some(source) = &mut self.source {
9033 ::fidl_next::WireEnvelope::encode_value(
9034 source,
9035 preallocated.encoder,
9036 &mut out,
9037 )?;
9038 } else {
9039 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9040 }
9041 }
9042
9043 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9044 }
9045 unsafe {
9046 preallocated.write_next(out.assume_init_ref());
9047 }
9048 }
9049
9050 ::fidl_next::WireTable::encode_len(table, max_ord);
9051
9052 Ok(())
9053 }
9054}
9055
9056impl ::fidl_next::TakeFrom<WireUseDirectory> for UseDirectory {
9057 #[inline]
9058 fn take_from(from: &WireUseDirectory) -> Self {
9059 Self {
9060 source: from.source().map(::fidl_next::TakeFrom::take_from),
9061
9062 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
9063
9064 target_path: from.target_path().map(::fidl_next::TakeFrom::take_from),
9065
9066 rights: from.rights().map(::fidl_next::TakeFrom::take_from),
9067
9068 subdir: from.subdir().map(::fidl_next::TakeFrom::take_from),
9069
9070 dependency_type: from.dependency_type().map(::fidl_next::TakeFrom::take_from),
9071
9072 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
9073
9074 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
9075 }
9076 }
9077}
9078
9079#[repr(C)]
9081pub struct WireUseDirectory {
9082 table: ::fidl_next::WireTable,
9083}
9084
9085unsafe impl ::fidl_next::ZeroPadding for WireUseDirectory {
9086 #[inline]
9087 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9088 ::fidl_next::munge!(let Self { table } = out);
9089 ::fidl_next::WireTable::zero_padding(table);
9090 }
9091}
9092
9093unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseDirectory
9094where
9095 ___D: ::fidl_next::Decoder + ?Sized,
9096{
9097 fn decode(
9098 slot: ::fidl_next::Slot<'_, Self>,
9099 decoder: &mut ___D,
9100 ) -> Result<(), ::fidl_next::DecodeError> {
9101 ::fidl_next::munge!(let Self { table } = slot);
9102
9103 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9104 match ordinal {
9105 0 => unsafe { ::core::hint::unreachable_unchecked() },
9106
9107 1 => {
9108 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
9109 slot.as_mut(),
9110 decoder,
9111 )?;
9112
9113 Ok(())
9114 }
9115
9116 2 => {
9117 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
9118 slot.as_mut(),
9119 decoder,
9120 )?;
9121
9122 let source_name = unsafe {
9123 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
9124 };
9125
9126 if source_name.len() > 100 {
9127 return Err(::fidl_next::DecodeError::VectorTooLong {
9128 size: source_name.len() as u64,
9129 limit: 100,
9130 });
9131 }
9132
9133 Ok(())
9134 }
9135
9136 3 => {
9137 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
9138 slot.as_mut(),
9139 decoder,
9140 )?;
9141
9142 let target_path = unsafe {
9143 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
9144 };
9145
9146 if target_path.len() > 1024 {
9147 return Err(::fidl_next::DecodeError::VectorTooLong {
9148 size: target_path.len() as u64,
9149 limit: 1024,
9150 });
9151 }
9152
9153 Ok(())
9154 }
9155
9156 4 => {
9157 ::fidl_next::WireEnvelope::decode_as::<
9158 ___D,
9159 ::fidl_next_fuchsia_io::WireOperations,
9160 >(slot.as_mut(), decoder)?;
9161
9162 Ok(())
9163 }
9164
9165 5 => {
9166 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
9167 slot.as_mut(),
9168 decoder,
9169 )?;
9170
9171 let subdir = unsafe {
9172 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
9173 };
9174
9175 if subdir.len() > 1024 {
9176 return Err(::fidl_next::DecodeError::VectorTooLong {
9177 size: subdir.len() as u64,
9178 limit: 1024,
9179 });
9180 }
9181
9182 Ok(())
9183 }
9184
9185 6 => {
9186 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
9187 slot.as_mut(),
9188 decoder,
9189 )?;
9190
9191 Ok(())
9192 }
9193
9194 7 => {
9195 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
9196 slot.as_mut(),
9197 decoder,
9198 )?;
9199
9200 Ok(())
9201 }
9202
9203 8 => {
9204 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
9205 slot.as_mut(),
9206 decoder,
9207 )?;
9208
9209 let source_dictionary = unsafe {
9210 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
9211 };
9212
9213 if source_dictionary.len() > 1024 {
9214 return Err(::fidl_next::DecodeError::VectorTooLong {
9215 size: source_dictionary.len() as u64,
9216 limit: 1024,
9217 });
9218 }
9219
9220 Ok(())
9221 }
9222
9223 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9224 }
9225 })
9226 }
9227}
9228
9229impl WireUseDirectory {
9230 pub fn source(&self) -> Option<&crate::WireRef> {
9231 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9232 }
9233
9234 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
9235 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9236 }
9237
9238 pub fn target_path(&self) -> Option<&::fidl_next::WireString> {
9239 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
9240 }
9241
9242 pub fn rights(&self) -> Option<&::fidl_next_fuchsia_io::WireOperations> {
9243 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
9244 }
9245
9246 pub fn subdir(&self) -> Option<&::fidl_next::WireString> {
9247 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
9248 }
9249
9250 pub fn dependency_type(&self) -> Option<&crate::WireDependencyType> {
9251 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
9252 }
9253
9254 pub fn availability(&self) -> Option<&crate::WireAvailability> {
9255 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
9256 }
9257
9258 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
9259 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
9260 }
9261}
9262
9263impl ::core::fmt::Debug for WireUseDirectory {
9264 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
9265 f.debug_struct("UseDirectory")
9266 .field("source", &self.source())
9267 .field("source_name", &self.source_name())
9268 .field("target_path", &self.target_path())
9269 .field("rights", &self.rights())
9270 .field("subdir", &self.subdir())
9271 .field("dependency_type", &self.dependency_type())
9272 .field("availability", &self.availability())
9273 .field("source_dictionary", &self.source_dictionary())
9274 .finish()
9275 }
9276}
9277
9278#[doc = " Declares an EventStream used by a component.\n"]
9279#[derive(Clone, Debug)]
9280pub struct UseEventStream {
9281 pub source_name: Option<String>,
9282
9283 pub source: Option<crate::Ref>,
9284
9285 pub scope: Option<Vec<crate::Ref>>,
9286
9287 pub target_path: Option<String>,
9288
9289 pub availability: Option<crate::Availability>,
9290
9291 pub filter: Option<::fidl_next_fuchsia_data::Dictionary>,
9292}
9293
9294impl UseEventStream {
9295 fn __max_ordinal(&self) -> usize {
9296 if self.source_name.is_some() {
9297 return 1;
9298 }
9299
9300 if self.source.is_some() {
9301 return 2;
9302 }
9303
9304 if self.scope.is_some() {
9305 return 3;
9306 }
9307
9308 if self.target_path.is_some() {
9309 return 4;
9310 }
9311
9312 if self.availability.is_some() {
9313 return 5;
9314 }
9315
9316 if self.filter.is_some() {
9317 return 6;
9318 }
9319
9320 0
9321 }
9322}
9323
9324impl ::fidl_next::Encodable for UseEventStream {
9325 type Encoded = WireUseEventStream;
9326}
9327
9328unsafe impl<___E> ::fidl_next::Encode<___E> for UseEventStream
9329where
9330 ___E: ::fidl_next::Encoder + ?Sized,
9331{
9332 #[inline]
9333 fn encode(
9334 &mut self,
9335 encoder: &mut ___E,
9336 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9337 ) -> Result<(), ::fidl_next::EncodeError> {
9338 ::fidl_next::munge!(let WireUseEventStream { table } = out);
9339
9340 let max_ord = self.__max_ordinal();
9341
9342 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9343 ::fidl_next::ZeroPadding::zero_padding(&mut out);
9344
9345 let mut preallocated =
9346 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9347
9348 for i in 1..=max_ord {
9349 match i {
9350 6 => {
9351 if let Some(filter) = &mut self.filter {
9352 ::fidl_next::WireEnvelope::encode_value(
9353 filter,
9354 preallocated.encoder,
9355 &mut out,
9356 )?;
9357 } else {
9358 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9359 }
9360 }
9361
9362 5 => {
9363 if let Some(availability) = &mut self.availability {
9364 ::fidl_next::WireEnvelope::encode_value(
9365 availability,
9366 preallocated.encoder,
9367 &mut out,
9368 )?;
9369 } else {
9370 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9371 }
9372 }
9373
9374 4 => {
9375 if let Some(target_path) = &mut self.target_path {
9376 ::fidl_next::WireEnvelope::encode_value(
9377 target_path,
9378 preallocated.encoder,
9379 &mut out,
9380 )?;
9381 } else {
9382 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9383 }
9384 }
9385
9386 3 => {
9387 if let Some(scope) = &mut self.scope {
9388 ::fidl_next::WireEnvelope::encode_value(
9389 scope,
9390 preallocated.encoder,
9391 &mut out,
9392 )?;
9393 } else {
9394 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9395 }
9396 }
9397
9398 2 => {
9399 if let Some(source) = &mut self.source {
9400 ::fidl_next::WireEnvelope::encode_value(
9401 source,
9402 preallocated.encoder,
9403 &mut out,
9404 )?;
9405 } else {
9406 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9407 }
9408 }
9409
9410 1 => {
9411 if let Some(source_name) = &mut self.source_name {
9412 ::fidl_next::WireEnvelope::encode_value(
9413 source_name,
9414 preallocated.encoder,
9415 &mut out,
9416 )?;
9417 } else {
9418 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9419 }
9420 }
9421
9422 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9423 }
9424 unsafe {
9425 preallocated.write_next(out.assume_init_ref());
9426 }
9427 }
9428
9429 ::fidl_next::WireTable::encode_len(table, max_ord);
9430
9431 Ok(())
9432 }
9433}
9434
9435impl ::fidl_next::TakeFrom<WireUseEventStream> for UseEventStream {
9436 #[inline]
9437 fn take_from(from: &WireUseEventStream) -> Self {
9438 Self {
9439 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
9440
9441 source: from.source().map(::fidl_next::TakeFrom::take_from),
9442
9443 scope: from.scope().map(::fidl_next::TakeFrom::take_from),
9444
9445 target_path: from.target_path().map(::fidl_next::TakeFrom::take_from),
9446
9447 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
9448
9449 filter: from.filter().map(::fidl_next::TakeFrom::take_from),
9450 }
9451 }
9452}
9453
9454#[repr(C)]
9456pub struct WireUseEventStream {
9457 table: ::fidl_next::WireTable,
9458}
9459
9460unsafe impl ::fidl_next::ZeroPadding for WireUseEventStream {
9461 #[inline]
9462 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9463 ::fidl_next::munge!(let Self { table } = out);
9464 ::fidl_next::WireTable::zero_padding(table);
9465 }
9466}
9467
9468unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseEventStream
9469where
9470 ___D: ::fidl_next::Decoder + ?Sized,
9471{
9472 fn decode(
9473 slot: ::fidl_next::Slot<'_, Self>,
9474 decoder: &mut ___D,
9475 ) -> Result<(), ::fidl_next::DecodeError> {
9476 ::fidl_next::munge!(let Self { table } = slot);
9477
9478 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9479 match ordinal {
9480 0 => unsafe { ::core::hint::unreachable_unchecked() },
9481
9482 1 => {
9483 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
9484 slot.as_mut(),
9485 decoder,
9486 )?;
9487
9488 let source_name = unsafe {
9489 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
9490 };
9491
9492 if source_name.len() > 100 {
9493 return Err(::fidl_next::DecodeError::VectorTooLong {
9494 size: source_name.len() as u64,
9495 limit: 100,
9496 });
9497 }
9498
9499 Ok(())
9500 }
9501
9502 2 => {
9503 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
9504 slot.as_mut(),
9505 decoder,
9506 )?;
9507
9508 Ok(())
9509 }
9510
9511 3 => {
9512 ::fidl_next::WireEnvelope::decode_as::<
9513 ___D,
9514 ::fidl_next::WireVector<crate::WireRef>,
9515 >(slot.as_mut(), decoder)?;
9516
9517 Ok(())
9518 }
9519
9520 4 => {
9521 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
9522 slot.as_mut(),
9523 decoder,
9524 )?;
9525
9526 let target_path = unsafe {
9527 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
9528 };
9529
9530 if target_path.len() > 100 {
9531 return Err(::fidl_next::DecodeError::VectorTooLong {
9532 size: target_path.len() as u64,
9533 limit: 100,
9534 });
9535 }
9536
9537 Ok(())
9538 }
9539
9540 5 => {
9541 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
9542 slot.as_mut(),
9543 decoder,
9544 )?;
9545
9546 Ok(())
9547 }
9548
9549 6 => {
9550 ::fidl_next::WireEnvelope::decode_as::<
9551 ___D,
9552 ::fidl_next_fuchsia_data::WireDictionary,
9553 >(slot.as_mut(), decoder)?;
9554
9555 Ok(())
9556 }
9557
9558 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9559 }
9560 })
9561 }
9562}
9563
9564impl WireUseEventStream {
9565 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
9566 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9567 }
9568
9569 pub fn source(&self) -> Option<&crate::WireRef> {
9570 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9571 }
9572
9573 pub fn scope(&self) -> Option<&::fidl_next::WireVector<crate::WireRef>> {
9574 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
9575 }
9576
9577 pub fn target_path(&self) -> Option<&::fidl_next::WireString> {
9578 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
9579 }
9580
9581 pub fn availability(&self) -> Option<&crate::WireAvailability> {
9582 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
9583 }
9584
9585 pub fn filter(&self) -> Option<&::fidl_next_fuchsia_data::WireDictionary> {
9586 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
9587 }
9588}
9589
9590impl ::core::fmt::Debug for WireUseEventStream {
9591 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
9592 f.debug_struct("UseEventStream")
9593 .field("source_name", &self.source_name())
9594 .field("source", &self.source())
9595 .field("scope", &self.scope())
9596 .field("target_path", &self.target_path())
9597 .field("availability", &self.availability())
9598 .field("filter", &self.filter())
9599 .finish()
9600 }
9601}
9602
9603#[doc = " Declares runner used by a component.\n"]
9604#[derive(Clone, Debug)]
9605pub struct UseRunner {
9606 pub source: Option<crate::Ref>,
9607
9608 pub source_name: Option<String>,
9609
9610 pub source_dictionary: Option<String>,
9611}
9612
9613impl UseRunner {
9614 fn __max_ordinal(&self) -> usize {
9615 if self.source.is_some() {
9616 return 1;
9617 }
9618
9619 if self.source_name.is_some() {
9620 return 2;
9621 }
9622
9623 if self.source_dictionary.is_some() {
9624 return 3;
9625 }
9626
9627 0
9628 }
9629}
9630
9631impl ::fidl_next::Encodable for UseRunner {
9632 type Encoded = WireUseRunner;
9633}
9634
9635unsafe impl<___E> ::fidl_next::Encode<___E> for UseRunner
9636where
9637 ___E: ::fidl_next::Encoder + ?Sized,
9638{
9639 #[inline]
9640 fn encode(
9641 &mut self,
9642 encoder: &mut ___E,
9643 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9644 ) -> Result<(), ::fidl_next::EncodeError> {
9645 ::fidl_next::munge!(let WireUseRunner { table } = out);
9646
9647 let max_ord = self.__max_ordinal();
9648
9649 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9650 ::fidl_next::ZeroPadding::zero_padding(&mut out);
9651
9652 let mut preallocated =
9653 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9654
9655 for i in 1..=max_ord {
9656 match i {
9657 3 => {
9658 if let Some(source_dictionary) = &mut self.source_dictionary {
9659 ::fidl_next::WireEnvelope::encode_value(
9660 source_dictionary,
9661 preallocated.encoder,
9662 &mut out,
9663 )?;
9664 } else {
9665 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9666 }
9667 }
9668
9669 2 => {
9670 if let Some(source_name) = &mut self.source_name {
9671 ::fidl_next::WireEnvelope::encode_value(
9672 source_name,
9673 preallocated.encoder,
9674 &mut out,
9675 )?;
9676 } else {
9677 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9678 }
9679 }
9680
9681 1 => {
9682 if let Some(source) = &mut self.source {
9683 ::fidl_next::WireEnvelope::encode_value(
9684 source,
9685 preallocated.encoder,
9686 &mut out,
9687 )?;
9688 } else {
9689 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9690 }
9691 }
9692
9693 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9694 }
9695 unsafe {
9696 preallocated.write_next(out.assume_init_ref());
9697 }
9698 }
9699
9700 ::fidl_next::WireTable::encode_len(table, max_ord);
9701
9702 Ok(())
9703 }
9704}
9705
9706impl ::fidl_next::TakeFrom<WireUseRunner> for UseRunner {
9707 #[inline]
9708 fn take_from(from: &WireUseRunner) -> Self {
9709 Self {
9710 source: from.source().map(::fidl_next::TakeFrom::take_from),
9711
9712 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
9713
9714 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
9715 }
9716 }
9717}
9718
9719#[repr(C)]
9721pub struct WireUseRunner {
9722 table: ::fidl_next::WireTable,
9723}
9724
9725unsafe impl ::fidl_next::ZeroPadding for WireUseRunner {
9726 #[inline]
9727 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
9728 ::fidl_next::munge!(let Self { table } = out);
9729 ::fidl_next::WireTable::zero_padding(table);
9730 }
9731}
9732
9733unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseRunner
9734where
9735 ___D: ::fidl_next::Decoder + ?Sized,
9736{
9737 fn decode(
9738 slot: ::fidl_next::Slot<'_, Self>,
9739 decoder: &mut ___D,
9740 ) -> Result<(), ::fidl_next::DecodeError> {
9741 ::fidl_next::munge!(let Self { table } = slot);
9742
9743 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
9744 match ordinal {
9745 0 => unsafe { ::core::hint::unreachable_unchecked() },
9746
9747 1 => {
9748 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
9749 slot.as_mut(),
9750 decoder,
9751 )?;
9752
9753 Ok(())
9754 }
9755
9756 2 => {
9757 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
9758 slot.as_mut(),
9759 decoder,
9760 )?;
9761
9762 let source_name = unsafe {
9763 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
9764 };
9765
9766 if source_name.len() > 100 {
9767 return Err(::fidl_next::DecodeError::VectorTooLong {
9768 size: source_name.len() as u64,
9769 limit: 100,
9770 });
9771 }
9772
9773 Ok(())
9774 }
9775
9776 3 => {
9777 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
9778 slot.as_mut(),
9779 decoder,
9780 )?;
9781
9782 let source_dictionary = unsafe {
9783 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
9784 };
9785
9786 if source_dictionary.len() > 1024 {
9787 return Err(::fidl_next::DecodeError::VectorTooLong {
9788 size: source_dictionary.len() as u64,
9789 limit: 1024,
9790 });
9791 }
9792
9793 Ok(())
9794 }
9795
9796 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
9797 }
9798 })
9799 }
9800}
9801
9802impl WireUseRunner {
9803 pub fn source(&self) -> Option<&crate::WireRef> {
9804 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
9805 }
9806
9807 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
9808 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
9809 }
9810
9811 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
9812 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
9813 }
9814}
9815
9816impl ::core::fmt::Debug for WireUseRunner {
9817 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
9818 f.debug_struct("UseRunner")
9819 .field("source", &self.source())
9820 .field("source_name", &self.source_name())
9821 .field("source_dictionary", &self.source_dictionary())
9822 .finish()
9823 }
9824}
9825
9826#[derive(Clone, Debug)]
9827pub struct UseConfiguration {
9828 pub source: Option<crate::Ref>,
9829
9830 pub source_name: Option<String>,
9831
9832 pub target_name: Option<String>,
9833
9834 pub availability: Option<crate::Availability>,
9835
9836 pub type_: Option<crate::ConfigType>,
9837
9838 pub default: Option<crate::ConfigValue>,
9839
9840 pub source_dictionary: Option<String>,
9841}
9842
9843impl UseConfiguration {
9844 fn __max_ordinal(&self) -> usize {
9845 if self.source.is_some() {
9846 return 1;
9847 }
9848
9849 if self.source_name.is_some() {
9850 return 2;
9851 }
9852
9853 if self.target_name.is_some() {
9854 return 3;
9855 }
9856
9857 if self.availability.is_some() {
9858 return 4;
9859 }
9860
9861 if self.type_.is_some() {
9862 return 5;
9863 }
9864
9865 if self.default.is_some() {
9866 return 6;
9867 }
9868
9869 if self.source_dictionary.is_some() {
9870 return 7;
9871 }
9872
9873 0
9874 }
9875}
9876
9877impl ::fidl_next::Encodable for UseConfiguration {
9878 type Encoded = WireUseConfiguration;
9879}
9880
9881unsafe impl<___E> ::fidl_next::Encode<___E> for UseConfiguration
9882where
9883 ___E: ::fidl_next::Encoder + ?Sized,
9884{
9885 #[inline]
9886 fn encode(
9887 &mut self,
9888 encoder: &mut ___E,
9889 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
9890 ) -> Result<(), ::fidl_next::EncodeError> {
9891 ::fidl_next::munge!(let WireUseConfiguration { table } = out);
9892
9893 let max_ord = self.__max_ordinal();
9894
9895 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9896 ::fidl_next::ZeroPadding::zero_padding(&mut out);
9897
9898 let mut preallocated =
9899 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9900
9901 for i in 1..=max_ord {
9902 match i {
9903 7 => {
9904 if let Some(source_dictionary) = &mut self.source_dictionary {
9905 ::fidl_next::WireEnvelope::encode_value(
9906 source_dictionary,
9907 preallocated.encoder,
9908 &mut out,
9909 )?;
9910 } else {
9911 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9912 }
9913 }
9914
9915 6 => {
9916 if let Some(default) = &mut self.default {
9917 ::fidl_next::WireEnvelope::encode_value(
9918 default,
9919 preallocated.encoder,
9920 &mut out,
9921 )?;
9922 } else {
9923 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9924 }
9925 }
9926
9927 5 => {
9928 if let Some(type_) = &mut self.type_ {
9929 ::fidl_next::WireEnvelope::encode_value(
9930 type_,
9931 preallocated.encoder,
9932 &mut out,
9933 )?;
9934 } else {
9935 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9936 }
9937 }
9938
9939 4 => {
9940 if let Some(availability) = &mut self.availability {
9941 ::fidl_next::WireEnvelope::encode_value(
9942 availability,
9943 preallocated.encoder,
9944 &mut out,
9945 )?;
9946 } else {
9947 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9948 }
9949 }
9950
9951 3 => {
9952 if let Some(target_name) = &mut self.target_name {
9953 ::fidl_next::WireEnvelope::encode_value(
9954 target_name,
9955 preallocated.encoder,
9956 &mut out,
9957 )?;
9958 } else {
9959 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9960 }
9961 }
9962
9963 2 => {
9964 if let Some(source_name) = &mut self.source_name {
9965 ::fidl_next::WireEnvelope::encode_value(
9966 source_name,
9967 preallocated.encoder,
9968 &mut out,
9969 )?;
9970 } else {
9971 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9972 }
9973 }
9974
9975 1 => {
9976 if let Some(source) = &mut self.source {
9977 ::fidl_next::WireEnvelope::encode_value(
9978 source,
9979 preallocated.encoder,
9980 &mut out,
9981 )?;
9982 } else {
9983 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9984 }
9985 }
9986
9987 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9988 }
9989 unsafe {
9990 preallocated.write_next(out.assume_init_ref());
9991 }
9992 }
9993
9994 ::fidl_next::WireTable::encode_len(table, max_ord);
9995
9996 Ok(())
9997 }
9998}
9999
10000impl ::fidl_next::TakeFrom<WireUseConfiguration> for UseConfiguration {
10001 #[inline]
10002 fn take_from(from: &WireUseConfiguration) -> Self {
10003 Self {
10004 source: from.source().map(::fidl_next::TakeFrom::take_from),
10005
10006 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
10007
10008 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
10009
10010 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
10011
10012 type_: from.type_().map(::fidl_next::TakeFrom::take_from),
10013
10014 default: from.default().map(::fidl_next::TakeFrom::take_from),
10015
10016 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
10017 }
10018 }
10019}
10020
10021#[repr(C)]
10023pub struct WireUseConfiguration {
10024 table: ::fidl_next::WireTable,
10025}
10026
10027unsafe impl ::fidl_next::ZeroPadding for WireUseConfiguration {
10028 #[inline]
10029 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10030 ::fidl_next::munge!(let Self { table } = out);
10031 ::fidl_next::WireTable::zero_padding(table);
10032 }
10033}
10034
10035unsafe impl<___D> ::fidl_next::Decode<___D> for WireUseConfiguration
10036where
10037 ___D: ::fidl_next::Decoder + ?Sized,
10038{
10039 fn decode(
10040 slot: ::fidl_next::Slot<'_, Self>,
10041 decoder: &mut ___D,
10042 ) -> Result<(), ::fidl_next::DecodeError> {
10043 ::fidl_next::munge!(let Self { table } = slot);
10044
10045 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10046 match ordinal {
10047 0 => unsafe { ::core::hint::unreachable_unchecked() },
10048
10049 1 => {
10050 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
10051 slot.as_mut(),
10052 decoder,
10053 )?;
10054
10055 Ok(())
10056 }
10057
10058 2 => {
10059 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
10060 slot.as_mut(),
10061 decoder,
10062 )?;
10063
10064 let source_name = unsafe {
10065 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
10066 };
10067
10068 if source_name.len() > 100 {
10069 return Err(::fidl_next::DecodeError::VectorTooLong {
10070 size: source_name.len() as u64,
10071 limit: 100,
10072 });
10073 }
10074
10075 Ok(())
10076 }
10077
10078 3 => {
10079 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
10080 slot.as_mut(),
10081 decoder,
10082 )?;
10083
10084 let target_name = unsafe {
10085 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
10086 };
10087
10088 if target_name.len() > 100 {
10089 return Err(::fidl_next::DecodeError::VectorTooLong {
10090 size: target_name.len() as u64,
10091 limit: 100,
10092 });
10093 }
10094
10095 Ok(())
10096 }
10097
10098 4 => {
10099 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
10100 slot.as_mut(),
10101 decoder,
10102 )?;
10103
10104 Ok(())
10105 }
10106
10107 5 => {
10108 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigType>(
10109 slot.as_mut(),
10110 decoder,
10111 )?;
10112
10113 Ok(())
10114 }
10115
10116 6 => {
10117 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigValue>(
10118 slot.as_mut(),
10119 decoder,
10120 )?;
10121
10122 Ok(())
10123 }
10124
10125 7 => {
10126 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
10127 slot.as_mut(),
10128 decoder,
10129 )?;
10130
10131 let source_dictionary = unsafe {
10132 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
10133 };
10134
10135 if source_dictionary.len() > 1024 {
10136 return Err(::fidl_next::DecodeError::VectorTooLong {
10137 size: source_dictionary.len() as u64,
10138 limit: 1024,
10139 });
10140 }
10141
10142 Ok(())
10143 }
10144
10145 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
10146 }
10147 })
10148 }
10149}
10150
10151impl WireUseConfiguration {
10152 pub fn source(&self) -> Option<&crate::WireRef> {
10153 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10154 }
10155
10156 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
10157 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10158 }
10159
10160 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
10161 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10162 }
10163
10164 pub fn availability(&self) -> Option<&crate::WireAvailability> {
10165 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10166 }
10167
10168 pub fn type_(&self) -> Option<&crate::WireConfigType> {
10169 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10170 }
10171
10172 pub fn default(&self) -> Option<&crate::WireConfigValue> {
10173 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10174 }
10175
10176 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
10177 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
10178 }
10179}
10180
10181impl ::core::fmt::Debug for WireUseConfiguration {
10182 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
10183 f.debug_struct("UseConfiguration")
10184 .field("source", &self.source())
10185 .field("source_name", &self.source_name())
10186 .field("target_name", &self.target_name())
10187 .field("availability", &self.availability())
10188 .field("type_", &self.type_())
10189 .field("default", &self.default())
10190 .field("source_dictionary", &self.source_dictionary())
10191 .finish()
10192 }
10193}
10194
10195#[doc = " Declares a capability used by a component, which was offered to it.\n"]
10196#[derive(Clone, Debug)]
10197pub enum Use {
10198 Service(crate::UseService),
10199
10200 Protocol(crate::UseProtocol),
10201
10202 Directory(crate::UseDirectory),
10203
10204 Storage(crate::UseStorage),
10205
10206 EventStream(crate::UseEventStream),
10207
10208 Runner(crate::UseRunner),
10209
10210 Config(crate::UseConfiguration),
10211
10212 UnknownOrdinal_(u64),
10213}
10214
10215impl ::fidl_next::Encodable for Use {
10216 type Encoded = WireUse;
10217}
10218
10219unsafe impl<___E> ::fidl_next::Encode<___E> for Use
10220where
10221 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10222
10223 ___E: ::fidl_next::Encoder,
10224{
10225 #[inline]
10226 fn encode(
10227 &mut self,
10228 encoder: &mut ___E,
10229 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10230 ) -> Result<(), ::fidl_next::EncodeError> {
10231 ::fidl_next::munge!(let WireUse { raw } = out);
10232
10233 match self {
10234 Self::Service(value) => {
10235 ::fidl_next::RawWireUnion::encode_as::<___E, crate::UseService>(
10236 value, 1, encoder, raw,
10237 )?
10238 }
10239
10240 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
10241 ___E,
10242 crate::UseProtocol,
10243 >(value, 2, encoder, raw)?,
10244
10245 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
10246 ___E,
10247 crate::UseDirectory,
10248 >(value, 3, encoder, raw)?,
10249
10250 Self::Storage(value) => {
10251 ::fidl_next::RawWireUnion::encode_as::<___E, crate::UseStorage>(
10252 value, 4, encoder, raw,
10253 )?
10254 }
10255
10256 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
10257 ___E,
10258 crate::UseEventStream,
10259 >(value, 7, encoder, raw)?,
10260
10261 Self::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<___E, crate::UseRunner>(
10262 value, 8, encoder, raw,
10263 )?,
10264
10265 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
10266 ___E,
10267 crate::UseConfiguration,
10268 >(value, 9, encoder, raw)?,
10269
10270 Self::UnknownOrdinal_(ordinal) => {
10271 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
10272 }
10273 }
10274
10275 Ok(())
10276 }
10277}
10278
10279impl ::fidl_next::EncodableOption for Box<Use> {
10280 type EncodedOption = WireOptionalUse;
10281}
10282
10283unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<Use>
10284where
10285 ___E: ?Sized,
10286 Use: ::fidl_next::Encode<___E>,
10287{
10288 #[inline]
10289 fn encode_option(
10290 this: Option<&mut Self>,
10291 encoder: &mut ___E,
10292 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
10293 ) -> Result<(), ::fidl_next::EncodeError> {
10294 ::fidl_next::munge!(let WireOptionalUse { raw } = &mut *out);
10295
10296 if let Some(inner) = this {
10297 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
10298 ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
10299 } else {
10300 ::fidl_next::RawWireUnion::encode_absent(raw);
10301 }
10302
10303 Ok(())
10304 }
10305}
10306
10307impl ::fidl_next::TakeFrom<WireUse> for Use {
10308 #[inline]
10309 fn take_from(from: &WireUse) -> Self {
10310 match from.raw.ordinal() {
10311 1 => Self::Service(::fidl_next::TakeFrom::take_from(unsafe {
10312 from.raw.get().deref_unchecked::<crate::WireUseService>()
10313 })),
10314
10315 2 => Self::Protocol(::fidl_next::TakeFrom::take_from(unsafe {
10316 from.raw.get().deref_unchecked::<crate::WireUseProtocol>()
10317 })),
10318
10319 3 => Self::Directory(::fidl_next::TakeFrom::take_from(unsafe {
10320 from.raw.get().deref_unchecked::<crate::WireUseDirectory>()
10321 })),
10322
10323 4 => Self::Storage(::fidl_next::TakeFrom::take_from(unsafe {
10324 from.raw.get().deref_unchecked::<crate::WireUseStorage>()
10325 })),
10326
10327 7 => Self::EventStream(::fidl_next::TakeFrom::take_from(unsafe {
10328 from.raw.get().deref_unchecked::<crate::WireUseEventStream>()
10329 })),
10330
10331 8 => Self::Runner(::fidl_next::TakeFrom::take_from(unsafe {
10332 from.raw.get().deref_unchecked::<crate::WireUseRunner>()
10333 })),
10334
10335 9 => Self::Config(::fidl_next::TakeFrom::take_from(unsafe {
10336 from.raw.get().deref_unchecked::<crate::WireUseConfiguration>()
10337 })),
10338
10339 _ => unsafe { ::core::hint::unreachable_unchecked() },
10340 }
10341 }
10342}
10343
10344impl ::fidl_next::TakeFrom<WireOptionalUse> for Option<Box<Use>> {
10345 #[inline]
10346 fn take_from(from: &WireOptionalUse) -> Self {
10347 if let Some(inner) = from.as_ref() {
10348 Some(::fidl_next::TakeFrom::take_from(inner))
10349 } else {
10350 None
10351 }
10352 }
10353}
10354
10355#[repr(transparent)]
10357pub struct WireUse {
10358 raw: ::fidl_next::RawWireUnion,
10359}
10360
10361unsafe impl ::fidl_next::ZeroPadding for WireUse {
10362 #[inline]
10363 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10364 ::fidl_next::munge!(let Self { raw } = out);
10365 ::fidl_next::RawWireUnion::zero_padding(raw);
10366 }
10367}
10368
10369pub mod use_ {
10370 pub enum Ref<'union> {
10371 Service(&'union crate::WireUseService),
10372
10373 Protocol(&'union crate::WireUseProtocol),
10374
10375 Directory(&'union crate::WireUseDirectory),
10376
10377 Storage(&'union crate::WireUseStorage),
10378
10379 EventStream(&'union crate::WireUseEventStream),
10380
10381 Runner(&'union crate::WireUseRunner),
10382
10383 Config(&'union crate::WireUseConfiguration),
10384
10385 UnknownOrdinal_(u64),
10386 }
10387}
10388
10389impl WireUse {
10390 pub fn as_ref(&self) -> crate::use_::Ref<'_> {
10391 match self.raw.ordinal() {
10392 1 => crate::use_::Ref::Service(unsafe {
10393 self.raw.get().deref_unchecked::<crate::WireUseService>()
10394 }),
10395
10396 2 => crate::use_::Ref::Protocol(unsafe {
10397 self.raw.get().deref_unchecked::<crate::WireUseProtocol>()
10398 }),
10399
10400 3 => crate::use_::Ref::Directory(unsafe {
10401 self.raw.get().deref_unchecked::<crate::WireUseDirectory>()
10402 }),
10403
10404 4 => crate::use_::Ref::Storage(unsafe {
10405 self.raw.get().deref_unchecked::<crate::WireUseStorage>()
10406 }),
10407
10408 7 => crate::use_::Ref::EventStream(unsafe {
10409 self.raw.get().deref_unchecked::<crate::WireUseEventStream>()
10410 }),
10411
10412 8 => crate::use_::Ref::Runner(unsafe {
10413 self.raw.get().deref_unchecked::<crate::WireUseRunner>()
10414 }),
10415
10416 9 => crate::use_::Ref::Config(unsafe {
10417 self.raw.get().deref_unchecked::<crate::WireUseConfiguration>()
10418 }),
10419
10420 unknown => crate::use_::Ref::UnknownOrdinal_(unknown),
10421 }
10422 }
10423}
10424
10425unsafe impl<___D> ::fidl_next::Decode<___D> for WireUse
10426where
10427 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10428
10429 ___D: ::fidl_next::Decoder,
10430{
10431 fn decode(
10432 mut slot: ::fidl_next::Slot<'_, Self>,
10433 decoder: &mut ___D,
10434 ) -> Result<(), ::fidl_next::DecodeError> {
10435 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
10436 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
10437 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseService>(raw, decoder)?,
10438
10439 2 => {
10440 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseProtocol>(raw, decoder)?
10441 }
10442
10443 3 => {
10444 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseDirectory>(raw, decoder)?
10445 }
10446
10447 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseStorage>(raw, decoder)?,
10448
10449 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseEventStream>(
10450 raw, decoder,
10451 )?,
10452
10453 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseRunner>(raw, decoder)?,
10454
10455 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseConfiguration>(
10456 raw, decoder,
10457 )?,
10458
10459 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
10460 }
10461
10462 Ok(())
10463 }
10464}
10465
10466impl ::core::fmt::Debug for WireUse {
10467 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
10468 match self.raw.ordinal() {
10469 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseService>().fmt(f) },
10470 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseProtocol>().fmt(f) },
10471 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseDirectory>().fmt(f) },
10472 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseStorage>().fmt(f) },
10473 7 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseEventStream>().fmt(f) },
10474 8 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseRunner>().fmt(f) },
10475 9 => unsafe { self.raw.get().deref_unchecked::<crate::WireUseConfiguration>().fmt(f) },
10476 _ => unsafe { ::core::hint::unreachable_unchecked() },
10477 }
10478 }
10479}
10480
10481#[repr(transparent)]
10482pub struct WireOptionalUse {
10483 raw: ::fidl_next::RawWireUnion,
10484}
10485
10486unsafe impl ::fidl_next::ZeroPadding for WireOptionalUse {
10487 #[inline]
10488 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10489 ::fidl_next::munge!(let Self { raw } = out);
10490 ::fidl_next::RawWireUnion::zero_padding(raw);
10491 }
10492}
10493
10494impl WireOptionalUse {
10495 pub fn is_some(&self) -> bool {
10496 self.raw.is_some()
10497 }
10498
10499 pub fn is_none(&self) -> bool {
10500 self.raw.is_none()
10501 }
10502
10503 pub fn as_ref(&self) -> Option<&WireUse> {
10504 if self.is_some() {
10505 Some(unsafe { &*(self as *const Self).cast() })
10506 } else {
10507 None
10508 }
10509 }
10510}
10511
10512unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalUse
10513where
10514 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
10515
10516 ___D: ::fidl_next::Decoder,
10517{
10518 fn decode(
10519 mut slot: ::fidl_next::Slot<'_, Self>,
10520 decoder: &mut ___D,
10521 ) -> Result<(), ::fidl_next::DecodeError> {
10522 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
10523 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
10524 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseService>(raw, decoder)?,
10525
10526 2 => {
10527 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseProtocol>(raw, decoder)?
10528 }
10529
10530 3 => {
10531 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseDirectory>(raw, decoder)?
10532 }
10533
10534 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseStorage>(raw, decoder)?,
10535
10536 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseEventStream>(
10537 raw, decoder,
10538 )?,
10539
10540 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseRunner>(raw, decoder)?,
10541
10542 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireUseConfiguration>(
10543 raw, decoder,
10544 )?,
10545
10546 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
10547 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
10548 }
10549
10550 Ok(())
10551 }
10552}
10553
10554impl ::core::fmt::Debug for WireOptionalUse {
10555 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
10556 self.as_ref().fmt(f)
10557 }
10558}
10559
10560#[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"]
10561#[derive(Clone, Debug)]
10562pub struct ExposeService {
10563 pub source: Option<crate::Ref>,
10564
10565 pub source_name: Option<String>,
10566
10567 pub target: Option<crate::Ref>,
10568
10569 pub target_name: Option<String>,
10570
10571 pub availability: Option<crate::Availability>,
10572
10573 pub source_dictionary: Option<String>,
10574}
10575
10576impl ExposeService {
10577 fn __max_ordinal(&self) -> usize {
10578 if self.source.is_some() {
10579 return 1;
10580 }
10581
10582 if self.source_name.is_some() {
10583 return 2;
10584 }
10585
10586 if self.target.is_some() {
10587 return 3;
10588 }
10589
10590 if self.target_name.is_some() {
10591 return 4;
10592 }
10593
10594 if self.availability.is_some() {
10595 return 5;
10596 }
10597
10598 if self.source_dictionary.is_some() {
10599 return 6;
10600 }
10601
10602 0
10603 }
10604}
10605
10606impl ::fidl_next::Encodable for ExposeService {
10607 type Encoded = WireExposeService;
10608}
10609
10610unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeService
10611where
10612 ___E: ::fidl_next::Encoder + ?Sized,
10613{
10614 #[inline]
10615 fn encode(
10616 &mut self,
10617 encoder: &mut ___E,
10618 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10619 ) -> Result<(), ::fidl_next::EncodeError> {
10620 ::fidl_next::munge!(let WireExposeService { table } = out);
10621
10622 let max_ord = self.__max_ordinal();
10623
10624 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10625 ::fidl_next::ZeroPadding::zero_padding(&mut out);
10626
10627 let mut preallocated =
10628 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10629
10630 for i in 1..=max_ord {
10631 match i {
10632 6 => {
10633 if let Some(source_dictionary) = &mut self.source_dictionary {
10634 ::fidl_next::WireEnvelope::encode_value(
10635 source_dictionary,
10636 preallocated.encoder,
10637 &mut out,
10638 )?;
10639 } else {
10640 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10641 }
10642 }
10643
10644 5 => {
10645 if let Some(availability) = &mut self.availability {
10646 ::fidl_next::WireEnvelope::encode_value(
10647 availability,
10648 preallocated.encoder,
10649 &mut out,
10650 )?;
10651 } else {
10652 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10653 }
10654 }
10655
10656 4 => {
10657 if let Some(target_name) = &mut self.target_name {
10658 ::fidl_next::WireEnvelope::encode_value(
10659 target_name,
10660 preallocated.encoder,
10661 &mut out,
10662 )?;
10663 } else {
10664 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10665 }
10666 }
10667
10668 3 => {
10669 if let Some(target) = &mut self.target {
10670 ::fidl_next::WireEnvelope::encode_value(
10671 target,
10672 preallocated.encoder,
10673 &mut out,
10674 )?;
10675 } else {
10676 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10677 }
10678 }
10679
10680 2 => {
10681 if let Some(source_name) = &mut self.source_name {
10682 ::fidl_next::WireEnvelope::encode_value(
10683 source_name,
10684 preallocated.encoder,
10685 &mut out,
10686 )?;
10687 } else {
10688 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10689 }
10690 }
10691
10692 1 => {
10693 if let Some(source) = &mut self.source {
10694 ::fidl_next::WireEnvelope::encode_value(
10695 source,
10696 preallocated.encoder,
10697 &mut out,
10698 )?;
10699 } else {
10700 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10701 }
10702 }
10703
10704 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10705 }
10706 unsafe {
10707 preallocated.write_next(out.assume_init_ref());
10708 }
10709 }
10710
10711 ::fidl_next::WireTable::encode_len(table, max_ord);
10712
10713 Ok(())
10714 }
10715}
10716
10717impl ::fidl_next::TakeFrom<WireExposeService> for ExposeService {
10718 #[inline]
10719 fn take_from(from: &WireExposeService) -> Self {
10720 Self {
10721 source: from.source().map(::fidl_next::TakeFrom::take_from),
10722
10723 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
10724
10725 target: from.target().map(::fidl_next::TakeFrom::take_from),
10726
10727 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
10728
10729 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
10730
10731 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
10732 }
10733 }
10734}
10735
10736#[repr(C)]
10738pub struct WireExposeService {
10739 table: ::fidl_next::WireTable,
10740}
10741
10742unsafe impl ::fidl_next::ZeroPadding for WireExposeService {
10743 #[inline]
10744 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
10745 ::fidl_next::munge!(let Self { table } = out);
10746 ::fidl_next::WireTable::zero_padding(table);
10747 }
10748}
10749
10750unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeService
10751where
10752 ___D: ::fidl_next::Decoder + ?Sized,
10753{
10754 fn decode(
10755 slot: ::fidl_next::Slot<'_, Self>,
10756 decoder: &mut ___D,
10757 ) -> Result<(), ::fidl_next::DecodeError> {
10758 ::fidl_next::munge!(let Self { table } = slot);
10759
10760 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
10761 match ordinal {
10762 0 => unsafe { ::core::hint::unreachable_unchecked() },
10763
10764 1 => {
10765 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
10766 slot.as_mut(),
10767 decoder,
10768 )?;
10769
10770 Ok(())
10771 }
10772
10773 2 => {
10774 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
10775 slot.as_mut(),
10776 decoder,
10777 )?;
10778
10779 let source_name = unsafe {
10780 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
10781 };
10782
10783 if source_name.len() > 100 {
10784 return Err(::fidl_next::DecodeError::VectorTooLong {
10785 size: source_name.len() as u64,
10786 limit: 100,
10787 });
10788 }
10789
10790 Ok(())
10791 }
10792
10793 3 => {
10794 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
10795 slot.as_mut(),
10796 decoder,
10797 )?;
10798
10799 Ok(())
10800 }
10801
10802 4 => {
10803 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
10804 slot.as_mut(),
10805 decoder,
10806 )?;
10807
10808 let target_name = unsafe {
10809 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
10810 };
10811
10812 if target_name.len() > 100 {
10813 return Err(::fidl_next::DecodeError::VectorTooLong {
10814 size: target_name.len() as u64,
10815 limit: 100,
10816 });
10817 }
10818
10819 Ok(())
10820 }
10821
10822 5 => {
10823 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
10824 slot.as_mut(),
10825 decoder,
10826 )?;
10827
10828 Ok(())
10829 }
10830
10831 6 => {
10832 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
10833 slot.as_mut(),
10834 decoder,
10835 )?;
10836
10837 let source_dictionary = unsafe {
10838 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
10839 };
10840
10841 if source_dictionary.len() > 1024 {
10842 return Err(::fidl_next::DecodeError::VectorTooLong {
10843 size: source_dictionary.len() as u64,
10844 limit: 1024,
10845 });
10846 }
10847
10848 Ok(())
10849 }
10850
10851 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
10852 }
10853 })
10854 }
10855}
10856
10857impl WireExposeService {
10858 pub fn source(&self) -> Option<&crate::WireRef> {
10859 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
10860 }
10861
10862 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
10863 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
10864 }
10865
10866 pub fn target(&self) -> Option<&crate::WireRef> {
10867 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
10868 }
10869
10870 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
10871 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
10872 }
10873
10874 pub fn availability(&self) -> Option<&crate::WireAvailability> {
10875 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
10876 }
10877
10878 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
10879 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
10880 }
10881}
10882
10883impl ::core::fmt::Debug for WireExposeService {
10884 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
10885 f.debug_struct("ExposeService")
10886 .field("source", &self.source())
10887 .field("source_name", &self.source_name())
10888 .field("target", &self.target())
10889 .field("target_name", &self.target_name())
10890 .field("availability", &self.availability())
10891 .field("source_dictionary", &self.source_dictionary())
10892 .finish()
10893 }
10894}
10895
10896#[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"]
10897#[derive(Clone, Debug)]
10898pub struct ExposeProtocol {
10899 pub source: Option<crate::Ref>,
10900
10901 pub source_name: Option<String>,
10902
10903 pub target: Option<crate::Ref>,
10904
10905 pub target_name: Option<String>,
10906
10907 pub availability: Option<crate::Availability>,
10908
10909 pub source_dictionary: Option<String>,
10910}
10911
10912impl ExposeProtocol {
10913 fn __max_ordinal(&self) -> usize {
10914 if self.source.is_some() {
10915 return 1;
10916 }
10917
10918 if self.source_name.is_some() {
10919 return 2;
10920 }
10921
10922 if self.target.is_some() {
10923 return 3;
10924 }
10925
10926 if self.target_name.is_some() {
10927 return 4;
10928 }
10929
10930 if self.availability.is_some() {
10931 return 5;
10932 }
10933
10934 if self.source_dictionary.is_some() {
10935 return 6;
10936 }
10937
10938 0
10939 }
10940}
10941
10942impl ::fidl_next::Encodable for ExposeProtocol {
10943 type Encoded = WireExposeProtocol;
10944}
10945
10946unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeProtocol
10947where
10948 ___E: ::fidl_next::Encoder + ?Sized,
10949{
10950 #[inline]
10951 fn encode(
10952 &mut self,
10953 encoder: &mut ___E,
10954 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
10955 ) -> Result<(), ::fidl_next::EncodeError> {
10956 ::fidl_next::munge!(let WireExposeProtocol { table } = out);
10957
10958 let max_ord = self.__max_ordinal();
10959
10960 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10961 ::fidl_next::ZeroPadding::zero_padding(&mut out);
10962
10963 let mut preallocated =
10964 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10965
10966 for i in 1..=max_ord {
10967 match i {
10968 6 => {
10969 if let Some(source_dictionary) = &mut self.source_dictionary {
10970 ::fidl_next::WireEnvelope::encode_value(
10971 source_dictionary,
10972 preallocated.encoder,
10973 &mut out,
10974 )?;
10975 } else {
10976 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10977 }
10978 }
10979
10980 5 => {
10981 if let Some(availability) = &mut self.availability {
10982 ::fidl_next::WireEnvelope::encode_value(
10983 availability,
10984 preallocated.encoder,
10985 &mut out,
10986 )?;
10987 } else {
10988 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10989 }
10990 }
10991
10992 4 => {
10993 if let Some(target_name) = &mut self.target_name {
10994 ::fidl_next::WireEnvelope::encode_value(
10995 target_name,
10996 preallocated.encoder,
10997 &mut out,
10998 )?;
10999 } else {
11000 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11001 }
11002 }
11003
11004 3 => {
11005 if let Some(target) = &mut self.target {
11006 ::fidl_next::WireEnvelope::encode_value(
11007 target,
11008 preallocated.encoder,
11009 &mut out,
11010 )?;
11011 } else {
11012 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11013 }
11014 }
11015
11016 2 => {
11017 if let Some(source_name) = &mut self.source_name {
11018 ::fidl_next::WireEnvelope::encode_value(
11019 source_name,
11020 preallocated.encoder,
11021 &mut out,
11022 )?;
11023 } else {
11024 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11025 }
11026 }
11027
11028 1 => {
11029 if let Some(source) = &mut self.source {
11030 ::fidl_next::WireEnvelope::encode_value(
11031 source,
11032 preallocated.encoder,
11033 &mut out,
11034 )?;
11035 } else {
11036 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11037 }
11038 }
11039
11040 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11041 }
11042 unsafe {
11043 preallocated.write_next(out.assume_init_ref());
11044 }
11045 }
11046
11047 ::fidl_next::WireTable::encode_len(table, max_ord);
11048
11049 Ok(())
11050 }
11051}
11052
11053impl ::fidl_next::TakeFrom<WireExposeProtocol> for ExposeProtocol {
11054 #[inline]
11055 fn take_from(from: &WireExposeProtocol) -> Self {
11056 Self {
11057 source: from.source().map(::fidl_next::TakeFrom::take_from),
11058
11059 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
11060
11061 target: from.target().map(::fidl_next::TakeFrom::take_from),
11062
11063 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
11064
11065 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
11066
11067 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
11068 }
11069 }
11070}
11071
11072#[repr(C)]
11074pub struct WireExposeProtocol {
11075 table: ::fidl_next::WireTable,
11076}
11077
11078unsafe impl ::fidl_next::ZeroPadding for WireExposeProtocol {
11079 #[inline]
11080 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11081 ::fidl_next::munge!(let Self { table } = out);
11082 ::fidl_next::WireTable::zero_padding(table);
11083 }
11084}
11085
11086unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeProtocol
11087where
11088 ___D: ::fidl_next::Decoder + ?Sized,
11089{
11090 fn decode(
11091 slot: ::fidl_next::Slot<'_, Self>,
11092 decoder: &mut ___D,
11093 ) -> Result<(), ::fidl_next::DecodeError> {
11094 ::fidl_next::munge!(let Self { table } = slot);
11095
11096 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11097 match ordinal {
11098 0 => unsafe { ::core::hint::unreachable_unchecked() },
11099
11100 1 => {
11101 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
11102 slot.as_mut(),
11103 decoder,
11104 )?;
11105
11106 Ok(())
11107 }
11108
11109 2 => {
11110 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
11111 slot.as_mut(),
11112 decoder,
11113 )?;
11114
11115 let source_name = unsafe {
11116 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
11117 };
11118
11119 if source_name.len() > 100 {
11120 return Err(::fidl_next::DecodeError::VectorTooLong {
11121 size: source_name.len() as u64,
11122 limit: 100,
11123 });
11124 }
11125
11126 Ok(())
11127 }
11128
11129 3 => {
11130 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
11131 slot.as_mut(),
11132 decoder,
11133 )?;
11134
11135 Ok(())
11136 }
11137
11138 4 => {
11139 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
11140 slot.as_mut(),
11141 decoder,
11142 )?;
11143
11144 let target_name = unsafe {
11145 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
11146 };
11147
11148 if target_name.len() > 100 {
11149 return Err(::fidl_next::DecodeError::VectorTooLong {
11150 size: target_name.len() as u64,
11151 limit: 100,
11152 });
11153 }
11154
11155 Ok(())
11156 }
11157
11158 5 => {
11159 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
11160 slot.as_mut(),
11161 decoder,
11162 )?;
11163
11164 Ok(())
11165 }
11166
11167 6 => {
11168 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
11169 slot.as_mut(),
11170 decoder,
11171 )?;
11172
11173 let source_dictionary = unsafe {
11174 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
11175 };
11176
11177 if source_dictionary.len() > 1024 {
11178 return Err(::fidl_next::DecodeError::VectorTooLong {
11179 size: source_dictionary.len() as u64,
11180 limit: 1024,
11181 });
11182 }
11183
11184 Ok(())
11185 }
11186
11187 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
11188 }
11189 })
11190 }
11191}
11192
11193impl WireExposeProtocol {
11194 pub fn source(&self) -> Option<&crate::WireRef> {
11195 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11196 }
11197
11198 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
11199 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11200 }
11201
11202 pub fn target(&self) -> Option<&crate::WireRef> {
11203 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
11204 }
11205
11206 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
11207 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
11208 }
11209
11210 pub fn availability(&self) -> Option<&crate::WireAvailability> {
11211 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
11212 }
11213
11214 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
11215 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
11216 }
11217}
11218
11219impl ::core::fmt::Debug for WireExposeProtocol {
11220 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
11221 f.debug_struct("ExposeProtocol")
11222 .field("source", &self.source())
11223 .field("source_name", &self.source_name())
11224 .field("target", &self.target())
11225 .field("target_name", &self.target_name())
11226 .field("availability", &self.availability())
11227 .field("source_dictionary", &self.source_dictionary())
11228 .finish()
11229 }
11230}
11231
11232#[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"]
11233#[derive(Clone, Debug)]
11234pub struct ExposeDirectory {
11235 pub source: Option<crate::Ref>,
11236
11237 pub source_name: Option<String>,
11238
11239 pub target: Option<crate::Ref>,
11240
11241 pub target_name: Option<String>,
11242
11243 pub rights: Option<::fidl_next_fuchsia_io::Operations>,
11244
11245 pub subdir: Option<String>,
11246
11247 pub availability: Option<crate::Availability>,
11248
11249 pub source_dictionary: Option<String>,
11250}
11251
11252impl ExposeDirectory {
11253 fn __max_ordinal(&self) -> usize {
11254 if self.source.is_some() {
11255 return 1;
11256 }
11257
11258 if self.source_name.is_some() {
11259 return 2;
11260 }
11261
11262 if self.target.is_some() {
11263 return 3;
11264 }
11265
11266 if self.target_name.is_some() {
11267 return 4;
11268 }
11269
11270 if self.rights.is_some() {
11271 return 5;
11272 }
11273
11274 if self.subdir.is_some() {
11275 return 6;
11276 }
11277
11278 if self.availability.is_some() {
11279 return 7;
11280 }
11281
11282 if self.source_dictionary.is_some() {
11283 return 8;
11284 }
11285
11286 0
11287 }
11288}
11289
11290impl ::fidl_next::Encodable for ExposeDirectory {
11291 type Encoded = WireExposeDirectory;
11292}
11293
11294unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeDirectory
11295where
11296 ___E: ::fidl_next::Encoder + ?Sized,
11297{
11298 #[inline]
11299 fn encode(
11300 &mut self,
11301 encoder: &mut ___E,
11302 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11303 ) -> Result<(), ::fidl_next::EncodeError> {
11304 ::fidl_next::munge!(let WireExposeDirectory { table } = out);
11305
11306 let max_ord = self.__max_ordinal();
11307
11308 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11309 ::fidl_next::ZeroPadding::zero_padding(&mut out);
11310
11311 let mut preallocated =
11312 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11313
11314 for i in 1..=max_ord {
11315 match i {
11316 8 => {
11317 if let Some(source_dictionary) = &mut self.source_dictionary {
11318 ::fidl_next::WireEnvelope::encode_value(
11319 source_dictionary,
11320 preallocated.encoder,
11321 &mut out,
11322 )?;
11323 } else {
11324 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11325 }
11326 }
11327
11328 7 => {
11329 if let Some(availability) = &mut self.availability {
11330 ::fidl_next::WireEnvelope::encode_value(
11331 availability,
11332 preallocated.encoder,
11333 &mut out,
11334 )?;
11335 } else {
11336 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11337 }
11338 }
11339
11340 6 => {
11341 if let Some(subdir) = &mut self.subdir {
11342 ::fidl_next::WireEnvelope::encode_value(
11343 subdir,
11344 preallocated.encoder,
11345 &mut out,
11346 )?;
11347 } else {
11348 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11349 }
11350 }
11351
11352 5 => {
11353 if let Some(rights) = &mut self.rights {
11354 ::fidl_next::WireEnvelope::encode_value(
11355 rights,
11356 preallocated.encoder,
11357 &mut out,
11358 )?;
11359 } else {
11360 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11361 }
11362 }
11363
11364 4 => {
11365 if let Some(target_name) = &mut self.target_name {
11366 ::fidl_next::WireEnvelope::encode_value(
11367 target_name,
11368 preallocated.encoder,
11369 &mut out,
11370 )?;
11371 } else {
11372 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11373 }
11374 }
11375
11376 3 => {
11377 if let Some(target) = &mut self.target {
11378 ::fidl_next::WireEnvelope::encode_value(
11379 target,
11380 preallocated.encoder,
11381 &mut out,
11382 )?;
11383 } else {
11384 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11385 }
11386 }
11387
11388 2 => {
11389 if let Some(source_name) = &mut self.source_name {
11390 ::fidl_next::WireEnvelope::encode_value(
11391 source_name,
11392 preallocated.encoder,
11393 &mut out,
11394 )?;
11395 } else {
11396 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11397 }
11398 }
11399
11400 1 => {
11401 if let Some(source) = &mut self.source {
11402 ::fidl_next::WireEnvelope::encode_value(
11403 source,
11404 preallocated.encoder,
11405 &mut out,
11406 )?;
11407 } else {
11408 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11409 }
11410 }
11411
11412 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11413 }
11414 unsafe {
11415 preallocated.write_next(out.assume_init_ref());
11416 }
11417 }
11418
11419 ::fidl_next::WireTable::encode_len(table, max_ord);
11420
11421 Ok(())
11422 }
11423}
11424
11425impl ::fidl_next::TakeFrom<WireExposeDirectory> for ExposeDirectory {
11426 #[inline]
11427 fn take_from(from: &WireExposeDirectory) -> Self {
11428 Self {
11429 source: from.source().map(::fidl_next::TakeFrom::take_from),
11430
11431 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
11432
11433 target: from.target().map(::fidl_next::TakeFrom::take_from),
11434
11435 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
11436
11437 rights: from.rights().map(::fidl_next::TakeFrom::take_from),
11438
11439 subdir: from.subdir().map(::fidl_next::TakeFrom::take_from),
11440
11441 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
11442
11443 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
11444 }
11445 }
11446}
11447
11448#[repr(C)]
11450pub struct WireExposeDirectory {
11451 table: ::fidl_next::WireTable,
11452}
11453
11454unsafe impl ::fidl_next::ZeroPadding for WireExposeDirectory {
11455 #[inline]
11456 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11457 ::fidl_next::munge!(let Self { table } = out);
11458 ::fidl_next::WireTable::zero_padding(table);
11459 }
11460}
11461
11462unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeDirectory
11463where
11464 ___D: ::fidl_next::Decoder + ?Sized,
11465{
11466 fn decode(
11467 slot: ::fidl_next::Slot<'_, Self>,
11468 decoder: &mut ___D,
11469 ) -> Result<(), ::fidl_next::DecodeError> {
11470 ::fidl_next::munge!(let Self { table } = slot);
11471
11472 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11473 match ordinal {
11474 0 => unsafe { ::core::hint::unreachable_unchecked() },
11475
11476 1 => {
11477 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
11478 slot.as_mut(),
11479 decoder,
11480 )?;
11481
11482 Ok(())
11483 }
11484
11485 2 => {
11486 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
11487 slot.as_mut(),
11488 decoder,
11489 )?;
11490
11491 let source_name = unsafe {
11492 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
11493 };
11494
11495 if source_name.len() > 100 {
11496 return Err(::fidl_next::DecodeError::VectorTooLong {
11497 size: source_name.len() as u64,
11498 limit: 100,
11499 });
11500 }
11501
11502 Ok(())
11503 }
11504
11505 3 => {
11506 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
11507 slot.as_mut(),
11508 decoder,
11509 )?;
11510
11511 Ok(())
11512 }
11513
11514 4 => {
11515 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
11516 slot.as_mut(),
11517 decoder,
11518 )?;
11519
11520 let target_name = unsafe {
11521 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
11522 };
11523
11524 if target_name.len() > 100 {
11525 return Err(::fidl_next::DecodeError::VectorTooLong {
11526 size: target_name.len() as u64,
11527 limit: 100,
11528 });
11529 }
11530
11531 Ok(())
11532 }
11533
11534 5 => {
11535 ::fidl_next::WireEnvelope::decode_as::<
11536 ___D,
11537 ::fidl_next_fuchsia_io::WireOperations,
11538 >(slot.as_mut(), decoder)?;
11539
11540 Ok(())
11541 }
11542
11543 6 => {
11544 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
11545 slot.as_mut(),
11546 decoder,
11547 )?;
11548
11549 let subdir = unsafe {
11550 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
11551 };
11552
11553 if subdir.len() > 1024 {
11554 return Err(::fidl_next::DecodeError::VectorTooLong {
11555 size: subdir.len() as u64,
11556 limit: 1024,
11557 });
11558 }
11559
11560 Ok(())
11561 }
11562
11563 7 => {
11564 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
11565 slot.as_mut(),
11566 decoder,
11567 )?;
11568
11569 Ok(())
11570 }
11571
11572 8 => {
11573 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
11574 slot.as_mut(),
11575 decoder,
11576 )?;
11577
11578 let source_dictionary = unsafe {
11579 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
11580 };
11581
11582 if source_dictionary.len() > 1024 {
11583 return Err(::fidl_next::DecodeError::VectorTooLong {
11584 size: source_dictionary.len() as u64,
11585 limit: 1024,
11586 });
11587 }
11588
11589 Ok(())
11590 }
11591
11592 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
11593 }
11594 })
11595 }
11596}
11597
11598impl WireExposeDirectory {
11599 pub fn source(&self) -> Option<&crate::WireRef> {
11600 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11601 }
11602
11603 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
11604 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11605 }
11606
11607 pub fn target(&self) -> Option<&crate::WireRef> {
11608 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
11609 }
11610
11611 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
11612 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
11613 }
11614
11615 pub fn rights(&self) -> Option<&::fidl_next_fuchsia_io::WireOperations> {
11616 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
11617 }
11618
11619 pub fn subdir(&self) -> Option<&::fidl_next::WireString> {
11620 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
11621 }
11622
11623 pub fn availability(&self) -> Option<&crate::WireAvailability> {
11624 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
11625 }
11626
11627 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
11628 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
11629 }
11630}
11631
11632impl ::core::fmt::Debug for WireExposeDirectory {
11633 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
11634 f.debug_struct("ExposeDirectory")
11635 .field("source", &self.source())
11636 .field("source_name", &self.source_name())
11637 .field("target", &self.target())
11638 .field("target_name", &self.target_name())
11639 .field("rights", &self.rights())
11640 .field("subdir", &self.subdir())
11641 .field("availability", &self.availability())
11642 .field("source_dictionary", &self.source_dictionary())
11643 .finish()
11644 }
11645}
11646
11647#[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"]
11648#[derive(Clone, Debug)]
11649pub struct ExposeRunner {
11650 pub source: Option<crate::Ref>,
11651
11652 pub source_name: Option<String>,
11653
11654 pub target: Option<crate::Ref>,
11655
11656 pub target_name: Option<String>,
11657
11658 pub source_dictionary: Option<String>,
11659}
11660
11661impl ExposeRunner {
11662 fn __max_ordinal(&self) -> usize {
11663 if self.source.is_some() {
11664 return 1;
11665 }
11666
11667 if self.source_name.is_some() {
11668 return 2;
11669 }
11670
11671 if self.target.is_some() {
11672 return 3;
11673 }
11674
11675 if self.target_name.is_some() {
11676 return 4;
11677 }
11678
11679 if self.source_dictionary.is_some() {
11680 return 6;
11681 }
11682
11683 0
11684 }
11685}
11686
11687impl ::fidl_next::Encodable for ExposeRunner {
11688 type Encoded = WireExposeRunner;
11689}
11690
11691unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeRunner
11692where
11693 ___E: ::fidl_next::Encoder + ?Sized,
11694{
11695 #[inline]
11696 fn encode(
11697 &mut self,
11698 encoder: &mut ___E,
11699 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
11700 ) -> Result<(), ::fidl_next::EncodeError> {
11701 ::fidl_next::munge!(let WireExposeRunner { table } = out);
11702
11703 let max_ord = self.__max_ordinal();
11704
11705 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11706 ::fidl_next::ZeroPadding::zero_padding(&mut out);
11707
11708 let mut preallocated =
11709 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11710
11711 for i in 1..=max_ord {
11712 match i {
11713 6 => {
11714 if let Some(source_dictionary) = &mut self.source_dictionary {
11715 ::fidl_next::WireEnvelope::encode_value(
11716 source_dictionary,
11717 preallocated.encoder,
11718 &mut out,
11719 )?;
11720 } else {
11721 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11722 }
11723 }
11724
11725 4 => {
11726 if let Some(target_name) = &mut self.target_name {
11727 ::fidl_next::WireEnvelope::encode_value(
11728 target_name,
11729 preallocated.encoder,
11730 &mut out,
11731 )?;
11732 } else {
11733 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11734 }
11735 }
11736
11737 3 => {
11738 if let Some(target) = &mut self.target {
11739 ::fidl_next::WireEnvelope::encode_value(
11740 target,
11741 preallocated.encoder,
11742 &mut out,
11743 )?;
11744 } else {
11745 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11746 }
11747 }
11748
11749 2 => {
11750 if let Some(source_name) = &mut self.source_name {
11751 ::fidl_next::WireEnvelope::encode_value(
11752 source_name,
11753 preallocated.encoder,
11754 &mut out,
11755 )?;
11756 } else {
11757 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11758 }
11759 }
11760
11761 1 => {
11762 if let Some(source) = &mut self.source {
11763 ::fidl_next::WireEnvelope::encode_value(
11764 source,
11765 preallocated.encoder,
11766 &mut out,
11767 )?;
11768 } else {
11769 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11770 }
11771 }
11772
11773 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11774 }
11775 unsafe {
11776 preallocated.write_next(out.assume_init_ref());
11777 }
11778 }
11779
11780 ::fidl_next::WireTable::encode_len(table, max_ord);
11781
11782 Ok(())
11783 }
11784}
11785
11786impl ::fidl_next::TakeFrom<WireExposeRunner> for ExposeRunner {
11787 #[inline]
11788 fn take_from(from: &WireExposeRunner) -> Self {
11789 Self {
11790 source: from.source().map(::fidl_next::TakeFrom::take_from),
11791
11792 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
11793
11794 target: from.target().map(::fidl_next::TakeFrom::take_from),
11795
11796 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
11797
11798 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
11799 }
11800 }
11801}
11802
11803#[repr(C)]
11805pub struct WireExposeRunner {
11806 table: ::fidl_next::WireTable,
11807}
11808
11809unsafe impl ::fidl_next::ZeroPadding for WireExposeRunner {
11810 #[inline]
11811 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
11812 ::fidl_next::munge!(let Self { table } = out);
11813 ::fidl_next::WireTable::zero_padding(table);
11814 }
11815}
11816
11817unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeRunner
11818where
11819 ___D: ::fidl_next::Decoder + ?Sized,
11820{
11821 fn decode(
11822 slot: ::fidl_next::Slot<'_, Self>,
11823 decoder: &mut ___D,
11824 ) -> Result<(), ::fidl_next::DecodeError> {
11825 ::fidl_next::munge!(let Self { table } = slot);
11826
11827 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
11828 match ordinal {
11829 0 => unsafe { ::core::hint::unreachable_unchecked() },
11830
11831 1 => {
11832 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
11833 slot.as_mut(),
11834 decoder,
11835 )?;
11836
11837 Ok(())
11838 }
11839
11840 2 => {
11841 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
11842 slot.as_mut(),
11843 decoder,
11844 )?;
11845
11846 let source_name = unsafe {
11847 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
11848 };
11849
11850 if source_name.len() > 100 {
11851 return Err(::fidl_next::DecodeError::VectorTooLong {
11852 size: source_name.len() as u64,
11853 limit: 100,
11854 });
11855 }
11856
11857 Ok(())
11858 }
11859
11860 3 => {
11861 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
11862 slot.as_mut(),
11863 decoder,
11864 )?;
11865
11866 Ok(())
11867 }
11868
11869 4 => {
11870 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
11871 slot.as_mut(),
11872 decoder,
11873 )?;
11874
11875 let target_name = unsafe {
11876 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
11877 };
11878
11879 if target_name.len() > 100 {
11880 return Err(::fidl_next::DecodeError::VectorTooLong {
11881 size: target_name.len() as u64,
11882 limit: 100,
11883 });
11884 }
11885
11886 Ok(())
11887 }
11888
11889 6 => {
11890 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
11891 slot.as_mut(),
11892 decoder,
11893 )?;
11894
11895 let source_dictionary = unsafe {
11896 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
11897 };
11898
11899 if source_dictionary.len() > 1024 {
11900 return Err(::fidl_next::DecodeError::VectorTooLong {
11901 size: source_dictionary.len() as u64,
11902 limit: 1024,
11903 });
11904 }
11905
11906 Ok(())
11907 }
11908
11909 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
11910 }
11911 })
11912 }
11913}
11914
11915impl WireExposeRunner {
11916 pub fn source(&self) -> Option<&crate::WireRef> {
11917 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
11918 }
11919
11920 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
11921 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
11922 }
11923
11924 pub fn target(&self) -> Option<&crate::WireRef> {
11925 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
11926 }
11927
11928 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
11929 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
11930 }
11931
11932 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
11933 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
11934 }
11935}
11936
11937impl ::core::fmt::Debug for WireExposeRunner {
11938 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
11939 f.debug_struct("ExposeRunner")
11940 .field("source", &self.source())
11941 .field("source_name", &self.source_name())
11942 .field("target", &self.target())
11943 .field("target_name", &self.target_name())
11944 .field("source_dictionary", &self.source_dictionary())
11945 .finish()
11946 }
11947}
11948
11949#[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"]
11950#[derive(Clone, Debug)]
11951pub struct ExposeResolver {
11952 pub source: Option<crate::Ref>,
11953
11954 pub source_name: Option<String>,
11955
11956 pub target: Option<crate::Ref>,
11957
11958 pub target_name: Option<String>,
11959
11960 pub source_dictionary: Option<String>,
11961}
11962
11963impl ExposeResolver {
11964 fn __max_ordinal(&self) -> usize {
11965 if self.source.is_some() {
11966 return 1;
11967 }
11968
11969 if self.source_name.is_some() {
11970 return 2;
11971 }
11972
11973 if self.target.is_some() {
11974 return 3;
11975 }
11976
11977 if self.target_name.is_some() {
11978 return 4;
11979 }
11980
11981 if self.source_dictionary.is_some() {
11982 return 6;
11983 }
11984
11985 0
11986 }
11987}
11988
11989impl ::fidl_next::Encodable for ExposeResolver {
11990 type Encoded = WireExposeResolver;
11991}
11992
11993unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeResolver
11994where
11995 ___E: ::fidl_next::Encoder + ?Sized,
11996{
11997 #[inline]
11998 fn encode(
11999 &mut self,
12000 encoder: &mut ___E,
12001 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12002 ) -> Result<(), ::fidl_next::EncodeError> {
12003 ::fidl_next::munge!(let WireExposeResolver { table } = out);
12004
12005 let max_ord = self.__max_ordinal();
12006
12007 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12008 ::fidl_next::ZeroPadding::zero_padding(&mut out);
12009
12010 let mut preallocated =
12011 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12012
12013 for i in 1..=max_ord {
12014 match i {
12015 6 => {
12016 if let Some(source_dictionary) = &mut self.source_dictionary {
12017 ::fidl_next::WireEnvelope::encode_value(
12018 source_dictionary,
12019 preallocated.encoder,
12020 &mut out,
12021 )?;
12022 } else {
12023 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12024 }
12025 }
12026
12027 4 => {
12028 if let Some(target_name) = &mut self.target_name {
12029 ::fidl_next::WireEnvelope::encode_value(
12030 target_name,
12031 preallocated.encoder,
12032 &mut out,
12033 )?;
12034 } else {
12035 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12036 }
12037 }
12038
12039 3 => {
12040 if let Some(target) = &mut self.target {
12041 ::fidl_next::WireEnvelope::encode_value(
12042 target,
12043 preallocated.encoder,
12044 &mut out,
12045 )?;
12046 } else {
12047 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12048 }
12049 }
12050
12051 2 => {
12052 if let Some(source_name) = &mut self.source_name {
12053 ::fidl_next::WireEnvelope::encode_value(
12054 source_name,
12055 preallocated.encoder,
12056 &mut out,
12057 )?;
12058 } else {
12059 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12060 }
12061 }
12062
12063 1 => {
12064 if let Some(source) = &mut self.source {
12065 ::fidl_next::WireEnvelope::encode_value(
12066 source,
12067 preallocated.encoder,
12068 &mut out,
12069 )?;
12070 } else {
12071 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12072 }
12073 }
12074
12075 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12076 }
12077 unsafe {
12078 preallocated.write_next(out.assume_init_ref());
12079 }
12080 }
12081
12082 ::fidl_next::WireTable::encode_len(table, max_ord);
12083
12084 Ok(())
12085 }
12086}
12087
12088impl ::fidl_next::TakeFrom<WireExposeResolver> for ExposeResolver {
12089 #[inline]
12090 fn take_from(from: &WireExposeResolver) -> Self {
12091 Self {
12092 source: from.source().map(::fidl_next::TakeFrom::take_from),
12093
12094 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
12095
12096 target: from.target().map(::fidl_next::TakeFrom::take_from),
12097
12098 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
12099
12100 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
12101 }
12102 }
12103}
12104
12105#[repr(C)]
12107pub struct WireExposeResolver {
12108 table: ::fidl_next::WireTable,
12109}
12110
12111unsafe impl ::fidl_next::ZeroPadding for WireExposeResolver {
12112 #[inline]
12113 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12114 ::fidl_next::munge!(let Self { table } = out);
12115 ::fidl_next::WireTable::zero_padding(table);
12116 }
12117}
12118
12119unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeResolver
12120where
12121 ___D: ::fidl_next::Decoder + ?Sized,
12122{
12123 fn decode(
12124 slot: ::fidl_next::Slot<'_, Self>,
12125 decoder: &mut ___D,
12126 ) -> Result<(), ::fidl_next::DecodeError> {
12127 ::fidl_next::munge!(let Self { table } = slot);
12128
12129 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12130 match ordinal {
12131 0 => unsafe { ::core::hint::unreachable_unchecked() },
12132
12133 1 => {
12134 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
12135 slot.as_mut(),
12136 decoder,
12137 )?;
12138
12139 Ok(())
12140 }
12141
12142 2 => {
12143 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
12144 slot.as_mut(),
12145 decoder,
12146 )?;
12147
12148 let source_name = unsafe {
12149 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
12150 };
12151
12152 if source_name.len() > 100 {
12153 return Err(::fidl_next::DecodeError::VectorTooLong {
12154 size: source_name.len() as u64,
12155 limit: 100,
12156 });
12157 }
12158
12159 Ok(())
12160 }
12161
12162 3 => {
12163 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
12164 slot.as_mut(),
12165 decoder,
12166 )?;
12167
12168 Ok(())
12169 }
12170
12171 4 => {
12172 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
12173 slot.as_mut(),
12174 decoder,
12175 )?;
12176
12177 let target_name = unsafe {
12178 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
12179 };
12180
12181 if target_name.len() > 100 {
12182 return Err(::fidl_next::DecodeError::VectorTooLong {
12183 size: target_name.len() as u64,
12184 limit: 100,
12185 });
12186 }
12187
12188 Ok(())
12189 }
12190
12191 6 => {
12192 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
12193 slot.as_mut(),
12194 decoder,
12195 )?;
12196
12197 let source_dictionary = unsafe {
12198 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
12199 };
12200
12201 if source_dictionary.len() > 1024 {
12202 return Err(::fidl_next::DecodeError::VectorTooLong {
12203 size: source_dictionary.len() as u64,
12204 limit: 1024,
12205 });
12206 }
12207
12208 Ok(())
12209 }
12210
12211 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
12212 }
12213 })
12214 }
12215}
12216
12217impl WireExposeResolver {
12218 pub fn source(&self) -> Option<&crate::WireRef> {
12219 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12220 }
12221
12222 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
12223 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12224 }
12225
12226 pub fn target(&self) -> Option<&crate::WireRef> {
12227 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
12228 }
12229
12230 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
12231 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
12232 }
12233
12234 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
12235 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
12236 }
12237}
12238
12239impl ::core::fmt::Debug for WireExposeResolver {
12240 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
12241 f.debug_struct("ExposeResolver")
12242 .field("source", &self.source())
12243 .field("source_name", &self.source_name())
12244 .field("target", &self.target())
12245 .field("target_name", &self.target_name())
12246 .field("source_dictionary", &self.source_dictionary())
12247 .finish()
12248 }
12249}
12250
12251#[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"]
12252#[derive(Clone, Debug)]
12253pub struct ExposeDictionary {
12254 pub source: Option<crate::Ref>,
12255
12256 pub source_name: Option<String>,
12257
12258 pub target: Option<crate::Ref>,
12259
12260 pub target_name: Option<String>,
12261
12262 pub availability: Option<crate::Availability>,
12263
12264 pub source_dictionary: Option<String>,
12265}
12266
12267impl ExposeDictionary {
12268 fn __max_ordinal(&self) -> usize {
12269 if self.source.is_some() {
12270 return 1;
12271 }
12272
12273 if self.source_name.is_some() {
12274 return 2;
12275 }
12276
12277 if self.target.is_some() {
12278 return 3;
12279 }
12280
12281 if self.target_name.is_some() {
12282 return 4;
12283 }
12284
12285 if self.availability.is_some() {
12286 return 5;
12287 }
12288
12289 if self.source_dictionary.is_some() {
12290 return 6;
12291 }
12292
12293 0
12294 }
12295}
12296
12297impl ::fidl_next::Encodable for ExposeDictionary {
12298 type Encoded = WireExposeDictionary;
12299}
12300
12301unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeDictionary
12302where
12303 ___E: ::fidl_next::Encoder + ?Sized,
12304{
12305 #[inline]
12306 fn encode(
12307 &mut self,
12308 encoder: &mut ___E,
12309 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12310 ) -> Result<(), ::fidl_next::EncodeError> {
12311 ::fidl_next::munge!(let WireExposeDictionary { table } = out);
12312
12313 let max_ord = self.__max_ordinal();
12314
12315 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12316 ::fidl_next::ZeroPadding::zero_padding(&mut out);
12317
12318 let mut preallocated =
12319 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12320
12321 for i in 1..=max_ord {
12322 match i {
12323 6 => {
12324 if let Some(source_dictionary) = &mut self.source_dictionary {
12325 ::fidl_next::WireEnvelope::encode_value(
12326 source_dictionary,
12327 preallocated.encoder,
12328 &mut out,
12329 )?;
12330 } else {
12331 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12332 }
12333 }
12334
12335 5 => {
12336 if let Some(availability) = &mut self.availability {
12337 ::fidl_next::WireEnvelope::encode_value(
12338 availability,
12339 preallocated.encoder,
12340 &mut out,
12341 )?;
12342 } else {
12343 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12344 }
12345 }
12346
12347 4 => {
12348 if let Some(target_name) = &mut self.target_name {
12349 ::fidl_next::WireEnvelope::encode_value(
12350 target_name,
12351 preallocated.encoder,
12352 &mut out,
12353 )?;
12354 } else {
12355 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12356 }
12357 }
12358
12359 3 => {
12360 if let Some(target) = &mut self.target {
12361 ::fidl_next::WireEnvelope::encode_value(
12362 target,
12363 preallocated.encoder,
12364 &mut out,
12365 )?;
12366 } else {
12367 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12368 }
12369 }
12370
12371 2 => {
12372 if let Some(source_name) = &mut self.source_name {
12373 ::fidl_next::WireEnvelope::encode_value(
12374 source_name,
12375 preallocated.encoder,
12376 &mut out,
12377 )?;
12378 } else {
12379 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12380 }
12381 }
12382
12383 1 => {
12384 if let Some(source) = &mut self.source {
12385 ::fidl_next::WireEnvelope::encode_value(
12386 source,
12387 preallocated.encoder,
12388 &mut out,
12389 )?;
12390 } else {
12391 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12392 }
12393 }
12394
12395 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12396 }
12397 unsafe {
12398 preallocated.write_next(out.assume_init_ref());
12399 }
12400 }
12401
12402 ::fidl_next::WireTable::encode_len(table, max_ord);
12403
12404 Ok(())
12405 }
12406}
12407
12408impl ::fidl_next::TakeFrom<WireExposeDictionary> for ExposeDictionary {
12409 #[inline]
12410 fn take_from(from: &WireExposeDictionary) -> Self {
12411 Self {
12412 source: from.source().map(::fidl_next::TakeFrom::take_from),
12413
12414 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
12415
12416 target: from.target().map(::fidl_next::TakeFrom::take_from),
12417
12418 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
12419
12420 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
12421
12422 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
12423 }
12424 }
12425}
12426
12427#[repr(C)]
12429pub struct WireExposeDictionary {
12430 table: ::fidl_next::WireTable,
12431}
12432
12433unsafe impl ::fidl_next::ZeroPadding for WireExposeDictionary {
12434 #[inline]
12435 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12436 ::fidl_next::munge!(let Self { table } = out);
12437 ::fidl_next::WireTable::zero_padding(table);
12438 }
12439}
12440
12441unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeDictionary
12442where
12443 ___D: ::fidl_next::Decoder + ?Sized,
12444{
12445 fn decode(
12446 slot: ::fidl_next::Slot<'_, Self>,
12447 decoder: &mut ___D,
12448 ) -> Result<(), ::fidl_next::DecodeError> {
12449 ::fidl_next::munge!(let Self { table } = slot);
12450
12451 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12452 match ordinal {
12453 0 => unsafe { ::core::hint::unreachable_unchecked() },
12454
12455 1 => {
12456 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
12457 slot.as_mut(),
12458 decoder,
12459 )?;
12460
12461 Ok(())
12462 }
12463
12464 2 => {
12465 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
12466 slot.as_mut(),
12467 decoder,
12468 )?;
12469
12470 let source_name = unsafe {
12471 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
12472 };
12473
12474 if source_name.len() > 100 {
12475 return Err(::fidl_next::DecodeError::VectorTooLong {
12476 size: source_name.len() as u64,
12477 limit: 100,
12478 });
12479 }
12480
12481 Ok(())
12482 }
12483
12484 3 => {
12485 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
12486 slot.as_mut(),
12487 decoder,
12488 )?;
12489
12490 Ok(())
12491 }
12492
12493 4 => {
12494 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
12495 slot.as_mut(),
12496 decoder,
12497 )?;
12498
12499 let target_name = unsafe {
12500 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
12501 };
12502
12503 if target_name.len() > 100 {
12504 return Err(::fidl_next::DecodeError::VectorTooLong {
12505 size: target_name.len() as u64,
12506 limit: 100,
12507 });
12508 }
12509
12510 Ok(())
12511 }
12512
12513 5 => {
12514 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
12515 slot.as_mut(),
12516 decoder,
12517 )?;
12518
12519 Ok(())
12520 }
12521
12522 6 => {
12523 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
12524 slot.as_mut(),
12525 decoder,
12526 )?;
12527
12528 let source_dictionary = unsafe {
12529 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
12530 };
12531
12532 if source_dictionary.len() > 1024 {
12533 return Err(::fidl_next::DecodeError::VectorTooLong {
12534 size: source_dictionary.len() as u64,
12535 limit: 1024,
12536 });
12537 }
12538
12539 Ok(())
12540 }
12541
12542 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
12543 }
12544 })
12545 }
12546}
12547
12548impl WireExposeDictionary {
12549 pub fn source(&self) -> Option<&crate::WireRef> {
12550 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12551 }
12552
12553 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
12554 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12555 }
12556
12557 pub fn target(&self) -> Option<&crate::WireRef> {
12558 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
12559 }
12560
12561 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
12562 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
12563 }
12564
12565 pub fn availability(&self) -> Option<&crate::WireAvailability> {
12566 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
12567 }
12568
12569 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
12570 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
12571 }
12572}
12573
12574impl ::core::fmt::Debug for WireExposeDictionary {
12575 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
12576 f.debug_struct("ExposeDictionary")
12577 .field("source", &self.source())
12578 .field("source_name", &self.source_name())
12579 .field("target", &self.target())
12580 .field("target_name", &self.target_name())
12581 .field("availability", &self.availability())
12582 .field("source_dictionary", &self.source_dictionary())
12583 .finish()
12584 }
12585}
12586
12587#[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"]
12588#[derive(Clone, Debug)]
12589pub struct ExposeConfiguration {
12590 pub source: Option<crate::Ref>,
12591
12592 pub source_name: Option<String>,
12593
12594 pub target: Option<crate::Ref>,
12595
12596 pub target_name: Option<String>,
12597
12598 pub availability: Option<crate::Availability>,
12599
12600 pub source_dictionary: Option<String>,
12601}
12602
12603impl ExposeConfiguration {
12604 fn __max_ordinal(&self) -> usize {
12605 if self.source.is_some() {
12606 return 1;
12607 }
12608
12609 if self.source_name.is_some() {
12610 return 2;
12611 }
12612
12613 if self.target.is_some() {
12614 return 3;
12615 }
12616
12617 if self.target_name.is_some() {
12618 return 4;
12619 }
12620
12621 if self.availability.is_some() {
12622 return 5;
12623 }
12624
12625 if self.source_dictionary.is_some() {
12626 return 6;
12627 }
12628
12629 0
12630 }
12631}
12632
12633impl ::fidl_next::Encodable for ExposeConfiguration {
12634 type Encoded = WireExposeConfiguration;
12635}
12636
12637unsafe impl<___E> ::fidl_next::Encode<___E> for ExposeConfiguration
12638where
12639 ___E: ::fidl_next::Encoder + ?Sized,
12640{
12641 #[inline]
12642 fn encode(
12643 &mut self,
12644 encoder: &mut ___E,
12645 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12646 ) -> Result<(), ::fidl_next::EncodeError> {
12647 ::fidl_next::munge!(let WireExposeConfiguration { table } = out);
12648
12649 let max_ord = self.__max_ordinal();
12650
12651 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12652 ::fidl_next::ZeroPadding::zero_padding(&mut out);
12653
12654 let mut preallocated =
12655 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12656
12657 for i in 1..=max_ord {
12658 match i {
12659 6 => {
12660 if let Some(source_dictionary) = &mut self.source_dictionary {
12661 ::fidl_next::WireEnvelope::encode_value(
12662 source_dictionary,
12663 preallocated.encoder,
12664 &mut out,
12665 )?;
12666 } else {
12667 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12668 }
12669 }
12670
12671 5 => {
12672 if let Some(availability) = &mut self.availability {
12673 ::fidl_next::WireEnvelope::encode_value(
12674 availability,
12675 preallocated.encoder,
12676 &mut out,
12677 )?;
12678 } else {
12679 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12680 }
12681 }
12682
12683 4 => {
12684 if let Some(target_name) = &mut self.target_name {
12685 ::fidl_next::WireEnvelope::encode_value(
12686 target_name,
12687 preallocated.encoder,
12688 &mut out,
12689 )?;
12690 } else {
12691 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12692 }
12693 }
12694
12695 3 => {
12696 if let Some(target) = &mut self.target {
12697 ::fidl_next::WireEnvelope::encode_value(
12698 target,
12699 preallocated.encoder,
12700 &mut out,
12701 )?;
12702 } else {
12703 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12704 }
12705 }
12706
12707 2 => {
12708 if let Some(source_name) = &mut self.source_name {
12709 ::fidl_next::WireEnvelope::encode_value(
12710 source_name,
12711 preallocated.encoder,
12712 &mut out,
12713 )?;
12714 } else {
12715 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12716 }
12717 }
12718
12719 1 => {
12720 if let Some(source) = &mut self.source {
12721 ::fidl_next::WireEnvelope::encode_value(
12722 source,
12723 preallocated.encoder,
12724 &mut out,
12725 )?;
12726 } else {
12727 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12728 }
12729 }
12730
12731 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12732 }
12733 unsafe {
12734 preallocated.write_next(out.assume_init_ref());
12735 }
12736 }
12737
12738 ::fidl_next::WireTable::encode_len(table, max_ord);
12739
12740 Ok(())
12741 }
12742}
12743
12744impl ::fidl_next::TakeFrom<WireExposeConfiguration> for ExposeConfiguration {
12745 #[inline]
12746 fn take_from(from: &WireExposeConfiguration) -> Self {
12747 Self {
12748 source: from.source().map(::fidl_next::TakeFrom::take_from),
12749
12750 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
12751
12752 target: from.target().map(::fidl_next::TakeFrom::take_from),
12753
12754 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
12755
12756 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
12757
12758 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
12759 }
12760 }
12761}
12762
12763#[repr(C)]
12765pub struct WireExposeConfiguration {
12766 table: ::fidl_next::WireTable,
12767}
12768
12769unsafe impl ::fidl_next::ZeroPadding for WireExposeConfiguration {
12770 #[inline]
12771 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
12772 ::fidl_next::munge!(let Self { table } = out);
12773 ::fidl_next::WireTable::zero_padding(table);
12774 }
12775}
12776
12777unsafe impl<___D> ::fidl_next::Decode<___D> for WireExposeConfiguration
12778where
12779 ___D: ::fidl_next::Decoder + ?Sized,
12780{
12781 fn decode(
12782 slot: ::fidl_next::Slot<'_, Self>,
12783 decoder: &mut ___D,
12784 ) -> Result<(), ::fidl_next::DecodeError> {
12785 ::fidl_next::munge!(let Self { table } = slot);
12786
12787 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
12788 match ordinal {
12789 0 => unsafe { ::core::hint::unreachable_unchecked() },
12790
12791 1 => {
12792 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
12793 slot.as_mut(),
12794 decoder,
12795 )?;
12796
12797 Ok(())
12798 }
12799
12800 2 => {
12801 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
12802 slot.as_mut(),
12803 decoder,
12804 )?;
12805
12806 let source_name = unsafe {
12807 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
12808 };
12809
12810 if source_name.len() > 100 {
12811 return Err(::fidl_next::DecodeError::VectorTooLong {
12812 size: source_name.len() as u64,
12813 limit: 100,
12814 });
12815 }
12816
12817 Ok(())
12818 }
12819
12820 3 => {
12821 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
12822 slot.as_mut(),
12823 decoder,
12824 )?;
12825
12826 Ok(())
12827 }
12828
12829 4 => {
12830 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
12831 slot.as_mut(),
12832 decoder,
12833 )?;
12834
12835 let target_name = unsafe {
12836 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
12837 };
12838
12839 if target_name.len() > 100 {
12840 return Err(::fidl_next::DecodeError::VectorTooLong {
12841 size: target_name.len() as u64,
12842 limit: 100,
12843 });
12844 }
12845
12846 Ok(())
12847 }
12848
12849 5 => {
12850 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
12851 slot.as_mut(),
12852 decoder,
12853 )?;
12854
12855 Ok(())
12856 }
12857
12858 6 => {
12859 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
12860 slot.as_mut(),
12861 decoder,
12862 )?;
12863
12864 let source_dictionary = unsafe {
12865 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
12866 };
12867
12868 if source_dictionary.len() > 1024 {
12869 return Err(::fidl_next::DecodeError::VectorTooLong {
12870 size: source_dictionary.len() as u64,
12871 limit: 1024,
12872 });
12873 }
12874
12875 Ok(())
12876 }
12877
12878 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
12879 }
12880 })
12881 }
12882}
12883
12884impl WireExposeConfiguration {
12885 pub fn source(&self) -> Option<&crate::WireRef> {
12886 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
12887 }
12888
12889 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
12890 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
12891 }
12892
12893 pub fn target(&self) -> Option<&crate::WireRef> {
12894 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
12895 }
12896
12897 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
12898 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
12899 }
12900
12901 pub fn availability(&self) -> Option<&crate::WireAvailability> {
12902 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
12903 }
12904
12905 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
12906 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
12907 }
12908}
12909
12910impl ::core::fmt::Debug for WireExposeConfiguration {
12911 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
12912 f.debug_struct("ExposeConfiguration")
12913 .field("source", &self.source())
12914 .field("source_name", &self.source_name())
12915 .field("target", &self.target())
12916 .field("target_name", &self.target_name())
12917 .field("availability", &self.availability())
12918 .field("source_dictionary", &self.source_dictionary())
12919 .finish()
12920 }
12921}
12922
12923#[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"]
12924#[derive(Clone, Debug)]
12925pub enum Expose {
12926 Service(crate::ExposeService),
12927
12928 Protocol(crate::ExposeProtocol),
12929
12930 Directory(crate::ExposeDirectory),
12931
12932 Runner(crate::ExposeRunner),
12933
12934 Resolver(crate::ExposeResolver),
12935
12936 Dictionary(crate::ExposeDictionary),
12937
12938 Config(crate::ExposeConfiguration),
12939
12940 UnknownOrdinal_(u64),
12941}
12942
12943impl ::fidl_next::Encodable for Expose {
12944 type Encoded = WireExpose;
12945}
12946
12947unsafe impl<___E> ::fidl_next::Encode<___E> for Expose
12948where
12949 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
12950
12951 ___E: ::fidl_next::Encoder,
12952{
12953 #[inline]
12954 fn encode(
12955 &mut self,
12956 encoder: &mut ___E,
12957 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
12958 ) -> Result<(), ::fidl_next::EncodeError> {
12959 ::fidl_next::munge!(let WireExpose { raw } = out);
12960
12961 match self {
12962 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
12963 ___E,
12964 crate::ExposeService,
12965 >(value, 1, encoder, raw)?,
12966
12967 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
12968 ___E,
12969 crate::ExposeProtocol,
12970 >(value, 2, encoder, raw)?,
12971
12972 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
12973 ___E,
12974 crate::ExposeDirectory,
12975 >(value, 3, encoder, raw)?,
12976
12977 Self::Runner(value) => {
12978 ::fidl_next::RawWireUnion::encode_as::<___E, crate::ExposeRunner>(
12979 value, 4, encoder, raw,
12980 )?
12981 }
12982
12983 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
12984 ___E,
12985 crate::ExposeResolver,
12986 >(value, 5, encoder, raw)?,
12987
12988 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
12989 ___E,
12990 crate::ExposeDictionary,
12991 >(value, 7, encoder, raw)?,
12992
12993 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
12994 ___E,
12995 crate::ExposeConfiguration,
12996 >(value, 8, encoder, raw)?,
12997
12998 Self::UnknownOrdinal_(ordinal) => {
12999 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
13000 }
13001 }
13002
13003 Ok(())
13004 }
13005}
13006
13007impl ::fidl_next::EncodableOption for Box<Expose> {
13008 type EncodedOption = WireOptionalExpose;
13009}
13010
13011unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<Expose>
13012where
13013 ___E: ?Sized,
13014 Expose: ::fidl_next::Encode<___E>,
13015{
13016 #[inline]
13017 fn encode_option(
13018 this: Option<&mut Self>,
13019 encoder: &mut ___E,
13020 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
13021 ) -> Result<(), ::fidl_next::EncodeError> {
13022 ::fidl_next::munge!(let WireOptionalExpose { raw } = &mut *out);
13023
13024 if let Some(inner) = this {
13025 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
13026 ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
13027 } else {
13028 ::fidl_next::RawWireUnion::encode_absent(raw);
13029 }
13030
13031 Ok(())
13032 }
13033}
13034
13035impl ::fidl_next::TakeFrom<WireExpose> for Expose {
13036 #[inline]
13037 fn take_from(from: &WireExpose) -> Self {
13038 match from.raw.ordinal() {
13039 1 => Self::Service(::fidl_next::TakeFrom::take_from(unsafe {
13040 from.raw.get().deref_unchecked::<crate::WireExposeService>()
13041 })),
13042
13043 2 => Self::Protocol(::fidl_next::TakeFrom::take_from(unsafe {
13044 from.raw.get().deref_unchecked::<crate::WireExposeProtocol>()
13045 })),
13046
13047 3 => Self::Directory(::fidl_next::TakeFrom::take_from(unsafe {
13048 from.raw.get().deref_unchecked::<crate::WireExposeDirectory>()
13049 })),
13050
13051 4 => Self::Runner(::fidl_next::TakeFrom::take_from(unsafe {
13052 from.raw.get().deref_unchecked::<crate::WireExposeRunner>()
13053 })),
13054
13055 5 => Self::Resolver(::fidl_next::TakeFrom::take_from(unsafe {
13056 from.raw.get().deref_unchecked::<crate::WireExposeResolver>()
13057 })),
13058
13059 7 => Self::Dictionary(::fidl_next::TakeFrom::take_from(unsafe {
13060 from.raw.get().deref_unchecked::<crate::WireExposeDictionary>()
13061 })),
13062
13063 8 => Self::Config(::fidl_next::TakeFrom::take_from(unsafe {
13064 from.raw.get().deref_unchecked::<crate::WireExposeConfiguration>()
13065 })),
13066
13067 _ => unsafe { ::core::hint::unreachable_unchecked() },
13068 }
13069 }
13070}
13071
13072impl ::fidl_next::TakeFrom<WireOptionalExpose> for Option<Box<Expose>> {
13073 #[inline]
13074 fn take_from(from: &WireOptionalExpose) -> Self {
13075 if let Some(inner) = from.as_ref() {
13076 Some(::fidl_next::TakeFrom::take_from(inner))
13077 } else {
13078 None
13079 }
13080 }
13081}
13082
13083#[repr(transparent)]
13085pub struct WireExpose {
13086 raw: ::fidl_next::RawWireUnion,
13087}
13088
13089unsafe impl ::fidl_next::ZeroPadding for WireExpose {
13090 #[inline]
13091 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13092 ::fidl_next::munge!(let Self { raw } = out);
13093 ::fidl_next::RawWireUnion::zero_padding(raw);
13094 }
13095}
13096
13097pub mod expose {
13098 pub enum Ref<'union> {
13099 Service(&'union crate::WireExposeService),
13100
13101 Protocol(&'union crate::WireExposeProtocol),
13102
13103 Directory(&'union crate::WireExposeDirectory),
13104
13105 Runner(&'union crate::WireExposeRunner),
13106
13107 Resolver(&'union crate::WireExposeResolver),
13108
13109 Dictionary(&'union crate::WireExposeDictionary),
13110
13111 Config(&'union crate::WireExposeConfiguration),
13112
13113 UnknownOrdinal_(u64),
13114 }
13115}
13116
13117impl WireExpose {
13118 pub fn as_ref(&self) -> crate::expose::Ref<'_> {
13119 match self.raw.ordinal() {
13120 1 => crate::expose::Ref::Service(unsafe {
13121 self.raw.get().deref_unchecked::<crate::WireExposeService>()
13122 }),
13123
13124 2 => crate::expose::Ref::Protocol(unsafe {
13125 self.raw.get().deref_unchecked::<crate::WireExposeProtocol>()
13126 }),
13127
13128 3 => crate::expose::Ref::Directory(unsafe {
13129 self.raw.get().deref_unchecked::<crate::WireExposeDirectory>()
13130 }),
13131
13132 4 => crate::expose::Ref::Runner(unsafe {
13133 self.raw.get().deref_unchecked::<crate::WireExposeRunner>()
13134 }),
13135
13136 5 => crate::expose::Ref::Resolver(unsafe {
13137 self.raw.get().deref_unchecked::<crate::WireExposeResolver>()
13138 }),
13139
13140 7 => crate::expose::Ref::Dictionary(unsafe {
13141 self.raw.get().deref_unchecked::<crate::WireExposeDictionary>()
13142 }),
13143
13144 8 => crate::expose::Ref::Config(unsafe {
13145 self.raw.get().deref_unchecked::<crate::WireExposeConfiguration>()
13146 }),
13147
13148 unknown => crate::expose::Ref::UnknownOrdinal_(unknown),
13149 }
13150 }
13151}
13152
13153unsafe impl<___D> ::fidl_next::Decode<___D> for WireExpose
13154where
13155 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
13156
13157 ___D: ::fidl_next::Decoder,
13158{
13159 fn decode(
13160 mut slot: ::fidl_next::Slot<'_, Self>,
13161 decoder: &mut ___D,
13162 ) -> Result<(), ::fidl_next::DecodeError> {
13163 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
13164 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
13165 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeService>(
13166 raw, decoder,
13167 )?,
13168
13169 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeProtocol>(
13170 raw, decoder,
13171 )?,
13172
13173 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeDirectory>(
13174 raw, decoder,
13175 )?,
13176
13177 4 => {
13178 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeRunner>(raw, decoder)?
13179 }
13180
13181 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeResolver>(
13182 raw, decoder,
13183 )?,
13184
13185 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeDictionary>(
13186 raw, decoder,
13187 )?,
13188
13189 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeConfiguration>(
13190 raw, decoder,
13191 )?,
13192
13193 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
13194 }
13195
13196 Ok(())
13197 }
13198}
13199
13200impl ::core::fmt::Debug for WireExpose {
13201 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13202 match self.raw.ordinal() {
13203 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireExposeService>().fmt(f) },
13204 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireExposeProtocol>().fmt(f) },
13205 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireExposeDirectory>().fmt(f) },
13206 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireExposeRunner>().fmt(f) },
13207 5 => unsafe { self.raw.get().deref_unchecked::<crate::WireExposeResolver>().fmt(f) },
13208 7 => unsafe { self.raw.get().deref_unchecked::<crate::WireExposeDictionary>().fmt(f) },
13209 8 => unsafe {
13210 self.raw.get().deref_unchecked::<crate::WireExposeConfiguration>().fmt(f)
13211 },
13212 _ => unsafe { ::core::hint::unreachable_unchecked() },
13213 }
13214 }
13215}
13216
13217#[repr(transparent)]
13218pub struct WireOptionalExpose {
13219 raw: ::fidl_next::RawWireUnion,
13220}
13221
13222unsafe impl ::fidl_next::ZeroPadding for WireOptionalExpose {
13223 #[inline]
13224 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13225 ::fidl_next::munge!(let Self { raw } = out);
13226 ::fidl_next::RawWireUnion::zero_padding(raw);
13227 }
13228}
13229
13230impl WireOptionalExpose {
13231 pub fn is_some(&self) -> bool {
13232 self.raw.is_some()
13233 }
13234
13235 pub fn is_none(&self) -> bool {
13236 self.raw.is_none()
13237 }
13238
13239 pub fn as_ref(&self) -> Option<&WireExpose> {
13240 if self.is_some() {
13241 Some(unsafe { &*(self as *const Self).cast() })
13242 } else {
13243 None
13244 }
13245 }
13246}
13247
13248unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalExpose
13249where
13250 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
13251
13252 ___D: ::fidl_next::Decoder,
13253{
13254 fn decode(
13255 mut slot: ::fidl_next::Slot<'_, Self>,
13256 decoder: &mut ___D,
13257 ) -> Result<(), ::fidl_next::DecodeError> {
13258 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
13259 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
13260 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeService>(
13261 raw, decoder,
13262 )?,
13263
13264 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeProtocol>(
13265 raw, decoder,
13266 )?,
13267
13268 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeDirectory>(
13269 raw, decoder,
13270 )?,
13271
13272 4 => {
13273 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeRunner>(raw, decoder)?
13274 }
13275
13276 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeResolver>(
13277 raw, decoder,
13278 )?,
13279
13280 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeDictionary>(
13281 raw, decoder,
13282 )?,
13283
13284 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireExposeConfiguration>(
13285 raw, decoder,
13286 )?,
13287
13288 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
13289 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
13290 }
13291
13292 Ok(())
13293 }
13294}
13295
13296impl ::core::fmt::Debug for WireOptionalExpose {
13297 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
13298 self.as_ref().fmt(f)
13299 }
13300}
13301
13302#[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"]
13303#[derive(Clone, Debug)]
13304pub struct OfferService {
13305 pub source: Option<crate::Ref>,
13306
13307 pub source_name: Option<String>,
13308
13309 pub target: Option<crate::Ref>,
13310
13311 pub target_name: Option<String>,
13312
13313 pub source_instance_filter: Option<Vec<String>>,
13314
13315 pub renamed_instances: Option<Vec<crate::NameMapping>>,
13316
13317 pub availability: Option<crate::Availability>,
13318
13319 pub source_dictionary: Option<String>,
13320
13321 pub dependency_type: Option<crate::DependencyType>,
13322}
13323
13324impl OfferService {
13325 fn __max_ordinal(&self) -> usize {
13326 if self.source.is_some() {
13327 return 1;
13328 }
13329
13330 if self.source_name.is_some() {
13331 return 2;
13332 }
13333
13334 if self.target.is_some() {
13335 return 3;
13336 }
13337
13338 if self.target_name.is_some() {
13339 return 4;
13340 }
13341
13342 if self.source_instance_filter.is_some() {
13343 return 5;
13344 }
13345
13346 if self.renamed_instances.is_some() {
13347 return 6;
13348 }
13349
13350 if self.availability.is_some() {
13351 return 7;
13352 }
13353
13354 if self.source_dictionary.is_some() {
13355 return 8;
13356 }
13357
13358 if self.dependency_type.is_some() {
13359 return 9;
13360 }
13361
13362 0
13363 }
13364}
13365
13366impl ::fidl_next::Encodable for OfferService {
13367 type Encoded = WireOfferService;
13368}
13369
13370unsafe impl<___E> ::fidl_next::Encode<___E> for OfferService
13371where
13372 ___E: ::fidl_next::Encoder + ?Sized,
13373{
13374 #[inline]
13375 fn encode(
13376 &mut self,
13377 encoder: &mut ___E,
13378 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13379 ) -> Result<(), ::fidl_next::EncodeError> {
13380 ::fidl_next::munge!(let WireOfferService { table } = out);
13381
13382 let max_ord = self.__max_ordinal();
13383
13384 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
13385 ::fidl_next::ZeroPadding::zero_padding(&mut out);
13386
13387 let mut preallocated =
13388 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
13389
13390 for i in 1..=max_ord {
13391 match i {
13392 9 => {
13393 if let Some(dependency_type) = &mut self.dependency_type {
13394 ::fidl_next::WireEnvelope::encode_value(
13395 dependency_type,
13396 preallocated.encoder,
13397 &mut out,
13398 )?;
13399 } else {
13400 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13401 }
13402 }
13403
13404 8 => {
13405 if let Some(source_dictionary) = &mut self.source_dictionary {
13406 ::fidl_next::WireEnvelope::encode_value(
13407 source_dictionary,
13408 preallocated.encoder,
13409 &mut out,
13410 )?;
13411 } else {
13412 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13413 }
13414 }
13415
13416 7 => {
13417 if let Some(availability) = &mut self.availability {
13418 ::fidl_next::WireEnvelope::encode_value(
13419 availability,
13420 preallocated.encoder,
13421 &mut out,
13422 )?;
13423 } else {
13424 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13425 }
13426 }
13427
13428 6 => {
13429 if let Some(renamed_instances) = &mut self.renamed_instances {
13430 ::fidl_next::WireEnvelope::encode_value(
13431 renamed_instances,
13432 preallocated.encoder,
13433 &mut out,
13434 )?;
13435 } else {
13436 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13437 }
13438 }
13439
13440 5 => {
13441 if let Some(source_instance_filter) = &mut self.source_instance_filter {
13442 ::fidl_next::WireEnvelope::encode_value(
13443 source_instance_filter,
13444 preallocated.encoder,
13445 &mut out,
13446 )?;
13447 } else {
13448 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13449 }
13450 }
13451
13452 4 => {
13453 if let Some(target_name) = &mut self.target_name {
13454 ::fidl_next::WireEnvelope::encode_value(
13455 target_name,
13456 preallocated.encoder,
13457 &mut out,
13458 )?;
13459 } else {
13460 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13461 }
13462 }
13463
13464 3 => {
13465 if let Some(target) = &mut self.target {
13466 ::fidl_next::WireEnvelope::encode_value(
13467 target,
13468 preallocated.encoder,
13469 &mut out,
13470 )?;
13471 } else {
13472 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13473 }
13474 }
13475
13476 2 => {
13477 if let Some(source_name) = &mut self.source_name {
13478 ::fidl_next::WireEnvelope::encode_value(
13479 source_name,
13480 preallocated.encoder,
13481 &mut out,
13482 )?;
13483 } else {
13484 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13485 }
13486 }
13487
13488 1 => {
13489 if let Some(source) = &mut self.source {
13490 ::fidl_next::WireEnvelope::encode_value(
13491 source,
13492 preallocated.encoder,
13493 &mut out,
13494 )?;
13495 } else {
13496 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13497 }
13498 }
13499
13500 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
13501 }
13502 unsafe {
13503 preallocated.write_next(out.assume_init_ref());
13504 }
13505 }
13506
13507 ::fidl_next::WireTable::encode_len(table, max_ord);
13508
13509 Ok(())
13510 }
13511}
13512
13513impl ::fidl_next::TakeFrom<WireOfferService> for OfferService {
13514 #[inline]
13515 fn take_from(from: &WireOfferService) -> Self {
13516 Self {
13517 source: from.source().map(::fidl_next::TakeFrom::take_from),
13518
13519 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
13520
13521 target: from.target().map(::fidl_next::TakeFrom::take_from),
13522
13523 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
13524
13525 source_instance_filter: from
13526 .source_instance_filter()
13527 .map(::fidl_next::TakeFrom::take_from),
13528
13529 renamed_instances: from.renamed_instances().map(::fidl_next::TakeFrom::take_from),
13530
13531 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
13532
13533 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
13534
13535 dependency_type: from.dependency_type().map(::fidl_next::TakeFrom::take_from),
13536 }
13537 }
13538}
13539
13540#[repr(C)]
13542pub struct WireOfferService {
13543 table: ::fidl_next::WireTable,
13544}
13545
13546unsafe impl ::fidl_next::ZeroPadding for WireOfferService {
13547 #[inline]
13548 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13549 ::fidl_next::munge!(let Self { table } = out);
13550 ::fidl_next::WireTable::zero_padding(table);
13551 }
13552}
13553
13554unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferService
13555where
13556 ___D: ::fidl_next::Decoder + ?Sized,
13557{
13558 fn decode(
13559 slot: ::fidl_next::Slot<'_, Self>,
13560 decoder: &mut ___D,
13561 ) -> Result<(), ::fidl_next::DecodeError> {
13562 ::fidl_next::munge!(let Self { table } = slot);
13563
13564 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13565 match ordinal {
13566 0 => unsafe { ::core::hint::unreachable_unchecked() },
13567
13568 1 => {
13569 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
13570 slot.as_mut(),
13571 decoder,
13572 )?;
13573
13574 Ok(())
13575 }
13576
13577 2 => {
13578 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
13579 slot.as_mut(),
13580 decoder,
13581 )?;
13582
13583 let source_name = unsafe {
13584 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
13585 };
13586
13587 if source_name.len() > 100 {
13588 return Err(::fidl_next::DecodeError::VectorTooLong {
13589 size: source_name.len() as u64,
13590 limit: 100,
13591 });
13592 }
13593
13594 Ok(())
13595 }
13596
13597 3 => {
13598 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
13599 slot.as_mut(),
13600 decoder,
13601 )?;
13602
13603 Ok(())
13604 }
13605
13606 4 => {
13607 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
13608 slot.as_mut(),
13609 decoder,
13610 )?;
13611
13612 let target_name = unsafe {
13613 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
13614 };
13615
13616 if target_name.len() > 100 {
13617 return Err(::fidl_next::DecodeError::VectorTooLong {
13618 size: target_name.len() as u64,
13619 limit: 100,
13620 });
13621 }
13622
13623 Ok(())
13624 }
13625
13626 5 => {
13627 ::fidl_next::WireEnvelope::decode_as::<
13628 ___D,
13629 ::fidl_next::WireVector<::fidl_next::WireString>,
13630 >(slot.as_mut(), decoder)?;
13631
13632 Ok(())
13633 }
13634
13635 6 => {
13636 ::fidl_next::WireEnvelope::decode_as::<
13637 ___D,
13638 ::fidl_next::WireVector<crate::WireNameMapping>,
13639 >(slot.as_mut(), decoder)?;
13640
13641 Ok(())
13642 }
13643
13644 7 => {
13645 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
13646 slot.as_mut(),
13647 decoder,
13648 )?;
13649
13650 Ok(())
13651 }
13652
13653 8 => {
13654 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
13655 slot.as_mut(),
13656 decoder,
13657 )?;
13658
13659 let source_dictionary = unsafe {
13660 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
13661 };
13662
13663 if source_dictionary.len() > 1024 {
13664 return Err(::fidl_next::DecodeError::VectorTooLong {
13665 size: source_dictionary.len() as u64,
13666 limit: 1024,
13667 });
13668 }
13669
13670 Ok(())
13671 }
13672
13673 9 => {
13674 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
13675 slot.as_mut(),
13676 decoder,
13677 )?;
13678
13679 Ok(())
13680 }
13681
13682 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
13683 }
13684 })
13685 }
13686}
13687
13688impl WireOfferService {
13689 pub fn source(&self) -> Option<&crate::WireRef> {
13690 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
13691 }
13692
13693 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
13694 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
13695 }
13696
13697 pub fn target(&self) -> Option<&crate::WireRef> {
13698 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
13699 }
13700
13701 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
13702 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
13703 }
13704
13705 pub fn source_instance_filter(
13706 &self,
13707 ) -> Option<&::fidl_next::WireVector<::fidl_next::WireString>> {
13708 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
13709 }
13710
13711 pub fn renamed_instances(&self) -> Option<&::fidl_next::WireVector<crate::WireNameMapping>> {
13712 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
13713 }
13714
13715 pub fn availability(&self) -> Option<&crate::WireAvailability> {
13716 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
13717 }
13718
13719 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
13720 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
13721 }
13722
13723 pub fn dependency_type(&self) -> Option<&crate::WireDependencyType> {
13724 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
13725 }
13726}
13727
13728impl ::core::fmt::Debug for WireOfferService {
13729 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
13730 f.debug_struct("OfferService")
13731 .field("source", &self.source())
13732 .field("source_name", &self.source_name())
13733 .field("target", &self.target())
13734 .field("target_name", &self.target_name())
13735 .field("source_instance_filter", &self.source_instance_filter())
13736 .field("renamed_instances", &self.renamed_instances())
13737 .field("availability", &self.availability())
13738 .field("source_dictionary", &self.source_dictionary())
13739 .field("dependency_type", &self.dependency_type())
13740 .finish()
13741 }
13742}
13743
13744#[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"]
13745#[derive(Clone, Debug)]
13746pub struct OfferProtocol {
13747 pub source: Option<crate::Ref>,
13748
13749 pub source_name: Option<String>,
13750
13751 pub target: Option<crate::Ref>,
13752
13753 pub target_name: Option<String>,
13754
13755 pub dependency_type: Option<crate::DependencyType>,
13756
13757 pub availability: Option<crate::Availability>,
13758
13759 pub source_dictionary: Option<String>,
13760}
13761
13762impl OfferProtocol {
13763 fn __max_ordinal(&self) -> usize {
13764 if self.source.is_some() {
13765 return 1;
13766 }
13767
13768 if self.source_name.is_some() {
13769 return 2;
13770 }
13771
13772 if self.target.is_some() {
13773 return 3;
13774 }
13775
13776 if self.target_name.is_some() {
13777 return 4;
13778 }
13779
13780 if self.dependency_type.is_some() {
13781 return 5;
13782 }
13783
13784 if self.availability.is_some() {
13785 return 6;
13786 }
13787
13788 if self.source_dictionary.is_some() {
13789 return 7;
13790 }
13791
13792 0
13793 }
13794}
13795
13796impl ::fidl_next::Encodable for OfferProtocol {
13797 type Encoded = WireOfferProtocol;
13798}
13799
13800unsafe impl<___E> ::fidl_next::Encode<___E> for OfferProtocol
13801where
13802 ___E: ::fidl_next::Encoder + ?Sized,
13803{
13804 #[inline]
13805 fn encode(
13806 &mut self,
13807 encoder: &mut ___E,
13808 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
13809 ) -> Result<(), ::fidl_next::EncodeError> {
13810 ::fidl_next::munge!(let WireOfferProtocol { table } = out);
13811
13812 let max_ord = self.__max_ordinal();
13813
13814 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
13815 ::fidl_next::ZeroPadding::zero_padding(&mut out);
13816
13817 let mut preallocated =
13818 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
13819
13820 for i in 1..=max_ord {
13821 match i {
13822 7 => {
13823 if let Some(source_dictionary) = &mut self.source_dictionary {
13824 ::fidl_next::WireEnvelope::encode_value(
13825 source_dictionary,
13826 preallocated.encoder,
13827 &mut out,
13828 )?;
13829 } else {
13830 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13831 }
13832 }
13833
13834 6 => {
13835 if let Some(availability) = &mut self.availability {
13836 ::fidl_next::WireEnvelope::encode_value(
13837 availability,
13838 preallocated.encoder,
13839 &mut out,
13840 )?;
13841 } else {
13842 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13843 }
13844 }
13845
13846 5 => {
13847 if let Some(dependency_type) = &mut self.dependency_type {
13848 ::fidl_next::WireEnvelope::encode_value(
13849 dependency_type,
13850 preallocated.encoder,
13851 &mut out,
13852 )?;
13853 } else {
13854 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13855 }
13856 }
13857
13858 4 => {
13859 if let Some(target_name) = &mut self.target_name {
13860 ::fidl_next::WireEnvelope::encode_value(
13861 target_name,
13862 preallocated.encoder,
13863 &mut out,
13864 )?;
13865 } else {
13866 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13867 }
13868 }
13869
13870 3 => {
13871 if let Some(target) = &mut self.target {
13872 ::fidl_next::WireEnvelope::encode_value(
13873 target,
13874 preallocated.encoder,
13875 &mut out,
13876 )?;
13877 } else {
13878 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13879 }
13880 }
13881
13882 2 => {
13883 if let Some(source_name) = &mut self.source_name {
13884 ::fidl_next::WireEnvelope::encode_value(
13885 source_name,
13886 preallocated.encoder,
13887 &mut out,
13888 )?;
13889 } else {
13890 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13891 }
13892 }
13893
13894 1 => {
13895 if let Some(source) = &mut self.source {
13896 ::fidl_next::WireEnvelope::encode_value(
13897 source,
13898 preallocated.encoder,
13899 &mut out,
13900 )?;
13901 } else {
13902 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13903 }
13904 }
13905
13906 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
13907 }
13908 unsafe {
13909 preallocated.write_next(out.assume_init_ref());
13910 }
13911 }
13912
13913 ::fidl_next::WireTable::encode_len(table, max_ord);
13914
13915 Ok(())
13916 }
13917}
13918
13919impl ::fidl_next::TakeFrom<WireOfferProtocol> for OfferProtocol {
13920 #[inline]
13921 fn take_from(from: &WireOfferProtocol) -> Self {
13922 Self {
13923 source: from.source().map(::fidl_next::TakeFrom::take_from),
13924
13925 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
13926
13927 target: from.target().map(::fidl_next::TakeFrom::take_from),
13928
13929 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
13930
13931 dependency_type: from.dependency_type().map(::fidl_next::TakeFrom::take_from),
13932
13933 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
13934
13935 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
13936 }
13937 }
13938}
13939
13940#[repr(C)]
13942pub struct WireOfferProtocol {
13943 table: ::fidl_next::WireTable,
13944}
13945
13946unsafe impl ::fidl_next::ZeroPadding for WireOfferProtocol {
13947 #[inline]
13948 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
13949 ::fidl_next::munge!(let Self { table } = out);
13950 ::fidl_next::WireTable::zero_padding(table);
13951 }
13952}
13953
13954unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferProtocol
13955where
13956 ___D: ::fidl_next::Decoder + ?Sized,
13957{
13958 fn decode(
13959 slot: ::fidl_next::Slot<'_, Self>,
13960 decoder: &mut ___D,
13961 ) -> Result<(), ::fidl_next::DecodeError> {
13962 ::fidl_next::munge!(let Self { table } = slot);
13963
13964 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
13965 match ordinal {
13966 0 => unsafe { ::core::hint::unreachable_unchecked() },
13967
13968 1 => {
13969 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
13970 slot.as_mut(),
13971 decoder,
13972 )?;
13973
13974 Ok(())
13975 }
13976
13977 2 => {
13978 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
13979 slot.as_mut(),
13980 decoder,
13981 )?;
13982
13983 let source_name = unsafe {
13984 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
13985 };
13986
13987 if source_name.len() > 100 {
13988 return Err(::fidl_next::DecodeError::VectorTooLong {
13989 size: source_name.len() as u64,
13990 limit: 100,
13991 });
13992 }
13993
13994 Ok(())
13995 }
13996
13997 3 => {
13998 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
13999 slot.as_mut(),
14000 decoder,
14001 )?;
14002
14003 Ok(())
14004 }
14005
14006 4 => {
14007 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
14008 slot.as_mut(),
14009 decoder,
14010 )?;
14011
14012 let target_name = unsafe {
14013 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
14014 };
14015
14016 if target_name.len() > 100 {
14017 return Err(::fidl_next::DecodeError::VectorTooLong {
14018 size: target_name.len() as u64,
14019 limit: 100,
14020 });
14021 }
14022
14023 Ok(())
14024 }
14025
14026 5 => {
14027 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
14028 slot.as_mut(),
14029 decoder,
14030 )?;
14031
14032 Ok(())
14033 }
14034
14035 6 => {
14036 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
14037 slot.as_mut(),
14038 decoder,
14039 )?;
14040
14041 Ok(())
14042 }
14043
14044 7 => {
14045 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
14046 slot.as_mut(),
14047 decoder,
14048 )?;
14049
14050 let source_dictionary = unsafe {
14051 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
14052 };
14053
14054 if source_dictionary.len() > 1024 {
14055 return Err(::fidl_next::DecodeError::VectorTooLong {
14056 size: source_dictionary.len() as u64,
14057 limit: 1024,
14058 });
14059 }
14060
14061 Ok(())
14062 }
14063
14064 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
14065 }
14066 })
14067 }
14068}
14069
14070impl WireOfferProtocol {
14071 pub fn source(&self) -> Option<&crate::WireRef> {
14072 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
14073 }
14074
14075 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
14076 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
14077 }
14078
14079 pub fn target(&self) -> Option<&crate::WireRef> {
14080 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
14081 }
14082
14083 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
14084 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
14085 }
14086
14087 pub fn dependency_type(&self) -> Option<&crate::WireDependencyType> {
14088 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
14089 }
14090
14091 pub fn availability(&self) -> Option<&crate::WireAvailability> {
14092 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
14093 }
14094
14095 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
14096 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
14097 }
14098}
14099
14100impl ::core::fmt::Debug for WireOfferProtocol {
14101 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
14102 f.debug_struct("OfferProtocol")
14103 .field("source", &self.source())
14104 .field("source_name", &self.source_name())
14105 .field("target", &self.target())
14106 .field("target_name", &self.target_name())
14107 .field("dependency_type", &self.dependency_type())
14108 .field("availability", &self.availability())
14109 .field("source_dictionary", &self.source_dictionary())
14110 .finish()
14111 }
14112}
14113
14114#[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"]
14115#[derive(Clone, Debug)]
14116pub struct OfferDirectory {
14117 pub source: Option<crate::Ref>,
14118
14119 pub source_name: Option<String>,
14120
14121 pub target: Option<crate::Ref>,
14122
14123 pub target_name: Option<String>,
14124
14125 pub rights: Option<::fidl_next_fuchsia_io::Operations>,
14126
14127 pub subdir: Option<String>,
14128
14129 pub dependency_type: Option<crate::DependencyType>,
14130
14131 pub availability: Option<crate::Availability>,
14132
14133 pub source_dictionary: Option<String>,
14134}
14135
14136impl OfferDirectory {
14137 fn __max_ordinal(&self) -> usize {
14138 if self.source.is_some() {
14139 return 1;
14140 }
14141
14142 if self.source_name.is_some() {
14143 return 2;
14144 }
14145
14146 if self.target.is_some() {
14147 return 3;
14148 }
14149
14150 if self.target_name.is_some() {
14151 return 4;
14152 }
14153
14154 if self.rights.is_some() {
14155 return 5;
14156 }
14157
14158 if self.subdir.is_some() {
14159 return 6;
14160 }
14161
14162 if self.dependency_type.is_some() {
14163 return 7;
14164 }
14165
14166 if self.availability.is_some() {
14167 return 8;
14168 }
14169
14170 if self.source_dictionary.is_some() {
14171 return 9;
14172 }
14173
14174 0
14175 }
14176}
14177
14178impl ::fidl_next::Encodable for OfferDirectory {
14179 type Encoded = WireOfferDirectory;
14180}
14181
14182unsafe impl<___E> ::fidl_next::Encode<___E> for OfferDirectory
14183where
14184 ___E: ::fidl_next::Encoder + ?Sized,
14185{
14186 #[inline]
14187 fn encode(
14188 &mut self,
14189 encoder: &mut ___E,
14190 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14191 ) -> Result<(), ::fidl_next::EncodeError> {
14192 ::fidl_next::munge!(let WireOfferDirectory { table } = out);
14193
14194 let max_ord = self.__max_ordinal();
14195
14196 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
14197 ::fidl_next::ZeroPadding::zero_padding(&mut out);
14198
14199 let mut preallocated =
14200 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
14201
14202 for i in 1..=max_ord {
14203 match i {
14204 9 => {
14205 if let Some(source_dictionary) = &mut self.source_dictionary {
14206 ::fidl_next::WireEnvelope::encode_value(
14207 source_dictionary,
14208 preallocated.encoder,
14209 &mut out,
14210 )?;
14211 } else {
14212 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14213 }
14214 }
14215
14216 8 => {
14217 if let Some(availability) = &mut self.availability {
14218 ::fidl_next::WireEnvelope::encode_value(
14219 availability,
14220 preallocated.encoder,
14221 &mut out,
14222 )?;
14223 } else {
14224 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14225 }
14226 }
14227
14228 7 => {
14229 if let Some(dependency_type) = &mut self.dependency_type {
14230 ::fidl_next::WireEnvelope::encode_value(
14231 dependency_type,
14232 preallocated.encoder,
14233 &mut out,
14234 )?;
14235 } else {
14236 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14237 }
14238 }
14239
14240 6 => {
14241 if let Some(subdir) = &mut self.subdir {
14242 ::fidl_next::WireEnvelope::encode_value(
14243 subdir,
14244 preallocated.encoder,
14245 &mut out,
14246 )?;
14247 } else {
14248 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14249 }
14250 }
14251
14252 5 => {
14253 if let Some(rights) = &mut self.rights {
14254 ::fidl_next::WireEnvelope::encode_value(
14255 rights,
14256 preallocated.encoder,
14257 &mut out,
14258 )?;
14259 } else {
14260 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14261 }
14262 }
14263
14264 4 => {
14265 if let Some(target_name) = &mut self.target_name {
14266 ::fidl_next::WireEnvelope::encode_value(
14267 target_name,
14268 preallocated.encoder,
14269 &mut out,
14270 )?;
14271 } else {
14272 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14273 }
14274 }
14275
14276 3 => {
14277 if let Some(target) = &mut self.target {
14278 ::fidl_next::WireEnvelope::encode_value(
14279 target,
14280 preallocated.encoder,
14281 &mut out,
14282 )?;
14283 } else {
14284 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14285 }
14286 }
14287
14288 2 => {
14289 if let Some(source_name) = &mut self.source_name {
14290 ::fidl_next::WireEnvelope::encode_value(
14291 source_name,
14292 preallocated.encoder,
14293 &mut out,
14294 )?;
14295 } else {
14296 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14297 }
14298 }
14299
14300 1 => {
14301 if let Some(source) = &mut self.source {
14302 ::fidl_next::WireEnvelope::encode_value(
14303 source,
14304 preallocated.encoder,
14305 &mut out,
14306 )?;
14307 } else {
14308 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14309 }
14310 }
14311
14312 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
14313 }
14314 unsafe {
14315 preallocated.write_next(out.assume_init_ref());
14316 }
14317 }
14318
14319 ::fidl_next::WireTable::encode_len(table, max_ord);
14320
14321 Ok(())
14322 }
14323}
14324
14325impl ::fidl_next::TakeFrom<WireOfferDirectory> for OfferDirectory {
14326 #[inline]
14327 fn take_from(from: &WireOfferDirectory) -> Self {
14328 Self {
14329 source: from.source().map(::fidl_next::TakeFrom::take_from),
14330
14331 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
14332
14333 target: from.target().map(::fidl_next::TakeFrom::take_from),
14334
14335 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
14336
14337 rights: from.rights().map(::fidl_next::TakeFrom::take_from),
14338
14339 subdir: from.subdir().map(::fidl_next::TakeFrom::take_from),
14340
14341 dependency_type: from.dependency_type().map(::fidl_next::TakeFrom::take_from),
14342
14343 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
14344
14345 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
14346 }
14347 }
14348}
14349
14350#[repr(C)]
14352pub struct WireOfferDirectory {
14353 table: ::fidl_next::WireTable,
14354}
14355
14356unsafe impl ::fidl_next::ZeroPadding for WireOfferDirectory {
14357 #[inline]
14358 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14359 ::fidl_next::munge!(let Self { table } = out);
14360 ::fidl_next::WireTable::zero_padding(table);
14361 }
14362}
14363
14364unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferDirectory
14365where
14366 ___D: ::fidl_next::Decoder + ?Sized,
14367{
14368 fn decode(
14369 slot: ::fidl_next::Slot<'_, Self>,
14370 decoder: &mut ___D,
14371 ) -> Result<(), ::fidl_next::DecodeError> {
14372 ::fidl_next::munge!(let Self { table } = slot);
14373
14374 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
14375 match ordinal {
14376 0 => unsafe { ::core::hint::unreachable_unchecked() },
14377
14378 1 => {
14379 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
14380 slot.as_mut(),
14381 decoder,
14382 )?;
14383
14384 Ok(())
14385 }
14386
14387 2 => {
14388 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
14389 slot.as_mut(),
14390 decoder,
14391 )?;
14392
14393 let source_name = unsafe {
14394 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
14395 };
14396
14397 if source_name.len() > 100 {
14398 return Err(::fidl_next::DecodeError::VectorTooLong {
14399 size: source_name.len() as u64,
14400 limit: 100,
14401 });
14402 }
14403
14404 Ok(())
14405 }
14406
14407 3 => {
14408 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
14409 slot.as_mut(),
14410 decoder,
14411 )?;
14412
14413 Ok(())
14414 }
14415
14416 4 => {
14417 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
14418 slot.as_mut(),
14419 decoder,
14420 )?;
14421
14422 let target_name = unsafe {
14423 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
14424 };
14425
14426 if target_name.len() > 100 {
14427 return Err(::fidl_next::DecodeError::VectorTooLong {
14428 size: target_name.len() as u64,
14429 limit: 100,
14430 });
14431 }
14432
14433 Ok(())
14434 }
14435
14436 5 => {
14437 ::fidl_next::WireEnvelope::decode_as::<
14438 ___D,
14439 ::fidl_next_fuchsia_io::WireOperations,
14440 >(slot.as_mut(), decoder)?;
14441
14442 Ok(())
14443 }
14444
14445 6 => {
14446 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
14447 slot.as_mut(),
14448 decoder,
14449 )?;
14450
14451 let subdir = unsafe {
14452 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
14453 };
14454
14455 if subdir.len() > 1024 {
14456 return Err(::fidl_next::DecodeError::VectorTooLong {
14457 size: subdir.len() as u64,
14458 limit: 1024,
14459 });
14460 }
14461
14462 Ok(())
14463 }
14464
14465 7 => {
14466 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
14467 slot.as_mut(),
14468 decoder,
14469 )?;
14470
14471 Ok(())
14472 }
14473
14474 8 => {
14475 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
14476 slot.as_mut(),
14477 decoder,
14478 )?;
14479
14480 Ok(())
14481 }
14482
14483 9 => {
14484 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
14485 slot.as_mut(),
14486 decoder,
14487 )?;
14488
14489 let source_dictionary = unsafe {
14490 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
14491 };
14492
14493 if source_dictionary.len() > 1024 {
14494 return Err(::fidl_next::DecodeError::VectorTooLong {
14495 size: source_dictionary.len() as u64,
14496 limit: 1024,
14497 });
14498 }
14499
14500 Ok(())
14501 }
14502
14503 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
14504 }
14505 })
14506 }
14507}
14508
14509impl WireOfferDirectory {
14510 pub fn source(&self) -> Option<&crate::WireRef> {
14511 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
14512 }
14513
14514 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
14515 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
14516 }
14517
14518 pub fn target(&self) -> Option<&crate::WireRef> {
14519 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
14520 }
14521
14522 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
14523 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
14524 }
14525
14526 pub fn rights(&self) -> Option<&::fidl_next_fuchsia_io::WireOperations> {
14527 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
14528 }
14529
14530 pub fn subdir(&self) -> Option<&::fidl_next::WireString> {
14531 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
14532 }
14533
14534 pub fn dependency_type(&self) -> Option<&crate::WireDependencyType> {
14535 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
14536 }
14537
14538 pub fn availability(&self) -> Option<&crate::WireAvailability> {
14539 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
14540 }
14541
14542 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
14543 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
14544 }
14545}
14546
14547impl ::core::fmt::Debug for WireOfferDirectory {
14548 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
14549 f.debug_struct("OfferDirectory")
14550 .field("source", &self.source())
14551 .field("source_name", &self.source_name())
14552 .field("target", &self.target())
14553 .field("target_name", &self.target_name())
14554 .field("rights", &self.rights())
14555 .field("subdir", &self.subdir())
14556 .field("dependency_type", &self.dependency_type())
14557 .field("availability", &self.availability())
14558 .field("source_dictionary", &self.source_dictionary())
14559 .finish()
14560 }
14561}
14562
14563#[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"]
14564#[derive(Clone, Debug)]
14565pub struct OfferStorage {
14566 pub source_name: Option<String>,
14567
14568 pub source: Option<crate::Ref>,
14569
14570 pub target: Option<crate::Ref>,
14571
14572 pub target_name: Option<String>,
14573
14574 pub availability: Option<crate::Availability>,
14575}
14576
14577impl OfferStorage {
14578 fn __max_ordinal(&self) -> usize {
14579 if self.source_name.is_some() {
14580 return 1;
14581 }
14582
14583 if self.source.is_some() {
14584 return 2;
14585 }
14586
14587 if self.target.is_some() {
14588 return 3;
14589 }
14590
14591 if self.target_name.is_some() {
14592 return 4;
14593 }
14594
14595 if self.availability.is_some() {
14596 return 5;
14597 }
14598
14599 0
14600 }
14601}
14602
14603impl ::fidl_next::Encodable for OfferStorage {
14604 type Encoded = WireOfferStorage;
14605}
14606
14607unsafe impl<___E> ::fidl_next::Encode<___E> for OfferStorage
14608where
14609 ___E: ::fidl_next::Encoder + ?Sized,
14610{
14611 #[inline]
14612 fn encode(
14613 &mut self,
14614 encoder: &mut ___E,
14615 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14616 ) -> Result<(), ::fidl_next::EncodeError> {
14617 ::fidl_next::munge!(let WireOfferStorage { table } = out);
14618
14619 let max_ord = self.__max_ordinal();
14620
14621 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
14622 ::fidl_next::ZeroPadding::zero_padding(&mut out);
14623
14624 let mut preallocated =
14625 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
14626
14627 for i in 1..=max_ord {
14628 match i {
14629 5 => {
14630 if let Some(availability) = &mut self.availability {
14631 ::fidl_next::WireEnvelope::encode_value(
14632 availability,
14633 preallocated.encoder,
14634 &mut out,
14635 )?;
14636 } else {
14637 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14638 }
14639 }
14640
14641 4 => {
14642 if let Some(target_name) = &mut self.target_name {
14643 ::fidl_next::WireEnvelope::encode_value(
14644 target_name,
14645 preallocated.encoder,
14646 &mut out,
14647 )?;
14648 } else {
14649 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14650 }
14651 }
14652
14653 3 => {
14654 if let Some(target) = &mut self.target {
14655 ::fidl_next::WireEnvelope::encode_value(
14656 target,
14657 preallocated.encoder,
14658 &mut out,
14659 )?;
14660 } else {
14661 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14662 }
14663 }
14664
14665 2 => {
14666 if let Some(source) = &mut self.source {
14667 ::fidl_next::WireEnvelope::encode_value(
14668 source,
14669 preallocated.encoder,
14670 &mut out,
14671 )?;
14672 } else {
14673 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14674 }
14675 }
14676
14677 1 => {
14678 if let Some(source_name) = &mut self.source_name {
14679 ::fidl_next::WireEnvelope::encode_value(
14680 source_name,
14681 preallocated.encoder,
14682 &mut out,
14683 )?;
14684 } else {
14685 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14686 }
14687 }
14688
14689 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
14690 }
14691 unsafe {
14692 preallocated.write_next(out.assume_init_ref());
14693 }
14694 }
14695
14696 ::fidl_next::WireTable::encode_len(table, max_ord);
14697
14698 Ok(())
14699 }
14700}
14701
14702impl ::fidl_next::TakeFrom<WireOfferStorage> for OfferStorage {
14703 #[inline]
14704 fn take_from(from: &WireOfferStorage) -> Self {
14705 Self {
14706 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
14707
14708 source: from.source().map(::fidl_next::TakeFrom::take_from),
14709
14710 target: from.target().map(::fidl_next::TakeFrom::take_from),
14711
14712 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
14713
14714 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
14715 }
14716 }
14717}
14718
14719#[repr(C)]
14721pub struct WireOfferStorage {
14722 table: ::fidl_next::WireTable,
14723}
14724
14725unsafe impl ::fidl_next::ZeroPadding for WireOfferStorage {
14726 #[inline]
14727 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
14728 ::fidl_next::munge!(let Self { table } = out);
14729 ::fidl_next::WireTable::zero_padding(table);
14730 }
14731}
14732
14733unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferStorage
14734where
14735 ___D: ::fidl_next::Decoder + ?Sized,
14736{
14737 fn decode(
14738 slot: ::fidl_next::Slot<'_, Self>,
14739 decoder: &mut ___D,
14740 ) -> Result<(), ::fidl_next::DecodeError> {
14741 ::fidl_next::munge!(let Self { table } = slot);
14742
14743 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
14744 match ordinal {
14745 0 => unsafe { ::core::hint::unreachable_unchecked() },
14746
14747 1 => {
14748 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
14749 slot.as_mut(),
14750 decoder,
14751 )?;
14752
14753 let source_name = unsafe {
14754 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
14755 };
14756
14757 if source_name.len() > 100 {
14758 return Err(::fidl_next::DecodeError::VectorTooLong {
14759 size: source_name.len() as u64,
14760 limit: 100,
14761 });
14762 }
14763
14764 Ok(())
14765 }
14766
14767 2 => {
14768 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
14769 slot.as_mut(),
14770 decoder,
14771 )?;
14772
14773 Ok(())
14774 }
14775
14776 3 => {
14777 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
14778 slot.as_mut(),
14779 decoder,
14780 )?;
14781
14782 Ok(())
14783 }
14784
14785 4 => {
14786 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
14787 slot.as_mut(),
14788 decoder,
14789 )?;
14790
14791 let target_name = unsafe {
14792 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
14793 };
14794
14795 if target_name.len() > 100 {
14796 return Err(::fidl_next::DecodeError::VectorTooLong {
14797 size: target_name.len() as u64,
14798 limit: 100,
14799 });
14800 }
14801
14802 Ok(())
14803 }
14804
14805 5 => {
14806 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
14807 slot.as_mut(),
14808 decoder,
14809 )?;
14810
14811 Ok(())
14812 }
14813
14814 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
14815 }
14816 })
14817 }
14818}
14819
14820impl WireOfferStorage {
14821 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
14822 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
14823 }
14824
14825 pub fn source(&self) -> Option<&crate::WireRef> {
14826 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
14827 }
14828
14829 pub fn target(&self) -> Option<&crate::WireRef> {
14830 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
14831 }
14832
14833 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
14834 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
14835 }
14836
14837 pub fn availability(&self) -> Option<&crate::WireAvailability> {
14838 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
14839 }
14840}
14841
14842impl ::core::fmt::Debug for WireOfferStorage {
14843 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
14844 f.debug_struct("OfferStorage")
14845 .field("source_name", &self.source_name())
14846 .field("source", &self.source())
14847 .field("target", &self.target())
14848 .field("target_name", &self.target_name())
14849 .field("availability", &self.availability())
14850 .finish()
14851 }
14852}
14853
14854#[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"]
14855#[derive(Clone, Debug)]
14856pub struct OfferRunner {
14857 pub source: Option<crate::Ref>,
14858
14859 pub source_name: Option<String>,
14860
14861 pub target: Option<crate::Ref>,
14862
14863 pub target_name: Option<String>,
14864
14865 pub source_dictionary: Option<String>,
14866}
14867
14868impl OfferRunner {
14869 fn __max_ordinal(&self) -> usize {
14870 if self.source.is_some() {
14871 return 1;
14872 }
14873
14874 if self.source_name.is_some() {
14875 return 2;
14876 }
14877
14878 if self.target.is_some() {
14879 return 3;
14880 }
14881
14882 if self.target_name.is_some() {
14883 return 4;
14884 }
14885
14886 if self.source_dictionary.is_some() {
14887 return 5;
14888 }
14889
14890 0
14891 }
14892}
14893
14894impl ::fidl_next::Encodable for OfferRunner {
14895 type Encoded = WireOfferRunner;
14896}
14897
14898unsafe impl<___E> ::fidl_next::Encode<___E> for OfferRunner
14899where
14900 ___E: ::fidl_next::Encoder + ?Sized,
14901{
14902 #[inline]
14903 fn encode(
14904 &mut self,
14905 encoder: &mut ___E,
14906 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
14907 ) -> Result<(), ::fidl_next::EncodeError> {
14908 ::fidl_next::munge!(let WireOfferRunner { table } = out);
14909
14910 let max_ord = self.__max_ordinal();
14911
14912 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
14913 ::fidl_next::ZeroPadding::zero_padding(&mut out);
14914
14915 let mut preallocated =
14916 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
14917
14918 for i in 1..=max_ord {
14919 match i {
14920 5 => {
14921 if let Some(source_dictionary) = &mut self.source_dictionary {
14922 ::fidl_next::WireEnvelope::encode_value(
14923 source_dictionary,
14924 preallocated.encoder,
14925 &mut out,
14926 )?;
14927 } else {
14928 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14929 }
14930 }
14931
14932 4 => {
14933 if let Some(target_name) = &mut self.target_name {
14934 ::fidl_next::WireEnvelope::encode_value(
14935 target_name,
14936 preallocated.encoder,
14937 &mut out,
14938 )?;
14939 } else {
14940 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14941 }
14942 }
14943
14944 3 => {
14945 if let Some(target) = &mut self.target {
14946 ::fidl_next::WireEnvelope::encode_value(
14947 target,
14948 preallocated.encoder,
14949 &mut out,
14950 )?;
14951 } else {
14952 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14953 }
14954 }
14955
14956 2 => {
14957 if let Some(source_name) = &mut self.source_name {
14958 ::fidl_next::WireEnvelope::encode_value(
14959 source_name,
14960 preallocated.encoder,
14961 &mut out,
14962 )?;
14963 } else {
14964 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14965 }
14966 }
14967
14968 1 => {
14969 if let Some(source) = &mut self.source {
14970 ::fidl_next::WireEnvelope::encode_value(
14971 source,
14972 preallocated.encoder,
14973 &mut out,
14974 )?;
14975 } else {
14976 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14977 }
14978 }
14979
14980 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
14981 }
14982 unsafe {
14983 preallocated.write_next(out.assume_init_ref());
14984 }
14985 }
14986
14987 ::fidl_next::WireTable::encode_len(table, max_ord);
14988
14989 Ok(())
14990 }
14991}
14992
14993impl ::fidl_next::TakeFrom<WireOfferRunner> for OfferRunner {
14994 #[inline]
14995 fn take_from(from: &WireOfferRunner) -> Self {
14996 Self {
14997 source: from.source().map(::fidl_next::TakeFrom::take_from),
14998
14999 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
15000
15001 target: from.target().map(::fidl_next::TakeFrom::take_from),
15002
15003 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
15004
15005 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
15006 }
15007 }
15008}
15009
15010#[repr(C)]
15012pub struct WireOfferRunner {
15013 table: ::fidl_next::WireTable,
15014}
15015
15016unsafe impl ::fidl_next::ZeroPadding for WireOfferRunner {
15017 #[inline]
15018 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
15019 ::fidl_next::munge!(let Self { table } = out);
15020 ::fidl_next::WireTable::zero_padding(table);
15021 }
15022}
15023
15024unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferRunner
15025where
15026 ___D: ::fidl_next::Decoder + ?Sized,
15027{
15028 fn decode(
15029 slot: ::fidl_next::Slot<'_, Self>,
15030 decoder: &mut ___D,
15031 ) -> Result<(), ::fidl_next::DecodeError> {
15032 ::fidl_next::munge!(let Self { table } = slot);
15033
15034 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
15035 match ordinal {
15036 0 => unsafe { ::core::hint::unreachable_unchecked() },
15037
15038 1 => {
15039 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
15040 slot.as_mut(),
15041 decoder,
15042 )?;
15043
15044 Ok(())
15045 }
15046
15047 2 => {
15048 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
15049 slot.as_mut(),
15050 decoder,
15051 )?;
15052
15053 let source_name = unsafe {
15054 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
15055 };
15056
15057 if source_name.len() > 100 {
15058 return Err(::fidl_next::DecodeError::VectorTooLong {
15059 size: source_name.len() as u64,
15060 limit: 100,
15061 });
15062 }
15063
15064 Ok(())
15065 }
15066
15067 3 => {
15068 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
15069 slot.as_mut(),
15070 decoder,
15071 )?;
15072
15073 Ok(())
15074 }
15075
15076 4 => {
15077 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
15078 slot.as_mut(),
15079 decoder,
15080 )?;
15081
15082 let target_name = unsafe {
15083 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
15084 };
15085
15086 if target_name.len() > 100 {
15087 return Err(::fidl_next::DecodeError::VectorTooLong {
15088 size: target_name.len() as u64,
15089 limit: 100,
15090 });
15091 }
15092
15093 Ok(())
15094 }
15095
15096 5 => {
15097 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
15098 slot.as_mut(),
15099 decoder,
15100 )?;
15101
15102 let source_dictionary = unsafe {
15103 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
15104 };
15105
15106 if source_dictionary.len() > 1024 {
15107 return Err(::fidl_next::DecodeError::VectorTooLong {
15108 size: source_dictionary.len() as u64,
15109 limit: 1024,
15110 });
15111 }
15112
15113 Ok(())
15114 }
15115
15116 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
15117 }
15118 })
15119 }
15120}
15121
15122impl WireOfferRunner {
15123 pub fn source(&self) -> Option<&crate::WireRef> {
15124 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
15125 }
15126
15127 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
15128 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
15129 }
15130
15131 pub fn target(&self) -> Option<&crate::WireRef> {
15132 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
15133 }
15134
15135 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
15136 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
15137 }
15138
15139 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
15140 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
15141 }
15142}
15143
15144impl ::core::fmt::Debug for WireOfferRunner {
15145 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
15146 f.debug_struct("OfferRunner")
15147 .field("source", &self.source())
15148 .field("source_name", &self.source_name())
15149 .field("target", &self.target())
15150 .field("target_name", &self.target_name())
15151 .field("source_dictionary", &self.source_dictionary())
15152 .finish()
15153 }
15154}
15155
15156#[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"]
15157#[derive(Clone, Debug)]
15158pub struct OfferResolver {
15159 pub source: Option<crate::Ref>,
15160
15161 pub source_name: Option<String>,
15162
15163 pub target: Option<crate::Ref>,
15164
15165 pub target_name: Option<String>,
15166
15167 pub source_dictionary: Option<String>,
15168}
15169
15170impl OfferResolver {
15171 fn __max_ordinal(&self) -> usize {
15172 if self.source.is_some() {
15173 return 1;
15174 }
15175
15176 if self.source_name.is_some() {
15177 return 2;
15178 }
15179
15180 if self.target.is_some() {
15181 return 3;
15182 }
15183
15184 if self.target_name.is_some() {
15185 return 4;
15186 }
15187
15188 if self.source_dictionary.is_some() {
15189 return 5;
15190 }
15191
15192 0
15193 }
15194}
15195
15196impl ::fidl_next::Encodable for OfferResolver {
15197 type Encoded = WireOfferResolver;
15198}
15199
15200unsafe impl<___E> ::fidl_next::Encode<___E> for OfferResolver
15201where
15202 ___E: ::fidl_next::Encoder + ?Sized,
15203{
15204 #[inline]
15205 fn encode(
15206 &mut self,
15207 encoder: &mut ___E,
15208 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15209 ) -> Result<(), ::fidl_next::EncodeError> {
15210 ::fidl_next::munge!(let WireOfferResolver { table } = out);
15211
15212 let max_ord = self.__max_ordinal();
15213
15214 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
15215 ::fidl_next::ZeroPadding::zero_padding(&mut out);
15216
15217 let mut preallocated =
15218 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
15219
15220 for i in 1..=max_ord {
15221 match i {
15222 5 => {
15223 if let Some(source_dictionary) = &mut self.source_dictionary {
15224 ::fidl_next::WireEnvelope::encode_value(
15225 source_dictionary,
15226 preallocated.encoder,
15227 &mut out,
15228 )?;
15229 } else {
15230 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15231 }
15232 }
15233
15234 4 => {
15235 if let Some(target_name) = &mut self.target_name {
15236 ::fidl_next::WireEnvelope::encode_value(
15237 target_name,
15238 preallocated.encoder,
15239 &mut out,
15240 )?;
15241 } else {
15242 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15243 }
15244 }
15245
15246 3 => {
15247 if let Some(target) = &mut self.target {
15248 ::fidl_next::WireEnvelope::encode_value(
15249 target,
15250 preallocated.encoder,
15251 &mut out,
15252 )?;
15253 } else {
15254 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15255 }
15256 }
15257
15258 2 => {
15259 if let Some(source_name) = &mut self.source_name {
15260 ::fidl_next::WireEnvelope::encode_value(
15261 source_name,
15262 preallocated.encoder,
15263 &mut out,
15264 )?;
15265 } else {
15266 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15267 }
15268 }
15269
15270 1 => {
15271 if let Some(source) = &mut self.source {
15272 ::fidl_next::WireEnvelope::encode_value(
15273 source,
15274 preallocated.encoder,
15275 &mut out,
15276 )?;
15277 } else {
15278 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15279 }
15280 }
15281
15282 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
15283 }
15284 unsafe {
15285 preallocated.write_next(out.assume_init_ref());
15286 }
15287 }
15288
15289 ::fidl_next::WireTable::encode_len(table, max_ord);
15290
15291 Ok(())
15292 }
15293}
15294
15295impl ::fidl_next::TakeFrom<WireOfferResolver> for OfferResolver {
15296 #[inline]
15297 fn take_from(from: &WireOfferResolver) -> Self {
15298 Self {
15299 source: from.source().map(::fidl_next::TakeFrom::take_from),
15300
15301 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
15302
15303 target: from.target().map(::fidl_next::TakeFrom::take_from),
15304
15305 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
15306
15307 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
15308 }
15309 }
15310}
15311
15312#[repr(C)]
15314pub struct WireOfferResolver {
15315 table: ::fidl_next::WireTable,
15316}
15317
15318unsafe impl ::fidl_next::ZeroPadding for WireOfferResolver {
15319 #[inline]
15320 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
15321 ::fidl_next::munge!(let Self { table } = out);
15322 ::fidl_next::WireTable::zero_padding(table);
15323 }
15324}
15325
15326unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferResolver
15327where
15328 ___D: ::fidl_next::Decoder + ?Sized,
15329{
15330 fn decode(
15331 slot: ::fidl_next::Slot<'_, Self>,
15332 decoder: &mut ___D,
15333 ) -> Result<(), ::fidl_next::DecodeError> {
15334 ::fidl_next::munge!(let Self { table } = slot);
15335
15336 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
15337 match ordinal {
15338 0 => unsafe { ::core::hint::unreachable_unchecked() },
15339
15340 1 => {
15341 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
15342 slot.as_mut(),
15343 decoder,
15344 )?;
15345
15346 Ok(())
15347 }
15348
15349 2 => {
15350 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
15351 slot.as_mut(),
15352 decoder,
15353 )?;
15354
15355 let source_name = unsafe {
15356 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
15357 };
15358
15359 if source_name.len() > 100 {
15360 return Err(::fidl_next::DecodeError::VectorTooLong {
15361 size: source_name.len() as u64,
15362 limit: 100,
15363 });
15364 }
15365
15366 Ok(())
15367 }
15368
15369 3 => {
15370 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
15371 slot.as_mut(),
15372 decoder,
15373 )?;
15374
15375 Ok(())
15376 }
15377
15378 4 => {
15379 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
15380 slot.as_mut(),
15381 decoder,
15382 )?;
15383
15384 let target_name = unsafe {
15385 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
15386 };
15387
15388 if target_name.len() > 100 {
15389 return Err(::fidl_next::DecodeError::VectorTooLong {
15390 size: target_name.len() as u64,
15391 limit: 100,
15392 });
15393 }
15394
15395 Ok(())
15396 }
15397
15398 5 => {
15399 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
15400 slot.as_mut(),
15401 decoder,
15402 )?;
15403
15404 let source_dictionary = unsafe {
15405 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
15406 };
15407
15408 if source_dictionary.len() > 1024 {
15409 return Err(::fidl_next::DecodeError::VectorTooLong {
15410 size: source_dictionary.len() as u64,
15411 limit: 1024,
15412 });
15413 }
15414
15415 Ok(())
15416 }
15417
15418 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
15419 }
15420 })
15421 }
15422}
15423
15424impl WireOfferResolver {
15425 pub fn source(&self) -> Option<&crate::WireRef> {
15426 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
15427 }
15428
15429 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
15430 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
15431 }
15432
15433 pub fn target(&self) -> Option<&crate::WireRef> {
15434 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
15435 }
15436
15437 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
15438 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
15439 }
15440
15441 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
15442 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
15443 }
15444}
15445
15446impl ::core::fmt::Debug for WireOfferResolver {
15447 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
15448 f.debug_struct("OfferResolver")
15449 .field("source", &self.source())
15450 .field("source_name", &self.source_name())
15451 .field("target", &self.target())
15452 .field("target_name", &self.target_name())
15453 .field("source_dictionary", &self.source_dictionary())
15454 .finish()
15455 }
15456}
15457
15458#[doc = " Declares an event stream offered by a component.\n"]
15459#[derive(Clone, Debug)]
15460pub struct OfferEventStream {
15461 pub source: Option<crate::Ref>,
15462
15463 pub source_name: Option<String>,
15464
15465 pub scope: Option<Vec<crate::Ref>>,
15466
15467 pub target: Option<crate::Ref>,
15468
15469 pub target_name: Option<String>,
15470
15471 pub availability: Option<crate::Availability>,
15472}
15473
15474impl OfferEventStream {
15475 fn __max_ordinal(&self) -> usize {
15476 if self.source.is_some() {
15477 return 1;
15478 }
15479
15480 if self.source_name.is_some() {
15481 return 2;
15482 }
15483
15484 if self.scope.is_some() {
15485 return 3;
15486 }
15487
15488 if self.target.is_some() {
15489 return 4;
15490 }
15491
15492 if self.target_name.is_some() {
15493 return 5;
15494 }
15495
15496 if self.availability.is_some() {
15497 return 7;
15498 }
15499
15500 0
15501 }
15502}
15503
15504impl ::fidl_next::Encodable for OfferEventStream {
15505 type Encoded = WireOfferEventStream;
15506}
15507
15508unsafe impl<___E> ::fidl_next::Encode<___E> for OfferEventStream
15509where
15510 ___E: ::fidl_next::Encoder + ?Sized,
15511{
15512 #[inline]
15513 fn encode(
15514 &mut self,
15515 encoder: &mut ___E,
15516 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15517 ) -> Result<(), ::fidl_next::EncodeError> {
15518 ::fidl_next::munge!(let WireOfferEventStream { table } = out);
15519
15520 let max_ord = self.__max_ordinal();
15521
15522 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
15523 ::fidl_next::ZeroPadding::zero_padding(&mut out);
15524
15525 let mut preallocated =
15526 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
15527
15528 for i in 1..=max_ord {
15529 match i {
15530 7 => {
15531 if let Some(availability) = &mut self.availability {
15532 ::fidl_next::WireEnvelope::encode_value(
15533 availability,
15534 preallocated.encoder,
15535 &mut out,
15536 )?;
15537 } else {
15538 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15539 }
15540 }
15541
15542 5 => {
15543 if let Some(target_name) = &mut self.target_name {
15544 ::fidl_next::WireEnvelope::encode_value(
15545 target_name,
15546 preallocated.encoder,
15547 &mut out,
15548 )?;
15549 } else {
15550 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15551 }
15552 }
15553
15554 4 => {
15555 if let Some(target) = &mut self.target {
15556 ::fidl_next::WireEnvelope::encode_value(
15557 target,
15558 preallocated.encoder,
15559 &mut out,
15560 )?;
15561 } else {
15562 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15563 }
15564 }
15565
15566 3 => {
15567 if let Some(scope) = &mut self.scope {
15568 ::fidl_next::WireEnvelope::encode_value(
15569 scope,
15570 preallocated.encoder,
15571 &mut out,
15572 )?;
15573 } else {
15574 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15575 }
15576 }
15577
15578 2 => {
15579 if let Some(source_name) = &mut self.source_name {
15580 ::fidl_next::WireEnvelope::encode_value(
15581 source_name,
15582 preallocated.encoder,
15583 &mut out,
15584 )?;
15585 } else {
15586 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15587 }
15588 }
15589
15590 1 => {
15591 if let Some(source) = &mut self.source {
15592 ::fidl_next::WireEnvelope::encode_value(
15593 source,
15594 preallocated.encoder,
15595 &mut out,
15596 )?;
15597 } else {
15598 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15599 }
15600 }
15601
15602 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
15603 }
15604 unsafe {
15605 preallocated.write_next(out.assume_init_ref());
15606 }
15607 }
15608
15609 ::fidl_next::WireTable::encode_len(table, max_ord);
15610
15611 Ok(())
15612 }
15613}
15614
15615impl ::fidl_next::TakeFrom<WireOfferEventStream> for OfferEventStream {
15616 #[inline]
15617 fn take_from(from: &WireOfferEventStream) -> Self {
15618 Self {
15619 source: from.source().map(::fidl_next::TakeFrom::take_from),
15620
15621 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
15622
15623 scope: from.scope().map(::fidl_next::TakeFrom::take_from),
15624
15625 target: from.target().map(::fidl_next::TakeFrom::take_from),
15626
15627 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
15628
15629 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
15630 }
15631 }
15632}
15633
15634#[repr(C)]
15636pub struct WireOfferEventStream {
15637 table: ::fidl_next::WireTable,
15638}
15639
15640unsafe impl ::fidl_next::ZeroPadding for WireOfferEventStream {
15641 #[inline]
15642 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
15643 ::fidl_next::munge!(let Self { table } = out);
15644 ::fidl_next::WireTable::zero_padding(table);
15645 }
15646}
15647
15648unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferEventStream
15649where
15650 ___D: ::fidl_next::Decoder + ?Sized,
15651{
15652 fn decode(
15653 slot: ::fidl_next::Slot<'_, Self>,
15654 decoder: &mut ___D,
15655 ) -> Result<(), ::fidl_next::DecodeError> {
15656 ::fidl_next::munge!(let Self { table } = slot);
15657
15658 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
15659 match ordinal {
15660 0 => unsafe { ::core::hint::unreachable_unchecked() },
15661
15662 1 => {
15663 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
15664 slot.as_mut(),
15665 decoder,
15666 )?;
15667
15668 Ok(())
15669 }
15670
15671 2 => {
15672 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
15673 slot.as_mut(),
15674 decoder,
15675 )?;
15676
15677 let source_name = unsafe {
15678 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
15679 };
15680
15681 if source_name.len() > 100 {
15682 return Err(::fidl_next::DecodeError::VectorTooLong {
15683 size: source_name.len() as u64,
15684 limit: 100,
15685 });
15686 }
15687
15688 Ok(())
15689 }
15690
15691 3 => {
15692 ::fidl_next::WireEnvelope::decode_as::<
15693 ___D,
15694 ::fidl_next::WireVector<crate::WireRef>,
15695 >(slot.as_mut(), decoder)?;
15696
15697 Ok(())
15698 }
15699
15700 4 => {
15701 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
15702 slot.as_mut(),
15703 decoder,
15704 )?;
15705
15706 Ok(())
15707 }
15708
15709 5 => {
15710 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
15711 slot.as_mut(),
15712 decoder,
15713 )?;
15714
15715 let target_name = unsafe {
15716 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
15717 };
15718
15719 if target_name.len() > 100 {
15720 return Err(::fidl_next::DecodeError::VectorTooLong {
15721 size: target_name.len() as u64,
15722 limit: 100,
15723 });
15724 }
15725
15726 Ok(())
15727 }
15728
15729 7 => {
15730 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
15731 slot.as_mut(),
15732 decoder,
15733 )?;
15734
15735 Ok(())
15736 }
15737
15738 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
15739 }
15740 })
15741 }
15742}
15743
15744impl WireOfferEventStream {
15745 pub fn source(&self) -> Option<&crate::WireRef> {
15746 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
15747 }
15748
15749 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
15750 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
15751 }
15752
15753 pub fn scope(&self) -> Option<&::fidl_next::WireVector<crate::WireRef>> {
15754 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
15755 }
15756
15757 pub fn target(&self) -> Option<&crate::WireRef> {
15758 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
15759 }
15760
15761 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
15762 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
15763 }
15764
15765 pub fn availability(&self) -> Option<&crate::WireAvailability> {
15766 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
15767 }
15768}
15769
15770impl ::core::fmt::Debug for WireOfferEventStream {
15771 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
15772 f.debug_struct("OfferEventStream")
15773 .field("source", &self.source())
15774 .field("source_name", &self.source_name())
15775 .field("scope", &self.scope())
15776 .field("target", &self.target())
15777 .field("target_name", &self.target_name())
15778 .field("availability", &self.availability())
15779 .finish()
15780 }
15781}
15782
15783#[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"]
15784#[derive(Clone, Debug)]
15785pub struct OfferDictionary {
15786 pub source: Option<crate::Ref>,
15787
15788 pub source_name: Option<String>,
15789
15790 pub target: Option<crate::Ref>,
15791
15792 pub target_name: Option<String>,
15793
15794 pub dependency_type: Option<crate::DependencyType>,
15795
15796 pub availability: Option<crate::Availability>,
15797
15798 pub source_dictionary: Option<String>,
15799}
15800
15801impl OfferDictionary {
15802 fn __max_ordinal(&self) -> usize {
15803 if self.source.is_some() {
15804 return 1;
15805 }
15806
15807 if self.source_name.is_some() {
15808 return 2;
15809 }
15810
15811 if self.target.is_some() {
15812 return 3;
15813 }
15814
15815 if self.target_name.is_some() {
15816 return 4;
15817 }
15818
15819 if self.dependency_type.is_some() {
15820 return 5;
15821 }
15822
15823 if self.availability.is_some() {
15824 return 6;
15825 }
15826
15827 if self.source_dictionary.is_some() {
15828 return 7;
15829 }
15830
15831 0
15832 }
15833}
15834
15835impl ::fidl_next::Encodable for OfferDictionary {
15836 type Encoded = WireOfferDictionary;
15837}
15838
15839unsafe impl<___E> ::fidl_next::Encode<___E> for OfferDictionary
15840where
15841 ___E: ::fidl_next::Encoder + ?Sized,
15842{
15843 #[inline]
15844 fn encode(
15845 &mut self,
15846 encoder: &mut ___E,
15847 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
15848 ) -> Result<(), ::fidl_next::EncodeError> {
15849 ::fidl_next::munge!(let WireOfferDictionary { table } = out);
15850
15851 let max_ord = self.__max_ordinal();
15852
15853 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
15854 ::fidl_next::ZeroPadding::zero_padding(&mut out);
15855
15856 let mut preallocated =
15857 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
15858
15859 for i in 1..=max_ord {
15860 match i {
15861 7 => {
15862 if let Some(source_dictionary) = &mut self.source_dictionary {
15863 ::fidl_next::WireEnvelope::encode_value(
15864 source_dictionary,
15865 preallocated.encoder,
15866 &mut out,
15867 )?;
15868 } else {
15869 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15870 }
15871 }
15872
15873 6 => {
15874 if let Some(availability) = &mut self.availability {
15875 ::fidl_next::WireEnvelope::encode_value(
15876 availability,
15877 preallocated.encoder,
15878 &mut out,
15879 )?;
15880 } else {
15881 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15882 }
15883 }
15884
15885 5 => {
15886 if let Some(dependency_type) = &mut self.dependency_type {
15887 ::fidl_next::WireEnvelope::encode_value(
15888 dependency_type,
15889 preallocated.encoder,
15890 &mut out,
15891 )?;
15892 } else {
15893 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15894 }
15895 }
15896
15897 4 => {
15898 if let Some(target_name) = &mut self.target_name {
15899 ::fidl_next::WireEnvelope::encode_value(
15900 target_name,
15901 preallocated.encoder,
15902 &mut out,
15903 )?;
15904 } else {
15905 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15906 }
15907 }
15908
15909 3 => {
15910 if let Some(target) = &mut self.target {
15911 ::fidl_next::WireEnvelope::encode_value(
15912 target,
15913 preallocated.encoder,
15914 &mut out,
15915 )?;
15916 } else {
15917 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15918 }
15919 }
15920
15921 2 => {
15922 if let Some(source_name) = &mut self.source_name {
15923 ::fidl_next::WireEnvelope::encode_value(
15924 source_name,
15925 preallocated.encoder,
15926 &mut out,
15927 )?;
15928 } else {
15929 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15930 }
15931 }
15932
15933 1 => {
15934 if let Some(source) = &mut self.source {
15935 ::fidl_next::WireEnvelope::encode_value(
15936 source,
15937 preallocated.encoder,
15938 &mut out,
15939 )?;
15940 } else {
15941 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15942 }
15943 }
15944
15945 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
15946 }
15947 unsafe {
15948 preallocated.write_next(out.assume_init_ref());
15949 }
15950 }
15951
15952 ::fidl_next::WireTable::encode_len(table, max_ord);
15953
15954 Ok(())
15955 }
15956}
15957
15958impl ::fidl_next::TakeFrom<WireOfferDictionary> for OfferDictionary {
15959 #[inline]
15960 fn take_from(from: &WireOfferDictionary) -> Self {
15961 Self {
15962 source: from.source().map(::fidl_next::TakeFrom::take_from),
15963
15964 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
15965
15966 target: from.target().map(::fidl_next::TakeFrom::take_from),
15967
15968 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
15969
15970 dependency_type: from.dependency_type().map(::fidl_next::TakeFrom::take_from),
15971
15972 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
15973
15974 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
15975 }
15976 }
15977}
15978
15979#[repr(C)]
15981pub struct WireOfferDictionary {
15982 table: ::fidl_next::WireTable,
15983}
15984
15985unsafe impl ::fidl_next::ZeroPadding for WireOfferDictionary {
15986 #[inline]
15987 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
15988 ::fidl_next::munge!(let Self { table } = out);
15989 ::fidl_next::WireTable::zero_padding(table);
15990 }
15991}
15992
15993unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferDictionary
15994where
15995 ___D: ::fidl_next::Decoder + ?Sized,
15996{
15997 fn decode(
15998 slot: ::fidl_next::Slot<'_, Self>,
15999 decoder: &mut ___D,
16000 ) -> Result<(), ::fidl_next::DecodeError> {
16001 ::fidl_next::munge!(let Self { table } = slot);
16002
16003 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
16004 match ordinal {
16005 0 => unsafe { ::core::hint::unreachable_unchecked() },
16006
16007 1 => {
16008 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
16009 slot.as_mut(),
16010 decoder,
16011 )?;
16012
16013 Ok(())
16014 }
16015
16016 2 => {
16017 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
16018 slot.as_mut(),
16019 decoder,
16020 )?;
16021
16022 let source_name = unsafe {
16023 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
16024 };
16025
16026 if source_name.len() > 100 {
16027 return Err(::fidl_next::DecodeError::VectorTooLong {
16028 size: source_name.len() as u64,
16029 limit: 100,
16030 });
16031 }
16032
16033 Ok(())
16034 }
16035
16036 3 => {
16037 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
16038 slot.as_mut(),
16039 decoder,
16040 )?;
16041
16042 Ok(())
16043 }
16044
16045 4 => {
16046 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
16047 slot.as_mut(),
16048 decoder,
16049 )?;
16050
16051 let target_name = unsafe {
16052 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
16053 };
16054
16055 if target_name.len() > 100 {
16056 return Err(::fidl_next::DecodeError::VectorTooLong {
16057 size: target_name.len() as u64,
16058 limit: 100,
16059 });
16060 }
16061
16062 Ok(())
16063 }
16064
16065 5 => {
16066 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireDependencyType>(
16067 slot.as_mut(),
16068 decoder,
16069 )?;
16070
16071 Ok(())
16072 }
16073
16074 6 => {
16075 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
16076 slot.as_mut(),
16077 decoder,
16078 )?;
16079
16080 Ok(())
16081 }
16082
16083 7 => {
16084 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
16085 slot.as_mut(),
16086 decoder,
16087 )?;
16088
16089 let source_dictionary = unsafe {
16090 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
16091 };
16092
16093 if source_dictionary.len() > 1024 {
16094 return Err(::fidl_next::DecodeError::VectorTooLong {
16095 size: source_dictionary.len() as u64,
16096 limit: 1024,
16097 });
16098 }
16099
16100 Ok(())
16101 }
16102
16103 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
16104 }
16105 })
16106 }
16107}
16108
16109impl WireOfferDictionary {
16110 pub fn source(&self) -> Option<&crate::WireRef> {
16111 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
16112 }
16113
16114 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
16115 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
16116 }
16117
16118 pub fn target(&self) -> Option<&crate::WireRef> {
16119 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
16120 }
16121
16122 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
16123 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
16124 }
16125
16126 pub fn dependency_type(&self) -> Option<&crate::WireDependencyType> {
16127 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
16128 }
16129
16130 pub fn availability(&self) -> Option<&crate::WireAvailability> {
16131 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
16132 }
16133
16134 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
16135 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
16136 }
16137}
16138
16139impl ::core::fmt::Debug for WireOfferDictionary {
16140 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
16141 f.debug_struct("OfferDictionary")
16142 .field("source", &self.source())
16143 .field("source_name", &self.source_name())
16144 .field("target", &self.target())
16145 .field("target_name", &self.target_name())
16146 .field("dependency_type", &self.dependency_type())
16147 .field("availability", &self.availability())
16148 .field("source_dictionary", &self.source_dictionary())
16149 .finish()
16150 }
16151}
16152
16153#[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"]
16154#[derive(Clone, Debug)]
16155pub struct OfferConfiguration {
16156 pub source: Option<crate::Ref>,
16157
16158 pub source_name: Option<String>,
16159
16160 pub target: Option<crate::Ref>,
16161
16162 pub target_name: Option<String>,
16163
16164 pub availability: Option<crate::Availability>,
16165
16166 pub source_dictionary: Option<String>,
16167}
16168
16169impl OfferConfiguration {
16170 fn __max_ordinal(&self) -> usize {
16171 if self.source.is_some() {
16172 return 1;
16173 }
16174
16175 if self.source_name.is_some() {
16176 return 2;
16177 }
16178
16179 if self.target.is_some() {
16180 return 3;
16181 }
16182
16183 if self.target_name.is_some() {
16184 return 4;
16185 }
16186
16187 if self.availability.is_some() {
16188 return 5;
16189 }
16190
16191 if self.source_dictionary.is_some() {
16192 return 6;
16193 }
16194
16195 0
16196 }
16197}
16198
16199impl ::fidl_next::Encodable for OfferConfiguration {
16200 type Encoded = WireOfferConfiguration;
16201}
16202
16203unsafe impl<___E> ::fidl_next::Encode<___E> for OfferConfiguration
16204where
16205 ___E: ::fidl_next::Encoder + ?Sized,
16206{
16207 #[inline]
16208 fn encode(
16209 &mut self,
16210 encoder: &mut ___E,
16211 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16212 ) -> Result<(), ::fidl_next::EncodeError> {
16213 ::fidl_next::munge!(let WireOfferConfiguration { table } = out);
16214
16215 let max_ord = self.__max_ordinal();
16216
16217 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
16218 ::fidl_next::ZeroPadding::zero_padding(&mut out);
16219
16220 let mut preallocated =
16221 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
16222
16223 for i in 1..=max_ord {
16224 match i {
16225 6 => {
16226 if let Some(source_dictionary) = &mut self.source_dictionary {
16227 ::fidl_next::WireEnvelope::encode_value(
16228 source_dictionary,
16229 preallocated.encoder,
16230 &mut out,
16231 )?;
16232 } else {
16233 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16234 }
16235 }
16236
16237 5 => {
16238 if let Some(availability) = &mut self.availability {
16239 ::fidl_next::WireEnvelope::encode_value(
16240 availability,
16241 preallocated.encoder,
16242 &mut out,
16243 )?;
16244 } else {
16245 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16246 }
16247 }
16248
16249 4 => {
16250 if let Some(target_name) = &mut self.target_name {
16251 ::fidl_next::WireEnvelope::encode_value(
16252 target_name,
16253 preallocated.encoder,
16254 &mut out,
16255 )?;
16256 } else {
16257 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16258 }
16259 }
16260
16261 3 => {
16262 if let Some(target) = &mut self.target {
16263 ::fidl_next::WireEnvelope::encode_value(
16264 target,
16265 preallocated.encoder,
16266 &mut out,
16267 )?;
16268 } else {
16269 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16270 }
16271 }
16272
16273 2 => {
16274 if let Some(source_name) = &mut self.source_name {
16275 ::fidl_next::WireEnvelope::encode_value(
16276 source_name,
16277 preallocated.encoder,
16278 &mut out,
16279 )?;
16280 } else {
16281 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16282 }
16283 }
16284
16285 1 => {
16286 if let Some(source) = &mut self.source {
16287 ::fidl_next::WireEnvelope::encode_value(
16288 source,
16289 preallocated.encoder,
16290 &mut out,
16291 )?;
16292 } else {
16293 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16294 }
16295 }
16296
16297 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
16298 }
16299 unsafe {
16300 preallocated.write_next(out.assume_init_ref());
16301 }
16302 }
16303
16304 ::fidl_next::WireTable::encode_len(table, max_ord);
16305
16306 Ok(())
16307 }
16308}
16309
16310impl ::fidl_next::TakeFrom<WireOfferConfiguration> for OfferConfiguration {
16311 #[inline]
16312 fn take_from(from: &WireOfferConfiguration) -> Self {
16313 Self {
16314 source: from.source().map(::fidl_next::TakeFrom::take_from),
16315
16316 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
16317
16318 target: from.target().map(::fidl_next::TakeFrom::take_from),
16319
16320 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
16321
16322 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
16323
16324 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
16325 }
16326 }
16327}
16328
16329#[repr(C)]
16331pub struct WireOfferConfiguration {
16332 table: ::fidl_next::WireTable,
16333}
16334
16335unsafe impl ::fidl_next::ZeroPadding for WireOfferConfiguration {
16336 #[inline]
16337 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
16338 ::fidl_next::munge!(let Self { table } = out);
16339 ::fidl_next::WireTable::zero_padding(table);
16340 }
16341}
16342
16343unsafe impl<___D> ::fidl_next::Decode<___D> for WireOfferConfiguration
16344where
16345 ___D: ::fidl_next::Decoder + ?Sized,
16346{
16347 fn decode(
16348 slot: ::fidl_next::Slot<'_, Self>,
16349 decoder: &mut ___D,
16350 ) -> Result<(), ::fidl_next::DecodeError> {
16351 ::fidl_next::munge!(let Self { table } = slot);
16352
16353 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
16354 match ordinal {
16355 0 => unsafe { ::core::hint::unreachable_unchecked() },
16356
16357 1 => {
16358 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
16359 slot.as_mut(),
16360 decoder,
16361 )?;
16362
16363 Ok(())
16364 }
16365
16366 2 => {
16367 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
16368 slot.as_mut(),
16369 decoder,
16370 )?;
16371
16372 let source_name = unsafe {
16373 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
16374 };
16375
16376 if source_name.len() > 100 {
16377 return Err(::fidl_next::DecodeError::VectorTooLong {
16378 size: source_name.len() as u64,
16379 limit: 100,
16380 });
16381 }
16382
16383 Ok(())
16384 }
16385
16386 3 => {
16387 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
16388 slot.as_mut(),
16389 decoder,
16390 )?;
16391
16392 Ok(())
16393 }
16394
16395 4 => {
16396 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
16397 slot.as_mut(),
16398 decoder,
16399 )?;
16400
16401 let target_name = unsafe {
16402 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
16403 };
16404
16405 if target_name.len() > 100 {
16406 return Err(::fidl_next::DecodeError::VectorTooLong {
16407 size: target_name.len() as u64,
16408 limit: 100,
16409 });
16410 }
16411
16412 Ok(())
16413 }
16414
16415 5 => {
16416 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireAvailability>(
16417 slot.as_mut(),
16418 decoder,
16419 )?;
16420
16421 Ok(())
16422 }
16423
16424 6 => {
16425 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
16426 slot.as_mut(),
16427 decoder,
16428 )?;
16429
16430 let source_dictionary = unsafe {
16431 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
16432 };
16433
16434 if source_dictionary.len() > 1024 {
16435 return Err(::fidl_next::DecodeError::VectorTooLong {
16436 size: source_dictionary.len() as u64,
16437 limit: 1024,
16438 });
16439 }
16440
16441 Ok(())
16442 }
16443
16444 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
16445 }
16446 })
16447 }
16448}
16449
16450impl WireOfferConfiguration {
16451 pub fn source(&self) -> Option<&crate::WireRef> {
16452 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
16453 }
16454
16455 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
16456 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
16457 }
16458
16459 pub fn target(&self) -> Option<&crate::WireRef> {
16460 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
16461 }
16462
16463 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
16464 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
16465 }
16466
16467 pub fn availability(&self) -> Option<&crate::WireAvailability> {
16468 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
16469 }
16470
16471 pub fn source_dictionary(&self) -> Option<&::fidl_next::WireString> {
16472 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
16473 }
16474}
16475
16476impl ::core::fmt::Debug for WireOfferConfiguration {
16477 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
16478 f.debug_struct("OfferConfiguration")
16479 .field("source", &self.source())
16480 .field("source_name", &self.source_name())
16481 .field("target", &self.target())
16482 .field("target_name", &self.target_name())
16483 .field("availability", &self.availability())
16484 .field("source_dictionary", &self.source_dictionary())
16485 .finish()
16486 }
16487}
16488
16489#[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"]
16490#[derive(Clone, Debug)]
16491pub enum Offer {
16492 Service(crate::OfferService),
16493
16494 Protocol(crate::OfferProtocol),
16495
16496 Directory(crate::OfferDirectory),
16497
16498 Storage(crate::OfferStorage),
16499
16500 Runner(crate::OfferRunner),
16501
16502 Resolver(crate::OfferResolver),
16503
16504 EventStream(crate::OfferEventStream),
16505
16506 Dictionary(crate::OfferDictionary),
16507
16508 Config(crate::OfferConfiguration),
16509
16510 UnknownOrdinal_(u64),
16511}
16512
16513impl ::fidl_next::Encodable for Offer {
16514 type Encoded = WireOffer;
16515}
16516
16517unsafe impl<___E> ::fidl_next::Encode<___E> for Offer
16518where
16519 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16520
16521 ___E: ::fidl_next::Encoder,
16522{
16523 #[inline]
16524 fn encode(
16525 &mut self,
16526 encoder: &mut ___E,
16527 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16528 ) -> Result<(), ::fidl_next::EncodeError> {
16529 ::fidl_next::munge!(let WireOffer { raw } = out);
16530
16531 match self {
16532 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
16533 ___E,
16534 crate::OfferService,
16535 >(value, 1, encoder, raw)?,
16536
16537 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
16538 ___E,
16539 crate::OfferProtocol,
16540 >(value, 2, encoder, raw)?,
16541
16542 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
16543 ___E,
16544 crate::OfferDirectory,
16545 >(value, 3, encoder, raw)?,
16546
16547 Self::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<
16548 ___E,
16549 crate::OfferStorage,
16550 >(value, 4, encoder, raw)?,
16551
16552 Self::Runner(value) => {
16553 ::fidl_next::RawWireUnion::encode_as::<___E, crate::OfferRunner>(
16554 value, 5, encoder, raw,
16555 )?
16556 }
16557
16558 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
16559 ___E,
16560 crate::OfferResolver,
16561 >(value, 6, encoder, raw)?,
16562
16563 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
16564 ___E,
16565 crate::OfferEventStream,
16566 >(value, 8, encoder, raw)?,
16567
16568 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
16569 ___E,
16570 crate::OfferDictionary,
16571 >(value, 9, encoder, raw)?,
16572
16573 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
16574 ___E,
16575 crate::OfferConfiguration,
16576 >(value, 10, encoder, raw)?,
16577
16578 Self::UnknownOrdinal_(ordinal) => {
16579 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
16580 }
16581 }
16582
16583 Ok(())
16584 }
16585}
16586
16587impl ::fidl_next::EncodableOption for Box<Offer> {
16588 type EncodedOption = WireOptionalOffer;
16589}
16590
16591unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<Offer>
16592where
16593 ___E: ?Sized,
16594 Offer: ::fidl_next::Encode<___E>,
16595{
16596 #[inline]
16597 fn encode_option(
16598 this: Option<&mut Self>,
16599 encoder: &mut ___E,
16600 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
16601 ) -> Result<(), ::fidl_next::EncodeError> {
16602 ::fidl_next::munge!(let WireOptionalOffer { raw } = &mut *out);
16603
16604 if let Some(inner) = this {
16605 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
16606 ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
16607 } else {
16608 ::fidl_next::RawWireUnion::encode_absent(raw);
16609 }
16610
16611 Ok(())
16612 }
16613}
16614
16615impl ::fidl_next::TakeFrom<WireOffer> for Offer {
16616 #[inline]
16617 fn take_from(from: &WireOffer) -> Self {
16618 match from.raw.ordinal() {
16619 1 => Self::Service(::fidl_next::TakeFrom::take_from(unsafe {
16620 from.raw.get().deref_unchecked::<crate::WireOfferService>()
16621 })),
16622
16623 2 => Self::Protocol(::fidl_next::TakeFrom::take_from(unsafe {
16624 from.raw.get().deref_unchecked::<crate::WireOfferProtocol>()
16625 })),
16626
16627 3 => Self::Directory(::fidl_next::TakeFrom::take_from(unsafe {
16628 from.raw.get().deref_unchecked::<crate::WireOfferDirectory>()
16629 })),
16630
16631 4 => Self::Storage(::fidl_next::TakeFrom::take_from(unsafe {
16632 from.raw.get().deref_unchecked::<crate::WireOfferStorage>()
16633 })),
16634
16635 5 => Self::Runner(::fidl_next::TakeFrom::take_from(unsafe {
16636 from.raw.get().deref_unchecked::<crate::WireOfferRunner>()
16637 })),
16638
16639 6 => Self::Resolver(::fidl_next::TakeFrom::take_from(unsafe {
16640 from.raw.get().deref_unchecked::<crate::WireOfferResolver>()
16641 })),
16642
16643 8 => Self::EventStream(::fidl_next::TakeFrom::take_from(unsafe {
16644 from.raw.get().deref_unchecked::<crate::WireOfferEventStream>()
16645 })),
16646
16647 9 => Self::Dictionary(::fidl_next::TakeFrom::take_from(unsafe {
16648 from.raw.get().deref_unchecked::<crate::WireOfferDictionary>()
16649 })),
16650
16651 10 => Self::Config(::fidl_next::TakeFrom::take_from(unsafe {
16652 from.raw.get().deref_unchecked::<crate::WireOfferConfiguration>()
16653 })),
16654
16655 _ => unsafe { ::core::hint::unreachable_unchecked() },
16656 }
16657 }
16658}
16659
16660impl ::fidl_next::TakeFrom<WireOptionalOffer> for Option<Box<Offer>> {
16661 #[inline]
16662 fn take_from(from: &WireOptionalOffer) -> Self {
16663 if let Some(inner) = from.as_ref() {
16664 Some(::fidl_next::TakeFrom::take_from(inner))
16665 } else {
16666 None
16667 }
16668 }
16669}
16670
16671#[repr(transparent)]
16673pub struct WireOffer {
16674 raw: ::fidl_next::RawWireUnion,
16675}
16676
16677unsafe impl ::fidl_next::ZeroPadding for WireOffer {
16678 #[inline]
16679 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
16680 ::fidl_next::munge!(let Self { raw } = out);
16681 ::fidl_next::RawWireUnion::zero_padding(raw);
16682 }
16683}
16684
16685pub mod offer {
16686 pub enum Ref<'union> {
16687 Service(&'union crate::WireOfferService),
16688
16689 Protocol(&'union crate::WireOfferProtocol),
16690
16691 Directory(&'union crate::WireOfferDirectory),
16692
16693 Storage(&'union crate::WireOfferStorage),
16694
16695 Runner(&'union crate::WireOfferRunner),
16696
16697 Resolver(&'union crate::WireOfferResolver),
16698
16699 EventStream(&'union crate::WireOfferEventStream),
16700
16701 Dictionary(&'union crate::WireOfferDictionary),
16702
16703 Config(&'union crate::WireOfferConfiguration),
16704
16705 UnknownOrdinal_(u64),
16706 }
16707}
16708
16709impl WireOffer {
16710 pub fn as_ref(&self) -> crate::offer::Ref<'_> {
16711 match self.raw.ordinal() {
16712 1 => crate::offer::Ref::Service(unsafe {
16713 self.raw.get().deref_unchecked::<crate::WireOfferService>()
16714 }),
16715
16716 2 => crate::offer::Ref::Protocol(unsafe {
16717 self.raw.get().deref_unchecked::<crate::WireOfferProtocol>()
16718 }),
16719
16720 3 => crate::offer::Ref::Directory(unsafe {
16721 self.raw.get().deref_unchecked::<crate::WireOfferDirectory>()
16722 }),
16723
16724 4 => crate::offer::Ref::Storage(unsafe {
16725 self.raw.get().deref_unchecked::<crate::WireOfferStorage>()
16726 }),
16727
16728 5 => crate::offer::Ref::Runner(unsafe {
16729 self.raw.get().deref_unchecked::<crate::WireOfferRunner>()
16730 }),
16731
16732 6 => crate::offer::Ref::Resolver(unsafe {
16733 self.raw.get().deref_unchecked::<crate::WireOfferResolver>()
16734 }),
16735
16736 8 => crate::offer::Ref::EventStream(unsafe {
16737 self.raw.get().deref_unchecked::<crate::WireOfferEventStream>()
16738 }),
16739
16740 9 => crate::offer::Ref::Dictionary(unsafe {
16741 self.raw.get().deref_unchecked::<crate::WireOfferDictionary>()
16742 }),
16743
16744 10 => crate::offer::Ref::Config(unsafe {
16745 self.raw.get().deref_unchecked::<crate::WireOfferConfiguration>()
16746 }),
16747
16748 unknown => crate::offer::Ref::UnknownOrdinal_(unknown),
16749 }
16750 }
16751}
16752
16753unsafe impl<___D> ::fidl_next::Decode<___D> for WireOffer
16754where
16755 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
16756
16757 ___D: ::fidl_next::Decoder,
16758{
16759 fn decode(
16760 mut slot: ::fidl_next::Slot<'_, Self>,
16761 decoder: &mut ___D,
16762 ) -> Result<(), ::fidl_next::DecodeError> {
16763 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
16764 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
16765 1 => {
16766 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferService>(raw, decoder)?
16767 }
16768
16769 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferProtocol>(
16770 raw, decoder,
16771 )?,
16772
16773 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferDirectory>(
16774 raw, decoder,
16775 )?,
16776
16777 4 => {
16778 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferStorage>(raw, decoder)?
16779 }
16780
16781 5 => {
16782 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferRunner>(raw, decoder)?
16783 }
16784
16785 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferResolver>(
16786 raw, decoder,
16787 )?,
16788
16789 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferEventStream>(
16790 raw, decoder,
16791 )?,
16792
16793 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferDictionary>(
16794 raw, decoder,
16795 )?,
16796
16797 10 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferConfiguration>(
16798 raw, decoder,
16799 )?,
16800
16801 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
16802 }
16803
16804 Ok(())
16805 }
16806}
16807
16808impl ::core::fmt::Debug for WireOffer {
16809 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
16810 match self.raw.ordinal() {
16811 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferService>().fmt(f) },
16812 2 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferProtocol>().fmt(f) },
16813 3 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferDirectory>().fmt(f) },
16814 4 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferStorage>().fmt(f) },
16815 5 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferRunner>().fmt(f) },
16816 6 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferResolver>().fmt(f) },
16817 8 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferEventStream>().fmt(f) },
16818 9 => unsafe { self.raw.get().deref_unchecked::<crate::WireOfferDictionary>().fmt(f) },
16819 10 => unsafe {
16820 self.raw.get().deref_unchecked::<crate::WireOfferConfiguration>().fmt(f)
16821 },
16822 _ => unsafe { ::core::hint::unreachable_unchecked() },
16823 }
16824 }
16825}
16826
16827#[repr(transparent)]
16828pub struct WireOptionalOffer {
16829 raw: ::fidl_next::RawWireUnion,
16830}
16831
16832unsafe impl ::fidl_next::ZeroPadding for WireOptionalOffer {
16833 #[inline]
16834 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
16835 ::fidl_next::munge!(let Self { raw } = out);
16836 ::fidl_next::RawWireUnion::zero_padding(raw);
16837 }
16838}
16839
16840impl WireOptionalOffer {
16841 pub fn is_some(&self) -> bool {
16842 self.raw.is_some()
16843 }
16844
16845 pub fn is_none(&self) -> bool {
16846 self.raw.is_none()
16847 }
16848
16849 pub fn as_ref(&self) -> Option<&WireOffer> {
16850 if self.is_some() {
16851 Some(unsafe { &*(self as *const Self).cast() })
16852 } else {
16853 None
16854 }
16855 }
16856}
16857
16858unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalOffer
16859where
16860 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
16861
16862 ___D: ::fidl_next::Decoder,
16863{
16864 fn decode(
16865 mut slot: ::fidl_next::Slot<'_, Self>,
16866 decoder: &mut ___D,
16867 ) -> Result<(), ::fidl_next::DecodeError> {
16868 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
16869 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
16870 1 => {
16871 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferService>(raw, decoder)?
16872 }
16873
16874 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferProtocol>(
16875 raw, decoder,
16876 )?,
16877
16878 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferDirectory>(
16879 raw, decoder,
16880 )?,
16881
16882 4 => {
16883 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferStorage>(raw, decoder)?
16884 }
16885
16886 5 => {
16887 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferRunner>(raw, decoder)?
16888 }
16889
16890 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferResolver>(
16891 raw, decoder,
16892 )?,
16893
16894 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferEventStream>(
16895 raw, decoder,
16896 )?,
16897
16898 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferDictionary>(
16899 raw, decoder,
16900 )?,
16901
16902 10 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireOfferConfiguration>(
16903 raw, decoder,
16904 )?,
16905
16906 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
16907 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
16908 }
16909
16910 Ok(())
16911 }
16912}
16913
16914impl ::core::fmt::Debug for WireOptionalOffer {
16915 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
16916 self.as_ref().fmt(f)
16917 }
16918}
16919
16920#[doc = " A repository of the runners available in an environment.\n"]
16921#[derive(Clone, Debug)]
16922pub struct RunnerRegistration {
16923 pub source_name: Option<String>,
16924
16925 pub source: Option<crate::Ref>,
16926
16927 pub target_name: Option<String>,
16928}
16929
16930impl RunnerRegistration {
16931 fn __max_ordinal(&self) -> usize {
16932 if self.source_name.is_some() {
16933 return 1;
16934 }
16935
16936 if self.source.is_some() {
16937 return 2;
16938 }
16939
16940 if self.target_name.is_some() {
16941 return 3;
16942 }
16943
16944 0
16945 }
16946}
16947
16948impl ::fidl_next::Encodable for RunnerRegistration {
16949 type Encoded = WireRunnerRegistration;
16950}
16951
16952unsafe impl<___E> ::fidl_next::Encode<___E> for RunnerRegistration
16953where
16954 ___E: ::fidl_next::Encoder + ?Sized,
16955{
16956 #[inline]
16957 fn encode(
16958 &mut self,
16959 encoder: &mut ___E,
16960 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
16961 ) -> Result<(), ::fidl_next::EncodeError> {
16962 ::fidl_next::munge!(let WireRunnerRegistration { table } = out);
16963
16964 let max_ord = self.__max_ordinal();
16965
16966 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
16967 ::fidl_next::ZeroPadding::zero_padding(&mut out);
16968
16969 let mut preallocated =
16970 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
16971
16972 for i in 1..=max_ord {
16973 match i {
16974 3 => {
16975 if let Some(target_name) = &mut self.target_name {
16976 ::fidl_next::WireEnvelope::encode_value(
16977 target_name,
16978 preallocated.encoder,
16979 &mut out,
16980 )?;
16981 } else {
16982 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16983 }
16984 }
16985
16986 2 => {
16987 if let Some(source) = &mut self.source {
16988 ::fidl_next::WireEnvelope::encode_value(
16989 source,
16990 preallocated.encoder,
16991 &mut out,
16992 )?;
16993 } else {
16994 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16995 }
16996 }
16997
16998 1 => {
16999 if let Some(source_name) = &mut self.source_name {
17000 ::fidl_next::WireEnvelope::encode_value(
17001 source_name,
17002 preallocated.encoder,
17003 &mut out,
17004 )?;
17005 } else {
17006 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17007 }
17008 }
17009
17010 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
17011 }
17012 unsafe {
17013 preallocated.write_next(out.assume_init_ref());
17014 }
17015 }
17016
17017 ::fidl_next::WireTable::encode_len(table, max_ord);
17018
17019 Ok(())
17020 }
17021}
17022
17023impl ::fidl_next::TakeFrom<WireRunnerRegistration> for RunnerRegistration {
17024 #[inline]
17025 fn take_from(from: &WireRunnerRegistration) -> Self {
17026 Self {
17027 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
17028
17029 source: from.source().map(::fidl_next::TakeFrom::take_from),
17030
17031 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
17032 }
17033 }
17034}
17035
17036#[repr(C)]
17038pub struct WireRunnerRegistration {
17039 table: ::fidl_next::WireTable,
17040}
17041
17042unsafe impl ::fidl_next::ZeroPadding for WireRunnerRegistration {
17043 #[inline]
17044 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
17045 ::fidl_next::munge!(let Self { table } = out);
17046 ::fidl_next::WireTable::zero_padding(table);
17047 }
17048}
17049
17050unsafe impl<___D> ::fidl_next::Decode<___D> for WireRunnerRegistration
17051where
17052 ___D: ::fidl_next::Decoder + ?Sized,
17053{
17054 fn decode(
17055 slot: ::fidl_next::Slot<'_, Self>,
17056 decoder: &mut ___D,
17057 ) -> Result<(), ::fidl_next::DecodeError> {
17058 ::fidl_next::munge!(let Self { table } = slot);
17059
17060 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
17061 match ordinal {
17062 0 => unsafe { ::core::hint::unreachable_unchecked() },
17063
17064 1 => {
17065 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
17066 slot.as_mut(),
17067 decoder,
17068 )?;
17069
17070 let source_name = unsafe {
17071 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
17072 };
17073
17074 if source_name.len() > 100 {
17075 return Err(::fidl_next::DecodeError::VectorTooLong {
17076 size: source_name.len() as u64,
17077 limit: 100,
17078 });
17079 }
17080
17081 Ok(())
17082 }
17083
17084 2 => {
17085 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
17086 slot.as_mut(),
17087 decoder,
17088 )?;
17089
17090 Ok(())
17091 }
17092
17093 3 => {
17094 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
17095 slot.as_mut(),
17096 decoder,
17097 )?;
17098
17099 let target_name = unsafe {
17100 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
17101 };
17102
17103 if target_name.len() > 100 {
17104 return Err(::fidl_next::DecodeError::VectorTooLong {
17105 size: target_name.len() as u64,
17106 limit: 100,
17107 });
17108 }
17109
17110 Ok(())
17111 }
17112
17113 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
17114 }
17115 })
17116 }
17117}
17118
17119impl WireRunnerRegistration {
17120 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
17121 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
17122 }
17123
17124 pub fn source(&self) -> Option<&crate::WireRef> {
17125 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
17126 }
17127
17128 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
17129 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
17130 }
17131}
17132
17133impl ::core::fmt::Debug for WireRunnerRegistration {
17134 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
17135 f.debug_struct("RunnerRegistration")
17136 .field("source_name", &self.source_name())
17137 .field("source", &self.source())
17138 .field("target_name", &self.target_name())
17139 .finish()
17140 }
17141}
17142
17143#[doc = " A mapping of URL scheme to resolver name.\n"]
17144#[derive(Clone, Debug)]
17145pub struct ResolverRegistration {
17146 pub resolver: Option<String>,
17147
17148 pub source: Option<crate::Ref>,
17149
17150 pub scheme: Option<String>,
17151}
17152
17153impl ResolverRegistration {
17154 fn __max_ordinal(&self) -> usize {
17155 if self.resolver.is_some() {
17156 return 1;
17157 }
17158
17159 if self.source.is_some() {
17160 return 2;
17161 }
17162
17163 if self.scheme.is_some() {
17164 return 3;
17165 }
17166
17167 0
17168 }
17169}
17170
17171impl ::fidl_next::Encodable for ResolverRegistration {
17172 type Encoded = WireResolverRegistration;
17173}
17174
17175unsafe impl<___E> ::fidl_next::Encode<___E> for ResolverRegistration
17176where
17177 ___E: ::fidl_next::Encoder + ?Sized,
17178{
17179 #[inline]
17180 fn encode(
17181 &mut self,
17182 encoder: &mut ___E,
17183 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17184 ) -> Result<(), ::fidl_next::EncodeError> {
17185 ::fidl_next::munge!(let WireResolverRegistration { table } = out);
17186
17187 let max_ord = self.__max_ordinal();
17188
17189 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
17190 ::fidl_next::ZeroPadding::zero_padding(&mut out);
17191
17192 let mut preallocated =
17193 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
17194
17195 for i in 1..=max_ord {
17196 match i {
17197 3 => {
17198 if let Some(scheme) = &mut self.scheme {
17199 ::fidl_next::WireEnvelope::encode_value(
17200 scheme,
17201 preallocated.encoder,
17202 &mut out,
17203 )?;
17204 } else {
17205 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17206 }
17207 }
17208
17209 2 => {
17210 if let Some(source) = &mut self.source {
17211 ::fidl_next::WireEnvelope::encode_value(
17212 source,
17213 preallocated.encoder,
17214 &mut out,
17215 )?;
17216 } else {
17217 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17218 }
17219 }
17220
17221 1 => {
17222 if let Some(resolver) = &mut self.resolver {
17223 ::fidl_next::WireEnvelope::encode_value(
17224 resolver,
17225 preallocated.encoder,
17226 &mut out,
17227 )?;
17228 } else {
17229 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17230 }
17231 }
17232
17233 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
17234 }
17235 unsafe {
17236 preallocated.write_next(out.assume_init_ref());
17237 }
17238 }
17239
17240 ::fidl_next::WireTable::encode_len(table, max_ord);
17241
17242 Ok(())
17243 }
17244}
17245
17246impl ::fidl_next::TakeFrom<WireResolverRegistration> for ResolverRegistration {
17247 #[inline]
17248 fn take_from(from: &WireResolverRegistration) -> Self {
17249 Self {
17250 resolver: from.resolver().map(::fidl_next::TakeFrom::take_from),
17251
17252 source: from.source().map(::fidl_next::TakeFrom::take_from),
17253
17254 scheme: from.scheme().map(::fidl_next::TakeFrom::take_from),
17255 }
17256 }
17257}
17258
17259#[repr(C)]
17261pub struct WireResolverRegistration {
17262 table: ::fidl_next::WireTable,
17263}
17264
17265unsafe impl ::fidl_next::ZeroPadding for WireResolverRegistration {
17266 #[inline]
17267 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
17268 ::fidl_next::munge!(let Self { table } = out);
17269 ::fidl_next::WireTable::zero_padding(table);
17270 }
17271}
17272
17273unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolverRegistration
17274where
17275 ___D: ::fidl_next::Decoder + ?Sized,
17276{
17277 fn decode(
17278 slot: ::fidl_next::Slot<'_, Self>,
17279 decoder: &mut ___D,
17280 ) -> Result<(), ::fidl_next::DecodeError> {
17281 ::fidl_next::munge!(let Self { table } = slot);
17282
17283 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
17284 match ordinal {
17285 0 => unsafe { ::core::hint::unreachable_unchecked() },
17286
17287 1 => {
17288 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
17289 slot.as_mut(),
17290 decoder,
17291 )?;
17292
17293 let resolver = unsafe {
17294 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
17295 };
17296
17297 if resolver.len() > 100 {
17298 return Err(::fidl_next::DecodeError::VectorTooLong {
17299 size: resolver.len() as u64,
17300 limit: 100,
17301 });
17302 }
17303
17304 Ok(())
17305 }
17306
17307 2 => {
17308 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
17309 slot.as_mut(),
17310 decoder,
17311 )?;
17312
17313 Ok(())
17314 }
17315
17316 3 => {
17317 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
17318 slot.as_mut(),
17319 decoder,
17320 )?;
17321
17322 let scheme = unsafe {
17323 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
17324 };
17325
17326 if scheme.len() > 100 {
17327 return Err(::fidl_next::DecodeError::VectorTooLong {
17328 size: scheme.len() as u64,
17329 limit: 100,
17330 });
17331 }
17332
17333 Ok(())
17334 }
17335
17336 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
17337 }
17338 })
17339 }
17340}
17341
17342impl WireResolverRegistration {
17343 pub fn resolver(&self) -> Option<&::fidl_next::WireString> {
17344 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
17345 }
17346
17347 pub fn source(&self) -> Option<&crate::WireRef> {
17348 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
17349 }
17350
17351 pub fn scheme(&self) -> Option<&::fidl_next::WireString> {
17352 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
17353 }
17354}
17355
17356impl ::core::fmt::Debug for WireResolverRegistration {
17357 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
17358 f.debug_struct("ResolverRegistration")
17359 .field("resolver", &self.resolver())
17360 .field("source", &self.source())
17361 .field("scheme", &self.scheme())
17362 .finish()
17363 }
17364}
17365
17366#[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"]
17367#[derive(Clone, Debug)]
17368pub struct DebugProtocolRegistration {
17369 pub source: Option<crate::Ref>,
17370
17371 pub source_name: Option<String>,
17372
17373 pub target_name: Option<String>,
17374}
17375
17376impl DebugProtocolRegistration {
17377 fn __max_ordinal(&self) -> usize {
17378 if self.source.is_some() {
17379 return 1;
17380 }
17381
17382 if self.source_name.is_some() {
17383 return 2;
17384 }
17385
17386 if self.target_name.is_some() {
17387 return 3;
17388 }
17389
17390 0
17391 }
17392}
17393
17394impl ::fidl_next::Encodable for DebugProtocolRegistration {
17395 type Encoded = WireDebugProtocolRegistration;
17396}
17397
17398unsafe impl<___E> ::fidl_next::Encode<___E> for DebugProtocolRegistration
17399where
17400 ___E: ::fidl_next::Encoder + ?Sized,
17401{
17402 #[inline]
17403 fn encode(
17404 &mut self,
17405 encoder: &mut ___E,
17406 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17407 ) -> Result<(), ::fidl_next::EncodeError> {
17408 ::fidl_next::munge!(let WireDebugProtocolRegistration { table } = out);
17409
17410 let max_ord = self.__max_ordinal();
17411
17412 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
17413 ::fidl_next::ZeroPadding::zero_padding(&mut out);
17414
17415 let mut preallocated =
17416 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
17417
17418 for i in 1..=max_ord {
17419 match i {
17420 3 => {
17421 if let Some(target_name) = &mut self.target_name {
17422 ::fidl_next::WireEnvelope::encode_value(
17423 target_name,
17424 preallocated.encoder,
17425 &mut out,
17426 )?;
17427 } else {
17428 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17429 }
17430 }
17431
17432 2 => {
17433 if let Some(source_name) = &mut self.source_name {
17434 ::fidl_next::WireEnvelope::encode_value(
17435 source_name,
17436 preallocated.encoder,
17437 &mut out,
17438 )?;
17439 } else {
17440 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17441 }
17442 }
17443
17444 1 => {
17445 if let Some(source) = &mut self.source {
17446 ::fidl_next::WireEnvelope::encode_value(
17447 source,
17448 preallocated.encoder,
17449 &mut out,
17450 )?;
17451 } else {
17452 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17453 }
17454 }
17455
17456 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
17457 }
17458 unsafe {
17459 preallocated.write_next(out.assume_init_ref());
17460 }
17461 }
17462
17463 ::fidl_next::WireTable::encode_len(table, max_ord);
17464
17465 Ok(())
17466 }
17467}
17468
17469impl ::fidl_next::TakeFrom<WireDebugProtocolRegistration> for DebugProtocolRegistration {
17470 #[inline]
17471 fn take_from(from: &WireDebugProtocolRegistration) -> Self {
17472 Self {
17473 source: from.source().map(::fidl_next::TakeFrom::take_from),
17474
17475 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
17476
17477 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
17478 }
17479 }
17480}
17481
17482#[repr(C)]
17484pub struct WireDebugProtocolRegistration {
17485 table: ::fidl_next::WireTable,
17486}
17487
17488unsafe impl ::fidl_next::ZeroPadding for WireDebugProtocolRegistration {
17489 #[inline]
17490 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
17491 ::fidl_next::munge!(let Self { table } = out);
17492 ::fidl_next::WireTable::zero_padding(table);
17493 }
17494}
17495
17496unsafe impl<___D> ::fidl_next::Decode<___D> for WireDebugProtocolRegistration
17497where
17498 ___D: ::fidl_next::Decoder + ?Sized,
17499{
17500 fn decode(
17501 slot: ::fidl_next::Slot<'_, Self>,
17502 decoder: &mut ___D,
17503 ) -> Result<(), ::fidl_next::DecodeError> {
17504 ::fidl_next::munge!(let Self { table } = slot);
17505
17506 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
17507 match ordinal {
17508 0 => unsafe { ::core::hint::unreachable_unchecked() },
17509
17510 1 => {
17511 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireRef>(
17512 slot.as_mut(),
17513 decoder,
17514 )?;
17515
17516 Ok(())
17517 }
17518
17519 2 => {
17520 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
17521 slot.as_mut(),
17522 decoder,
17523 )?;
17524
17525 let source_name = unsafe {
17526 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
17527 };
17528
17529 if source_name.len() > 100 {
17530 return Err(::fidl_next::DecodeError::VectorTooLong {
17531 size: source_name.len() as u64,
17532 limit: 100,
17533 });
17534 }
17535
17536 Ok(())
17537 }
17538
17539 3 => {
17540 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
17541 slot.as_mut(),
17542 decoder,
17543 )?;
17544
17545 let target_name = unsafe {
17546 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
17547 };
17548
17549 if target_name.len() > 100 {
17550 return Err(::fidl_next::DecodeError::VectorTooLong {
17551 size: target_name.len() as u64,
17552 limit: 100,
17553 });
17554 }
17555
17556 Ok(())
17557 }
17558
17559 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
17560 }
17561 })
17562 }
17563}
17564
17565impl WireDebugProtocolRegistration {
17566 pub fn source(&self) -> Option<&crate::WireRef> {
17567 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
17568 }
17569
17570 pub fn source_name(&self) -> Option<&::fidl_next::WireString> {
17571 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
17572 }
17573
17574 pub fn target_name(&self) -> Option<&::fidl_next::WireString> {
17575 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
17576 }
17577}
17578
17579impl ::core::fmt::Debug for WireDebugProtocolRegistration {
17580 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
17581 f.debug_struct("DebugProtocolRegistration")
17582 .field("source", &self.source())
17583 .field("source_name", &self.source_name())
17584 .field("target_name", &self.target_name())
17585 .finish()
17586 }
17587}
17588
17589#[doc = " Declares a capability registered in the debug section of an environment.\n"]
17590#[derive(Clone, Debug)]
17591pub enum DebugRegistration {
17592 Protocol(crate::DebugProtocolRegistration),
17593
17594 UnknownOrdinal_(u64),
17595}
17596
17597impl ::fidl_next::Encodable for DebugRegistration {
17598 type Encoded = WireDebugRegistration;
17599}
17600
17601unsafe impl<___E> ::fidl_next::Encode<___E> for DebugRegistration
17602where
17603 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17604
17605 ___E: ::fidl_next::Encoder,
17606{
17607 #[inline]
17608 fn encode(
17609 &mut self,
17610 encoder: &mut ___E,
17611 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17612 ) -> Result<(), ::fidl_next::EncodeError> {
17613 ::fidl_next::munge!(let WireDebugRegistration { raw } = out);
17614
17615 match self {
17616 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
17617 ___E,
17618 crate::DebugProtocolRegistration,
17619 >(value, 1, encoder, raw)?,
17620
17621 Self::UnknownOrdinal_(ordinal) => {
17622 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
17623 }
17624 }
17625
17626 Ok(())
17627 }
17628}
17629
17630impl ::fidl_next::EncodableOption for Box<DebugRegistration> {
17631 type EncodedOption = WireOptionalDebugRegistration;
17632}
17633
17634unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<DebugRegistration>
17635where
17636 ___E: ?Sized,
17637 DebugRegistration: ::fidl_next::Encode<___E>,
17638{
17639 #[inline]
17640 fn encode_option(
17641 this: Option<&mut Self>,
17642 encoder: &mut ___E,
17643 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
17644 ) -> Result<(), ::fidl_next::EncodeError> {
17645 ::fidl_next::munge!(let WireOptionalDebugRegistration { raw } = &mut *out);
17646
17647 if let Some(inner) = this {
17648 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
17649 ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
17650 } else {
17651 ::fidl_next::RawWireUnion::encode_absent(raw);
17652 }
17653
17654 Ok(())
17655 }
17656}
17657
17658impl ::fidl_next::TakeFrom<WireDebugRegistration> for DebugRegistration {
17659 #[inline]
17660 fn take_from(from: &WireDebugRegistration) -> Self {
17661 match from.raw.ordinal() {
17662 1 => Self::Protocol(::fidl_next::TakeFrom::take_from(unsafe {
17663 from.raw.get().deref_unchecked::<crate::WireDebugProtocolRegistration>()
17664 })),
17665
17666 _ => unsafe { ::core::hint::unreachable_unchecked() },
17667 }
17668 }
17669}
17670
17671impl ::fidl_next::TakeFrom<WireOptionalDebugRegistration> for Option<Box<DebugRegistration>> {
17672 #[inline]
17673 fn take_from(from: &WireOptionalDebugRegistration) -> Self {
17674 if let Some(inner) = from.as_ref() {
17675 Some(::fidl_next::TakeFrom::take_from(inner))
17676 } else {
17677 None
17678 }
17679 }
17680}
17681
17682#[repr(transparent)]
17684pub struct WireDebugRegistration {
17685 raw: ::fidl_next::RawWireUnion,
17686}
17687
17688unsafe impl ::fidl_next::ZeroPadding for WireDebugRegistration {
17689 #[inline]
17690 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
17691 ::fidl_next::munge!(let Self { raw } = out);
17692 ::fidl_next::RawWireUnion::zero_padding(raw);
17693 }
17694}
17695
17696pub mod debug_registration {
17697 pub enum Ref<'union> {
17698 Protocol(&'union crate::WireDebugProtocolRegistration),
17699
17700 UnknownOrdinal_(u64),
17701 }
17702}
17703
17704impl WireDebugRegistration {
17705 pub fn as_ref(&self) -> crate::debug_registration::Ref<'_> {
17706 match self.raw.ordinal() {
17707 1 => crate::debug_registration::Ref::Protocol(unsafe {
17708 self.raw.get().deref_unchecked::<crate::WireDebugProtocolRegistration>()
17709 }),
17710
17711 unknown => crate::debug_registration::Ref::UnknownOrdinal_(unknown),
17712 }
17713 }
17714}
17715
17716unsafe impl<___D> ::fidl_next::Decode<___D> for WireDebugRegistration
17717where
17718 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
17719
17720 ___D: ::fidl_next::Decoder,
17721{
17722 fn decode(
17723 mut slot: ::fidl_next::Slot<'_, Self>,
17724 decoder: &mut ___D,
17725 ) -> Result<(), ::fidl_next::DecodeError> {
17726 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
17727 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
17728 1 => {
17729 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDebugProtocolRegistration>(
17730 raw, decoder,
17731 )?
17732 }
17733
17734 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
17735 }
17736
17737 Ok(())
17738 }
17739}
17740
17741impl ::core::fmt::Debug for WireDebugRegistration {
17742 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
17743 match self.raw.ordinal() {
17744 1 => unsafe {
17745 self.raw.get().deref_unchecked::<crate::WireDebugProtocolRegistration>().fmt(f)
17746 },
17747 _ => unsafe { ::core::hint::unreachable_unchecked() },
17748 }
17749 }
17750}
17751
17752#[repr(transparent)]
17753pub struct WireOptionalDebugRegistration {
17754 raw: ::fidl_next::RawWireUnion,
17755}
17756
17757unsafe impl ::fidl_next::ZeroPadding for WireOptionalDebugRegistration {
17758 #[inline]
17759 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
17760 ::fidl_next::munge!(let Self { raw } = out);
17761 ::fidl_next::RawWireUnion::zero_padding(raw);
17762 }
17763}
17764
17765impl WireOptionalDebugRegistration {
17766 pub fn is_some(&self) -> bool {
17767 self.raw.is_some()
17768 }
17769
17770 pub fn is_none(&self) -> bool {
17771 self.raw.is_none()
17772 }
17773
17774 pub fn as_ref(&self) -> Option<&WireDebugRegistration> {
17775 if self.is_some() {
17776 Some(unsafe { &*(self as *const Self).cast() })
17777 } else {
17778 None
17779 }
17780 }
17781}
17782
17783unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalDebugRegistration
17784where
17785 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
17786
17787 ___D: ::fidl_next::Decoder,
17788{
17789 fn decode(
17790 mut slot: ::fidl_next::Slot<'_, Self>,
17791 decoder: &mut ___D,
17792 ) -> Result<(), ::fidl_next::DecodeError> {
17793 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
17794 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
17795 1 => {
17796 ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDebugProtocolRegistration>(
17797 raw, decoder,
17798 )?
17799 }
17800
17801 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
17802 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
17803 }
17804
17805 Ok(())
17806 }
17807}
17808
17809impl ::core::fmt::Debug for WireOptionalDebugRegistration {
17810 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
17811 self.as_ref().fmt(f)
17812 }
17813}
17814
17815#[doc = " Declares an environment which configures a realm.\n"]
17816#[derive(Clone, Debug)]
17817pub struct Environment {
17818 pub name: Option<String>,
17819
17820 pub extends: Option<crate::EnvironmentExtends>,
17821
17822 pub runners: Option<Vec<crate::RunnerRegistration>>,
17823
17824 pub resolvers: Option<Vec<crate::ResolverRegistration>>,
17825
17826 pub debug_capabilities: Option<Vec<crate::DebugRegistration>>,
17827
17828 pub stop_timeout_ms: Option<u32>,
17829}
17830
17831impl Environment {
17832 fn __max_ordinal(&self) -> usize {
17833 if self.name.is_some() {
17834 return 1;
17835 }
17836
17837 if self.extends.is_some() {
17838 return 2;
17839 }
17840
17841 if self.runners.is_some() {
17842 return 3;
17843 }
17844
17845 if self.resolvers.is_some() {
17846 return 4;
17847 }
17848
17849 if self.debug_capabilities.is_some() {
17850 return 5;
17851 }
17852
17853 if self.stop_timeout_ms.is_some() {
17854 return 6;
17855 }
17856
17857 0
17858 }
17859}
17860
17861impl ::fidl_next::Encodable for Environment {
17862 type Encoded = WireEnvironment;
17863}
17864
17865unsafe impl<___E> ::fidl_next::Encode<___E> for Environment
17866where
17867 ___E: ::fidl_next::Encoder + ?Sized,
17868{
17869 #[inline]
17870 fn encode(
17871 &mut self,
17872 encoder: &mut ___E,
17873 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
17874 ) -> Result<(), ::fidl_next::EncodeError> {
17875 ::fidl_next::munge!(let WireEnvironment { table } = out);
17876
17877 let max_ord = self.__max_ordinal();
17878
17879 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
17880 ::fidl_next::ZeroPadding::zero_padding(&mut out);
17881
17882 let mut preallocated =
17883 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
17884
17885 for i in 1..=max_ord {
17886 match i {
17887 6 => {
17888 if let Some(stop_timeout_ms) = &mut self.stop_timeout_ms {
17889 ::fidl_next::WireEnvelope::encode_value(
17890 stop_timeout_ms,
17891 preallocated.encoder,
17892 &mut out,
17893 )?;
17894 } else {
17895 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17896 }
17897 }
17898
17899 5 => {
17900 if let Some(debug_capabilities) = &mut self.debug_capabilities {
17901 ::fidl_next::WireEnvelope::encode_value(
17902 debug_capabilities,
17903 preallocated.encoder,
17904 &mut out,
17905 )?;
17906 } else {
17907 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17908 }
17909 }
17910
17911 4 => {
17912 if let Some(resolvers) = &mut self.resolvers {
17913 ::fidl_next::WireEnvelope::encode_value(
17914 resolvers,
17915 preallocated.encoder,
17916 &mut out,
17917 )?;
17918 } else {
17919 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17920 }
17921 }
17922
17923 3 => {
17924 if let Some(runners) = &mut self.runners {
17925 ::fidl_next::WireEnvelope::encode_value(
17926 runners,
17927 preallocated.encoder,
17928 &mut out,
17929 )?;
17930 } else {
17931 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17932 }
17933 }
17934
17935 2 => {
17936 if let Some(extends) = &mut self.extends {
17937 ::fidl_next::WireEnvelope::encode_value(
17938 extends,
17939 preallocated.encoder,
17940 &mut out,
17941 )?;
17942 } else {
17943 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17944 }
17945 }
17946
17947 1 => {
17948 if let Some(name) = &mut self.name {
17949 ::fidl_next::WireEnvelope::encode_value(
17950 name,
17951 preallocated.encoder,
17952 &mut out,
17953 )?;
17954 } else {
17955 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17956 }
17957 }
17958
17959 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
17960 }
17961 unsafe {
17962 preallocated.write_next(out.assume_init_ref());
17963 }
17964 }
17965
17966 ::fidl_next::WireTable::encode_len(table, max_ord);
17967
17968 Ok(())
17969 }
17970}
17971
17972impl ::fidl_next::TakeFrom<WireEnvironment> for Environment {
17973 #[inline]
17974 fn take_from(from: &WireEnvironment) -> Self {
17975 Self {
17976 name: from.name().map(::fidl_next::TakeFrom::take_from),
17977
17978 extends: from.extends().map(::fidl_next::TakeFrom::take_from),
17979
17980 runners: from.runners().map(::fidl_next::TakeFrom::take_from),
17981
17982 resolvers: from.resolvers().map(::fidl_next::TakeFrom::take_from),
17983
17984 debug_capabilities: from.debug_capabilities().map(::fidl_next::TakeFrom::take_from),
17985
17986 stop_timeout_ms: from.stop_timeout_ms().map(::fidl_next::TakeFrom::take_from),
17987 }
17988 }
17989}
17990
17991#[repr(C)]
17993pub struct WireEnvironment {
17994 table: ::fidl_next::WireTable,
17995}
17996
17997unsafe impl ::fidl_next::ZeroPadding for WireEnvironment {
17998 #[inline]
17999 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
18000 ::fidl_next::munge!(let Self { table } = out);
18001 ::fidl_next::WireTable::zero_padding(table);
18002 }
18003}
18004
18005unsafe impl<___D> ::fidl_next::Decode<___D> for WireEnvironment
18006where
18007 ___D: ::fidl_next::Decoder + ?Sized,
18008{
18009 fn decode(
18010 slot: ::fidl_next::Slot<'_, Self>,
18011 decoder: &mut ___D,
18012 ) -> Result<(), ::fidl_next::DecodeError> {
18013 ::fidl_next::munge!(let Self { table } = slot);
18014
18015 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
18016 match ordinal {
18017 0 => unsafe { ::core::hint::unreachable_unchecked() },
18018
18019 1 => {
18020 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
18021 slot.as_mut(),
18022 decoder,
18023 )?;
18024
18025 let name = unsafe {
18026 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
18027 };
18028
18029 if name.len() > 100 {
18030 return Err(::fidl_next::DecodeError::VectorTooLong {
18031 size: name.len() as u64,
18032 limit: 100,
18033 });
18034 }
18035
18036 Ok(())
18037 }
18038
18039 2 => {
18040 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireEnvironmentExtends>(
18041 slot.as_mut(),
18042 decoder,
18043 )?;
18044
18045 Ok(())
18046 }
18047
18048 3 => {
18049 ::fidl_next::WireEnvelope::decode_as::<
18050 ___D,
18051 ::fidl_next::WireVector<crate::WireRunnerRegistration>,
18052 >(slot.as_mut(), decoder)?;
18053
18054 Ok(())
18055 }
18056
18057 4 => {
18058 ::fidl_next::WireEnvelope::decode_as::<
18059 ___D,
18060 ::fidl_next::WireVector<crate::WireResolverRegistration>,
18061 >(slot.as_mut(), decoder)?;
18062
18063 Ok(())
18064 }
18065
18066 5 => {
18067 ::fidl_next::WireEnvelope::decode_as::<
18068 ___D,
18069 ::fidl_next::WireVector<crate::WireDebugRegistration>,
18070 >(slot.as_mut(), decoder)?;
18071
18072 Ok(())
18073 }
18074
18075 6 => {
18076 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
18077 slot.as_mut(),
18078 decoder,
18079 )?;
18080
18081 Ok(())
18082 }
18083
18084 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
18085 }
18086 })
18087 }
18088}
18089
18090impl WireEnvironment {
18091 pub fn name(&self) -> Option<&::fidl_next::WireString> {
18092 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
18093 }
18094
18095 pub fn extends(&self) -> Option<&crate::WireEnvironmentExtends> {
18096 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
18097 }
18098
18099 pub fn runners(&self) -> Option<&::fidl_next::WireVector<crate::WireRunnerRegistration>> {
18100 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
18101 }
18102
18103 pub fn resolvers(&self) -> Option<&::fidl_next::WireVector<crate::WireResolverRegistration>> {
18104 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
18105 }
18106
18107 pub fn debug_capabilities(
18108 &self,
18109 ) -> Option<&::fidl_next::WireVector<crate::WireDebugRegistration>> {
18110 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
18111 }
18112
18113 pub fn stop_timeout_ms(&self) -> Option<&::fidl_next::WireU32> {
18114 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
18115 }
18116}
18117
18118impl ::core::fmt::Debug for WireEnvironment {
18119 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
18120 f.debug_struct("Environment")
18121 .field("name", &self.name())
18122 .field("extends", &self.extends())
18123 .field("runners", &self.runners())
18124 .field("resolvers", &self.resolvers())
18125 .field("debug_capabilities", &self.debug_capabilities())
18126 .field("stop_timeout_ms", &self.stop_timeout_ms())
18127 .finish()
18128 }
18129}
18130
18131#[derive(Clone, Debug)]
18132pub struct ConfigSourceCapabilities {}
18133
18134impl ConfigSourceCapabilities {
18135 fn __max_ordinal(&self) -> usize {
18136 0
18137 }
18138}
18139
18140impl ::fidl_next::Encodable for ConfigSourceCapabilities {
18141 type Encoded = WireConfigSourceCapabilities;
18142}
18143
18144unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigSourceCapabilities
18145where
18146 ___E: ::fidl_next::Encoder + ?Sized,
18147{
18148 #[inline]
18149 fn encode(
18150 &mut self,
18151 encoder: &mut ___E,
18152 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18153 ) -> Result<(), ::fidl_next::EncodeError> {
18154 ::fidl_next::munge!(let WireConfigSourceCapabilities { table } = out);
18155
18156 let max_ord = self.__max_ordinal();
18157
18158 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18159 ::fidl_next::ZeroPadding::zero_padding(&mut out);
18160
18161 let mut preallocated =
18162 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18163
18164 for i in 1..=max_ord {
18165 match i {
18166 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18167 }
18168 unsafe {
18169 preallocated.write_next(out.assume_init_ref());
18170 }
18171 }
18172
18173 ::fidl_next::WireTable::encode_len(table, max_ord);
18174
18175 Ok(())
18176 }
18177}
18178
18179impl ::fidl_next::TakeFrom<WireConfigSourceCapabilities> for ConfigSourceCapabilities {
18180 #[inline]
18181 fn take_from(from: &WireConfigSourceCapabilities) -> Self {
18182 Self {}
18183 }
18184}
18185
18186#[repr(C)]
18188pub struct WireConfigSourceCapabilities {
18189 table: ::fidl_next::WireTable,
18190}
18191
18192unsafe impl ::fidl_next::ZeroPadding for WireConfigSourceCapabilities {
18193 #[inline]
18194 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
18195 ::fidl_next::munge!(let Self { table } = out);
18196 ::fidl_next::WireTable::zero_padding(table);
18197 }
18198}
18199
18200unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigSourceCapabilities
18201where
18202 ___D: ::fidl_next::Decoder + ?Sized,
18203{
18204 fn decode(
18205 slot: ::fidl_next::Slot<'_, Self>,
18206 decoder: &mut ___D,
18207 ) -> Result<(), ::fidl_next::DecodeError> {
18208 ::fidl_next::munge!(let Self { table } = slot);
18209
18210 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
18211 match ordinal {
18212 0 => unsafe { ::core::hint::unreachable_unchecked() },
18213
18214 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
18215 }
18216 })
18217 }
18218}
18219
18220impl WireConfigSourceCapabilities {}
18221
18222impl ::core::fmt::Debug for WireConfigSourceCapabilities {
18223 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
18224 f.debug_struct("ConfigSourceCapabilities").finish()
18225 }
18226}
18227
18228#[doc = " Strategies available for resolving configuration values.\n"]
18229#[derive(Clone, Debug)]
18230pub enum ConfigValueSource {
18231 PackagePath(String),
18232
18233 Capabilities(crate::ConfigSourceCapabilities),
18234
18235 UnknownOrdinal_(u64),
18236}
18237
18238impl ::fidl_next::Encodable for ConfigValueSource {
18239 type Encoded = WireConfigValueSource;
18240}
18241
18242unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigValueSource
18243where
18244 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18245
18246 ___E: ::fidl_next::Encoder,
18247{
18248 #[inline]
18249 fn encode(
18250 &mut self,
18251 encoder: &mut ___E,
18252 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18253 ) -> Result<(), ::fidl_next::EncodeError> {
18254 ::fidl_next::munge!(let WireConfigValueSource { raw } = out);
18255
18256 match self {
18257 Self::PackagePath(value) => {
18258 ::fidl_next::RawWireUnion::encode_as::<___E, String>(value, 1, encoder, raw)?
18259 }
18260
18261 Self::Capabilities(value) => ::fidl_next::RawWireUnion::encode_as::<
18262 ___E,
18263 crate::ConfigSourceCapabilities,
18264 >(value, 2, encoder, raw)?,
18265
18266 Self::UnknownOrdinal_(ordinal) => {
18267 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
18268 }
18269 }
18270
18271 Ok(())
18272 }
18273}
18274
18275impl ::fidl_next::EncodableOption for Box<ConfigValueSource> {
18276 type EncodedOption = WireOptionalConfigValueSource;
18277}
18278
18279unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ConfigValueSource>
18280where
18281 ___E: ?Sized,
18282 ConfigValueSource: ::fidl_next::Encode<___E>,
18283{
18284 #[inline]
18285 fn encode_option(
18286 this: Option<&mut Self>,
18287 encoder: &mut ___E,
18288 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
18289 ) -> Result<(), ::fidl_next::EncodeError> {
18290 ::fidl_next::munge!(let WireOptionalConfigValueSource { raw } = &mut *out);
18291
18292 if let Some(inner) = this {
18293 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
18294 ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
18295 } else {
18296 ::fidl_next::RawWireUnion::encode_absent(raw);
18297 }
18298
18299 Ok(())
18300 }
18301}
18302
18303impl ::fidl_next::TakeFrom<WireConfigValueSource> for ConfigValueSource {
18304 #[inline]
18305 fn take_from(from: &WireConfigValueSource) -> Self {
18306 match from.raw.ordinal() {
18307 1 => Self::PackagePath(::fidl_next::TakeFrom::take_from(unsafe {
18308 from.raw.get().deref_unchecked::<::fidl_next::WireString>()
18309 })),
18310
18311 2 => Self::Capabilities(::fidl_next::TakeFrom::take_from(unsafe {
18312 from.raw.get().deref_unchecked::<crate::WireConfigSourceCapabilities>()
18313 })),
18314
18315 _ => unsafe { ::core::hint::unreachable_unchecked() },
18316 }
18317 }
18318}
18319
18320impl ::fidl_next::TakeFrom<WireOptionalConfigValueSource> for Option<Box<ConfigValueSource>> {
18321 #[inline]
18322 fn take_from(from: &WireOptionalConfigValueSource) -> Self {
18323 if let Some(inner) = from.as_ref() {
18324 Some(::fidl_next::TakeFrom::take_from(inner))
18325 } else {
18326 None
18327 }
18328 }
18329}
18330
18331#[repr(transparent)]
18333pub struct WireConfigValueSource {
18334 raw: ::fidl_next::RawWireUnion,
18335}
18336
18337unsafe impl ::fidl_next::ZeroPadding for WireConfigValueSource {
18338 #[inline]
18339 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
18340 ::fidl_next::munge!(let Self { raw } = out);
18341 ::fidl_next::RawWireUnion::zero_padding(raw);
18342 }
18343}
18344
18345pub mod config_value_source {
18346 pub enum Ref<'union> {
18347 PackagePath(&'union ::fidl_next::WireString),
18348
18349 Capabilities(&'union crate::WireConfigSourceCapabilities),
18350
18351 UnknownOrdinal_(u64),
18352 }
18353}
18354
18355impl WireConfigValueSource {
18356 pub fn as_ref(&self) -> crate::config_value_source::Ref<'_> {
18357 match self.raw.ordinal() {
18358 1 => crate::config_value_source::Ref::PackagePath(unsafe {
18359 self.raw.get().deref_unchecked::<::fidl_next::WireString>()
18360 }),
18361
18362 2 => crate::config_value_source::Ref::Capabilities(unsafe {
18363 self.raw.get().deref_unchecked::<crate::WireConfigSourceCapabilities>()
18364 }),
18365
18366 unknown => crate::config_value_source::Ref::UnknownOrdinal_(unknown),
18367 }
18368 }
18369}
18370
18371unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigValueSource
18372where
18373 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
18374
18375 ___D: ::fidl_next::Decoder,
18376{
18377 fn decode(
18378 mut slot: ::fidl_next::Slot<'_, Self>,
18379 decoder: &mut ___D,
18380 ) -> Result<(), ::fidl_next::DecodeError> {
18381 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
18382 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
18383 1 => {
18384 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString>(raw, decoder)?
18385 }
18386
18387 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigSourceCapabilities>(
18388 raw, decoder,
18389 )?,
18390
18391 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
18392 }
18393
18394 Ok(())
18395 }
18396}
18397
18398impl ::core::fmt::Debug for WireConfigValueSource {
18399 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
18400 match self.raw.ordinal() {
18401 1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireString>().fmt(f) },
18402 2 => unsafe {
18403 self.raw.get().deref_unchecked::<crate::WireConfigSourceCapabilities>().fmt(f)
18404 },
18405 _ => unsafe { ::core::hint::unreachable_unchecked() },
18406 }
18407 }
18408}
18409
18410#[repr(transparent)]
18411pub struct WireOptionalConfigValueSource {
18412 raw: ::fidl_next::RawWireUnion,
18413}
18414
18415unsafe impl ::fidl_next::ZeroPadding for WireOptionalConfigValueSource {
18416 #[inline]
18417 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
18418 ::fidl_next::munge!(let Self { raw } = out);
18419 ::fidl_next::RawWireUnion::zero_padding(raw);
18420 }
18421}
18422
18423impl WireOptionalConfigValueSource {
18424 pub fn is_some(&self) -> bool {
18425 self.raw.is_some()
18426 }
18427
18428 pub fn is_none(&self) -> bool {
18429 self.raw.is_none()
18430 }
18431
18432 pub fn as_ref(&self) -> Option<&WireConfigValueSource> {
18433 if self.is_some() {
18434 Some(unsafe { &*(self as *const Self).cast() })
18435 } else {
18436 None
18437 }
18438 }
18439}
18440
18441unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalConfigValueSource
18442where
18443 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
18444
18445 ___D: ::fidl_next::Decoder,
18446{
18447 fn decode(
18448 mut slot: ::fidl_next::Slot<'_, Self>,
18449 decoder: &mut ___D,
18450 ) -> Result<(), ::fidl_next::DecodeError> {
18451 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
18452 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
18453 1 => {
18454 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString>(raw, decoder)?
18455 }
18456
18457 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigSourceCapabilities>(
18458 raw, decoder,
18459 )?,
18460
18461 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
18462 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
18463 }
18464
18465 Ok(())
18466 }
18467}
18468
18469impl ::core::fmt::Debug for WireOptionalConfigValueSource {
18470 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
18471 self.as_ref().fmt(f)
18472 }
18473}
18474
18475#[doc = " The schema of a component\'s configuration interface.\n"]
18476#[derive(Clone, Debug)]
18477pub struct ConfigSchema {
18478 pub fields: Option<Vec<crate::ConfigField>>,
18479
18480 pub checksum: Option<crate::ConfigChecksum>,
18481
18482 pub value_source: Option<crate::ConfigValueSource>,
18483}
18484
18485impl ConfigSchema {
18486 fn __max_ordinal(&self) -> usize {
18487 if self.fields.is_some() {
18488 return 1;
18489 }
18490
18491 if self.checksum.is_some() {
18492 return 2;
18493 }
18494
18495 if self.value_source.is_some() {
18496 return 3;
18497 }
18498
18499 0
18500 }
18501}
18502
18503impl ::fidl_next::Encodable for ConfigSchema {
18504 type Encoded = WireConfigSchema;
18505}
18506
18507unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigSchema
18508where
18509 ___E: ::fidl_next::Encoder + ?Sized,
18510{
18511 #[inline]
18512 fn encode(
18513 &mut self,
18514 encoder: &mut ___E,
18515 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18516 ) -> Result<(), ::fidl_next::EncodeError> {
18517 ::fidl_next::munge!(let WireConfigSchema { table } = out);
18518
18519 let max_ord = self.__max_ordinal();
18520
18521 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18522 ::fidl_next::ZeroPadding::zero_padding(&mut out);
18523
18524 let mut preallocated =
18525 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18526
18527 for i in 1..=max_ord {
18528 match i {
18529 3 => {
18530 if let Some(value_source) = &mut self.value_source {
18531 ::fidl_next::WireEnvelope::encode_value(
18532 value_source,
18533 preallocated.encoder,
18534 &mut out,
18535 )?;
18536 } else {
18537 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18538 }
18539 }
18540
18541 2 => {
18542 if let Some(checksum) = &mut self.checksum {
18543 ::fidl_next::WireEnvelope::encode_value(
18544 checksum,
18545 preallocated.encoder,
18546 &mut out,
18547 )?;
18548 } else {
18549 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18550 }
18551 }
18552
18553 1 => {
18554 if let Some(fields) = &mut self.fields {
18555 ::fidl_next::WireEnvelope::encode_value(
18556 fields,
18557 preallocated.encoder,
18558 &mut out,
18559 )?;
18560 } else {
18561 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18562 }
18563 }
18564
18565 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18566 }
18567 unsafe {
18568 preallocated.write_next(out.assume_init_ref());
18569 }
18570 }
18571
18572 ::fidl_next::WireTable::encode_len(table, max_ord);
18573
18574 Ok(())
18575 }
18576}
18577
18578impl ::fidl_next::TakeFrom<WireConfigSchema> for ConfigSchema {
18579 #[inline]
18580 fn take_from(from: &WireConfigSchema) -> Self {
18581 Self {
18582 fields: from.fields().map(::fidl_next::TakeFrom::take_from),
18583
18584 checksum: from.checksum().map(::fidl_next::TakeFrom::take_from),
18585
18586 value_source: from.value_source().map(::fidl_next::TakeFrom::take_from),
18587 }
18588 }
18589}
18590
18591#[repr(C)]
18593pub struct WireConfigSchema {
18594 table: ::fidl_next::WireTable,
18595}
18596
18597unsafe impl ::fidl_next::ZeroPadding for WireConfigSchema {
18598 #[inline]
18599 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
18600 ::fidl_next::munge!(let Self { table } = out);
18601 ::fidl_next::WireTable::zero_padding(table);
18602 }
18603}
18604
18605unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigSchema
18606where
18607 ___D: ::fidl_next::Decoder + ?Sized,
18608{
18609 fn decode(
18610 slot: ::fidl_next::Slot<'_, Self>,
18611 decoder: &mut ___D,
18612 ) -> Result<(), ::fidl_next::DecodeError> {
18613 ::fidl_next::munge!(let Self { table } = slot);
18614
18615 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
18616 match ordinal {
18617 0 => unsafe { ::core::hint::unreachable_unchecked() },
18618
18619 1 => {
18620 ::fidl_next::WireEnvelope::decode_as::<
18621 ___D,
18622 ::fidl_next::WireVector<crate::WireConfigField>,
18623 >(slot.as_mut(), decoder)?;
18624
18625 Ok(())
18626 }
18627
18628 2 => {
18629 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigChecksum>(
18630 slot.as_mut(),
18631 decoder,
18632 )?;
18633
18634 Ok(())
18635 }
18636
18637 3 => {
18638 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigValueSource>(
18639 slot.as_mut(),
18640 decoder,
18641 )?;
18642
18643 Ok(())
18644 }
18645
18646 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
18647 }
18648 })
18649 }
18650}
18651
18652impl WireConfigSchema {
18653 pub fn fields(&self) -> Option<&::fidl_next::WireVector<crate::WireConfigField>> {
18654 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
18655 }
18656
18657 pub fn checksum(&self) -> Option<&crate::WireConfigChecksum> {
18658 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
18659 }
18660
18661 pub fn value_source(&self) -> Option<&crate::WireConfigValueSource> {
18662 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
18663 }
18664}
18665
18666impl ::core::fmt::Debug for WireConfigSchema {
18667 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
18668 f.debug_struct("ConfigSchema")
18669 .field("fields", &self.fields())
18670 .field("checksum", &self.checksum())
18671 .field("value_source", &self.value_source())
18672 .finish()
18673 }
18674}
18675
18676#[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"]
18677#[derive(Clone, Debug)]
18678pub struct Component {
18679 pub program: Option<crate::Program>,
18680
18681 pub uses: Option<Vec<crate::Use>>,
18682
18683 pub exposes: Option<Vec<crate::Expose>>,
18684
18685 pub offers: Option<Vec<crate::Offer>>,
18686
18687 pub capabilities: Option<Vec<crate::Capability>>,
18688
18689 pub children: Option<Vec<crate::Child>>,
18690
18691 pub collections: Option<Vec<crate::Collection>>,
18692
18693 pub environments: Option<Vec<crate::Environment>>,
18694
18695 pub facets: Option<::fidl_next_fuchsia_data::Dictionary>,
18696
18697 pub config: Option<crate::ConfigSchema>,
18698}
18699
18700impl Component {
18701 fn __max_ordinal(&self) -> usize {
18702 if self.program.is_some() {
18703 return 1;
18704 }
18705
18706 if self.uses.is_some() {
18707 return 2;
18708 }
18709
18710 if self.exposes.is_some() {
18711 return 3;
18712 }
18713
18714 if self.offers.is_some() {
18715 return 4;
18716 }
18717
18718 if self.capabilities.is_some() {
18719 return 5;
18720 }
18721
18722 if self.children.is_some() {
18723 return 6;
18724 }
18725
18726 if self.collections.is_some() {
18727 return 7;
18728 }
18729
18730 if self.environments.is_some() {
18731 return 8;
18732 }
18733
18734 if self.facets.is_some() {
18735 return 9;
18736 }
18737
18738 if self.config.is_some() {
18739 return 10;
18740 }
18741
18742 0
18743 }
18744}
18745
18746impl ::fidl_next::Encodable for Component {
18747 type Encoded = WireComponent;
18748}
18749
18750unsafe impl<___E> ::fidl_next::Encode<___E> for Component
18751where
18752 ___E: ::fidl_next::Encoder + ?Sized,
18753{
18754 #[inline]
18755 fn encode(
18756 &mut self,
18757 encoder: &mut ___E,
18758 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
18759 ) -> Result<(), ::fidl_next::EncodeError> {
18760 ::fidl_next::munge!(let WireComponent { table } = out);
18761
18762 let max_ord = self.__max_ordinal();
18763
18764 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18765 ::fidl_next::ZeroPadding::zero_padding(&mut out);
18766
18767 let mut preallocated =
18768 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18769
18770 for i in 1..=max_ord {
18771 match i {
18772 10 => {
18773 if let Some(config) = &mut self.config {
18774 ::fidl_next::WireEnvelope::encode_value(
18775 config,
18776 preallocated.encoder,
18777 &mut out,
18778 )?;
18779 } else {
18780 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18781 }
18782 }
18783
18784 9 => {
18785 if let Some(facets) = &mut self.facets {
18786 ::fidl_next::WireEnvelope::encode_value(
18787 facets,
18788 preallocated.encoder,
18789 &mut out,
18790 )?;
18791 } else {
18792 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18793 }
18794 }
18795
18796 8 => {
18797 if let Some(environments) = &mut self.environments {
18798 ::fidl_next::WireEnvelope::encode_value(
18799 environments,
18800 preallocated.encoder,
18801 &mut out,
18802 )?;
18803 } else {
18804 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18805 }
18806 }
18807
18808 7 => {
18809 if let Some(collections) = &mut self.collections {
18810 ::fidl_next::WireEnvelope::encode_value(
18811 collections,
18812 preallocated.encoder,
18813 &mut out,
18814 )?;
18815 } else {
18816 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18817 }
18818 }
18819
18820 6 => {
18821 if let Some(children) = &mut self.children {
18822 ::fidl_next::WireEnvelope::encode_value(
18823 children,
18824 preallocated.encoder,
18825 &mut out,
18826 )?;
18827 } else {
18828 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18829 }
18830 }
18831
18832 5 => {
18833 if let Some(capabilities) = &mut self.capabilities {
18834 ::fidl_next::WireEnvelope::encode_value(
18835 capabilities,
18836 preallocated.encoder,
18837 &mut out,
18838 )?;
18839 } else {
18840 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18841 }
18842 }
18843
18844 4 => {
18845 if let Some(offers) = &mut self.offers {
18846 ::fidl_next::WireEnvelope::encode_value(
18847 offers,
18848 preallocated.encoder,
18849 &mut out,
18850 )?;
18851 } else {
18852 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18853 }
18854 }
18855
18856 3 => {
18857 if let Some(exposes) = &mut self.exposes {
18858 ::fidl_next::WireEnvelope::encode_value(
18859 exposes,
18860 preallocated.encoder,
18861 &mut out,
18862 )?;
18863 } else {
18864 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18865 }
18866 }
18867
18868 2 => {
18869 if let Some(uses) = &mut self.uses {
18870 ::fidl_next::WireEnvelope::encode_value(
18871 uses,
18872 preallocated.encoder,
18873 &mut out,
18874 )?;
18875 } else {
18876 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18877 }
18878 }
18879
18880 1 => {
18881 if let Some(program) = &mut self.program {
18882 ::fidl_next::WireEnvelope::encode_value(
18883 program,
18884 preallocated.encoder,
18885 &mut out,
18886 )?;
18887 } else {
18888 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18889 }
18890 }
18891
18892 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18893 }
18894 unsafe {
18895 preallocated.write_next(out.assume_init_ref());
18896 }
18897 }
18898
18899 ::fidl_next::WireTable::encode_len(table, max_ord);
18900
18901 Ok(())
18902 }
18903}
18904
18905impl ::fidl_next::TakeFrom<WireComponent> for Component {
18906 #[inline]
18907 fn take_from(from: &WireComponent) -> Self {
18908 Self {
18909 program: from.program().map(::fidl_next::TakeFrom::take_from),
18910
18911 uses: from.uses().map(::fidl_next::TakeFrom::take_from),
18912
18913 exposes: from.exposes().map(::fidl_next::TakeFrom::take_from),
18914
18915 offers: from.offers().map(::fidl_next::TakeFrom::take_from),
18916
18917 capabilities: from.capabilities().map(::fidl_next::TakeFrom::take_from),
18918
18919 children: from.children().map(::fidl_next::TakeFrom::take_from),
18920
18921 collections: from.collections().map(::fidl_next::TakeFrom::take_from),
18922
18923 environments: from.environments().map(::fidl_next::TakeFrom::take_from),
18924
18925 facets: from.facets().map(::fidl_next::TakeFrom::take_from),
18926
18927 config: from.config().map(::fidl_next::TakeFrom::take_from),
18928 }
18929 }
18930}
18931
18932#[repr(C)]
18934pub struct WireComponent {
18935 table: ::fidl_next::WireTable,
18936}
18937
18938unsafe impl ::fidl_next::ZeroPadding for WireComponent {
18939 #[inline]
18940 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
18941 ::fidl_next::munge!(let Self { table } = out);
18942 ::fidl_next::WireTable::zero_padding(table);
18943 }
18944}
18945
18946unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponent
18947where
18948 ___D: ::fidl_next::Decoder + ?Sized,
18949{
18950 fn decode(
18951 slot: ::fidl_next::Slot<'_, Self>,
18952 decoder: &mut ___D,
18953 ) -> Result<(), ::fidl_next::DecodeError> {
18954 ::fidl_next::munge!(let Self { table } = slot);
18955
18956 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
18957 match ordinal {
18958 0 => unsafe { ::core::hint::unreachable_unchecked() },
18959
18960 1 => {
18961 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireProgram>(
18962 slot.as_mut(),
18963 decoder,
18964 )?;
18965
18966 Ok(())
18967 }
18968
18969 2 => {
18970 ::fidl_next::WireEnvelope::decode_as::<
18971 ___D,
18972 ::fidl_next::WireVector<crate::WireUse>,
18973 >(slot.as_mut(), decoder)?;
18974
18975 Ok(())
18976 }
18977
18978 3 => {
18979 ::fidl_next::WireEnvelope::decode_as::<
18980 ___D,
18981 ::fidl_next::WireVector<crate::WireExpose>,
18982 >(slot.as_mut(), decoder)?;
18983
18984 Ok(())
18985 }
18986
18987 4 => {
18988 ::fidl_next::WireEnvelope::decode_as::<
18989 ___D,
18990 ::fidl_next::WireVector<crate::WireOffer>,
18991 >(slot.as_mut(), decoder)?;
18992
18993 Ok(())
18994 }
18995
18996 5 => {
18997 ::fidl_next::WireEnvelope::decode_as::<
18998 ___D,
18999 ::fidl_next::WireVector<crate::WireCapability>,
19000 >(slot.as_mut(), decoder)?;
19001
19002 Ok(())
19003 }
19004
19005 6 => {
19006 ::fidl_next::WireEnvelope::decode_as::<
19007 ___D,
19008 ::fidl_next::WireVector<crate::WireChild>,
19009 >(slot.as_mut(), decoder)?;
19010
19011 Ok(())
19012 }
19013
19014 7 => {
19015 ::fidl_next::WireEnvelope::decode_as::<
19016 ___D,
19017 ::fidl_next::WireVector<crate::WireCollection>,
19018 >(slot.as_mut(), decoder)?;
19019
19020 Ok(())
19021 }
19022
19023 8 => {
19024 ::fidl_next::WireEnvelope::decode_as::<
19025 ___D,
19026 ::fidl_next::WireVector<crate::WireEnvironment>,
19027 >(slot.as_mut(), decoder)?;
19028
19029 Ok(())
19030 }
19031
19032 9 => {
19033 ::fidl_next::WireEnvelope::decode_as::<
19034 ___D,
19035 ::fidl_next_fuchsia_data::WireDictionary,
19036 >(slot.as_mut(), decoder)?;
19037
19038 Ok(())
19039 }
19040
19041 10 => {
19042 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigSchema>(
19043 slot.as_mut(),
19044 decoder,
19045 )?;
19046
19047 Ok(())
19048 }
19049
19050 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
19051 }
19052 })
19053 }
19054}
19055
19056impl WireComponent {
19057 pub fn program(&self) -> Option<&crate::WireProgram> {
19058 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
19059 }
19060
19061 pub fn uses(&self) -> Option<&::fidl_next::WireVector<crate::WireUse>> {
19062 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
19063 }
19064
19065 pub fn exposes(&self) -> Option<&::fidl_next::WireVector<crate::WireExpose>> {
19066 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
19067 }
19068
19069 pub fn offers(&self) -> Option<&::fidl_next::WireVector<crate::WireOffer>> {
19070 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
19071 }
19072
19073 pub fn capabilities(&self) -> Option<&::fidl_next::WireVector<crate::WireCapability>> {
19074 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
19075 }
19076
19077 pub fn children(&self) -> Option<&::fidl_next::WireVector<crate::WireChild>> {
19078 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
19079 }
19080
19081 pub fn collections(&self) -> Option<&::fidl_next::WireVector<crate::WireCollection>> {
19082 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
19083 }
19084
19085 pub fn environments(&self) -> Option<&::fidl_next::WireVector<crate::WireEnvironment>> {
19086 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
19087 }
19088
19089 pub fn facets(&self) -> Option<&::fidl_next_fuchsia_data::WireDictionary> {
19090 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
19091 }
19092
19093 pub fn config(&self) -> Option<&crate::WireConfigSchema> {
19094 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
19095 }
19096}
19097
19098impl ::core::fmt::Debug for WireComponent {
19099 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
19100 f.debug_struct("Component")
19101 .field("program", &self.program())
19102 .field("uses", &self.uses())
19103 .field("exposes", &self.exposes())
19104 .field("offers", &self.offers())
19105 .field("capabilities", &self.capabilities())
19106 .field("children", &self.children())
19107 .field("collections", &self.collections())
19108 .field("environments", &self.environments())
19109 .field("facets", &self.facets())
19110 .field("config", &self.config())
19111 .finish()
19112 }
19113}
19114
19115#[doc = " An individual configuration value. It is matched against a specific configuration field based\n on its offset within `ValuesData.values`.\n"]
19116#[derive(Clone, Debug)]
19117pub struct ConfigValueSpec {
19118 pub value: Option<crate::ConfigValue>,
19119}
19120
19121impl ConfigValueSpec {
19122 fn __max_ordinal(&self) -> usize {
19123 if self.value.is_some() {
19124 return 1;
19125 }
19126
19127 0
19128 }
19129}
19130
19131impl ::fidl_next::Encodable for ConfigValueSpec {
19132 type Encoded = WireConfigValueSpec;
19133}
19134
19135unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigValueSpec
19136where
19137 ___E: ::fidl_next::Encoder + ?Sized,
19138{
19139 #[inline]
19140 fn encode(
19141 &mut self,
19142 encoder: &mut ___E,
19143 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19144 ) -> Result<(), ::fidl_next::EncodeError> {
19145 ::fidl_next::munge!(let WireConfigValueSpec { table } = out);
19146
19147 let max_ord = self.__max_ordinal();
19148
19149 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
19150 ::fidl_next::ZeroPadding::zero_padding(&mut out);
19151
19152 let mut preallocated =
19153 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
19154
19155 for i in 1..=max_ord {
19156 match i {
19157 1 => {
19158 if let Some(value) = &mut self.value {
19159 ::fidl_next::WireEnvelope::encode_value(
19160 value,
19161 preallocated.encoder,
19162 &mut out,
19163 )?;
19164 } else {
19165 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19166 }
19167 }
19168
19169 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
19170 }
19171 unsafe {
19172 preallocated.write_next(out.assume_init_ref());
19173 }
19174 }
19175
19176 ::fidl_next::WireTable::encode_len(table, max_ord);
19177
19178 Ok(())
19179 }
19180}
19181
19182impl ::fidl_next::TakeFrom<WireConfigValueSpec> for ConfigValueSpec {
19183 #[inline]
19184 fn take_from(from: &WireConfigValueSpec) -> Self {
19185 Self { value: from.value().map(::fidl_next::TakeFrom::take_from) }
19186 }
19187}
19188
19189#[repr(C)]
19191pub struct WireConfigValueSpec {
19192 table: ::fidl_next::WireTable,
19193}
19194
19195unsafe impl ::fidl_next::ZeroPadding for WireConfigValueSpec {
19196 #[inline]
19197 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
19198 ::fidl_next::munge!(let Self { table } = out);
19199 ::fidl_next::WireTable::zero_padding(table);
19200 }
19201}
19202
19203unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigValueSpec
19204where
19205 ___D: ::fidl_next::Decoder + ?Sized,
19206{
19207 fn decode(
19208 slot: ::fidl_next::Slot<'_, Self>,
19209 decoder: &mut ___D,
19210 ) -> Result<(), ::fidl_next::DecodeError> {
19211 ::fidl_next::munge!(let Self { table } = slot);
19212
19213 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
19214 match ordinal {
19215 0 => unsafe { ::core::hint::unreachable_unchecked() },
19216
19217 1 => {
19218 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigValue>(
19219 slot.as_mut(),
19220 decoder,
19221 )?;
19222
19223 Ok(())
19224 }
19225
19226 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
19227 }
19228 })
19229 }
19230}
19231
19232impl WireConfigValueSpec {
19233 pub fn value(&self) -> Option<&crate::WireConfigValue> {
19234 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
19235 }
19236}
19237
19238impl ::core::fmt::Debug for WireConfigValueSpec {
19239 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
19240 f.debug_struct("ConfigValueSpec").field("value", &self.value()).finish()
19241 }
19242}
19243
19244#[doc = " Contents of the configuration value file. Defines the base values for a component\'s config.\n"]
19245#[derive(Clone, Debug)]
19246pub struct ConfigValuesData {
19247 pub values: Option<Vec<crate::ConfigValueSpec>>,
19248
19249 pub checksum: Option<crate::ConfigChecksum>,
19250}
19251
19252impl ConfigValuesData {
19253 fn __max_ordinal(&self) -> usize {
19254 if self.values.is_some() {
19255 return 1;
19256 }
19257
19258 if self.checksum.is_some() {
19259 return 2;
19260 }
19261
19262 0
19263 }
19264}
19265
19266impl ::fidl_next::Encodable for ConfigValuesData {
19267 type Encoded = WireConfigValuesData;
19268}
19269
19270unsafe impl<___E> ::fidl_next::Encode<___E> for ConfigValuesData
19271where
19272 ___E: ::fidl_next::Encoder + ?Sized,
19273{
19274 #[inline]
19275 fn encode(
19276 &mut self,
19277 encoder: &mut ___E,
19278 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19279 ) -> Result<(), ::fidl_next::EncodeError> {
19280 ::fidl_next::munge!(let WireConfigValuesData { table } = out);
19281
19282 let max_ord = self.__max_ordinal();
19283
19284 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
19285 ::fidl_next::ZeroPadding::zero_padding(&mut out);
19286
19287 let mut preallocated =
19288 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
19289
19290 for i in 1..=max_ord {
19291 match i {
19292 2 => {
19293 if let Some(checksum) = &mut self.checksum {
19294 ::fidl_next::WireEnvelope::encode_value(
19295 checksum,
19296 preallocated.encoder,
19297 &mut out,
19298 )?;
19299 } else {
19300 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19301 }
19302 }
19303
19304 1 => {
19305 if let Some(values) = &mut self.values {
19306 ::fidl_next::WireEnvelope::encode_value(
19307 values,
19308 preallocated.encoder,
19309 &mut out,
19310 )?;
19311 } else {
19312 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19313 }
19314 }
19315
19316 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
19317 }
19318 unsafe {
19319 preallocated.write_next(out.assume_init_ref());
19320 }
19321 }
19322
19323 ::fidl_next::WireTable::encode_len(table, max_ord);
19324
19325 Ok(())
19326 }
19327}
19328
19329impl ::fidl_next::TakeFrom<WireConfigValuesData> for ConfigValuesData {
19330 #[inline]
19331 fn take_from(from: &WireConfigValuesData) -> Self {
19332 Self {
19333 values: from.values().map(::fidl_next::TakeFrom::take_from),
19334
19335 checksum: from.checksum().map(::fidl_next::TakeFrom::take_from),
19336 }
19337 }
19338}
19339
19340#[repr(C)]
19342pub struct WireConfigValuesData {
19343 table: ::fidl_next::WireTable,
19344}
19345
19346unsafe impl ::fidl_next::ZeroPadding for WireConfigValuesData {
19347 #[inline]
19348 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
19349 ::fidl_next::munge!(let Self { table } = out);
19350 ::fidl_next::WireTable::zero_padding(table);
19351 }
19352}
19353
19354unsafe impl<___D> ::fidl_next::Decode<___D> for WireConfigValuesData
19355where
19356 ___D: ::fidl_next::Decoder + ?Sized,
19357{
19358 fn decode(
19359 slot: ::fidl_next::Slot<'_, Self>,
19360 decoder: &mut ___D,
19361 ) -> Result<(), ::fidl_next::DecodeError> {
19362 ::fidl_next::munge!(let Self { table } = slot);
19363
19364 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
19365 match ordinal {
19366 0 => unsafe { ::core::hint::unreachable_unchecked() },
19367
19368 1 => {
19369 ::fidl_next::WireEnvelope::decode_as::<
19370 ___D,
19371 ::fidl_next::WireVector<crate::WireConfigValueSpec>,
19372 >(slot.as_mut(), decoder)?;
19373
19374 Ok(())
19375 }
19376
19377 2 => {
19378 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConfigChecksum>(
19379 slot.as_mut(),
19380 decoder,
19381 )?;
19382
19383 Ok(())
19384 }
19385
19386 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
19387 }
19388 })
19389 }
19390}
19391
19392impl WireConfigValuesData {
19393 pub fn values(&self) -> Option<&::fidl_next::WireVector<crate::WireConfigValueSpec>> {
19394 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
19395 }
19396
19397 pub fn checksum(&self) -> Option<&crate::WireConfigChecksum> {
19398 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
19399 }
19400}
19401
19402impl ::core::fmt::Debug for WireConfigValuesData {
19403 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
19404 f.debug_struct("ConfigValuesData")
19405 .field("values", &self.values())
19406 .field("checksum", &self.checksum())
19407 .finish()
19408 }
19409}
19410
19411#[doc = " Indicates the event name to subscribe to with a given event mode.\n"]
19412#[derive(Clone, Debug)]
19413pub struct EventSubscription {
19414 pub event_name: Option<String>,
19415}
19416
19417impl EventSubscription {
19418 fn __max_ordinal(&self) -> usize {
19419 if self.event_name.is_some() {
19420 return 1;
19421 }
19422
19423 0
19424 }
19425}
19426
19427impl ::fidl_next::Encodable for EventSubscription {
19428 type Encoded = WireEventSubscription;
19429}
19430
19431unsafe impl<___E> ::fidl_next::Encode<___E> for EventSubscription
19432where
19433 ___E: ::fidl_next::Encoder + ?Sized,
19434{
19435 #[inline]
19436 fn encode(
19437 &mut self,
19438 encoder: &mut ___E,
19439 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19440 ) -> Result<(), ::fidl_next::EncodeError> {
19441 ::fidl_next::munge!(let WireEventSubscription { table } = out);
19442
19443 let max_ord = self.__max_ordinal();
19444
19445 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
19446 ::fidl_next::ZeroPadding::zero_padding(&mut out);
19447
19448 let mut preallocated =
19449 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
19450
19451 for i in 1..=max_ord {
19452 match i {
19453 1 => {
19454 if let Some(event_name) = &mut self.event_name {
19455 ::fidl_next::WireEnvelope::encode_value(
19456 event_name,
19457 preallocated.encoder,
19458 &mut out,
19459 )?;
19460 } else {
19461 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19462 }
19463 }
19464
19465 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
19466 }
19467 unsafe {
19468 preallocated.write_next(out.assume_init_ref());
19469 }
19470 }
19471
19472 ::fidl_next::WireTable::encode_len(table, max_ord);
19473
19474 Ok(())
19475 }
19476}
19477
19478impl ::fidl_next::TakeFrom<WireEventSubscription> for EventSubscription {
19479 #[inline]
19480 fn take_from(from: &WireEventSubscription) -> Self {
19481 Self { event_name: from.event_name().map(::fidl_next::TakeFrom::take_from) }
19482 }
19483}
19484
19485#[repr(C)]
19487pub struct WireEventSubscription {
19488 table: ::fidl_next::WireTable,
19489}
19490
19491unsafe impl ::fidl_next::ZeroPadding for WireEventSubscription {
19492 #[inline]
19493 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
19494 ::fidl_next::munge!(let Self { table } = out);
19495 ::fidl_next::WireTable::zero_padding(table);
19496 }
19497}
19498
19499unsafe impl<___D> ::fidl_next::Decode<___D> for WireEventSubscription
19500where
19501 ___D: ::fidl_next::Decoder + ?Sized,
19502{
19503 fn decode(
19504 slot: ::fidl_next::Slot<'_, Self>,
19505 decoder: &mut ___D,
19506 ) -> Result<(), ::fidl_next::DecodeError> {
19507 ::fidl_next::munge!(let Self { table } = slot);
19508
19509 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
19510 match ordinal {
19511 0 => unsafe { ::core::hint::unreachable_unchecked() },
19512
19513 1 => {
19514 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
19515 slot.as_mut(),
19516 decoder,
19517 )?;
19518
19519 let event_name = unsafe {
19520 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
19521 };
19522
19523 if event_name.len() > 100 {
19524 return Err(::fidl_next::DecodeError::VectorTooLong {
19525 size: event_name.len() as u64,
19526 limit: 100,
19527 });
19528 }
19529
19530 Ok(())
19531 }
19532
19533 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
19534 }
19535 })
19536 }
19537}
19538
19539impl WireEventSubscription {
19540 pub fn event_name(&self) -> Option<&::fidl_next::WireString> {
19541 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
19542 }
19543}
19544
19545impl ::core::fmt::Debug for WireEventSubscription {
19546 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
19547 f.debug_struct("EventSubscription").field("event_name", &self.event_name()).finish()
19548 }
19549}
19550
19551#[derive(Clone, Debug)]
19552pub enum LayoutParameter {
19553 NestedType(crate::ConfigType),
19554
19555 UnknownOrdinal_(u64),
19556}
19557
19558impl ::fidl_next::Encodable for LayoutParameter {
19559 type Encoded = WireLayoutParameter;
19560}
19561
19562unsafe impl<___E> ::fidl_next::Encode<___E> for LayoutParameter
19563where
19564 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19565
19566 ___E: ::fidl_next::Encoder,
19567{
19568 #[inline]
19569 fn encode(
19570 &mut self,
19571 encoder: &mut ___E,
19572 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19573 ) -> Result<(), ::fidl_next::EncodeError> {
19574 ::fidl_next::munge!(let WireLayoutParameter { raw } = out);
19575
19576 match self {
19577 Self::NestedType(value) => ::fidl_next::RawWireUnion::encode_as::<
19578 ___E,
19579 crate::ConfigType,
19580 >(value, 1, encoder, raw)?,
19581
19582 Self::UnknownOrdinal_(ordinal) => {
19583 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize))
19584 }
19585 }
19586
19587 Ok(())
19588 }
19589}
19590
19591impl ::fidl_next::EncodableOption for Box<LayoutParameter> {
19592 type EncodedOption = WireOptionalLayoutParameter;
19593}
19594
19595unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<LayoutParameter>
19596where
19597 ___E: ?Sized,
19598 LayoutParameter: ::fidl_next::Encode<___E>,
19599{
19600 #[inline]
19601 fn encode_option(
19602 this: Option<&mut Self>,
19603 encoder: &mut ___E,
19604 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19605 ) -> Result<(), ::fidl_next::EncodeError> {
19606 ::fidl_next::munge!(let WireOptionalLayoutParameter { raw } = &mut *out);
19607
19608 if let Some(inner) = this {
19609 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
19610 ::fidl_next::Encode::encode(&mut **inner, encoder, value_out)?;
19611 } else {
19612 ::fidl_next::RawWireUnion::encode_absent(raw);
19613 }
19614
19615 Ok(())
19616 }
19617}
19618
19619impl ::fidl_next::TakeFrom<WireLayoutParameter> for LayoutParameter {
19620 #[inline]
19621 fn take_from(from: &WireLayoutParameter) -> Self {
19622 match from.raw.ordinal() {
19623 1 => Self::NestedType(::fidl_next::TakeFrom::take_from(unsafe {
19624 from.raw.get().deref_unchecked::<crate::WireConfigType>()
19625 })),
19626
19627 _ => unsafe { ::core::hint::unreachable_unchecked() },
19628 }
19629 }
19630}
19631
19632impl ::fidl_next::TakeFrom<WireOptionalLayoutParameter> for Option<Box<LayoutParameter>> {
19633 #[inline]
19634 fn take_from(from: &WireOptionalLayoutParameter) -> Self {
19635 if let Some(inner) = from.as_ref() {
19636 Some(::fidl_next::TakeFrom::take_from(inner))
19637 } else {
19638 None
19639 }
19640 }
19641}
19642
19643#[repr(transparent)]
19645pub struct WireLayoutParameter {
19646 raw: ::fidl_next::RawWireUnion,
19647}
19648
19649unsafe impl ::fidl_next::ZeroPadding for WireLayoutParameter {
19650 #[inline]
19651 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
19652 ::fidl_next::munge!(let Self { raw } = out);
19653 ::fidl_next::RawWireUnion::zero_padding(raw);
19654 }
19655}
19656
19657pub mod layout_parameter {
19658 pub enum Ref<'union> {
19659 NestedType(&'union crate::WireConfigType),
19660
19661 UnknownOrdinal_(u64),
19662 }
19663}
19664
19665impl WireLayoutParameter {
19666 pub fn as_ref(&self) -> crate::layout_parameter::Ref<'_> {
19667 match self.raw.ordinal() {
19668 1 => crate::layout_parameter::Ref::NestedType(unsafe {
19669 self.raw.get().deref_unchecked::<crate::WireConfigType>()
19670 }),
19671
19672 unknown => crate::layout_parameter::Ref::UnknownOrdinal_(unknown),
19673 }
19674 }
19675}
19676
19677unsafe impl<___D> ::fidl_next::Decode<___D> for WireLayoutParameter
19678where
19679 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
19680
19681 ___D: ::fidl_next::Decoder,
19682{
19683 fn decode(
19684 mut slot: ::fidl_next::Slot<'_, Self>,
19685 decoder: &mut ___D,
19686 ) -> Result<(), ::fidl_next::DecodeError> {
19687 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
19688 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
19689 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigType>(raw, decoder)?,
19690
19691 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
19692 }
19693
19694 Ok(())
19695 }
19696}
19697
19698impl ::core::fmt::Debug for WireLayoutParameter {
19699 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
19700 match self.raw.ordinal() {
19701 1 => unsafe { self.raw.get().deref_unchecked::<crate::WireConfigType>().fmt(f) },
19702 _ => unsafe { ::core::hint::unreachable_unchecked() },
19703 }
19704 }
19705}
19706
19707#[repr(transparent)]
19708pub struct WireOptionalLayoutParameter {
19709 raw: ::fidl_next::RawWireUnion,
19710}
19711
19712unsafe impl ::fidl_next::ZeroPadding for WireOptionalLayoutParameter {
19713 #[inline]
19714 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
19715 ::fidl_next::munge!(let Self { raw } = out);
19716 ::fidl_next::RawWireUnion::zero_padding(raw);
19717 }
19718}
19719
19720impl WireOptionalLayoutParameter {
19721 pub fn is_some(&self) -> bool {
19722 self.raw.is_some()
19723 }
19724
19725 pub fn is_none(&self) -> bool {
19726 self.raw.is_none()
19727 }
19728
19729 pub fn as_ref(&self) -> Option<&WireLayoutParameter> {
19730 if self.is_some() {
19731 Some(unsafe { &*(self as *const Self).cast() })
19732 } else {
19733 None
19734 }
19735 }
19736}
19737
19738unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalLayoutParameter
19739where
19740 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
19741
19742 ___D: ::fidl_next::Decoder,
19743{
19744 fn decode(
19745 mut slot: ::fidl_next::Slot<'_, Self>,
19746 decoder: &mut ___D,
19747 ) -> Result<(), ::fidl_next::DecodeError> {
19748 ::fidl_next::munge!(let Self { mut raw } = slot.as_mut());
19749 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
19750 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireConfigType>(raw, decoder)?,
19751
19752 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
19753 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
19754 }
19755
19756 Ok(())
19757 }
19758}
19759
19760impl ::core::fmt::Debug for WireOptionalLayoutParameter {
19761 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
19762 self.as_ref().fmt(f)
19763 }
19764}
19765
19766pub const MAX_MONIKER_LENGTH: u32 = 4096;
19767
19768#[doc = " The maximum number of EventSubscriptions in an EventStream.\n"]
19769pub const MAX_NUM_EVENT_STREAM_SUBSCRIPTIONS: u64 = 100;
19770
19771#[derive(Clone, Debug)]
19772pub struct ResolvedConfigField {
19773 pub key: String,
19774
19775 pub value: crate::ConfigValue,
19776}
19777
19778impl ::fidl_next::Encodable for ResolvedConfigField {
19779 type Encoded = WireResolvedConfigField;
19780}
19781
19782unsafe impl<___E> ::fidl_next::Encode<___E> for ResolvedConfigField
19783where
19784 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19785
19786 ___E: ::fidl_next::Encoder,
19787{
19788 #[inline]
19789 fn encode(
19790 &mut self,
19791 encoder: &mut ___E,
19792 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19793 ) -> Result<(), ::fidl_next::EncodeError> {
19794 ::fidl_next::munge! {
19795 let Self::Encoded {
19796 key,
19797 value,
19798
19799 } = out;
19800 }
19801
19802 ::fidl_next::Encode::encode(&mut self.key, encoder, key)?;
19803
19804 ::fidl_next::Encode::encode(&mut self.value, encoder, value)?;
19805
19806 Ok(())
19807 }
19808}
19809
19810impl ::fidl_next::EncodableOption for Box<ResolvedConfigField> {
19811 type EncodedOption = ::fidl_next::WireBox<WireResolvedConfigField>;
19812}
19813
19814unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ResolvedConfigField>
19815where
19816 ___E: ::fidl_next::Encoder + ?Sized,
19817 ResolvedConfigField: ::fidl_next::Encode<___E>,
19818{
19819 #[inline]
19820 fn encode_option(
19821 this: Option<&mut Self>,
19822 encoder: &mut ___E,
19823 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19824 ) -> Result<(), ::fidl_next::EncodeError> {
19825 if let Some(inner) = this {
19826 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19827 ::fidl_next::WireBox::encode_present(out);
19828 } else {
19829 ::fidl_next::WireBox::encode_absent(out);
19830 }
19831
19832 Ok(())
19833 }
19834}
19835
19836impl ::fidl_next::TakeFrom<WireResolvedConfigField> for ResolvedConfigField {
19837 #[inline]
19838 fn take_from(from: &WireResolvedConfigField) -> Self {
19839 Self {
19840 key: ::fidl_next::TakeFrom::take_from(&from.key),
19841
19842 value: ::fidl_next::TakeFrom::take_from(&from.value),
19843 }
19844 }
19845}
19846
19847#[derive(Debug)]
19849#[repr(C)]
19850pub struct WireResolvedConfigField {
19851 pub key: ::fidl_next::WireString,
19852
19853 pub value: crate::WireConfigValue,
19854}
19855
19856unsafe impl ::fidl_next::ZeroPadding for WireResolvedConfigField {
19857 #[inline]
19858 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
19859}
19860
19861unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolvedConfigField
19862where
19863 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
19864
19865 ___D: ::fidl_next::Decoder,
19866{
19867 fn decode(
19868 slot: ::fidl_next::Slot<'_, Self>,
19869 decoder: &mut ___D,
19870 ) -> Result<(), ::fidl_next::DecodeError> {
19871 ::fidl_next::munge! {
19872 let Self {
19873 mut key,
19874 mut value,
19875
19876 } = slot;
19877 }
19878
19879 ::fidl_next::Decode::decode(key.as_mut(), decoder)?;
19880
19881 ::fidl_next::Decode::decode(value.as_mut(), decoder)?;
19882
19883 Ok(())
19884 }
19885}
19886
19887#[doc = " A configuration that has been completely resolved by component manager.\n"]
19888#[derive(Clone, Debug)]
19889pub struct ResolvedConfig {
19890 pub fields: Vec<crate::ResolvedConfigField>,
19891
19892 pub checksum: crate::ConfigChecksum,
19893}
19894
19895impl ::fidl_next::Encodable for ResolvedConfig {
19896 type Encoded = WireResolvedConfig;
19897}
19898
19899unsafe impl<___E> ::fidl_next::Encode<___E> for ResolvedConfig
19900where
19901 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19902
19903 ___E: ::fidl_next::Encoder,
19904{
19905 #[inline]
19906 fn encode(
19907 &mut self,
19908 encoder: &mut ___E,
19909 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
19910 ) -> Result<(), ::fidl_next::EncodeError> {
19911 ::fidl_next::munge! {
19912 let Self::Encoded {
19913 fields,
19914 checksum,
19915
19916 } = out;
19917 }
19918
19919 ::fidl_next::Encode::encode(&mut self.fields, encoder, fields)?;
19920
19921 ::fidl_next::Encode::encode(&mut self.checksum, encoder, checksum)?;
19922
19923 Ok(())
19924 }
19925}
19926
19927impl ::fidl_next::EncodableOption for Box<ResolvedConfig> {
19928 type EncodedOption = ::fidl_next::WireBox<WireResolvedConfig>;
19929}
19930
19931unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ResolvedConfig>
19932where
19933 ___E: ::fidl_next::Encoder + ?Sized,
19934 ResolvedConfig: ::fidl_next::Encode<___E>,
19935{
19936 #[inline]
19937 fn encode_option(
19938 this: Option<&mut Self>,
19939 encoder: &mut ___E,
19940 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
19941 ) -> Result<(), ::fidl_next::EncodeError> {
19942 if let Some(inner) = this {
19943 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
19944 ::fidl_next::WireBox::encode_present(out);
19945 } else {
19946 ::fidl_next::WireBox::encode_absent(out);
19947 }
19948
19949 Ok(())
19950 }
19951}
19952
19953impl ::fidl_next::TakeFrom<WireResolvedConfig> for ResolvedConfig {
19954 #[inline]
19955 fn take_from(from: &WireResolvedConfig) -> Self {
19956 Self {
19957 fields: ::fidl_next::TakeFrom::take_from(&from.fields),
19958
19959 checksum: ::fidl_next::TakeFrom::take_from(&from.checksum),
19960 }
19961 }
19962}
19963
19964#[derive(Debug)]
19966#[repr(C)]
19967pub struct WireResolvedConfig {
19968 pub fields: ::fidl_next::WireVector<crate::WireResolvedConfigField>,
19969
19970 pub checksum: crate::WireConfigChecksum,
19971}
19972
19973unsafe impl ::fidl_next::ZeroPadding for WireResolvedConfig {
19974 #[inline]
19975 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
19976}
19977
19978unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolvedConfig
19979where
19980 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
19981
19982 ___D: ::fidl_next::Decoder,
19983{
19984 fn decode(
19985 slot: ::fidl_next::Slot<'_, Self>,
19986 decoder: &mut ___D,
19987 ) -> Result<(), ::fidl_next::DecodeError> {
19988 ::fidl_next::munge! {
19989 let Self {
19990 mut fields,
19991 mut checksum,
19992
19993 } = slot;
19994 }
19995
19996 ::fidl_next::Decode::decode(fields.as_mut(), decoder)?;
19997
19998 ::fidl_next::Decode::decode(checksum.as_mut(), decoder)?;
19999
20000 Ok(())
20001 }
20002}
20003
20004pub mod compat {
20006
20007 impl ::fidl_next::TakeFrom<crate::WireAllowedOffers>
20008 for ::fidl_fuchsia_component_decl::AllowedOffers
20009 {
20010 #[inline]
20011 fn take_from(from: &crate::WireAllowedOffers) -> Self {
20012 match crate::AllowedOffers::from(*from) {
20013 crate::AllowedOffers::StaticOnly => Self::StaticOnly,
20014
20015 crate::AllowedOffers::StaticAndDynamic => Self::StaticAndDynamic,
20016 }
20017 }
20018 }
20019
20020 impl ::fidl_next::TakeFrom<crate::WireAvailability>
20021 for ::fidl_fuchsia_component_decl::Availability
20022 {
20023 #[inline]
20024 fn take_from(from: &crate::WireAvailability) -> Self {
20025 match crate::Availability::from(*from) {
20026 crate::Availability::Required => Self::Required,
20027
20028 crate::Availability::Optional => Self::Optional,
20029
20030 crate::Availability::SameAsTarget => Self::SameAsTarget,
20031
20032 crate::Availability::Transitional => Self::Transitional,
20033 }
20034 }
20035 }
20036
20037 impl ::fidl_next::TakeFrom<crate::WireService> for ::fidl_fuchsia_component_decl::Service {
20038 #[inline]
20039 fn take_from(from: &crate::WireService) -> Self {
20040 Self {
20041 name: from.name().map(::fidl_next::TakeFrom::take_from),
20042
20043 source_path: from.source_path().map(::fidl_next::TakeFrom::take_from),
20044
20045 __source_breaking: ::fidl::marker::SourceBreaking,
20046 }
20047 }
20048 }
20049
20050 impl ::fidl_next::TakeFrom<crate::WireDirectory> for ::fidl_fuchsia_component_decl::Directory {
20051 #[inline]
20052 fn take_from(from: &crate::WireDirectory) -> Self {
20053 Self {
20054 name: from.name().map(::fidl_next::TakeFrom::take_from),
20055
20056 source_path: from.source_path().map(::fidl_next::TakeFrom::take_from),
20057
20058 rights: from.rights().map(::fidl_next::TakeFrom::take_from),
20059
20060 __source_breaking: ::fidl::marker::SourceBreaking,
20061 }
20062 }
20063 }
20064
20065 impl ::fidl_next::TakeFrom<crate::WireParentRef> for ::fidl_fuchsia_component_decl::ParentRef {
20066 #[inline]
20067 fn take_from(from: &crate::WireParentRef) -> Self {
20068 Self {}
20069 }
20070 }
20071
20072 impl ::fidl_next::TakeFrom<crate::WireSelfRef> for ::fidl_fuchsia_component_decl::SelfRef {
20073 #[inline]
20074 fn take_from(from: &crate::WireSelfRef) -> Self {
20075 Self {}
20076 }
20077 }
20078
20079 impl ::fidl_next::TakeFrom<crate::WireChildRef> for ::fidl_fuchsia_component_decl::ChildRef {
20080 #[inline]
20081 fn take_from(from: &crate::WireChildRef) -> Self {
20082 Self {
20083 name: ::fidl_next::TakeFrom::take_from(&from.name),
20084
20085 collection: ::fidl_next::TakeFrom::take_from(&from.collection),
20086 }
20087 }
20088 }
20089
20090 impl ::fidl_next::TakeFrom<crate::WireCollectionRef>
20091 for ::fidl_fuchsia_component_decl::CollectionRef
20092 {
20093 #[inline]
20094 fn take_from(from: &crate::WireCollectionRef) -> Self {
20095 Self { name: ::fidl_next::TakeFrom::take_from(&from.name) }
20096 }
20097 }
20098
20099 impl ::fidl_next::TakeFrom<crate::WireFrameworkRef>
20100 for ::fidl_fuchsia_component_decl::FrameworkRef
20101 {
20102 #[inline]
20103 fn take_from(from: &crate::WireFrameworkRef) -> Self {
20104 Self {}
20105 }
20106 }
20107
20108 impl ::fidl_next::TakeFrom<crate::WireCapabilityRef>
20109 for ::fidl_fuchsia_component_decl::CapabilityRef
20110 {
20111 #[inline]
20112 fn take_from(from: &crate::WireCapabilityRef) -> Self {
20113 Self { name: ::fidl_next::TakeFrom::take_from(&from.name) }
20114 }
20115 }
20116
20117 impl ::fidl_next::TakeFrom<crate::WireDebugRef> for ::fidl_fuchsia_component_decl::DebugRef {
20118 #[inline]
20119 fn take_from(from: &crate::WireDebugRef) -> Self {
20120 Self {}
20121 }
20122 }
20123
20124 impl ::fidl_next::TakeFrom<crate::WireVoidRef> for ::fidl_fuchsia_component_decl::VoidRef {
20125 #[inline]
20126 fn take_from(from: &crate::WireVoidRef) -> Self {
20127 Self {}
20128 }
20129 }
20130
20131 impl ::fidl_next::TakeFrom<crate::WireStorageId> for ::fidl_fuchsia_component_decl::StorageId {
20132 #[inline]
20133 fn take_from(from: &crate::WireStorageId) -> Self {
20134 match crate::StorageId::from(*from) {
20135 crate::StorageId::StaticInstanceId => Self::StaticInstanceId,
20136
20137 crate::StorageId::StaticInstanceIdOrMoniker => Self::StaticInstanceIdOrMoniker,
20138 }
20139 }
20140 }
20141
20142 impl ::fidl_next::TakeFrom<crate::WireRunner> for ::fidl_fuchsia_component_decl::Runner {
20143 #[inline]
20144 fn take_from(from: &crate::WireRunner) -> Self {
20145 Self {
20146 name: from.name().map(::fidl_next::TakeFrom::take_from),
20147
20148 source_path: from.source_path().map(::fidl_next::TakeFrom::take_from),
20149
20150 __source_breaking: ::fidl::marker::SourceBreaking,
20151 }
20152 }
20153 }
20154
20155 impl ::fidl_next::TakeFrom<crate::WireResolver> for ::fidl_fuchsia_component_decl::Resolver {
20156 #[inline]
20157 fn take_from(from: &crate::WireResolver) -> Self {
20158 Self {
20159 name: from.name().map(::fidl_next::TakeFrom::take_from),
20160
20161 source_path: from.source_path().map(::fidl_next::TakeFrom::take_from),
20162
20163 __source_breaking: ::fidl::marker::SourceBreaking,
20164 }
20165 }
20166 }
20167
20168 impl ::fidl_next::TakeFrom<crate::WireEventStream> for ::fidl_fuchsia_component_decl::EventStream {
20169 #[inline]
20170 fn take_from(from: &crate::WireEventStream) -> Self {
20171 Self {
20172 name: from.name().map(::fidl_next::TakeFrom::take_from),
20173
20174 __source_breaking: ::fidl::marker::SourceBreaking,
20175 }
20176 }
20177 }
20178
20179 impl ::fidl_next::TakeFrom<crate::WireConfigSingleValue>
20180 for ::fidl_fuchsia_component_decl::ConfigSingleValue
20181 {
20182 #[inline]
20183 fn take_from(from: &crate::WireConfigSingleValue) -> Self {
20184 match from.as_ref() {
20185 crate::config_single_value::Ref::Bool(value) => {
20186 Self::Bool(::fidl_next::TakeFrom::take_from(value))
20187 }
20188
20189 crate::config_single_value::Ref::Uint8(value) => {
20190 Self::Uint8(::fidl_next::TakeFrom::take_from(value))
20191 }
20192
20193 crate::config_single_value::Ref::Uint16(value) => {
20194 Self::Uint16(::fidl_next::TakeFrom::take_from(value))
20195 }
20196
20197 crate::config_single_value::Ref::Uint32(value) => {
20198 Self::Uint32(::fidl_next::TakeFrom::take_from(value))
20199 }
20200
20201 crate::config_single_value::Ref::Uint64(value) => {
20202 Self::Uint64(::fidl_next::TakeFrom::take_from(value))
20203 }
20204
20205 crate::config_single_value::Ref::Int8(value) => {
20206 Self::Int8(::fidl_next::TakeFrom::take_from(value))
20207 }
20208
20209 crate::config_single_value::Ref::Int16(value) => {
20210 Self::Int16(::fidl_next::TakeFrom::take_from(value))
20211 }
20212
20213 crate::config_single_value::Ref::Int32(value) => {
20214 Self::Int32(::fidl_next::TakeFrom::take_from(value))
20215 }
20216
20217 crate::config_single_value::Ref::Int64(value) => {
20218 Self::Int64(::fidl_next::TakeFrom::take_from(value))
20219 }
20220
20221 crate::config_single_value::Ref::String(value) => {
20222 Self::String(::fidl_next::TakeFrom::take_from(value))
20223 }
20224
20225 crate::config_single_value::Ref::UnknownOrdinal_(unknown_ordinal) => {
20226 Self::__SourceBreaking { unknown_ordinal }
20227 }
20228 }
20229 }
20230 }
20231
20232 impl ::fidl_next::TakeFrom<crate::WireOptionalConfigSingleValue>
20233 for Option<Box<::fidl_fuchsia_component_decl::ConfigSingleValue>>
20234 {
20235 #[inline]
20236 fn take_from(from: &crate::WireOptionalConfigSingleValue) -> Self {
20237 if let Some(inner) = from.as_ref() {
20238 Some(::fidl_next::TakeFrom::take_from(inner))
20239 } else {
20240 None
20241 }
20242 }
20243 }
20244
20245 impl ::fidl_next::TakeFrom<crate::WireConfigVectorValue>
20246 for ::fidl_fuchsia_component_decl::ConfigVectorValue
20247 {
20248 #[inline]
20249 fn take_from(from: &crate::WireConfigVectorValue) -> Self {
20250 match from.as_ref() {
20251 crate::config_vector_value::Ref::BoolVector(value) => {
20252 Self::BoolVector(::fidl_next::TakeFrom::take_from(value))
20253 }
20254
20255 crate::config_vector_value::Ref::Uint8Vector(value) => {
20256 Self::Uint8Vector(::fidl_next::TakeFrom::take_from(value))
20257 }
20258
20259 crate::config_vector_value::Ref::Uint16Vector(value) => {
20260 Self::Uint16Vector(::fidl_next::TakeFrom::take_from(value))
20261 }
20262
20263 crate::config_vector_value::Ref::Uint32Vector(value) => {
20264 Self::Uint32Vector(::fidl_next::TakeFrom::take_from(value))
20265 }
20266
20267 crate::config_vector_value::Ref::Uint64Vector(value) => {
20268 Self::Uint64Vector(::fidl_next::TakeFrom::take_from(value))
20269 }
20270
20271 crate::config_vector_value::Ref::Int8Vector(value) => {
20272 Self::Int8Vector(::fidl_next::TakeFrom::take_from(value))
20273 }
20274
20275 crate::config_vector_value::Ref::Int16Vector(value) => {
20276 Self::Int16Vector(::fidl_next::TakeFrom::take_from(value))
20277 }
20278
20279 crate::config_vector_value::Ref::Int32Vector(value) => {
20280 Self::Int32Vector(::fidl_next::TakeFrom::take_from(value))
20281 }
20282
20283 crate::config_vector_value::Ref::Int64Vector(value) => {
20284 Self::Int64Vector(::fidl_next::TakeFrom::take_from(value))
20285 }
20286
20287 crate::config_vector_value::Ref::StringVector(value) => {
20288 Self::StringVector(::fidl_next::TakeFrom::take_from(value))
20289 }
20290
20291 crate::config_vector_value::Ref::UnknownOrdinal_(unknown_ordinal) => {
20292 Self::__SourceBreaking { unknown_ordinal }
20293 }
20294 }
20295 }
20296 }
20297
20298 impl ::fidl_next::TakeFrom<crate::WireOptionalConfigVectorValue>
20299 for Option<Box<::fidl_fuchsia_component_decl::ConfigVectorValue>>
20300 {
20301 #[inline]
20302 fn take_from(from: &crate::WireOptionalConfigVectorValue) -> Self {
20303 if let Some(inner) = from.as_ref() {
20304 Some(::fidl_next::TakeFrom::take_from(inner))
20305 } else {
20306 None
20307 }
20308 }
20309 }
20310
20311 impl ::fidl_next::TakeFrom<crate::WireConfigValue> for ::fidl_fuchsia_component_decl::ConfigValue {
20312 #[inline]
20313 fn take_from(from: &crate::WireConfigValue) -> Self {
20314 match from.as_ref() {
20315 crate::config_value::Ref::Single(value) => {
20316 Self::Single(::fidl_next::TakeFrom::take_from(value))
20317 }
20318
20319 crate::config_value::Ref::Vector(value) => {
20320 Self::Vector(::fidl_next::TakeFrom::take_from(value))
20321 }
20322
20323 crate::config_value::Ref::UnknownOrdinal_(unknown_ordinal) => {
20324 Self::__SourceBreaking { unknown_ordinal }
20325 }
20326 }
20327 }
20328 }
20329
20330 impl ::fidl_next::TakeFrom<crate::WireOptionalConfigValue>
20331 for Option<Box<::fidl_fuchsia_component_decl::ConfigValue>>
20332 {
20333 #[inline]
20334 fn take_from(from: &crate::WireOptionalConfigValue) -> Self {
20335 if let Some(inner) = from.as_ref() {
20336 Some(::fidl_next::TakeFrom::take_from(inner))
20337 } else {
20338 None
20339 }
20340 }
20341 }
20342
20343 impl ::fidl_next::TakeFrom<crate::WireConfiguration>
20344 for ::fidl_fuchsia_component_decl::Configuration
20345 {
20346 #[inline]
20347 fn take_from(from: &crate::WireConfiguration) -> Self {
20348 Self {
20349 name: from.name().map(::fidl_next::TakeFrom::take_from),
20350
20351 value: from.value().map(::fidl_next::TakeFrom::take_from),
20352
20353 __source_breaking: ::fidl::marker::SourceBreaking,
20354 }
20355 }
20356 }
20357
20358 impl ::fidl_next::TakeFrom<crate::WireDeliveryType>
20359 for ::fidl_fuchsia_component_decl::DeliveryType
20360 {
20361 #[inline]
20362 fn take_from(from: &crate::WireDeliveryType) -> Self {
20363 match crate::DeliveryType::from(*from) {
20364 crate::DeliveryType::Immediate => Self::Immediate,
20365
20366 crate::DeliveryType::OnReadable => Self::OnReadable,
20367
20368 crate::DeliveryType::UnknownOrdinal_(value) => {
20369 Self::__SourceBreaking { unknown_ordinal: value }
20370 }
20371 }
20372 }
20373 }
20374
20375 impl ::fidl_next::TakeFrom<crate::WireProtocol> for ::fidl_fuchsia_component_decl::Protocol {
20376 #[inline]
20377 fn take_from(from: &crate::WireProtocol) -> Self {
20378 Self {
20379 name: from.name().map(::fidl_next::TakeFrom::take_from),
20380
20381 source_path: from.source_path().map(::fidl_next::TakeFrom::take_from),
20382
20383 delivery: from.delivery().map(::fidl_next::TakeFrom::take_from),
20384
20385 __source_breaking: ::fidl::marker::SourceBreaking,
20386 }
20387 }
20388 }
20389
20390 impl ::fidl_next::TakeFrom<crate::WireEnvironmentRef>
20391 for ::fidl_fuchsia_component_decl::EnvironmentRef
20392 {
20393 #[inline]
20394 fn take_from(from: &crate::WireEnvironmentRef) -> Self {
20395 Self {}
20396 }
20397 }
20398
20399 impl ::fidl_next::TakeFrom<crate::WireRef> for ::fidl_fuchsia_component_decl::Ref {
20400 #[inline]
20401 fn take_from(from: &crate::WireRef) -> Self {
20402 match from.as_ref() {
20403 crate::ref_::Ref::Parent(value) => {
20404 Self::Parent(::fidl_next::TakeFrom::take_from(value))
20405 }
20406
20407 crate::ref_::Ref::Self_(value) => {
20408 Self::Self_(::fidl_next::TakeFrom::take_from(value))
20409 }
20410
20411 crate::ref_::Ref::Child(value) => {
20412 Self::Child(::fidl_next::TakeFrom::take_from(value))
20413 }
20414
20415 crate::ref_::Ref::Collection(value) => {
20416 Self::Collection(::fidl_next::TakeFrom::take_from(value))
20417 }
20418
20419 crate::ref_::Ref::Framework(value) => {
20420 Self::Framework(::fidl_next::TakeFrom::take_from(value))
20421 }
20422
20423 crate::ref_::Ref::Capability(value) => {
20424 Self::Capability(::fidl_next::TakeFrom::take_from(value))
20425 }
20426
20427 crate::ref_::Ref::Debug(value) => {
20428 Self::Debug(::fidl_next::TakeFrom::take_from(value))
20429 }
20430
20431 crate::ref_::Ref::VoidType(value) => {
20432 Self::VoidType(::fidl_next::TakeFrom::take_from(value))
20433 }
20434
20435 crate::ref_::Ref::Environment(value) => {
20436 Self::Environment(::fidl_next::TakeFrom::take_from(value))
20437 }
20438
20439 crate::ref_::Ref::UnknownOrdinal_(unknown_ordinal) => {
20440 Self::__SourceBreaking { unknown_ordinal }
20441 }
20442 }
20443 }
20444 }
20445
20446 impl ::fidl_next::TakeFrom<crate::WireOptionalRef>
20447 for Option<Box<::fidl_fuchsia_component_decl::Ref>>
20448 {
20449 #[inline]
20450 fn take_from(from: &crate::WireOptionalRef) -> Self {
20451 if let Some(inner) = from.as_ref() {
20452 Some(::fidl_next::TakeFrom::take_from(inner))
20453 } else {
20454 None
20455 }
20456 }
20457 }
20458
20459 impl ::fidl_next::TakeFrom<crate::WireStorage> for ::fidl_fuchsia_component_decl::Storage {
20460 #[inline]
20461 fn take_from(from: &crate::WireStorage) -> Self {
20462 Self {
20463 name: from.name().map(::fidl_next::TakeFrom::take_from),
20464
20465 source: from.source().map(::fidl_next::TakeFrom::take_from),
20466
20467 backing_dir: from.backing_dir().map(::fidl_next::TakeFrom::take_from),
20468
20469 subdir: from.subdir().map(::fidl_next::TakeFrom::take_from),
20470
20471 storage_id: from.storage_id().map(::fidl_next::TakeFrom::take_from),
20472
20473 __source_breaking: ::fidl::marker::SourceBreaking,
20474 }
20475 }
20476 }
20477
20478 impl ::fidl_next::TakeFrom<crate::WireDictionary> for ::fidl_fuchsia_component_decl::Dictionary {
20479 #[inline]
20480 fn take_from(from: &crate::WireDictionary) -> Self {
20481 Self {
20482 name: from.name().map(::fidl_next::TakeFrom::take_from),
20483
20484 source: from.source().map(::fidl_next::TakeFrom::take_from),
20485
20486 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
20487
20488 source_path: from.source_path().map(::fidl_next::TakeFrom::take_from),
20489
20490 __source_breaking: ::fidl::marker::SourceBreaking,
20491 }
20492 }
20493 }
20494
20495 impl ::fidl_next::TakeFrom<crate::WireCapability> for ::fidl_fuchsia_component_decl::Capability {
20496 #[inline]
20497 fn take_from(from: &crate::WireCapability) -> Self {
20498 match from.as_ref() {
20499 crate::capability::Ref::Service(value) => {
20500 Self::Service(::fidl_next::TakeFrom::take_from(value))
20501 }
20502
20503 crate::capability::Ref::Protocol(value) => {
20504 Self::Protocol(::fidl_next::TakeFrom::take_from(value))
20505 }
20506
20507 crate::capability::Ref::Directory(value) => {
20508 Self::Directory(::fidl_next::TakeFrom::take_from(value))
20509 }
20510
20511 crate::capability::Ref::Storage(value) => {
20512 Self::Storage(::fidl_next::TakeFrom::take_from(value))
20513 }
20514
20515 crate::capability::Ref::Runner(value) => {
20516 Self::Runner(::fidl_next::TakeFrom::take_from(value))
20517 }
20518
20519 crate::capability::Ref::Resolver(value) => {
20520 Self::Resolver(::fidl_next::TakeFrom::take_from(value))
20521 }
20522
20523 crate::capability::Ref::EventStream(value) => {
20524 Self::EventStream(::fidl_next::TakeFrom::take_from(value))
20525 }
20526
20527 crate::capability::Ref::Dictionary(value) => {
20528 Self::Dictionary(::fidl_next::TakeFrom::take_from(value))
20529 }
20530
20531 crate::capability::Ref::Config(value) => {
20532 Self::Config(::fidl_next::TakeFrom::take_from(value))
20533 }
20534
20535 crate::capability::Ref::UnknownOrdinal_(unknown_ordinal) => {
20536 Self::__SourceBreaking { unknown_ordinal }
20537 }
20538 }
20539 }
20540 }
20541
20542 impl ::fidl_next::TakeFrom<crate::WireOptionalCapability>
20543 for Option<Box<::fidl_fuchsia_component_decl::Capability>>
20544 {
20545 #[inline]
20546 fn take_from(from: &crate::WireOptionalCapability) -> Self {
20547 if let Some(inner) = from.as_ref() {
20548 Some(::fidl_next::TakeFrom::take_from(inner))
20549 } else {
20550 None
20551 }
20552 }
20553 }
20554
20555 impl ::fidl_next::TakeFrom<crate::WireStartupMode> for ::fidl_fuchsia_component_decl::StartupMode {
20556 #[inline]
20557 fn take_from(from: &crate::WireStartupMode) -> Self {
20558 match crate::StartupMode::from(*from) {
20559 crate::StartupMode::Lazy => Self::Lazy,
20560
20561 crate::StartupMode::Eager => Self::Eager,
20562 }
20563 }
20564 }
20565
20566 impl ::fidl_next::TakeFrom<crate::WireOnTerminate> for ::fidl_fuchsia_component_decl::OnTerminate {
20567 #[inline]
20568 fn take_from(from: &crate::WireOnTerminate) -> Self {
20569 match crate::OnTerminate::from(*from) {
20570 crate::OnTerminate::None => Self::None,
20571
20572 crate::OnTerminate::Reboot => Self::Reboot,
20573 }
20574 }
20575 }
20576
20577 impl ::fidl_next::TakeFrom<crate::WireConfigOverride>
20578 for ::fidl_fuchsia_component_decl::ConfigOverride
20579 {
20580 #[inline]
20581 fn take_from(from: &crate::WireConfigOverride) -> Self {
20582 Self {
20583 key: from.key().map(::fidl_next::TakeFrom::take_from),
20584
20585 value: from.value().map(::fidl_next::TakeFrom::take_from),
20586
20587 __source_breaking: ::fidl::marker::SourceBreaking,
20588 }
20589 }
20590 }
20591
20592 impl ::fidl_next::TakeFrom<crate::WireChild> for ::fidl_fuchsia_component_decl::Child {
20593 #[inline]
20594 fn take_from(from: &crate::WireChild) -> Self {
20595 Self {
20596 name: from.name().map(::fidl_next::TakeFrom::take_from),
20597
20598 url: from.url().map(::fidl_next::TakeFrom::take_from),
20599
20600 startup: from.startup().map(::fidl_next::TakeFrom::take_from),
20601
20602 environment: from.environment().map(::fidl_next::TakeFrom::take_from),
20603
20604 on_terminate: from.on_terminate().map(::fidl_next::TakeFrom::take_from),
20605
20606 config_overrides: from.config_overrides().map(::fidl_next::TakeFrom::take_from),
20607
20608 __source_breaking: ::fidl::marker::SourceBreaking,
20609 }
20610 }
20611 }
20612
20613 impl ::fidl_next::TakeFrom<crate::WireDurability> for ::fidl_fuchsia_component_decl::Durability {
20614 #[inline]
20615 fn take_from(from: &crate::WireDurability) -> Self {
20616 match crate::Durability::from(*from) {
20617 crate::Durability::Transient => Self::Transient,
20618
20619 crate::Durability::SingleRun => Self::SingleRun,
20620 }
20621 }
20622 }
20623
20624 impl ::fidl_next::TakeFrom<crate::WireCollection> for ::fidl_fuchsia_component_decl::Collection {
20625 #[inline]
20626 fn take_from(from: &crate::WireCollection) -> Self {
20627 Self {
20628 name: from.name().map(::fidl_next::TakeFrom::take_from),
20629
20630 durability: from.durability().map(::fidl_next::TakeFrom::take_from),
20631
20632 environment: from.environment().map(::fidl_next::TakeFrom::take_from),
20633
20634 allowed_offers: from.allowed_offers().map(::fidl_next::TakeFrom::take_from),
20635
20636 allow_long_names: from.allow_long_names().map(::fidl_next::TakeFrom::take_from),
20637
20638 persistent_storage: from.persistent_storage().map(::fidl_next::TakeFrom::take_from),
20639
20640 __source_breaking: ::fidl::marker::SourceBreaking,
20641 }
20642 }
20643 }
20644
20645 impl ::fidl_next::TakeFrom<crate::WireDependencyType>
20646 for ::fidl_fuchsia_component_decl::DependencyType
20647 {
20648 #[inline]
20649 fn take_from(from: &crate::WireDependencyType) -> Self {
20650 match crate::DependencyType::from(*from) {
20651 crate::DependencyType::Strong => Self::Strong,
20652
20653 crate::DependencyType::Weak => Self::Weak,
20654 }
20655 }
20656 }
20657
20658 impl ::fidl_next::TakeFrom<crate::WireNameMapping> for ::fidl_fuchsia_component_decl::NameMapping {
20659 #[inline]
20660 fn take_from(from: &crate::WireNameMapping) -> Self {
20661 Self {
20662 source_name: ::fidl_next::TakeFrom::take_from(&from.source_name),
20663
20664 target_name: ::fidl_next::TakeFrom::take_from(&from.target_name),
20665 }
20666 }
20667 }
20668
20669 impl ::fidl_next::TakeFrom<crate::WireEnvironmentExtends>
20670 for ::fidl_fuchsia_component_decl::EnvironmentExtends
20671 {
20672 #[inline]
20673 fn take_from(from: &crate::WireEnvironmentExtends) -> Self {
20674 match crate::EnvironmentExtends::from(*from) {
20675 crate::EnvironmentExtends::None => Self::None,
20676
20677 crate::EnvironmentExtends::Realm => Self::Realm,
20678 }
20679 }
20680 }
20681
20682 impl ::fidl_next::TakeFrom<crate::WireConfigTypeLayout>
20683 for ::fidl_fuchsia_component_decl::ConfigTypeLayout
20684 {
20685 #[inline]
20686 fn take_from(from: &crate::WireConfigTypeLayout) -> Self {
20687 match crate::ConfigTypeLayout::from(*from) {
20688 crate::ConfigTypeLayout::Bool => Self::Bool,
20689
20690 crate::ConfigTypeLayout::Uint8 => Self::Uint8,
20691
20692 crate::ConfigTypeLayout::Uint16 => Self::Uint16,
20693
20694 crate::ConfigTypeLayout::Uint32 => Self::Uint32,
20695
20696 crate::ConfigTypeLayout::Uint64 => Self::Uint64,
20697
20698 crate::ConfigTypeLayout::Int8 => Self::Int8,
20699
20700 crate::ConfigTypeLayout::Int16 => Self::Int16,
20701
20702 crate::ConfigTypeLayout::Int32 => Self::Int32,
20703
20704 crate::ConfigTypeLayout::Int64 => Self::Int64,
20705
20706 crate::ConfigTypeLayout::String => Self::String,
20707
20708 crate::ConfigTypeLayout::Vector => Self::Vector,
20709
20710 crate::ConfigTypeLayout::UnknownOrdinal_(value) => {
20711 Self::__SourceBreaking { unknown_ordinal: value }
20712 }
20713 }
20714 }
20715 }
20716
20717 impl ::fidl_next::TakeFrom<crate::WireLayoutConstraint>
20718 for ::fidl_fuchsia_component_decl::LayoutConstraint
20719 {
20720 #[inline]
20721 fn take_from(from: &crate::WireLayoutConstraint) -> Self {
20722 match from.as_ref() {
20723 crate::layout_constraint::Ref::MaxSize(value) => {
20724 Self::MaxSize(::fidl_next::TakeFrom::take_from(value))
20725 }
20726
20727 crate::layout_constraint::Ref::UnknownOrdinal_(unknown_ordinal) => {
20728 Self::__SourceBreaking { unknown_ordinal }
20729 }
20730 }
20731 }
20732 }
20733
20734 impl ::fidl_next::TakeFrom<crate::WireOptionalLayoutConstraint>
20735 for Option<Box<::fidl_fuchsia_component_decl::LayoutConstraint>>
20736 {
20737 #[inline]
20738 fn take_from(from: &crate::WireOptionalLayoutConstraint) -> Self {
20739 if let Some(inner) = from.as_ref() {
20740 Some(::fidl_next::TakeFrom::take_from(inner))
20741 } else {
20742 None
20743 }
20744 }
20745 }
20746
20747 impl ::fidl_next::TakeFrom<crate::WireConfigType> for ::fidl_fuchsia_component_decl::ConfigType {
20748 #[inline]
20749 fn take_from(from: &crate::WireConfigType) -> Self {
20750 Self {
20751 layout: ::fidl_next::TakeFrom::take_from(&from.layout),
20752
20753 parameters: ::fidl_next::TakeFrom::take_from(&from.parameters),
20754
20755 constraints: ::fidl_next::TakeFrom::take_from(&from.constraints),
20756 }
20757 }
20758 }
20759
20760 impl ::fidl_next::TakeFrom<crate::WireConfigChecksum>
20761 for ::fidl_fuchsia_component_decl::ConfigChecksum
20762 {
20763 #[inline]
20764 fn take_from(from: &crate::WireConfigChecksum) -> Self {
20765 match from.as_ref() {
20766 crate::config_checksum::Ref::Sha256(value) => {
20767 Self::Sha256(::fidl_next::TakeFrom::take_from(value))
20768 }
20769
20770 crate::config_checksum::Ref::UnknownOrdinal_(unknown_ordinal) => {
20771 Self::__SourceBreaking { unknown_ordinal }
20772 }
20773 }
20774 }
20775 }
20776
20777 impl ::fidl_next::TakeFrom<crate::WireOptionalConfigChecksum>
20778 for Option<Box<::fidl_fuchsia_component_decl::ConfigChecksum>>
20779 {
20780 #[inline]
20781 fn take_from(from: &crate::WireOptionalConfigChecksum) -> Self {
20782 if let Some(inner) = from.as_ref() {
20783 Some(::fidl_next::TakeFrom::take_from(inner))
20784 } else {
20785 None
20786 }
20787 }
20788 }
20789
20790 impl ::fidl_next::TakeFrom<crate::WireUseStorage> for ::fidl_fuchsia_component_decl::UseStorage {
20791 #[inline]
20792 fn take_from(from: &crate::WireUseStorage) -> Self {
20793 Self {
20794 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
20795
20796 target_path: from.target_path().map(::fidl_next::TakeFrom::take_from),
20797
20798 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
20799
20800 __source_breaking: ::fidl::marker::SourceBreaking,
20801 }
20802 }
20803 }
20804
20805 impl ::fidl_next::TakeFrom<crate::WireConfigMutability>
20806 for ::fidl_fuchsia_component_decl::ConfigMutability
20807 {
20808 #[inline]
20809 fn take_from(from: &crate::WireConfigMutability) -> Self {
20810 Self::from_bits_retain(from.value.into())
20811 }
20812 }
20813
20814 impl ::fidl_next::TakeFrom<crate::WireConfigField> for ::fidl_fuchsia_component_decl::ConfigField {
20815 #[inline]
20816 fn take_from(from: &crate::WireConfigField) -> Self {
20817 Self {
20818 key: from.key().map(::fidl_next::TakeFrom::take_from),
20819
20820 type_: from.type_().map(::fidl_next::TakeFrom::take_from),
20821
20822 mutability: from.mutability().map(::fidl_next::TakeFrom::take_from),
20823
20824 __source_breaking: ::fidl::marker::SourceBreaking,
20825 }
20826 }
20827 }
20828
20829 impl ::fidl_next::TakeFrom<crate::WireProgram> for ::fidl_fuchsia_component_decl::Program {
20830 #[inline]
20831 fn take_from(from: &crate::WireProgram) -> Self {
20832 Self {
20833 runner: from.runner().map(::fidl_next::TakeFrom::take_from),
20834
20835 info: from.info().map(::fidl_next::TakeFrom::take_from),
20836
20837 __source_breaking: ::fidl::marker::SourceBreaking,
20838 }
20839 }
20840 }
20841
20842 impl ::fidl_next::TakeFrom<crate::WireUseService> for ::fidl_fuchsia_component_decl::UseService {
20843 #[inline]
20844 fn take_from(from: &crate::WireUseService) -> Self {
20845 Self {
20846 source: from.source().map(::fidl_next::TakeFrom::take_from),
20847
20848 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
20849
20850 target_path: from.target_path().map(::fidl_next::TakeFrom::take_from),
20851
20852 dependency_type: from.dependency_type().map(::fidl_next::TakeFrom::take_from),
20853
20854 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
20855
20856 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
20857
20858 __source_breaking: ::fidl::marker::SourceBreaking,
20859 }
20860 }
20861 }
20862
20863 impl ::fidl_next::TakeFrom<crate::WireUseProtocol> for ::fidl_fuchsia_component_decl::UseProtocol {
20864 #[inline]
20865 fn take_from(from: &crate::WireUseProtocol) -> Self {
20866 Self {
20867 source: from.source().map(::fidl_next::TakeFrom::take_from),
20868
20869 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
20870
20871 target_path: from.target_path().map(::fidl_next::TakeFrom::take_from),
20872
20873 dependency_type: from.dependency_type().map(::fidl_next::TakeFrom::take_from),
20874
20875 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
20876
20877 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
20878
20879 __source_breaking: ::fidl::marker::SourceBreaking,
20880 }
20881 }
20882 }
20883
20884 impl ::fidl_next::TakeFrom<crate::WireUseDirectory>
20885 for ::fidl_fuchsia_component_decl::UseDirectory
20886 {
20887 #[inline]
20888 fn take_from(from: &crate::WireUseDirectory) -> Self {
20889 Self {
20890 source: from.source().map(::fidl_next::TakeFrom::take_from),
20891
20892 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
20893
20894 target_path: from.target_path().map(::fidl_next::TakeFrom::take_from),
20895
20896 rights: from.rights().map(::fidl_next::TakeFrom::take_from),
20897
20898 subdir: from.subdir().map(::fidl_next::TakeFrom::take_from),
20899
20900 dependency_type: from.dependency_type().map(::fidl_next::TakeFrom::take_from),
20901
20902 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
20903
20904 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
20905
20906 __source_breaking: ::fidl::marker::SourceBreaking,
20907 }
20908 }
20909 }
20910
20911 impl ::fidl_next::TakeFrom<crate::WireUseEventStream>
20912 for ::fidl_fuchsia_component_decl::UseEventStream
20913 {
20914 #[inline]
20915 fn take_from(from: &crate::WireUseEventStream) -> Self {
20916 Self {
20917 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
20918
20919 source: from.source().map(::fidl_next::TakeFrom::take_from),
20920
20921 scope: from.scope().map(::fidl_next::TakeFrom::take_from),
20922
20923 target_path: from.target_path().map(::fidl_next::TakeFrom::take_from),
20924
20925 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
20926
20927 filter: from.filter().map(::fidl_next::TakeFrom::take_from),
20928
20929 __source_breaking: ::fidl::marker::SourceBreaking,
20930 }
20931 }
20932 }
20933
20934 impl ::fidl_next::TakeFrom<crate::WireUseRunner> for ::fidl_fuchsia_component_decl::UseRunner {
20935 #[inline]
20936 fn take_from(from: &crate::WireUseRunner) -> Self {
20937 Self {
20938 source: from.source().map(::fidl_next::TakeFrom::take_from),
20939
20940 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
20941
20942 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
20943
20944 __source_breaking: ::fidl::marker::SourceBreaking,
20945 }
20946 }
20947 }
20948
20949 impl ::fidl_next::TakeFrom<crate::WireUseConfiguration>
20950 for ::fidl_fuchsia_component_decl::UseConfiguration
20951 {
20952 #[inline]
20953 fn take_from(from: &crate::WireUseConfiguration) -> Self {
20954 Self {
20955 source: from.source().map(::fidl_next::TakeFrom::take_from),
20956
20957 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
20958
20959 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
20960
20961 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
20962
20963 type_: from.type_().map(::fidl_next::TakeFrom::take_from),
20964
20965 default: from.default().map(::fidl_next::TakeFrom::take_from),
20966
20967 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
20968
20969 __source_breaking: ::fidl::marker::SourceBreaking,
20970 }
20971 }
20972 }
20973
20974 impl ::fidl_next::TakeFrom<crate::WireUse> for ::fidl_fuchsia_component_decl::Use {
20975 #[inline]
20976 fn take_from(from: &crate::WireUse) -> Self {
20977 match from.as_ref() {
20978 crate::use_::Ref::Service(value) => {
20979 Self::Service(::fidl_next::TakeFrom::take_from(value))
20980 }
20981
20982 crate::use_::Ref::Protocol(value) => {
20983 Self::Protocol(::fidl_next::TakeFrom::take_from(value))
20984 }
20985
20986 crate::use_::Ref::Directory(value) => {
20987 Self::Directory(::fidl_next::TakeFrom::take_from(value))
20988 }
20989
20990 crate::use_::Ref::Storage(value) => {
20991 Self::Storage(::fidl_next::TakeFrom::take_from(value))
20992 }
20993
20994 crate::use_::Ref::EventStream(value) => {
20995 Self::EventStream(::fidl_next::TakeFrom::take_from(value))
20996 }
20997
20998 crate::use_::Ref::Runner(value) => {
20999 Self::Runner(::fidl_next::TakeFrom::take_from(value))
21000 }
21001
21002 crate::use_::Ref::Config(value) => {
21003 Self::Config(::fidl_next::TakeFrom::take_from(value))
21004 }
21005
21006 crate::use_::Ref::UnknownOrdinal_(unknown_ordinal) => {
21007 Self::__SourceBreaking { unknown_ordinal }
21008 }
21009 }
21010 }
21011 }
21012
21013 impl ::fidl_next::TakeFrom<crate::WireOptionalUse>
21014 for Option<Box<::fidl_fuchsia_component_decl::Use>>
21015 {
21016 #[inline]
21017 fn take_from(from: &crate::WireOptionalUse) -> Self {
21018 if let Some(inner) = from.as_ref() {
21019 Some(::fidl_next::TakeFrom::take_from(inner))
21020 } else {
21021 None
21022 }
21023 }
21024 }
21025
21026 impl ::fidl_next::TakeFrom<crate::WireExposeService>
21027 for ::fidl_fuchsia_component_decl::ExposeService
21028 {
21029 #[inline]
21030 fn take_from(from: &crate::WireExposeService) -> Self {
21031 Self {
21032 source: from.source().map(::fidl_next::TakeFrom::take_from),
21033
21034 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21035
21036 target: from.target().map(::fidl_next::TakeFrom::take_from),
21037
21038 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21039
21040 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
21041
21042 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
21043
21044 __source_breaking: ::fidl::marker::SourceBreaking,
21045 }
21046 }
21047 }
21048
21049 impl ::fidl_next::TakeFrom<crate::WireExposeProtocol>
21050 for ::fidl_fuchsia_component_decl::ExposeProtocol
21051 {
21052 #[inline]
21053 fn take_from(from: &crate::WireExposeProtocol) -> Self {
21054 Self {
21055 source: from.source().map(::fidl_next::TakeFrom::take_from),
21056
21057 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21058
21059 target: from.target().map(::fidl_next::TakeFrom::take_from),
21060
21061 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21062
21063 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
21064
21065 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
21066
21067 __source_breaking: ::fidl::marker::SourceBreaking,
21068 }
21069 }
21070 }
21071
21072 impl ::fidl_next::TakeFrom<crate::WireExposeDirectory>
21073 for ::fidl_fuchsia_component_decl::ExposeDirectory
21074 {
21075 #[inline]
21076 fn take_from(from: &crate::WireExposeDirectory) -> Self {
21077 Self {
21078 source: from.source().map(::fidl_next::TakeFrom::take_from),
21079
21080 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21081
21082 target: from.target().map(::fidl_next::TakeFrom::take_from),
21083
21084 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21085
21086 rights: from.rights().map(::fidl_next::TakeFrom::take_from),
21087
21088 subdir: from.subdir().map(::fidl_next::TakeFrom::take_from),
21089
21090 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
21091
21092 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
21093
21094 __source_breaking: ::fidl::marker::SourceBreaking,
21095 }
21096 }
21097 }
21098
21099 impl ::fidl_next::TakeFrom<crate::WireExposeRunner>
21100 for ::fidl_fuchsia_component_decl::ExposeRunner
21101 {
21102 #[inline]
21103 fn take_from(from: &crate::WireExposeRunner) -> Self {
21104 Self {
21105 source: from.source().map(::fidl_next::TakeFrom::take_from),
21106
21107 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21108
21109 target: from.target().map(::fidl_next::TakeFrom::take_from),
21110
21111 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21112
21113 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
21114
21115 __source_breaking: ::fidl::marker::SourceBreaking,
21116 }
21117 }
21118 }
21119
21120 impl ::fidl_next::TakeFrom<crate::WireExposeResolver>
21121 for ::fidl_fuchsia_component_decl::ExposeResolver
21122 {
21123 #[inline]
21124 fn take_from(from: &crate::WireExposeResolver) -> Self {
21125 Self {
21126 source: from.source().map(::fidl_next::TakeFrom::take_from),
21127
21128 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21129
21130 target: from.target().map(::fidl_next::TakeFrom::take_from),
21131
21132 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21133
21134 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
21135
21136 __source_breaking: ::fidl::marker::SourceBreaking,
21137 }
21138 }
21139 }
21140
21141 impl ::fidl_next::TakeFrom<crate::WireExposeDictionary>
21142 for ::fidl_fuchsia_component_decl::ExposeDictionary
21143 {
21144 #[inline]
21145 fn take_from(from: &crate::WireExposeDictionary) -> Self {
21146 Self {
21147 source: from.source().map(::fidl_next::TakeFrom::take_from),
21148
21149 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21150
21151 target: from.target().map(::fidl_next::TakeFrom::take_from),
21152
21153 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21154
21155 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
21156
21157 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
21158
21159 __source_breaking: ::fidl::marker::SourceBreaking,
21160 }
21161 }
21162 }
21163
21164 impl ::fidl_next::TakeFrom<crate::WireExposeConfiguration>
21165 for ::fidl_fuchsia_component_decl::ExposeConfiguration
21166 {
21167 #[inline]
21168 fn take_from(from: &crate::WireExposeConfiguration) -> Self {
21169 Self {
21170 source: from.source().map(::fidl_next::TakeFrom::take_from),
21171
21172 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21173
21174 target: from.target().map(::fidl_next::TakeFrom::take_from),
21175
21176 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21177
21178 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
21179
21180 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
21181
21182 __source_breaking: ::fidl::marker::SourceBreaking,
21183 }
21184 }
21185 }
21186
21187 impl ::fidl_next::TakeFrom<crate::WireExpose> for ::fidl_fuchsia_component_decl::Expose {
21188 #[inline]
21189 fn take_from(from: &crate::WireExpose) -> Self {
21190 match from.as_ref() {
21191 crate::expose::Ref::Service(value) => {
21192 Self::Service(::fidl_next::TakeFrom::take_from(value))
21193 }
21194
21195 crate::expose::Ref::Protocol(value) => {
21196 Self::Protocol(::fidl_next::TakeFrom::take_from(value))
21197 }
21198
21199 crate::expose::Ref::Directory(value) => {
21200 Self::Directory(::fidl_next::TakeFrom::take_from(value))
21201 }
21202
21203 crate::expose::Ref::Runner(value) => {
21204 Self::Runner(::fidl_next::TakeFrom::take_from(value))
21205 }
21206
21207 crate::expose::Ref::Resolver(value) => {
21208 Self::Resolver(::fidl_next::TakeFrom::take_from(value))
21209 }
21210
21211 crate::expose::Ref::Dictionary(value) => {
21212 Self::Dictionary(::fidl_next::TakeFrom::take_from(value))
21213 }
21214
21215 crate::expose::Ref::Config(value) => {
21216 Self::Config(::fidl_next::TakeFrom::take_from(value))
21217 }
21218
21219 crate::expose::Ref::UnknownOrdinal_(unknown_ordinal) => {
21220 Self::__SourceBreaking { unknown_ordinal }
21221 }
21222 }
21223 }
21224 }
21225
21226 impl ::fidl_next::TakeFrom<crate::WireOptionalExpose>
21227 for Option<Box<::fidl_fuchsia_component_decl::Expose>>
21228 {
21229 #[inline]
21230 fn take_from(from: &crate::WireOptionalExpose) -> Self {
21231 if let Some(inner) = from.as_ref() {
21232 Some(::fidl_next::TakeFrom::take_from(inner))
21233 } else {
21234 None
21235 }
21236 }
21237 }
21238
21239 impl ::fidl_next::TakeFrom<crate::WireOfferService>
21240 for ::fidl_fuchsia_component_decl::OfferService
21241 {
21242 #[inline]
21243 fn take_from(from: &crate::WireOfferService) -> Self {
21244 Self {
21245 source: from.source().map(::fidl_next::TakeFrom::take_from),
21246
21247 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21248
21249 target: from.target().map(::fidl_next::TakeFrom::take_from),
21250
21251 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21252
21253 source_instance_filter: from
21254 .source_instance_filter()
21255 .map(::fidl_next::TakeFrom::take_from),
21256
21257 renamed_instances: from.renamed_instances().map(::fidl_next::TakeFrom::take_from),
21258
21259 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
21260
21261 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
21262
21263 dependency_type: from.dependency_type().map(::fidl_next::TakeFrom::take_from),
21264
21265 __source_breaking: ::fidl::marker::SourceBreaking,
21266 }
21267 }
21268 }
21269
21270 impl ::fidl_next::TakeFrom<crate::WireOfferProtocol>
21271 for ::fidl_fuchsia_component_decl::OfferProtocol
21272 {
21273 #[inline]
21274 fn take_from(from: &crate::WireOfferProtocol) -> Self {
21275 Self {
21276 source: from.source().map(::fidl_next::TakeFrom::take_from),
21277
21278 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21279
21280 target: from.target().map(::fidl_next::TakeFrom::take_from),
21281
21282 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21283
21284 dependency_type: from.dependency_type().map(::fidl_next::TakeFrom::take_from),
21285
21286 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
21287
21288 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
21289
21290 __source_breaking: ::fidl::marker::SourceBreaking,
21291 }
21292 }
21293 }
21294
21295 impl ::fidl_next::TakeFrom<crate::WireOfferDirectory>
21296 for ::fidl_fuchsia_component_decl::OfferDirectory
21297 {
21298 #[inline]
21299 fn take_from(from: &crate::WireOfferDirectory) -> Self {
21300 Self {
21301 source: from.source().map(::fidl_next::TakeFrom::take_from),
21302
21303 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21304
21305 target: from.target().map(::fidl_next::TakeFrom::take_from),
21306
21307 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21308
21309 rights: from.rights().map(::fidl_next::TakeFrom::take_from),
21310
21311 subdir: from.subdir().map(::fidl_next::TakeFrom::take_from),
21312
21313 dependency_type: from.dependency_type().map(::fidl_next::TakeFrom::take_from),
21314
21315 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
21316
21317 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
21318
21319 __source_breaking: ::fidl::marker::SourceBreaking,
21320 }
21321 }
21322 }
21323
21324 impl ::fidl_next::TakeFrom<crate::WireOfferStorage>
21325 for ::fidl_fuchsia_component_decl::OfferStorage
21326 {
21327 #[inline]
21328 fn take_from(from: &crate::WireOfferStorage) -> Self {
21329 Self {
21330 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21331
21332 source: from.source().map(::fidl_next::TakeFrom::take_from),
21333
21334 target: from.target().map(::fidl_next::TakeFrom::take_from),
21335
21336 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21337
21338 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
21339
21340 __source_breaking: ::fidl::marker::SourceBreaking,
21341 }
21342 }
21343 }
21344
21345 impl ::fidl_next::TakeFrom<crate::WireOfferRunner> for ::fidl_fuchsia_component_decl::OfferRunner {
21346 #[inline]
21347 fn take_from(from: &crate::WireOfferRunner) -> Self {
21348 Self {
21349 source: from.source().map(::fidl_next::TakeFrom::take_from),
21350
21351 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21352
21353 target: from.target().map(::fidl_next::TakeFrom::take_from),
21354
21355 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21356
21357 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
21358
21359 __source_breaking: ::fidl::marker::SourceBreaking,
21360 }
21361 }
21362 }
21363
21364 impl ::fidl_next::TakeFrom<crate::WireOfferResolver>
21365 for ::fidl_fuchsia_component_decl::OfferResolver
21366 {
21367 #[inline]
21368 fn take_from(from: &crate::WireOfferResolver) -> Self {
21369 Self {
21370 source: from.source().map(::fidl_next::TakeFrom::take_from),
21371
21372 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21373
21374 target: from.target().map(::fidl_next::TakeFrom::take_from),
21375
21376 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21377
21378 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
21379
21380 __source_breaking: ::fidl::marker::SourceBreaking,
21381 }
21382 }
21383 }
21384
21385 impl ::fidl_next::TakeFrom<crate::WireOfferEventStream>
21386 for ::fidl_fuchsia_component_decl::OfferEventStream
21387 {
21388 #[inline]
21389 fn take_from(from: &crate::WireOfferEventStream) -> Self {
21390 Self {
21391 source: from.source().map(::fidl_next::TakeFrom::take_from),
21392
21393 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21394
21395 scope: from.scope().map(::fidl_next::TakeFrom::take_from),
21396
21397 target: from.target().map(::fidl_next::TakeFrom::take_from),
21398
21399 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21400
21401 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
21402
21403 __source_breaking: ::fidl::marker::SourceBreaking,
21404 }
21405 }
21406 }
21407
21408 impl ::fidl_next::TakeFrom<crate::WireOfferDictionary>
21409 for ::fidl_fuchsia_component_decl::OfferDictionary
21410 {
21411 #[inline]
21412 fn take_from(from: &crate::WireOfferDictionary) -> Self {
21413 Self {
21414 source: from.source().map(::fidl_next::TakeFrom::take_from),
21415
21416 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21417
21418 target: from.target().map(::fidl_next::TakeFrom::take_from),
21419
21420 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21421
21422 dependency_type: from.dependency_type().map(::fidl_next::TakeFrom::take_from),
21423
21424 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
21425
21426 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
21427
21428 __source_breaking: ::fidl::marker::SourceBreaking,
21429 }
21430 }
21431 }
21432
21433 impl ::fidl_next::TakeFrom<crate::WireOfferConfiguration>
21434 for ::fidl_fuchsia_component_decl::OfferConfiguration
21435 {
21436 #[inline]
21437 fn take_from(from: &crate::WireOfferConfiguration) -> Self {
21438 Self {
21439 source: from.source().map(::fidl_next::TakeFrom::take_from),
21440
21441 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21442
21443 target: from.target().map(::fidl_next::TakeFrom::take_from),
21444
21445 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21446
21447 availability: from.availability().map(::fidl_next::TakeFrom::take_from),
21448
21449 source_dictionary: from.source_dictionary().map(::fidl_next::TakeFrom::take_from),
21450
21451 __source_breaking: ::fidl::marker::SourceBreaking,
21452 }
21453 }
21454 }
21455
21456 impl ::fidl_next::TakeFrom<crate::WireOffer> for ::fidl_fuchsia_component_decl::Offer {
21457 #[inline]
21458 fn take_from(from: &crate::WireOffer) -> Self {
21459 match from.as_ref() {
21460 crate::offer::Ref::Service(value) => {
21461 Self::Service(::fidl_next::TakeFrom::take_from(value))
21462 }
21463
21464 crate::offer::Ref::Protocol(value) => {
21465 Self::Protocol(::fidl_next::TakeFrom::take_from(value))
21466 }
21467
21468 crate::offer::Ref::Directory(value) => {
21469 Self::Directory(::fidl_next::TakeFrom::take_from(value))
21470 }
21471
21472 crate::offer::Ref::Storage(value) => {
21473 Self::Storage(::fidl_next::TakeFrom::take_from(value))
21474 }
21475
21476 crate::offer::Ref::Runner(value) => {
21477 Self::Runner(::fidl_next::TakeFrom::take_from(value))
21478 }
21479
21480 crate::offer::Ref::Resolver(value) => {
21481 Self::Resolver(::fidl_next::TakeFrom::take_from(value))
21482 }
21483
21484 crate::offer::Ref::EventStream(value) => {
21485 Self::EventStream(::fidl_next::TakeFrom::take_from(value))
21486 }
21487
21488 crate::offer::Ref::Dictionary(value) => {
21489 Self::Dictionary(::fidl_next::TakeFrom::take_from(value))
21490 }
21491
21492 crate::offer::Ref::Config(value) => {
21493 Self::Config(::fidl_next::TakeFrom::take_from(value))
21494 }
21495
21496 crate::offer::Ref::UnknownOrdinal_(unknown_ordinal) => {
21497 Self::__SourceBreaking { unknown_ordinal }
21498 }
21499 }
21500 }
21501 }
21502
21503 impl ::fidl_next::TakeFrom<crate::WireOptionalOffer>
21504 for Option<Box<::fidl_fuchsia_component_decl::Offer>>
21505 {
21506 #[inline]
21507 fn take_from(from: &crate::WireOptionalOffer) -> Self {
21508 if let Some(inner) = from.as_ref() {
21509 Some(::fidl_next::TakeFrom::take_from(inner))
21510 } else {
21511 None
21512 }
21513 }
21514 }
21515
21516 impl ::fidl_next::TakeFrom<crate::WireRunnerRegistration>
21517 for ::fidl_fuchsia_component_decl::RunnerRegistration
21518 {
21519 #[inline]
21520 fn take_from(from: &crate::WireRunnerRegistration) -> Self {
21521 Self {
21522 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21523
21524 source: from.source().map(::fidl_next::TakeFrom::take_from),
21525
21526 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21527
21528 __source_breaking: ::fidl::marker::SourceBreaking,
21529 }
21530 }
21531 }
21532
21533 impl ::fidl_next::TakeFrom<crate::WireResolverRegistration>
21534 for ::fidl_fuchsia_component_decl::ResolverRegistration
21535 {
21536 #[inline]
21537 fn take_from(from: &crate::WireResolverRegistration) -> Self {
21538 Self {
21539 resolver: from.resolver().map(::fidl_next::TakeFrom::take_from),
21540
21541 source: from.source().map(::fidl_next::TakeFrom::take_from),
21542
21543 scheme: from.scheme().map(::fidl_next::TakeFrom::take_from),
21544
21545 __source_breaking: ::fidl::marker::SourceBreaking,
21546 }
21547 }
21548 }
21549
21550 impl ::fidl_next::TakeFrom<crate::WireDebugProtocolRegistration>
21551 for ::fidl_fuchsia_component_decl::DebugProtocolRegistration
21552 {
21553 #[inline]
21554 fn take_from(from: &crate::WireDebugProtocolRegistration) -> Self {
21555 Self {
21556 source: from.source().map(::fidl_next::TakeFrom::take_from),
21557
21558 source_name: from.source_name().map(::fidl_next::TakeFrom::take_from),
21559
21560 target_name: from.target_name().map(::fidl_next::TakeFrom::take_from),
21561
21562 __source_breaking: ::fidl::marker::SourceBreaking,
21563 }
21564 }
21565 }
21566
21567 impl ::fidl_next::TakeFrom<crate::WireDebugRegistration>
21568 for ::fidl_fuchsia_component_decl::DebugRegistration
21569 {
21570 #[inline]
21571 fn take_from(from: &crate::WireDebugRegistration) -> Self {
21572 match from.as_ref() {
21573 crate::debug_registration::Ref::Protocol(value) => {
21574 Self::Protocol(::fidl_next::TakeFrom::take_from(value))
21575 }
21576
21577 crate::debug_registration::Ref::UnknownOrdinal_(unknown_ordinal) => {
21578 Self::__SourceBreaking { unknown_ordinal }
21579 }
21580 }
21581 }
21582 }
21583
21584 impl ::fidl_next::TakeFrom<crate::WireOptionalDebugRegistration>
21585 for Option<Box<::fidl_fuchsia_component_decl::DebugRegistration>>
21586 {
21587 #[inline]
21588 fn take_from(from: &crate::WireOptionalDebugRegistration) -> Self {
21589 if let Some(inner) = from.as_ref() {
21590 Some(::fidl_next::TakeFrom::take_from(inner))
21591 } else {
21592 None
21593 }
21594 }
21595 }
21596
21597 impl ::fidl_next::TakeFrom<crate::WireEnvironment> for ::fidl_fuchsia_component_decl::Environment {
21598 #[inline]
21599 fn take_from(from: &crate::WireEnvironment) -> Self {
21600 Self {
21601 name: from.name().map(::fidl_next::TakeFrom::take_from),
21602
21603 extends: from.extends().map(::fidl_next::TakeFrom::take_from),
21604
21605 runners: from.runners().map(::fidl_next::TakeFrom::take_from),
21606
21607 resolvers: from.resolvers().map(::fidl_next::TakeFrom::take_from),
21608
21609 debug_capabilities: from.debug_capabilities().map(::fidl_next::TakeFrom::take_from),
21610
21611 stop_timeout_ms: from.stop_timeout_ms().map(::fidl_next::TakeFrom::take_from),
21612
21613 __source_breaking: ::fidl::marker::SourceBreaking,
21614 }
21615 }
21616 }
21617
21618 impl ::fidl_next::TakeFrom<crate::WireConfigSourceCapabilities>
21619 for ::fidl_fuchsia_component_decl::ConfigSourceCapabilities
21620 {
21621 #[inline]
21622 fn take_from(from: &crate::WireConfigSourceCapabilities) -> Self {
21623 Self { __source_breaking: ::fidl::marker::SourceBreaking }
21624 }
21625 }
21626
21627 impl ::fidl_next::TakeFrom<crate::WireConfigValueSource>
21628 for ::fidl_fuchsia_component_decl::ConfigValueSource
21629 {
21630 #[inline]
21631 fn take_from(from: &crate::WireConfigValueSource) -> Self {
21632 match from.as_ref() {
21633 crate::config_value_source::Ref::PackagePath(value) => {
21634 Self::PackagePath(::fidl_next::TakeFrom::take_from(value))
21635 }
21636
21637 crate::config_value_source::Ref::Capabilities(value) => {
21638 Self::Capabilities(::fidl_next::TakeFrom::take_from(value))
21639 }
21640
21641 crate::config_value_source::Ref::UnknownOrdinal_(unknown_ordinal) => {
21642 Self::__SourceBreaking { unknown_ordinal }
21643 }
21644 }
21645 }
21646 }
21647
21648 impl ::fidl_next::TakeFrom<crate::WireOptionalConfigValueSource>
21649 for Option<Box<::fidl_fuchsia_component_decl::ConfigValueSource>>
21650 {
21651 #[inline]
21652 fn take_from(from: &crate::WireOptionalConfigValueSource) -> Self {
21653 if let Some(inner) = from.as_ref() {
21654 Some(::fidl_next::TakeFrom::take_from(inner))
21655 } else {
21656 None
21657 }
21658 }
21659 }
21660
21661 impl ::fidl_next::TakeFrom<crate::WireConfigSchema>
21662 for ::fidl_fuchsia_component_decl::ConfigSchema
21663 {
21664 #[inline]
21665 fn take_from(from: &crate::WireConfigSchema) -> Self {
21666 Self {
21667 fields: from.fields().map(::fidl_next::TakeFrom::take_from),
21668
21669 checksum: from.checksum().map(::fidl_next::TakeFrom::take_from),
21670
21671 value_source: from.value_source().map(::fidl_next::TakeFrom::take_from),
21672
21673 __source_breaking: ::fidl::marker::SourceBreaking,
21674 }
21675 }
21676 }
21677
21678 impl ::fidl_next::TakeFrom<crate::WireComponent> for ::fidl_fuchsia_component_decl::Component {
21679 #[inline]
21680 fn take_from(from: &crate::WireComponent) -> Self {
21681 Self {
21682 program: from.program().map(::fidl_next::TakeFrom::take_from),
21683
21684 uses: from.uses().map(::fidl_next::TakeFrom::take_from),
21685
21686 exposes: from.exposes().map(::fidl_next::TakeFrom::take_from),
21687
21688 offers: from.offers().map(::fidl_next::TakeFrom::take_from),
21689
21690 capabilities: from.capabilities().map(::fidl_next::TakeFrom::take_from),
21691
21692 children: from.children().map(::fidl_next::TakeFrom::take_from),
21693
21694 collections: from.collections().map(::fidl_next::TakeFrom::take_from),
21695
21696 environments: from.environments().map(::fidl_next::TakeFrom::take_from),
21697
21698 facets: from.facets().map(::fidl_next::TakeFrom::take_from),
21699
21700 config: from.config().map(::fidl_next::TakeFrom::take_from),
21701
21702 __source_breaking: ::fidl::marker::SourceBreaking,
21703 }
21704 }
21705 }
21706
21707 impl ::fidl_next::TakeFrom<crate::WireConfigValueSpec>
21708 for ::fidl_fuchsia_component_decl::ConfigValueSpec
21709 {
21710 #[inline]
21711 fn take_from(from: &crate::WireConfigValueSpec) -> Self {
21712 Self {
21713 value: from.value().map(::fidl_next::TakeFrom::take_from),
21714
21715 __source_breaking: ::fidl::marker::SourceBreaking,
21716 }
21717 }
21718 }
21719
21720 impl ::fidl_next::TakeFrom<crate::WireConfigValuesData>
21721 for ::fidl_fuchsia_component_decl::ConfigValuesData
21722 {
21723 #[inline]
21724 fn take_from(from: &crate::WireConfigValuesData) -> Self {
21725 Self {
21726 values: from.values().map(::fidl_next::TakeFrom::take_from),
21727
21728 checksum: from.checksum().map(::fidl_next::TakeFrom::take_from),
21729
21730 __source_breaking: ::fidl::marker::SourceBreaking,
21731 }
21732 }
21733 }
21734
21735 impl ::fidl_next::TakeFrom<crate::WireEventSubscription>
21736 for ::fidl_fuchsia_component_decl::EventSubscription
21737 {
21738 #[inline]
21739 fn take_from(from: &crate::WireEventSubscription) -> Self {
21740 Self {
21741 event_name: from.event_name().map(::fidl_next::TakeFrom::take_from),
21742
21743 __source_breaking: ::fidl::marker::SourceBreaking,
21744 }
21745 }
21746 }
21747
21748 impl ::fidl_next::TakeFrom<crate::WireLayoutParameter>
21749 for ::fidl_fuchsia_component_decl::LayoutParameter
21750 {
21751 #[inline]
21752 fn take_from(from: &crate::WireLayoutParameter) -> Self {
21753 match from.as_ref() {
21754 crate::layout_parameter::Ref::NestedType(value) => {
21755 Self::NestedType(::fidl_next::TakeFrom::take_from(value))
21756 }
21757
21758 crate::layout_parameter::Ref::UnknownOrdinal_(unknown_ordinal) => {
21759 Self::__SourceBreaking { unknown_ordinal }
21760 }
21761 }
21762 }
21763 }
21764
21765 impl ::fidl_next::TakeFrom<crate::WireOptionalLayoutParameter>
21766 for Option<Box<::fidl_fuchsia_component_decl::LayoutParameter>>
21767 {
21768 #[inline]
21769 fn take_from(from: &crate::WireOptionalLayoutParameter) -> Self {
21770 if let Some(inner) = from.as_ref() {
21771 Some(::fidl_next::TakeFrom::take_from(inner))
21772 } else {
21773 None
21774 }
21775 }
21776 }
21777
21778 impl ::fidl_next::TakeFrom<crate::WireResolvedConfigField>
21779 for ::fidl_fuchsia_component_decl::ResolvedConfigField
21780 {
21781 #[inline]
21782 fn take_from(from: &crate::WireResolvedConfigField) -> Self {
21783 Self {
21784 key: ::fidl_next::TakeFrom::take_from(&from.key),
21785
21786 value: ::fidl_next::TakeFrom::take_from(&from.value),
21787 }
21788 }
21789 }
21790
21791 impl ::fidl_next::TakeFrom<crate::WireResolvedConfig>
21792 for ::fidl_fuchsia_component_decl::ResolvedConfig
21793 {
21794 #[inline]
21795 fn take_from(from: &crate::WireResolvedConfig) -> Self {
21796 Self {
21797 fields: ::fidl_next::TakeFrom::take_from(&from.fields),
21798
21799 checksum: ::fidl_next::TakeFrom::take_from(&from.checksum),
21800 }
21801 }
21802 }
21803}