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