1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
12#[repr(u32)]
13pub enum ConfigurationError {
14 InvalidArguments = 1,
15 RejectedByNetstack = 2,
16 Internal = 4294967295,
17}
18
19impl ConfigurationError {
20 #[inline]
21 pub fn from_primitive(prim: u32) -> Option<Self> {
22 match prim {
23 1 => Some(Self::InvalidArguments),
24 2 => Some(Self::RejectedByNetstack),
25 4294967295 => Some(Self::Internal),
26 _ => None,
27 }
28 }
29
30 #[inline]
31 pub const fn into_primitive(self) -> u32 {
32 self as u32
33 }
34
35 #[deprecated = "Strict enums should not use `is_unknown`"]
36 #[inline]
37 pub fn is_unknown(&self) -> bool {
38 false
39 }
40}
41
42#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
43#[repr(u8)]
44pub enum StorageVariant {
45 Data = 0,
47 Cache = 1,
49 Tmp = 2,
51 CustomArtifacts = 3,
67}
68
69impl StorageVariant {
70 #[inline]
71 pub fn from_primitive(prim: u8) -> Option<Self> {
72 match prim {
73 0 => Some(Self::Data),
74 1 => Some(Self::Cache),
75 2 => Some(Self::Tmp),
76 3 => Some(Self::CustomArtifacts),
77 _ => None,
78 }
79 }
80
81 #[inline]
82 pub const fn into_primitive(self) -> u8 {
83 self as u8
84 }
85
86 #[deprecated = "Strict enums should not use `is_unknown`"]
87 #[inline]
88 pub fn is_unknown(&self) -> bool {
89 false
90 }
91}
92
93#[derive(Clone, Debug, PartialEq)]
94pub struct ChildConfigValue {
95 pub key: String,
97 pub value: fidl_fuchsia_component_decl::ConfigValue,
100}
101
102impl fidl::Persistable for ChildConfigValue {}
103
104#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
105pub struct Empty;
106
107impl fidl::Persistable for Empty {}
108
109#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
110pub struct ManagedRealmGetMonikerResponse {
111 pub moniker: String,
112}
113
114impl fidl::Persistable for ManagedRealmGetMonikerResponse {}
115
116#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
117pub struct ManagedRealmRemoveDeviceRequest {
118 pub path: String,
119}
120
121impl fidl::Persistable for ManagedRealmRemoveDeviceRequest {}
122
123#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
124pub struct ManagedRealmStartChildComponentRequest {
125 pub child_name: String,
126}
127
128impl fidl::Persistable for ManagedRealmStartChildComponentRequest {}
129
130#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
131pub struct ManagedRealmStopChildComponentRequest {
132 pub child_name: String,
133}
134
135impl fidl::Persistable for ManagedRealmStopChildComponentRequest {}
136
137#[derive(Clone, Debug, Default, PartialEq)]
138pub struct ChildDep {
139 pub name: Option<String>,
144 pub capability: Option<ExposedCapability>,
148 #[doc(hidden)]
149 pub __source_breaking: fidl::marker::SourceBreaking,
150}
151
152impl fidl::Persistable for ChildDep {}
153
154#[derive(Clone, Debug, Default, PartialEq)]
155pub struct DevfsDep {
156 pub name: Option<String>,
160 pub subdir: Option<String>,
166 #[doc(hidden)]
167 pub __source_breaking: fidl::marker::SourceBreaking,
168}
169
170impl fidl::Persistable for DevfsDep {}
171
172#[derive(Clone, Debug, Default, PartialEq)]
173pub struct StorageDep {
174 pub variant: Option<StorageVariant>,
178 pub path: Option<String>,
183 #[doc(hidden)]
184 pub __source_breaking: fidl::marker::SourceBreaking,
185}
186
187impl fidl::Persistable for StorageDep {}
188
189#[derive(Clone, Debug, PartialEq)]
190pub enum Capability {
191 NetemulDevfs(DevfsDep),
194 NetemulNetworkContext(Empty),
197 LogSink(Empty),
202 ChildDep(ChildDep),
205 StorageDep(StorageDep),
208 TracingProvider(Empty),
211}
212
213impl Capability {
214 #[inline]
215 pub fn ordinal(&self) -> u64 {
216 match *self {
217 Self::NetemulDevfs(_) => 1,
218 Self::NetemulNetworkContext(_) => 3,
219 Self::LogSink(_) => 4,
220 Self::ChildDep(_) => 5,
221 Self::StorageDep(_) => 6,
222 Self::TracingProvider(_) => 7,
223 }
224 }
225
226 #[deprecated = "Strict unions should not use `is_unknown`"]
227 #[inline]
228 pub fn is_unknown(&self) -> bool {
229 false
230 }
231}
232
233impl fidl::Persistable for Capability {}
234
235#[derive(Clone, Debug, PartialEq)]
236pub enum ChildUses {
237 Capabilities(Vec<Capability>),
242}
243
244impl ChildUses {
245 #[inline]
246 pub fn ordinal(&self) -> u64 {
247 match *self {
248 Self::Capabilities(_) => 1,
249 }
250 }
251
252 #[deprecated = "Strict unions should not use `is_unknown`"]
253 #[inline]
254 pub fn is_unknown(&self) -> bool {
255 false
256 }
257}
258
259impl fidl::Persistable for ChildUses {}
260
261#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
262pub enum ExposedCapability {
263 Protocol(String),
265 Configuration(String),
267 Service(String),
269}
270
271impl ExposedCapability {
272 #[inline]
273 pub fn ordinal(&self) -> u64 {
274 match *self {
275 Self::Protocol(_) => 1,
276 Self::Configuration(_) => 2,
277 Self::Service(_) => 3,
278 }
279 }
280
281 #[deprecated = "Strict unions should not use `is_unknown`"]
282 #[inline]
283 pub fn is_unknown(&self) -> bool {
284 false
285 }
286}
287
288impl fidl::Persistable for ExposedCapability {}
289
290mod internal {
291 use super::*;
292 unsafe impl fidl::encoding::TypeMarker for ConfigurationError {
293 type Owned = Self;
294
295 #[inline(always)]
296 fn inline_align(_context: fidl::encoding::Context) -> usize {
297 std::mem::align_of::<u32>()
298 }
299
300 #[inline(always)]
301 fn inline_size(_context: fidl::encoding::Context) -> usize {
302 std::mem::size_of::<u32>()
303 }
304
305 #[inline(always)]
306 fn encode_is_copy() -> bool {
307 true
308 }
309
310 #[inline(always)]
311 fn decode_is_copy() -> bool {
312 false
313 }
314 }
315
316 impl fidl::encoding::ValueTypeMarker for ConfigurationError {
317 type Borrowed<'a> = Self;
318 #[inline(always)]
319 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
320 *value
321 }
322 }
323
324 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
325 for ConfigurationError
326 {
327 #[inline]
328 unsafe fn encode(
329 self,
330 encoder: &mut fidl::encoding::Encoder<'_, D>,
331 offset: usize,
332 _depth: fidl::encoding::Depth,
333 ) -> fidl::Result<()> {
334 encoder.debug_check_bounds::<Self>(offset);
335 encoder.write_num(self.into_primitive(), offset);
336 Ok(())
337 }
338 }
339
340 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigurationError {
341 #[inline(always)]
342 fn new_empty() -> Self {
343 Self::InvalidArguments
344 }
345
346 #[inline]
347 unsafe fn decode(
348 &mut self,
349 decoder: &mut fidl::encoding::Decoder<'_, D>,
350 offset: usize,
351 _depth: fidl::encoding::Depth,
352 ) -> fidl::Result<()> {
353 decoder.debug_check_bounds::<Self>(offset);
354 let prim = decoder.read_num::<u32>(offset);
355
356 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
357 Ok(())
358 }
359 }
360 unsafe impl fidl::encoding::TypeMarker for StorageVariant {
361 type Owned = Self;
362
363 #[inline(always)]
364 fn inline_align(_context: fidl::encoding::Context) -> usize {
365 std::mem::align_of::<u8>()
366 }
367
368 #[inline(always)]
369 fn inline_size(_context: fidl::encoding::Context) -> usize {
370 std::mem::size_of::<u8>()
371 }
372
373 #[inline(always)]
374 fn encode_is_copy() -> bool {
375 true
376 }
377
378 #[inline(always)]
379 fn decode_is_copy() -> bool {
380 false
381 }
382 }
383
384 impl fidl::encoding::ValueTypeMarker for StorageVariant {
385 type Borrowed<'a> = Self;
386 #[inline(always)]
387 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
388 *value
389 }
390 }
391
392 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for StorageVariant {
393 #[inline]
394 unsafe fn encode(
395 self,
396 encoder: &mut fidl::encoding::Encoder<'_, D>,
397 offset: usize,
398 _depth: fidl::encoding::Depth,
399 ) -> fidl::Result<()> {
400 encoder.debug_check_bounds::<Self>(offset);
401 encoder.write_num(self.into_primitive(), offset);
402 Ok(())
403 }
404 }
405
406 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StorageVariant {
407 #[inline(always)]
408 fn new_empty() -> Self {
409 Self::Data
410 }
411
412 #[inline]
413 unsafe fn decode(
414 &mut self,
415 decoder: &mut fidl::encoding::Decoder<'_, D>,
416 offset: usize,
417 _depth: fidl::encoding::Depth,
418 ) -> fidl::Result<()> {
419 decoder.debug_check_bounds::<Self>(offset);
420 let prim = decoder.read_num::<u8>(offset);
421
422 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
423 Ok(())
424 }
425 }
426
427 impl fidl::encoding::ValueTypeMarker for ChildConfigValue {
428 type Borrowed<'a> = &'a Self;
429 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
430 value
431 }
432 }
433
434 unsafe impl fidl::encoding::TypeMarker for ChildConfigValue {
435 type Owned = Self;
436
437 #[inline(always)]
438 fn inline_align(_context: fidl::encoding::Context) -> usize {
439 8
440 }
441
442 #[inline(always)]
443 fn inline_size(_context: fidl::encoding::Context) -> usize {
444 32
445 }
446 }
447
448 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ChildConfigValue, D>
449 for &ChildConfigValue
450 {
451 #[inline]
452 unsafe fn encode(
453 self,
454 encoder: &mut fidl::encoding::Encoder<'_, D>,
455 offset: usize,
456 _depth: fidl::encoding::Depth,
457 ) -> fidl::Result<()> {
458 encoder.debug_check_bounds::<ChildConfigValue>(offset);
459 fidl::encoding::Encode::<ChildConfigValue, D>::encode(
461 (
462 <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
463 <fidl_fuchsia_component_decl::ConfigValue as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
464 ),
465 encoder, offset, _depth
466 )
467 }
468 }
469 unsafe impl<
470 D: fidl::encoding::ResourceDialect,
471 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
472 T1: fidl::encoding::Encode<fidl_fuchsia_component_decl::ConfigValue, D>,
473 > fidl::encoding::Encode<ChildConfigValue, D> for (T0, T1)
474 {
475 #[inline]
476 unsafe fn encode(
477 self,
478 encoder: &mut fidl::encoding::Encoder<'_, D>,
479 offset: usize,
480 depth: fidl::encoding::Depth,
481 ) -> fidl::Result<()> {
482 encoder.debug_check_bounds::<ChildConfigValue>(offset);
483 self.0.encode(encoder, offset + 0, depth)?;
487 self.1.encode(encoder, offset + 16, depth)?;
488 Ok(())
489 }
490 }
491
492 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChildConfigValue {
493 #[inline(always)]
494 fn new_empty() -> Self {
495 Self {
496 key: fidl::new_empty!(fidl::encoding::BoundedString<64>, D),
497 value: fidl::new_empty!(fidl_fuchsia_component_decl::ConfigValue, D),
498 }
499 }
500
501 #[inline]
502 unsafe fn decode(
503 &mut self,
504 decoder: &mut fidl::encoding::Decoder<'_, D>,
505 offset: usize,
506 _depth: fidl::encoding::Depth,
507 ) -> fidl::Result<()> {
508 decoder.debug_check_bounds::<Self>(offset);
509 fidl::decode!(
511 fidl::encoding::BoundedString<64>,
512 D,
513 &mut self.key,
514 decoder,
515 offset + 0,
516 _depth
517 )?;
518 fidl::decode!(
519 fidl_fuchsia_component_decl::ConfigValue,
520 D,
521 &mut self.value,
522 decoder,
523 offset + 16,
524 _depth
525 )?;
526 Ok(())
527 }
528 }
529
530 impl fidl::encoding::ValueTypeMarker for Empty {
531 type Borrowed<'a> = &'a Self;
532 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
533 value
534 }
535 }
536
537 unsafe impl fidl::encoding::TypeMarker for Empty {
538 type Owned = Self;
539
540 #[inline(always)]
541 fn inline_align(_context: fidl::encoding::Context) -> usize {
542 1
543 }
544
545 #[inline(always)]
546 fn inline_size(_context: fidl::encoding::Context) -> usize {
547 1
548 }
549 }
550
551 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
552 #[inline]
553 unsafe fn encode(
554 self,
555 encoder: &mut fidl::encoding::Encoder<'_, D>,
556 offset: usize,
557 _depth: fidl::encoding::Depth,
558 ) -> fidl::Result<()> {
559 encoder.debug_check_bounds::<Empty>(offset);
560 encoder.write_num(0u8, offset);
561 Ok(())
562 }
563 }
564
565 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
566 #[inline(always)]
567 fn new_empty() -> Self {
568 Self
569 }
570
571 #[inline]
572 unsafe fn decode(
573 &mut self,
574 decoder: &mut fidl::encoding::Decoder<'_, D>,
575 offset: usize,
576 _depth: fidl::encoding::Depth,
577 ) -> fidl::Result<()> {
578 decoder.debug_check_bounds::<Self>(offset);
579 match decoder.read_num::<u8>(offset) {
580 0 => Ok(()),
581 _ => Err(fidl::Error::Invalid),
582 }
583 }
584 }
585
586 impl fidl::encoding::ValueTypeMarker for ManagedRealmGetMonikerResponse {
587 type Borrowed<'a> = &'a Self;
588 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
589 value
590 }
591 }
592
593 unsafe impl fidl::encoding::TypeMarker for ManagedRealmGetMonikerResponse {
594 type Owned = Self;
595
596 #[inline(always)]
597 fn inline_align(_context: fidl::encoding::Context) -> usize {
598 8
599 }
600
601 #[inline(always)]
602 fn inline_size(_context: fidl::encoding::Context) -> usize {
603 16
604 }
605 }
606
607 unsafe impl<D: fidl::encoding::ResourceDialect>
608 fidl::encoding::Encode<ManagedRealmGetMonikerResponse, D>
609 for &ManagedRealmGetMonikerResponse
610 {
611 #[inline]
612 unsafe fn encode(
613 self,
614 encoder: &mut fidl::encoding::Encoder<'_, D>,
615 offset: usize,
616 _depth: fidl::encoding::Depth,
617 ) -> fidl::Result<()> {
618 encoder.debug_check_bounds::<ManagedRealmGetMonikerResponse>(offset);
619 fidl::encoding::Encode::<ManagedRealmGetMonikerResponse, D>::encode(
621 (<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
622 &self.moniker,
623 ),),
624 encoder,
625 offset,
626 _depth,
627 )
628 }
629 }
630 unsafe impl<
631 D: fidl::encoding::ResourceDialect,
632 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
633 > fidl::encoding::Encode<ManagedRealmGetMonikerResponse, D> for (T0,)
634 {
635 #[inline]
636 unsafe fn encode(
637 self,
638 encoder: &mut fidl::encoding::Encoder<'_, D>,
639 offset: usize,
640 depth: fidl::encoding::Depth,
641 ) -> fidl::Result<()> {
642 encoder.debug_check_bounds::<ManagedRealmGetMonikerResponse>(offset);
643 self.0.encode(encoder, offset + 0, depth)?;
647 Ok(())
648 }
649 }
650
651 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
652 for ManagedRealmGetMonikerResponse
653 {
654 #[inline(always)]
655 fn new_empty() -> Self {
656 Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
657 }
658
659 #[inline]
660 unsafe fn decode(
661 &mut self,
662 decoder: &mut fidl::encoding::Decoder<'_, D>,
663 offset: usize,
664 _depth: fidl::encoding::Depth,
665 ) -> fidl::Result<()> {
666 decoder.debug_check_bounds::<Self>(offset);
667 fidl::decode!(
669 fidl::encoding::BoundedString<4096>,
670 D,
671 &mut self.moniker,
672 decoder,
673 offset + 0,
674 _depth
675 )?;
676 Ok(())
677 }
678 }
679
680 impl fidl::encoding::ValueTypeMarker for ManagedRealmRemoveDeviceRequest {
681 type Borrowed<'a> = &'a Self;
682 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
683 value
684 }
685 }
686
687 unsafe impl fidl::encoding::TypeMarker for ManagedRealmRemoveDeviceRequest {
688 type Owned = Self;
689
690 #[inline(always)]
691 fn inline_align(_context: fidl::encoding::Context) -> usize {
692 8
693 }
694
695 #[inline(always)]
696 fn inline_size(_context: fidl::encoding::Context) -> usize {
697 16
698 }
699 }
700
701 unsafe impl<D: fidl::encoding::ResourceDialect>
702 fidl::encoding::Encode<ManagedRealmRemoveDeviceRequest, D>
703 for &ManagedRealmRemoveDeviceRequest
704 {
705 #[inline]
706 unsafe fn encode(
707 self,
708 encoder: &mut fidl::encoding::Encoder<'_, D>,
709 offset: usize,
710 _depth: fidl::encoding::Depth,
711 ) -> fidl::Result<()> {
712 encoder.debug_check_bounds::<ManagedRealmRemoveDeviceRequest>(offset);
713 fidl::encoding::Encode::<ManagedRealmRemoveDeviceRequest, D>::encode(
715 (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
716 &self.path,
717 ),),
718 encoder,
719 offset,
720 _depth,
721 )
722 }
723 }
724 unsafe impl<
725 D: fidl::encoding::ResourceDialect,
726 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
727 > fidl::encoding::Encode<ManagedRealmRemoveDeviceRequest, D> for (T0,)
728 {
729 #[inline]
730 unsafe fn encode(
731 self,
732 encoder: &mut fidl::encoding::Encoder<'_, D>,
733 offset: usize,
734 depth: fidl::encoding::Depth,
735 ) -> fidl::Result<()> {
736 encoder.debug_check_bounds::<ManagedRealmRemoveDeviceRequest>(offset);
737 self.0.encode(encoder, offset + 0, depth)?;
741 Ok(())
742 }
743 }
744
745 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
746 for ManagedRealmRemoveDeviceRequest
747 {
748 #[inline(always)]
749 fn new_empty() -> Self {
750 Self { path: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
751 }
752
753 #[inline]
754 unsafe fn decode(
755 &mut self,
756 decoder: &mut fidl::encoding::Decoder<'_, D>,
757 offset: usize,
758 _depth: fidl::encoding::Depth,
759 ) -> fidl::Result<()> {
760 decoder.debug_check_bounds::<Self>(offset);
761 fidl::decode!(
763 fidl::encoding::UnboundedString,
764 D,
765 &mut self.path,
766 decoder,
767 offset + 0,
768 _depth
769 )?;
770 Ok(())
771 }
772 }
773
774 impl fidl::encoding::ValueTypeMarker for ManagedRealmStartChildComponentRequest {
775 type Borrowed<'a> = &'a Self;
776 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
777 value
778 }
779 }
780
781 unsafe impl fidl::encoding::TypeMarker for ManagedRealmStartChildComponentRequest {
782 type Owned = Self;
783
784 #[inline(always)]
785 fn inline_align(_context: fidl::encoding::Context) -> usize {
786 8
787 }
788
789 #[inline(always)]
790 fn inline_size(_context: fidl::encoding::Context) -> usize {
791 16
792 }
793 }
794
795 unsafe impl<D: fidl::encoding::ResourceDialect>
796 fidl::encoding::Encode<ManagedRealmStartChildComponentRequest, D>
797 for &ManagedRealmStartChildComponentRequest
798 {
799 #[inline]
800 unsafe fn encode(
801 self,
802 encoder: &mut fidl::encoding::Encoder<'_, D>,
803 offset: usize,
804 _depth: fidl::encoding::Depth,
805 ) -> fidl::Result<()> {
806 encoder.debug_check_bounds::<ManagedRealmStartChildComponentRequest>(offset);
807 fidl::encoding::Encode::<ManagedRealmStartChildComponentRequest, D>::encode(
809 (<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
810 &self.child_name,
811 ),),
812 encoder,
813 offset,
814 _depth,
815 )
816 }
817 }
818 unsafe impl<
819 D: fidl::encoding::ResourceDialect,
820 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
821 > fidl::encoding::Encode<ManagedRealmStartChildComponentRequest, D> for (T0,)
822 {
823 #[inline]
824 unsafe fn encode(
825 self,
826 encoder: &mut fidl::encoding::Encoder<'_, D>,
827 offset: usize,
828 depth: fidl::encoding::Depth,
829 ) -> fidl::Result<()> {
830 encoder.debug_check_bounds::<ManagedRealmStartChildComponentRequest>(offset);
831 self.0.encode(encoder, offset + 0, depth)?;
835 Ok(())
836 }
837 }
838
839 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
840 for ManagedRealmStartChildComponentRequest
841 {
842 #[inline(always)]
843 fn new_empty() -> Self {
844 Self { child_name: fidl::new_empty!(fidl::encoding::BoundedString<255>, D) }
845 }
846
847 #[inline]
848 unsafe fn decode(
849 &mut self,
850 decoder: &mut fidl::encoding::Decoder<'_, D>,
851 offset: usize,
852 _depth: fidl::encoding::Depth,
853 ) -> fidl::Result<()> {
854 decoder.debug_check_bounds::<Self>(offset);
855 fidl::decode!(
857 fidl::encoding::BoundedString<255>,
858 D,
859 &mut self.child_name,
860 decoder,
861 offset + 0,
862 _depth
863 )?;
864 Ok(())
865 }
866 }
867
868 impl fidl::encoding::ValueTypeMarker for ManagedRealmStopChildComponentRequest {
869 type Borrowed<'a> = &'a Self;
870 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
871 value
872 }
873 }
874
875 unsafe impl fidl::encoding::TypeMarker for ManagedRealmStopChildComponentRequest {
876 type Owned = Self;
877
878 #[inline(always)]
879 fn inline_align(_context: fidl::encoding::Context) -> usize {
880 8
881 }
882
883 #[inline(always)]
884 fn inline_size(_context: fidl::encoding::Context) -> usize {
885 16
886 }
887 }
888
889 unsafe impl<D: fidl::encoding::ResourceDialect>
890 fidl::encoding::Encode<ManagedRealmStopChildComponentRequest, D>
891 for &ManagedRealmStopChildComponentRequest
892 {
893 #[inline]
894 unsafe fn encode(
895 self,
896 encoder: &mut fidl::encoding::Encoder<'_, D>,
897 offset: usize,
898 _depth: fidl::encoding::Depth,
899 ) -> fidl::Result<()> {
900 encoder.debug_check_bounds::<ManagedRealmStopChildComponentRequest>(offset);
901 fidl::encoding::Encode::<ManagedRealmStopChildComponentRequest, D>::encode(
903 (<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
904 &self.child_name,
905 ),),
906 encoder,
907 offset,
908 _depth,
909 )
910 }
911 }
912 unsafe impl<
913 D: fidl::encoding::ResourceDialect,
914 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
915 > fidl::encoding::Encode<ManagedRealmStopChildComponentRequest, D> for (T0,)
916 {
917 #[inline]
918 unsafe fn encode(
919 self,
920 encoder: &mut fidl::encoding::Encoder<'_, D>,
921 offset: usize,
922 depth: fidl::encoding::Depth,
923 ) -> fidl::Result<()> {
924 encoder.debug_check_bounds::<ManagedRealmStopChildComponentRequest>(offset);
925 self.0.encode(encoder, offset + 0, depth)?;
929 Ok(())
930 }
931 }
932
933 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
934 for ManagedRealmStopChildComponentRequest
935 {
936 #[inline(always)]
937 fn new_empty() -> Self {
938 Self { child_name: fidl::new_empty!(fidl::encoding::BoundedString<255>, D) }
939 }
940
941 #[inline]
942 unsafe fn decode(
943 &mut self,
944 decoder: &mut fidl::encoding::Decoder<'_, D>,
945 offset: usize,
946 _depth: fidl::encoding::Depth,
947 ) -> fidl::Result<()> {
948 decoder.debug_check_bounds::<Self>(offset);
949 fidl::decode!(
951 fidl::encoding::BoundedString<255>,
952 D,
953 &mut self.child_name,
954 decoder,
955 offset + 0,
956 _depth
957 )?;
958 Ok(())
959 }
960 }
961
962 impl ChildDep {
963 #[inline(always)]
964 fn max_ordinal_present(&self) -> u64 {
965 if let Some(_) = self.capability {
966 return 2;
967 }
968 if let Some(_) = self.name {
969 return 1;
970 }
971 0
972 }
973 }
974
975 impl fidl::encoding::ValueTypeMarker for ChildDep {
976 type Borrowed<'a> = &'a Self;
977 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
978 value
979 }
980 }
981
982 unsafe impl fidl::encoding::TypeMarker for ChildDep {
983 type Owned = Self;
984
985 #[inline(always)]
986 fn inline_align(_context: fidl::encoding::Context) -> usize {
987 8
988 }
989
990 #[inline(always)]
991 fn inline_size(_context: fidl::encoding::Context) -> usize {
992 16
993 }
994 }
995
996 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ChildDep, D> for &ChildDep {
997 unsafe fn encode(
998 self,
999 encoder: &mut fidl::encoding::Encoder<'_, D>,
1000 offset: usize,
1001 mut depth: fidl::encoding::Depth,
1002 ) -> fidl::Result<()> {
1003 encoder.debug_check_bounds::<ChildDep>(offset);
1004 let max_ordinal: u64 = self.max_ordinal_present();
1006 encoder.write_num(max_ordinal, offset);
1007 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1008 if max_ordinal == 0 {
1010 return Ok(());
1011 }
1012 depth.increment()?;
1013 let envelope_size = 8;
1014 let bytes_len = max_ordinal as usize * envelope_size;
1015 #[allow(unused_variables)]
1016 let offset = encoder.out_of_line_offset(bytes_len);
1017 let mut _prev_end_offset: usize = 0;
1018 if 1 > max_ordinal {
1019 return Ok(());
1020 }
1021
1022 let cur_offset: usize = (1 - 1) * envelope_size;
1025
1026 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1028
1029 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
1034 self.name.as_ref().map(
1035 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
1036 ),
1037 encoder,
1038 offset + cur_offset,
1039 depth,
1040 )?;
1041
1042 _prev_end_offset = cur_offset + envelope_size;
1043 if 2 > max_ordinal {
1044 return Ok(());
1045 }
1046
1047 let cur_offset: usize = (2 - 1) * envelope_size;
1050
1051 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1053
1054 fidl::encoding::encode_in_envelope_optional::<ExposedCapability, D>(
1059 self.capability
1060 .as_ref()
1061 .map(<ExposedCapability as fidl::encoding::ValueTypeMarker>::borrow),
1062 encoder,
1063 offset + cur_offset,
1064 depth,
1065 )?;
1066
1067 _prev_end_offset = cur_offset + envelope_size;
1068
1069 Ok(())
1070 }
1071 }
1072
1073 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChildDep {
1074 #[inline(always)]
1075 fn new_empty() -> Self {
1076 Self::default()
1077 }
1078
1079 unsafe fn decode(
1080 &mut self,
1081 decoder: &mut fidl::encoding::Decoder<'_, D>,
1082 offset: usize,
1083 mut depth: fidl::encoding::Depth,
1084 ) -> fidl::Result<()> {
1085 decoder.debug_check_bounds::<Self>(offset);
1086 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1087 None => return Err(fidl::Error::NotNullable),
1088 Some(len) => len,
1089 };
1090 if len == 0 {
1092 return Ok(());
1093 };
1094 depth.increment()?;
1095 let envelope_size = 8;
1096 let bytes_len = len * envelope_size;
1097 let offset = decoder.out_of_line_offset(bytes_len)?;
1098 let mut _next_ordinal_to_read = 0;
1100 let mut next_offset = offset;
1101 let end_offset = offset + bytes_len;
1102 _next_ordinal_to_read += 1;
1103 if next_offset >= end_offset {
1104 return Ok(());
1105 }
1106
1107 while _next_ordinal_to_read < 1 {
1109 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1110 _next_ordinal_to_read += 1;
1111 next_offset += envelope_size;
1112 }
1113
1114 let next_out_of_line = decoder.next_out_of_line();
1115 let handles_before = decoder.remaining_handles();
1116 if let Some((inlined, num_bytes, num_handles)) =
1117 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1118 {
1119 let member_inline_size =
1120 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
1121 decoder.context,
1122 );
1123 if inlined != (member_inline_size <= 4) {
1124 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1125 }
1126 let inner_offset;
1127 let mut inner_depth = depth.clone();
1128 if inlined {
1129 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1130 inner_offset = next_offset;
1131 } else {
1132 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1133 inner_depth.increment()?;
1134 }
1135 let val_ref = self
1136 .name
1137 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
1138 fidl::decode!(
1139 fidl::encoding::BoundedString<255>,
1140 D,
1141 val_ref,
1142 decoder,
1143 inner_offset,
1144 inner_depth
1145 )?;
1146 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1147 {
1148 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1149 }
1150 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1151 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1152 }
1153 }
1154
1155 next_offset += envelope_size;
1156 _next_ordinal_to_read += 1;
1157 if next_offset >= end_offset {
1158 return Ok(());
1159 }
1160
1161 while _next_ordinal_to_read < 2 {
1163 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1164 _next_ordinal_to_read += 1;
1165 next_offset += envelope_size;
1166 }
1167
1168 let next_out_of_line = decoder.next_out_of_line();
1169 let handles_before = decoder.remaining_handles();
1170 if let Some((inlined, num_bytes, num_handles)) =
1171 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1172 {
1173 let member_inline_size =
1174 <ExposedCapability as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1175 if inlined != (member_inline_size <= 4) {
1176 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1177 }
1178 let inner_offset;
1179 let mut inner_depth = depth.clone();
1180 if inlined {
1181 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1182 inner_offset = next_offset;
1183 } else {
1184 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1185 inner_depth.increment()?;
1186 }
1187 let val_ref =
1188 self.capability.get_or_insert_with(|| fidl::new_empty!(ExposedCapability, D));
1189 fidl::decode!(ExposedCapability, D, val_ref, decoder, inner_offset, inner_depth)?;
1190 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1191 {
1192 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1193 }
1194 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1195 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1196 }
1197 }
1198
1199 next_offset += envelope_size;
1200
1201 while next_offset < end_offset {
1203 _next_ordinal_to_read += 1;
1204 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1205 next_offset += envelope_size;
1206 }
1207
1208 Ok(())
1209 }
1210 }
1211
1212 impl DevfsDep {
1213 #[inline(always)]
1214 fn max_ordinal_present(&self) -> u64 {
1215 if let Some(_) = self.subdir {
1216 return 2;
1217 }
1218 if let Some(_) = self.name {
1219 return 1;
1220 }
1221 0
1222 }
1223 }
1224
1225 impl fidl::encoding::ValueTypeMarker for DevfsDep {
1226 type Borrowed<'a> = &'a Self;
1227 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1228 value
1229 }
1230 }
1231
1232 unsafe impl fidl::encoding::TypeMarker for DevfsDep {
1233 type Owned = Self;
1234
1235 #[inline(always)]
1236 fn inline_align(_context: fidl::encoding::Context) -> usize {
1237 8
1238 }
1239
1240 #[inline(always)]
1241 fn inline_size(_context: fidl::encoding::Context) -> usize {
1242 16
1243 }
1244 }
1245
1246 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DevfsDep, D> for &DevfsDep {
1247 unsafe fn encode(
1248 self,
1249 encoder: &mut fidl::encoding::Encoder<'_, D>,
1250 offset: usize,
1251 mut depth: fidl::encoding::Depth,
1252 ) -> fidl::Result<()> {
1253 encoder.debug_check_bounds::<DevfsDep>(offset);
1254 let max_ordinal: u64 = self.max_ordinal_present();
1256 encoder.write_num(max_ordinal, offset);
1257 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1258 if max_ordinal == 0 {
1260 return Ok(());
1261 }
1262 depth.increment()?;
1263 let envelope_size = 8;
1264 let bytes_len = max_ordinal as usize * envelope_size;
1265 #[allow(unused_variables)]
1266 let offset = encoder.out_of_line_offset(bytes_len);
1267 let mut _prev_end_offset: usize = 0;
1268 if 1 > max_ordinal {
1269 return Ok(());
1270 }
1271
1272 let cur_offset: usize = (1 - 1) * envelope_size;
1275
1276 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1278
1279 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
1284 self.name.as_ref().map(
1285 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
1286 ),
1287 encoder,
1288 offset + cur_offset,
1289 depth,
1290 )?;
1291
1292 _prev_end_offset = cur_offset + envelope_size;
1293 if 2 > max_ordinal {
1294 return Ok(());
1295 }
1296
1297 let cur_offset: usize = (2 - 1) * envelope_size;
1300
1301 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1303
1304 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, D>(
1309 self.subdir.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
1310 encoder, offset + cur_offset, depth
1311 )?;
1312
1313 _prev_end_offset = cur_offset + envelope_size;
1314
1315 Ok(())
1316 }
1317 }
1318
1319 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DevfsDep {
1320 #[inline(always)]
1321 fn new_empty() -> Self {
1322 Self::default()
1323 }
1324
1325 unsafe fn decode(
1326 &mut self,
1327 decoder: &mut fidl::encoding::Decoder<'_, D>,
1328 offset: usize,
1329 mut depth: fidl::encoding::Depth,
1330 ) -> fidl::Result<()> {
1331 decoder.debug_check_bounds::<Self>(offset);
1332 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1333 None => return Err(fidl::Error::NotNullable),
1334 Some(len) => len,
1335 };
1336 if len == 0 {
1338 return Ok(());
1339 };
1340 depth.increment()?;
1341 let envelope_size = 8;
1342 let bytes_len = len * envelope_size;
1343 let offset = decoder.out_of_line_offset(bytes_len)?;
1344 let mut _next_ordinal_to_read = 0;
1346 let mut next_offset = offset;
1347 let end_offset = offset + bytes_len;
1348 _next_ordinal_to_read += 1;
1349 if next_offset >= end_offset {
1350 return Ok(());
1351 }
1352
1353 while _next_ordinal_to_read < 1 {
1355 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1356 _next_ordinal_to_read += 1;
1357 next_offset += envelope_size;
1358 }
1359
1360 let next_out_of_line = decoder.next_out_of_line();
1361 let handles_before = decoder.remaining_handles();
1362 if let Some((inlined, num_bytes, num_handles)) =
1363 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1364 {
1365 let member_inline_size =
1366 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
1367 decoder.context,
1368 );
1369 if inlined != (member_inline_size <= 4) {
1370 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1371 }
1372 let inner_offset;
1373 let mut inner_depth = depth.clone();
1374 if inlined {
1375 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1376 inner_offset = next_offset;
1377 } else {
1378 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1379 inner_depth.increment()?;
1380 }
1381 let val_ref = self
1382 .name
1383 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
1384 fidl::decode!(
1385 fidl::encoding::BoundedString<255>,
1386 D,
1387 val_ref,
1388 decoder,
1389 inner_offset,
1390 inner_depth
1391 )?;
1392 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1393 {
1394 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1395 }
1396 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1397 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1398 }
1399 }
1400
1401 next_offset += envelope_size;
1402 _next_ordinal_to_read += 1;
1403 if next_offset >= end_offset {
1404 return Ok(());
1405 }
1406
1407 while _next_ordinal_to_read < 2 {
1409 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1410 _next_ordinal_to_read += 1;
1411 next_offset += envelope_size;
1412 }
1413
1414 let next_out_of_line = decoder.next_out_of_line();
1415 let handles_before = decoder.remaining_handles();
1416 if let Some((inlined, num_bytes, num_handles)) =
1417 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1418 {
1419 let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1420 if inlined != (member_inline_size <= 4) {
1421 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1422 }
1423 let inner_offset;
1424 let mut inner_depth = depth.clone();
1425 if inlined {
1426 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1427 inner_offset = next_offset;
1428 } else {
1429 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1430 inner_depth.increment()?;
1431 }
1432 let val_ref = self.subdir.get_or_insert_with(|| {
1433 fidl::new_empty!(fidl::encoding::BoundedString<4095>, D)
1434 });
1435 fidl::decode!(
1436 fidl::encoding::BoundedString<4095>,
1437 D,
1438 val_ref,
1439 decoder,
1440 inner_offset,
1441 inner_depth
1442 )?;
1443 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1444 {
1445 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1446 }
1447 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1448 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1449 }
1450 }
1451
1452 next_offset += envelope_size;
1453
1454 while next_offset < end_offset {
1456 _next_ordinal_to_read += 1;
1457 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1458 next_offset += envelope_size;
1459 }
1460
1461 Ok(())
1462 }
1463 }
1464
1465 impl StorageDep {
1466 #[inline(always)]
1467 fn max_ordinal_present(&self) -> u64 {
1468 if let Some(_) = self.path {
1469 return 2;
1470 }
1471 if let Some(_) = self.variant {
1472 return 1;
1473 }
1474 0
1475 }
1476 }
1477
1478 impl fidl::encoding::ValueTypeMarker for StorageDep {
1479 type Borrowed<'a> = &'a Self;
1480 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1481 value
1482 }
1483 }
1484
1485 unsafe impl fidl::encoding::TypeMarker for StorageDep {
1486 type Owned = Self;
1487
1488 #[inline(always)]
1489 fn inline_align(_context: fidl::encoding::Context) -> usize {
1490 8
1491 }
1492
1493 #[inline(always)]
1494 fn inline_size(_context: fidl::encoding::Context) -> usize {
1495 16
1496 }
1497 }
1498
1499 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StorageDep, D>
1500 for &StorageDep
1501 {
1502 unsafe fn encode(
1503 self,
1504 encoder: &mut fidl::encoding::Encoder<'_, D>,
1505 offset: usize,
1506 mut depth: fidl::encoding::Depth,
1507 ) -> fidl::Result<()> {
1508 encoder.debug_check_bounds::<StorageDep>(offset);
1509 let max_ordinal: u64 = self.max_ordinal_present();
1511 encoder.write_num(max_ordinal, offset);
1512 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1513 if max_ordinal == 0 {
1515 return Ok(());
1516 }
1517 depth.increment()?;
1518 let envelope_size = 8;
1519 let bytes_len = max_ordinal as usize * envelope_size;
1520 #[allow(unused_variables)]
1521 let offset = encoder.out_of_line_offset(bytes_len);
1522 let mut _prev_end_offset: usize = 0;
1523 if 1 > max_ordinal {
1524 return Ok(());
1525 }
1526
1527 let cur_offset: usize = (1 - 1) * envelope_size;
1530
1531 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1533
1534 fidl::encoding::encode_in_envelope_optional::<StorageVariant, D>(
1539 self.variant
1540 .as_ref()
1541 .map(<StorageVariant as fidl::encoding::ValueTypeMarker>::borrow),
1542 encoder,
1543 offset + cur_offset,
1544 depth,
1545 )?;
1546
1547 _prev_end_offset = cur_offset + envelope_size;
1548 if 2 > max_ordinal {
1549 return Ok(());
1550 }
1551
1552 let cur_offset: usize = (2 - 1) * envelope_size;
1555
1556 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1558
1559 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, D>(
1564 self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
1565 encoder, offset + cur_offset, depth
1566 )?;
1567
1568 _prev_end_offset = cur_offset + envelope_size;
1569
1570 Ok(())
1571 }
1572 }
1573
1574 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StorageDep {
1575 #[inline(always)]
1576 fn new_empty() -> Self {
1577 Self::default()
1578 }
1579
1580 unsafe fn decode(
1581 &mut self,
1582 decoder: &mut fidl::encoding::Decoder<'_, D>,
1583 offset: usize,
1584 mut depth: fidl::encoding::Depth,
1585 ) -> fidl::Result<()> {
1586 decoder.debug_check_bounds::<Self>(offset);
1587 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1588 None => return Err(fidl::Error::NotNullable),
1589 Some(len) => len,
1590 };
1591 if len == 0 {
1593 return Ok(());
1594 };
1595 depth.increment()?;
1596 let envelope_size = 8;
1597 let bytes_len = len * envelope_size;
1598 let offset = decoder.out_of_line_offset(bytes_len)?;
1599 let mut _next_ordinal_to_read = 0;
1601 let mut next_offset = offset;
1602 let end_offset = offset + bytes_len;
1603 _next_ordinal_to_read += 1;
1604 if next_offset >= end_offset {
1605 return Ok(());
1606 }
1607
1608 while _next_ordinal_to_read < 1 {
1610 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1611 _next_ordinal_to_read += 1;
1612 next_offset += envelope_size;
1613 }
1614
1615 let next_out_of_line = decoder.next_out_of_line();
1616 let handles_before = decoder.remaining_handles();
1617 if let Some((inlined, num_bytes, num_handles)) =
1618 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1619 {
1620 let member_inline_size =
1621 <StorageVariant as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1622 if inlined != (member_inline_size <= 4) {
1623 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1624 }
1625 let inner_offset;
1626 let mut inner_depth = depth.clone();
1627 if inlined {
1628 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1629 inner_offset = next_offset;
1630 } else {
1631 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1632 inner_depth.increment()?;
1633 }
1634 let val_ref =
1635 self.variant.get_or_insert_with(|| fidl::new_empty!(StorageVariant, D));
1636 fidl::decode!(StorageVariant, D, val_ref, decoder, inner_offset, inner_depth)?;
1637 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1638 {
1639 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1640 }
1641 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1642 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1643 }
1644 }
1645
1646 next_offset += envelope_size;
1647 _next_ordinal_to_read += 1;
1648 if next_offset >= end_offset {
1649 return Ok(());
1650 }
1651
1652 while _next_ordinal_to_read < 2 {
1654 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1655 _next_ordinal_to_read += 1;
1656 next_offset += envelope_size;
1657 }
1658
1659 let next_out_of_line = decoder.next_out_of_line();
1660 let handles_before = decoder.remaining_handles();
1661 if let Some((inlined, num_bytes, num_handles)) =
1662 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1663 {
1664 let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1665 if inlined != (member_inline_size <= 4) {
1666 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1667 }
1668 let inner_offset;
1669 let mut inner_depth = depth.clone();
1670 if inlined {
1671 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1672 inner_offset = next_offset;
1673 } else {
1674 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1675 inner_depth.increment()?;
1676 }
1677 let val_ref = self.path.get_or_insert_with(|| {
1678 fidl::new_empty!(fidl::encoding::BoundedString<4095>, D)
1679 });
1680 fidl::decode!(
1681 fidl::encoding::BoundedString<4095>,
1682 D,
1683 val_ref,
1684 decoder,
1685 inner_offset,
1686 inner_depth
1687 )?;
1688 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1689 {
1690 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1691 }
1692 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1693 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1694 }
1695 }
1696
1697 next_offset += envelope_size;
1698
1699 while next_offset < end_offset {
1701 _next_ordinal_to_read += 1;
1702 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1703 next_offset += envelope_size;
1704 }
1705
1706 Ok(())
1707 }
1708 }
1709
1710 impl fidl::encoding::ValueTypeMarker for Capability {
1711 type Borrowed<'a> = &'a Self;
1712 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1713 value
1714 }
1715 }
1716
1717 unsafe impl fidl::encoding::TypeMarker for Capability {
1718 type Owned = Self;
1719
1720 #[inline(always)]
1721 fn inline_align(_context: fidl::encoding::Context) -> usize {
1722 8
1723 }
1724
1725 #[inline(always)]
1726 fn inline_size(_context: fidl::encoding::Context) -> usize {
1727 16
1728 }
1729 }
1730
1731 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Capability, D>
1732 for &Capability
1733 {
1734 #[inline]
1735 unsafe fn encode(
1736 self,
1737 encoder: &mut fidl::encoding::Encoder<'_, D>,
1738 offset: usize,
1739 _depth: fidl::encoding::Depth,
1740 ) -> fidl::Result<()> {
1741 encoder.debug_check_bounds::<Capability>(offset);
1742 encoder.write_num::<u64>(self.ordinal(), offset);
1743 match self {
1744 Capability::NetemulDevfs(ref val) => {
1745 fidl::encoding::encode_in_envelope::<DevfsDep, D>(
1746 <DevfsDep as fidl::encoding::ValueTypeMarker>::borrow(val),
1747 encoder,
1748 offset + 8,
1749 _depth,
1750 )
1751 }
1752 Capability::NetemulNetworkContext(ref val) => {
1753 fidl::encoding::encode_in_envelope::<Empty, D>(
1754 <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
1755 encoder,
1756 offset + 8,
1757 _depth,
1758 )
1759 }
1760 Capability::LogSink(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
1761 <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
1762 encoder,
1763 offset + 8,
1764 _depth,
1765 ),
1766 Capability::ChildDep(ref val) => fidl::encoding::encode_in_envelope::<ChildDep, D>(
1767 <ChildDep as fidl::encoding::ValueTypeMarker>::borrow(val),
1768 encoder,
1769 offset + 8,
1770 _depth,
1771 ),
1772 Capability::StorageDep(ref val) => {
1773 fidl::encoding::encode_in_envelope::<StorageDep, D>(
1774 <StorageDep as fidl::encoding::ValueTypeMarker>::borrow(val),
1775 encoder,
1776 offset + 8,
1777 _depth,
1778 )
1779 }
1780 Capability::TracingProvider(ref val) => {
1781 fidl::encoding::encode_in_envelope::<Empty, D>(
1782 <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
1783 encoder,
1784 offset + 8,
1785 _depth,
1786 )
1787 }
1788 }
1789 }
1790 }
1791
1792 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Capability {
1793 #[inline(always)]
1794 fn new_empty() -> Self {
1795 Self::NetemulDevfs(fidl::new_empty!(DevfsDep, D))
1796 }
1797
1798 #[inline]
1799 unsafe fn decode(
1800 &mut self,
1801 decoder: &mut fidl::encoding::Decoder<'_, D>,
1802 offset: usize,
1803 mut depth: fidl::encoding::Depth,
1804 ) -> fidl::Result<()> {
1805 decoder.debug_check_bounds::<Self>(offset);
1806 #[allow(unused_variables)]
1807 let next_out_of_line = decoder.next_out_of_line();
1808 let handles_before = decoder.remaining_handles();
1809 let (ordinal, inlined, num_bytes, num_handles) =
1810 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
1811
1812 let member_inline_size = match ordinal {
1813 1 => <DevfsDep as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1814 3 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1815 4 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1816 5 => <ChildDep as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1817 6 => <StorageDep as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1818 7 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
1819 _ => return Err(fidl::Error::UnknownUnionTag),
1820 };
1821
1822 if inlined != (member_inline_size <= 4) {
1823 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1824 }
1825 let _inner_offset;
1826 if inlined {
1827 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
1828 _inner_offset = offset + 8;
1829 } else {
1830 depth.increment()?;
1831 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1832 }
1833 match ordinal {
1834 1 => {
1835 #[allow(irrefutable_let_patterns)]
1836 if let Capability::NetemulDevfs(_) = self {
1837 } else {
1839 *self = Capability::NetemulDevfs(fidl::new_empty!(DevfsDep, D));
1841 }
1842 #[allow(irrefutable_let_patterns)]
1843 if let Capability::NetemulDevfs(ref mut val) = self {
1844 fidl::decode!(DevfsDep, D, val, decoder, _inner_offset, depth)?;
1845 } else {
1846 unreachable!()
1847 }
1848 }
1849 3 => {
1850 #[allow(irrefutable_let_patterns)]
1851 if let Capability::NetemulNetworkContext(_) = self {
1852 } else {
1854 *self = Capability::NetemulNetworkContext(fidl::new_empty!(Empty, D));
1856 }
1857 #[allow(irrefutable_let_patterns)]
1858 if let Capability::NetemulNetworkContext(ref mut val) = self {
1859 fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
1860 } else {
1861 unreachable!()
1862 }
1863 }
1864 4 => {
1865 #[allow(irrefutable_let_patterns)]
1866 if let Capability::LogSink(_) = self {
1867 } else {
1869 *self = Capability::LogSink(fidl::new_empty!(Empty, D));
1871 }
1872 #[allow(irrefutable_let_patterns)]
1873 if let Capability::LogSink(ref mut val) = self {
1874 fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
1875 } else {
1876 unreachable!()
1877 }
1878 }
1879 5 => {
1880 #[allow(irrefutable_let_patterns)]
1881 if let Capability::ChildDep(_) = self {
1882 } else {
1884 *self = Capability::ChildDep(fidl::new_empty!(ChildDep, D));
1886 }
1887 #[allow(irrefutable_let_patterns)]
1888 if let Capability::ChildDep(ref mut val) = self {
1889 fidl::decode!(ChildDep, D, val, decoder, _inner_offset, depth)?;
1890 } else {
1891 unreachable!()
1892 }
1893 }
1894 6 => {
1895 #[allow(irrefutable_let_patterns)]
1896 if let Capability::StorageDep(_) = self {
1897 } else {
1899 *self = Capability::StorageDep(fidl::new_empty!(StorageDep, D));
1901 }
1902 #[allow(irrefutable_let_patterns)]
1903 if let Capability::StorageDep(ref mut val) = self {
1904 fidl::decode!(StorageDep, D, val, decoder, _inner_offset, depth)?;
1905 } else {
1906 unreachable!()
1907 }
1908 }
1909 7 => {
1910 #[allow(irrefutable_let_patterns)]
1911 if let Capability::TracingProvider(_) = self {
1912 } else {
1914 *self = Capability::TracingProvider(fidl::new_empty!(Empty, D));
1916 }
1917 #[allow(irrefutable_let_patterns)]
1918 if let Capability::TracingProvider(ref mut val) = self {
1919 fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
1920 } else {
1921 unreachable!()
1922 }
1923 }
1924 ordinal => panic!("unexpected ordinal {:?}", ordinal),
1925 }
1926 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
1927 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1928 }
1929 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1930 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1931 }
1932 Ok(())
1933 }
1934 }
1935
1936 impl fidl::encoding::ValueTypeMarker for ChildUses {
1937 type Borrowed<'a> = &'a Self;
1938 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1939 value
1940 }
1941 }
1942
1943 unsafe impl fidl::encoding::TypeMarker for ChildUses {
1944 type Owned = Self;
1945
1946 #[inline(always)]
1947 fn inline_align(_context: fidl::encoding::Context) -> usize {
1948 8
1949 }
1950
1951 #[inline(always)]
1952 fn inline_size(_context: fidl::encoding::Context) -> usize {
1953 16
1954 }
1955 }
1956
1957 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ChildUses, D>
1958 for &ChildUses
1959 {
1960 #[inline]
1961 unsafe fn encode(
1962 self,
1963 encoder: &mut fidl::encoding::Encoder<'_, D>,
1964 offset: usize,
1965 _depth: fidl::encoding::Depth,
1966 ) -> fidl::Result<()> {
1967 encoder.debug_check_bounds::<ChildUses>(offset);
1968 encoder.write_num::<u64>(self.ordinal(), offset);
1969 match self {
1970 ChildUses::Capabilities(ref val) => {
1971 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<Capability>, D>(
1972 <fidl::encoding::UnboundedVector<Capability> as fidl::encoding::ValueTypeMarker>::borrow(val),
1973 encoder, offset + 8, _depth
1974 )
1975 }
1976 }
1977 }
1978 }
1979
1980 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChildUses {
1981 #[inline(always)]
1982 fn new_empty() -> Self {
1983 Self::Capabilities(fidl::new_empty!(fidl::encoding::UnboundedVector<Capability>, D))
1984 }
1985
1986 #[inline]
1987 unsafe fn decode(
1988 &mut self,
1989 decoder: &mut fidl::encoding::Decoder<'_, D>,
1990 offset: usize,
1991 mut depth: fidl::encoding::Depth,
1992 ) -> fidl::Result<()> {
1993 decoder.debug_check_bounds::<Self>(offset);
1994 #[allow(unused_variables)]
1995 let next_out_of_line = decoder.next_out_of_line();
1996 let handles_before = decoder.remaining_handles();
1997 let (ordinal, inlined, num_bytes, num_handles) =
1998 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
1999
2000 let member_inline_size = match ordinal {
2001 1 => <fidl::encoding::UnboundedVector<Capability> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2002 _ => return Err(fidl::Error::UnknownUnionTag),
2003 };
2004
2005 if inlined != (member_inline_size <= 4) {
2006 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2007 }
2008 let _inner_offset;
2009 if inlined {
2010 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
2011 _inner_offset = offset + 8;
2012 } else {
2013 depth.increment()?;
2014 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2015 }
2016 match ordinal {
2017 1 => {
2018 #[allow(irrefutable_let_patterns)]
2019 if let ChildUses::Capabilities(_) = self {
2020 } else {
2022 *self = ChildUses::Capabilities(fidl::new_empty!(
2024 fidl::encoding::UnboundedVector<Capability>,
2025 D
2026 ));
2027 }
2028 #[allow(irrefutable_let_patterns)]
2029 if let ChildUses::Capabilities(ref mut val) = self {
2030 fidl::decode!(
2031 fidl::encoding::UnboundedVector<Capability>,
2032 D,
2033 val,
2034 decoder,
2035 _inner_offset,
2036 depth
2037 )?;
2038 } else {
2039 unreachable!()
2040 }
2041 }
2042 ordinal => panic!("unexpected ordinal {:?}", ordinal),
2043 }
2044 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
2045 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2046 }
2047 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2048 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2049 }
2050 Ok(())
2051 }
2052 }
2053
2054 impl fidl::encoding::ValueTypeMarker for ExposedCapability {
2055 type Borrowed<'a> = &'a Self;
2056 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2057 value
2058 }
2059 }
2060
2061 unsafe impl fidl::encoding::TypeMarker for ExposedCapability {
2062 type Owned = Self;
2063
2064 #[inline(always)]
2065 fn inline_align(_context: fidl::encoding::Context) -> usize {
2066 8
2067 }
2068
2069 #[inline(always)]
2070 fn inline_size(_context: fidl::encoding::Context) -> usize {
2071 16
2072 }
2073 }
2074
2075 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ExposedCapability, D>
2076 for &ExposedCapability
2077 {
2078 #[inline]
2079 unsafe fn encode(
2080 self,
2081 encoder: &mut fidl::encoding::Encoder<'_, D>,
2082 offset: usize,
2083 _depth: fidl::encoding::Depth,
2084 ) -> fidl::Result<()> {
2085 encoder.debug_check_bounds::<ExposedCapability>(offset);
2086 encoder.write_num::<u64>(self.ordinal(), offset);
2087 match self {
2088 ExposedCapability::Protocol(ref val) => fidl::encoding::encode_in_envelope::<
2089 fidl::encoding::BoundedString<255>,
2090 D,
2091 >(
2092 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
2093 val,
2094 ),
2095 encoder,
2096 offset + 8,
2097 _depth,
2098 ),
2099 ExposedCapability::Configuration(ref val) => fidl::encoding::encode_in_envelope::<
2100 fidl::encoding::BoundedString<255>,
2101 D,
2102 >(
2103 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
2104 val,
2105 ),
2106 encoder,
2107 offset + 8,
2108 _depth,
2109 ),
2110 ExposedCapability::Service(ref val) => fidl::encoding::encode_in_envelope::<
2111 fidl::encoding::BoundedString<255>,
2112 D,
2113 >(
2114 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
2115 val,
2116 ),
2117 encoder,
2118 offset + 8,
2119 _depth,
2120 ),
2121 }
2122 }
2123 }
2124
2125 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ExposedCapability {
2126 #[inline(always)]
2127 fn new_empty() -> Self {
2128 Self::Protocol(fidl::new_empty!(fidl::encoding::BoundedString<255>, D))
2129 }
2130
2131 #[inline]
2132 unsafe fn decode(
2133 &mut self,
2134 decoder: &mut fidl::encoding::Decoder<'_, D>,
2135 offset: usize,
2136 mut depth: fidl::encoding::Depth,
2137 ) -> fidl::Result<()> {
2138 decoder.debug_check_bounds::<Self>(offset);
2139 #[allow(unused_variables)]
2140 let next_out_of_line = decoder.next_out_of_line();
2141 let handles_before = decoder.remaining_handles();
2142 let (ordinal, inlined, num_bytes, num_handles) =
2143 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
2144
2145 let member_inline_size = match ordinal {
2146 1 => {
2147 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
2148 decoder.context,
2149 )
2150 }
2151 2 => {
2152 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
2153 decoder.context,
2154 )
2155 }
2156 3 => {
2157 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
2158 decoder.context,
2159 )
2160 }
2161 _ => return Err(fidl::Error::UnknownUnionTag),
2162 };
2163
2164 if inlined != (member_inline_size <= 4) {
2165 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2166 }
2167 let _inner_offset;
2168 if inlined {
2169 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
2170 _inner_offset = offset + 8;
2171 } else {
2172 depth.increment()?;
2173 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2174 }
2175 match ordinal {
2176 1 => {
2177 #[allow(irrefutable_let_patterns)]
2178 if let ExposedCapability::Protocol(_) = self {
2179 } else {
2181 *self = ExposedCapability::Protocol(fidl::new_empty!(
2183 fidl::encoding::BoundedString<255>,
2184 D
2185 ));
2186 }
2187 #[allow(irrefutable_let_patterns)]
2188 if let ExposedCapability::Protocol(ref mut val) = self {
2189 fidl::decode!(
2190 fidl::encoding::BoundedString<255>,
2191 D,
2192 val,
2193 decoder,
2194 _inner_offset,
2195 depth
2196 )?;
2197 } else {
2198 unreachable!()
2199 }
2200 }
2201 2 => {
2202 #[allow(irrefutable_let_patterns)]
2203 if let ExposedCapability::Configuration(_) = self {
2204 } else {
2206 *self = ExposedCapability::Configuration(fidl::new_empty!(
2208 fidl::encoding::BoundedString<255>,
2209 D
2210 ));
2211 }
2212 #[allow(irrefutable_let_patterns)]
2213 if let ExposedCapability::Configuration(ref mut val) = self {
2214 fidl::decode!(
2215 fidl::encoding::BoundedString<255>,
2216 D,
2217 val,
2218 decoder,
2219 _inner_offset,
2220 depth
2221 )?;
2222 } else {
2223 unreachable!()
2224 }
2225 }
2226 3 => {
2227 #[allow(irrefutable_let_patterns)]
2228 if let ExposedCapability::Service(_) = self {
2229 } else {
2231 *self = ExposedCapability::Service(fidl::new_empty!(
2233 fidl::encoding::BoundedString<255>,
2234 D
2235 ));
2236 }
2237 #[allow(irrefutable_let_patterns)]
2238 if let ExposedCapability::Service(ref mut val) = self {
2239 fidl::decode!(
2240 fidl::encoding::BoundedString<255>,
2241 D,
2242 val,
2243 decoder,
2244 _inner_offset,
2245 depth
2246 )?;
2247 } else {
2248 unreachable!()
2249 }
2250 }
2251 ordinal => panic!("unexpected ordinal {:?}", ordinal),
2252 }
2253 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
2254 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2255 }
2256 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2257 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2258 }
2259 Ok(())
2260 }
2261 }
2262}