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 const MAX_ANNOTATION_KEY_LENGTH: u64 = 128;
13
14pub const MAX_ANNOTATION_VALUE_LENGTH: u64 = 1024;
16
17pub const MAX_CRASH_SIGNATURE_LENGTH: u32 = 128;
18
19pub const MAX_EVENT_ID_LENGTH: u32 = 128;
20
21pub const MAX_EXCEPTION_MESSAGE_LENGTH: u32 = 4096;
22
23pub const MAX_EXCEPTION_TYPE_LENGTH: u32 = 128;
24
25pub const MAX_NAMESPACE_LENGTH: u32 = 32;
26
27pub const MAX_NUM_ANNOTATIONS2_PROVIDED: u32 = 512;
28
29pub const MAX_NUM_ANNOTATIONS_PER_CRASH_REPORT: u32 = 32;
30
31pub const MAX_NUM_ANNOTATIONS_PER_NAMESPACE: u32 = 16;
32
33pub const MAX_NUM_ATTACHMENTS_PER_CRASH_REPORT: u32 = 16;
34
35pub const MAX_PROCESS_NAME_LENGTH: u32 = 64;
36
37pub const MAX_PROGRAM_NAME_LENGTH: u32 = 1024;
38
39pub const MAX_REPORT_ID_LENGTH: u32 = 64;
40
41pub const MAX_THREAD_NAME_LENGTH: u32 = 64;
42
43#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
44pub enum FilingError {
45 Unknown,
46 InvalidArgsError,
47 ServerError,
48 PersistenceError,
49 QuotaReachedError,
50 #[doc(hidden)]
51 __SourceBreaking {
52 unknown_ordinal: u32,
53 },
54}
55
56#[macro_export]
58macro_rules! FilingErrorUnknown {
59 () => {
60 _
61 };
62}
63
64impl FilingError {
65 #[inline]
66 pub fn from_primitive(prim: u32) -> Option<Self> {
67 match prim {
68 0 => Some(Self::Unknown),
69 1 => Some(Self::InvalidArgsError),
70 2 => Some(Self::ServerError),
71 3 => Some(Self::PersistenceError),
72 4 => Some(Self::QuotaReachedError),
73 _ => None,
74 }
75 }
76
77 #[inline]
78 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
79 match prim {
80 0 => Self::Unknown,
81 1 => Self::InvalidArgsError,
82 2 => Self::ServerError,
83 3 => Self::PersistenceError,
84 4 => Self::QuotaReachedError,
85 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
86 }
87 }
88
89 #[inline]
90 pub fn unknown() -> Self {
91 Self::__SourceBreaking { unknown_ordinal: 0x0 }
92 }
93
94 #[inline]
95 pub const fn into_primitive(self) -> u32 {
96 match self {
97 Self::Unknown => 0,
98 Self::InvalidArgsError => 1,
99 Self::ServerError => 2,
100 Self::PersistenceError => 3,
101 Self::QuotaReachedError => 4,
102 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
103 }
104 }
105
106 #[inline]
107 pub fn is_unknown(&self) -> bool {
108 match self {
109 Self::__SourceBreaking { unknown_ordinal: _ } => true,
110 _ => false,
111 }
112 }
113}
114
115#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
118pub enum FilingSuccess {
119 Unknown,
120 ReportUploaded,
121 ReportOnDisk,
122 ReportInMemory,
123 ReportNotFiledUserOptedOut,
124 #[doc(hidden)]
125 __SourceBreaking {
126 unknown_ordinal: u32,
127 },
128}
129
130#[macro_export]
132macro_rules! FilingSuccessUnknown {
133 () => {
134 _
135 };
136}
137
138impl FilingSuccess {
139 #[inline]
140 pub fn from_primitive(prim: u32) -> Option<Self> {
141 match prim {
142 0 => Some(Self::Unknown),
143 1 => Some(Self::ReportUploaded),
144 2 => Some(Self::ReportOnDisk),
145 3 => Some(Self::ReportInMemory),
146 4 => Some(Self::ReportNotFiledUserOptedOut),
147 _ => None,
148 }
149 }
150
151 #[inline]
152 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
153 match prim {
154 0 => Self::Unknown,
155 1 => Self::ReportUploaded,
156 2 => Self::ReportOnDisk,
157 3 => Self::ReportInMemory,
158 4 => Self::ReportNotFiledUserOptedOut,
159 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
160 }
161 }
162
163 #[inline]
164 pub fn unknown() -> Self {
165 Self::__SourceBreaking { unknown_ordinal: 0x0 }
166 }
167
168 #[inline]
169 pub const fn into_primitive(self) -> u32 {
170 match self {
171 Self::Unknown => 0,
172 Self::ReportUploaded => 1,
173 Self::ReportOnDisk => 2,
174 Self::ReportInMemory => 3,
175 Self::ReportNotFiledUserOptedOut => 4,
176 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
177 }
178 }
179
180 #[inline]
181 pub fn is_unknown(&self) -> bool {
182 match self {
183 Self::__SourceBreaking { unknown_ordinal: _ } => true,
184 _ => false,
185 }
186 }
187}
188
189#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
191pub enum RebootReason {
192 Unknown,
195 Cold,
200 BriefPowerLoss,
205 Brownout,
207 KernelPanic,
208 SystemOutOfMemory,
209 HardwareWatchdogTimeout,
210 SoftwareWatchdogTimeout,
211 RootJobTermination,
214 UserRequest,
219 DeveloperRequest,
222 RetrySystemUpdate,
224 HighTemperature,
226 SessionFailure,
229 SysmgrFailure,
232 FactoryDataReset,
235 CriticalComponentFailure,
237 ZbiSwap,
239 AndroidUnexpectedReason,
241 AndroidRescueParty,
243 AndroidCriticalProcessFailure,
245 SystemUpdate,
247 NetstackMigration,
249 #[doc(hidden)]
250 __SourceBreaking {
251 unknown_ordinal: u16,
252 },
253}
254
255#[macro_export]
257macro_rules! RebootReasonUnknown {
258 () => {
259 _
260 };
261}
262
263impl RebootReason {
264 #[inline]
265 pub fn from_primitive(prim: u16) -> Option<Self> {
266 match prim {
267 0 => Some(Self::Unknown),
268 2 => Some(Self::Cold),
269 3 => Some(Self::BriefPowerLoss),
270 4 => Some(Self::Brownout),
271 5 => Some(Self::KernelPanic),
272 6 => Some(Self::SystemOutOfMemory),
273 7 => Some(Self::HardwareWatchdogTimeout),
274 8 => Some(Self::SoftwareWatchdogTimeout),
275 19 => Some(Self::RootJobTermination),
276 9 => Some(Self::UserRequest),
277 22 => Some(Self::DeveloperRequest),
278 17 => Some(Self::RetrySystemUpdate),
279 11 => Some(Self::HighTemperature),
280 12 => Some(Self::SessionFailure),
281 15 => Some(Self::SysmgrFailure),
282 14 => Some(Self::FactoryDataReset),
283 16 => Some(Self::CriticalComponentFailure),
284 18 => Some(Self::ZbiSwap),
285 21 => Some(Self::AndroidUnexpectedReason),
286 23 => Some(Self::AndroidRescueParty),
287 24 => Some(Self::AndroidCriticalProcessFailure),
288 10 => Some(Self::SystemUpdate),
289 20 => Some(Self::NetstackMigration),
290 _ => None,
291 }
292 }
293
294 #[inline]
295 pub fn from_primitive_allow_unknown(prim: u16) -> Self {
296 match prim {
297 0 => Self::Unknown,
298 2 => Self::Cold,
299 3 => Self::BriefPowerLoss,
300 4 => Self::Brownout,
301 5 => Self::KernelPanic,
302 6 => Self::SystemOutOfMemory,
303 7 => Self::HardwareWatchdogTimeout,
304 8 => Self::SoftwareWatchdogTimeout,
305 19 => Self::RootJobTermination,
306 9 => Self::UserRequest,
307 22 => Self::DeveloperRequest,
308 17 => Self::RetrySystemUpdate,
309 11 => Self::HighTemperature,
310 12 => Self::SessionFailure,
311 15 => Self::SysmgrFailure,
312 14 => Self::FactoryDataReset,
313 16 => Self::CriticalComponentFailure,
314 18 => Self::ZbiSwap,
315 21 => Self::AndroidUnexpectedReason,
316 23 => Self::AndroidRescueParty,
317 24 => Self::AndroidCriticalProcessFailure,
318 10 => Self::SystemUpdate,
319 20 => Self::NetstackMigration,
320 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
321 }
322 }
323
324 #[inline]
325 pub fn unknown() -> Self {
326 Self::__SourceBreaking { unknown_ordinal: 0x0 }
327 }
328
329 #[inline]
330 pub const fn into_primitive(self) -> u16 {
331 match self {
332 Self::Unknown => 0,
333 Self::Cold => 2,
334 Self::BriefPowerLoss => 3,
335 Self::Brownout => 4,
336 Self::KernelPanic => 5,
337 Self::SystemOutOfMemory => 6,
338 Self::HardwareWatchdogTimeout => 7,
339 Self::SoftwareWatchdogTimeout => 8,
340 Self::RootJobTermination => 19,
341 Self::UserRequest => 9,
342 Self::DeveloperRequest => 22,
343 Self::RetrySystemUpdate => 17,
344 Self::HighTemperature => 11,
345 Self::SessionFailure => 12,
346 Self::SysmgrFailure => 15,
347 Self::FactoryDataReset => 14,
348 Self::CriticalComponentFailure => 16,
349 Self::ZbiSwap => 18,
350 Self::AndroidUnexpectedReason => 21,
351 Self::AndroidRescueParty => 23,
352 Self::AndroidCriticalProcessFailure => 24,
353 Self::SystemUpdate => 10,
354 Self::NetstackMigration => 20,
355 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
356 }
357 }
358
359 #[inline]
360 pub fn is_unknown(&self) -> bool {
361 match self {
362 Self::__SourceBreaking { unknown_ordinal: _ } => true,
363 _ => false,
364 }
365 }
366}
367
368#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
371pub struct Annotation {
372 pub key: String,
373 pub value: String,
374}
375
376impl fidl::Persistable for Annotation {}
377
378#[derive(Clone, Debug, PartialEq)]
379pub struct ComponentDataRegisterUpsertRequest {
380 pub data: ComponentData,
381}
382
383impl fidl::Persistable for ComponentDataRegisterUpsertRequest {}
384
385#[derive(Clone, Debug, PartialEq)]
386pub struct CrashReporterFileReportResponse {
387 pub results: FileReportResults,
388}
389
390impl fidl::Persistable for CrashReporterFileReportResponse {}
391
392#[derive(Clone, Debug, PartialEq)]
393pub struct CrashReportingProductRegisterUpsertRequest {
394 pub component_url: String,
395 pub product: CrashReportingProduct,
396}
397
398impl fidl::Persistable for CrashReportingProductRegisterUpsertRequest {}
399
400#[derive(Clone, Debug, PartialEq)]
401pub struct CrashReportingProductRegisterUpsertWithAckRequest {
402 pub component_url: String,
403 pub product: CrashReportingProduct,
404}
405
406impl fidl::Persistable for CrashReportingProductRegisterUpsertWithAckRequest {}
407
408#[derive(Clone, Debug, PartialEq)]
409pub struct DataProviderGetAnnotationsRequest {
410 pub params: GetAnnotationsParameters,
411}
412
413impl fidl::Persistable for DataProviderGetAnnotationsRequest {}
414
415#[derive(Clone, Debug, PartialEq)]
416pub struct DataProviderGetAnnotationsResponse {
417 pub annotations: Annotations,
418}
419
420impl fidl::Persistable for DataProviderGetAnnotationsResponse {}
421
422#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
423pub struct DeviceIdProviderGetIdResponse {
424 pub feedback_id: String,
425}
426
427impl fidl::Persistable for DeviceIdProviderGetIdResponse {}
428
429#[derive(Clone, Debug, PartialEq)]
430pub struct LastRebootInfoProviderGetResponse {
431 pub last_reboot: LastReboot,
432}
433
434impl fidl::Persistable for LastRebootInfoProviderGetResponse {}
435
436#[derive(Clone, Debug, Default, PartialEq)]
441pub struct Annotations {
442 pub annotations2: Option<Vec<Annotation>>,
444 #[doc(hidden)]
445 pub __source_breaking: fidl::marker::SourceBreaking,
446}
447
448impl fidl::Persistable for Annotations {}
449
450#[derive(Clone, Debug, Default, PartialEq)]
452pub struct ComponentData {
453 pub namespace: Option<String>,
468 pub annotations: Option<Vec<Annotation>>,
477 #[doc(hidden)]
478 pub __source_breaking: fidl::marker::SourceBreaking,
479}
480
481impl fidl::Persistable for ComponentData {}
482
483#[derive(Clone, Debug, Default, PartialEq)]
485pub struct CrashReportingProduct {
486 pub name: Option<String>,
492 pub version: Option<String>,
499 pub channel: Option<String>,
503 #[doc(hidden)]
504 pub __source_breaking: fidl::marker::SourceBreaking,
505}
506
507impl fidl::Persistable for CrashReportingProduct {}
508
509#[derive(Clone, Debug, Default, PartialEq)]
510pub struct FileReportResults {
511 pub result: Option<FilingSuccess>,
513 pub report_id: Option<String>,
515 #[doc(hidden)]
516 pub __source_breaking: fidl::marker::SourceBreaking,
517}
518
519impl fidl::Persistable for FileReportResults {}
520
521#[derive(Clone, Debug, Default, PartialEq)]
523pub struct GetAnnotationsParameters {
524 pub collection_timeout_per_annotation: Option<i64>,
531 #[doc(hidden)]
532 pub __source_breaking: fidl::marker::SourceBreaking,
533}
534
535impl fidl::Persistable for GetAnnotationsParameters {}
536
537#[derive(Clone, Debug, Default, PartialEq)]
539pub struct LastReboot {
540 pub graceful: Option<bool>,
551 pub reason: Option<RebootReason>,
553 pub uptime: Option<i64>,
556 pub planned: Option<bool>,
564 pub runtime: Option<i64>,
567 #[doc(hidden)]
568 pub __source_breaking: fidl::marker::SourceBreaking,
569}
570
571impl fidl::Persistable for LastReboot {}
572
573pub mod component_data_register_ordinals {
574 pub const UPSERT: u64 = 0xa25b7c4e125c0a1;
575}
576
577pub mod crash_reporter_ordinals {
578 pub const FILE_REPORT: u64 = 0x6f660f55b3160dd4;
579}
580
581pub mod crash_reporting_product_register_ordinals {
582 pub const UPSERT: u64 = 0x668cdc9615c91d7f;
583 pub const UPSERT_WITH_ACK: u64 = 0x4a4f1279b3439c9d;
584}
585
586pub mod data_provider_ordinals {
587 pub const GET_SNAPSHOT: u64 = 0x753649a04e5d0bc0;
588 pub const GET_ANNOTATIONS: u64 = 0x367b4b6afe4345d8;
589}
590
591pub mod device_id_provider_ordinals {
592 pub const GET_ID: u64 = 0xea7f28a243488dc;
593}
594
595pub mod last_reboot_info_provider_ordinals {
596 pub const GET: u64 = 0xbc32d10e081ffac;
597}
598
599mod internal {
600 use super::*;
601 unsafe impl fidl::encoding::TypeMarker for FilingError {
602 type Owned = Self;
603
604 #[inline(always)]
605 fn inline_align(_context: fidl::encoding::Context) -> usize {
606 std::mem::align_of::<u32>()
607 }
608
609 #[inline(always)]
610 fn inline_size(_context: fidl::encoding::Context) -> usize {
611 std::mem::size_of::<u32>()
612 }
613
614 #[inline(always)]
615 fn encode_is_copy() -> bool {
616 false
617 }
618
619 #[inline(always)]
620 fn decode_is_copy() -> bool {
621 false
622 }
623 }
624
625 impl fidl::encoding::ValueTypeMarker for FilingError {
626 type Borrowed<'a> = Self;
627 #[inline(always)]
628 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
629 *value
630 }
631 }
632
633 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilingError {
634 #[inline]
635 unsafe fn encode(
636 self,
637 encoder: &mut fidl::encoding::Encoder<'_, D>,
638 offset: usize,
639 _depth: fidl::encoding::Depth,
640 ) -> fidl::Result<()> {
641 encoder.debug_check_bounds::<Self>(offset);
642 encoder.write_num(self.into_primitive(), offset);
643 Ok(())
644 }
645 }
646
647 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilingError {
648 #[inline(always)]
649 fn new_empty() -> Self {
650 Self::unknown()
651 }
652
653 #[inline]
654 unsafe fn decode(
655 &mut self,
656 decoder: &mut fidl::encoding::Decoder<'_, D>,
657 offset: usize,
658 _depth: fidl::encoding::Depth,
659 ) -> fidl::Result<()> {
660 decoder.debug_check_bounds::<Self>(offset);
661 let prim = decoder.read_num::<u32>(offset);
662
663 *self = Self::from_primitive_allow_unknown(prim);
664 Ok(())
665 }
666 }
667 unsafe impl fidl::encoding::TypeMarker for FilingSuccess {
668 type Owned = Self;
669
670 #[inline(always)]
671 fn inline_align(_context: fidl::encoding::Context) -> usize {
672 std::mem::align_of::<u32>()
673 }
674
675 #[inline(always)]
676 fn inline_size(_context: fidl::encoding::Context) -> usize {
677 std::mem::size_of::<u32>()
678 }
679
680 #[inline(always)]
681 fn encode_is_copy() -> bool {
682 false
683 }
684
685 #[inline(always)]
686 fn decode_is_copy() -> bool {
687 false
688 }
689 }
690
691 impl fidl::encoding::ValueTypeMarker for FilingSuccess {
692 type Borrowed<'a> = Self;
693 #[inline(always)]
694 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
695 *value
696 }
697 }
698
699 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilingSuccess {
700 #[inline]
701 unsafe fn encode(
702 self,
703 encoder: &mut fidl::encoding::Encoder<'_, D>,
704 offset: usize,
705 _depth: fidl::encoding::Depth,
706 ) -> fidl::Result<()> {
707 encoder.debug_check_bounds::<Self>(offset);
708 encoder.write_num(self.into_primitive(), offset);
709 Ok(())
710 }
711 }
712
713 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilingSuccess {
714 #[inline(always)]
715 fn new_empty() -> Self {
716 Self::unknown()
717 }
718
719 #[inline]
720 unsafe fn decode(
721 &mut self,
722 decoder: &mut fidl::encoding::Decoder<'_, D>,
723 offset: usize,
724 _depth: fidl::encoding::Depth,
725 ) -> fidl::Result<()> {
726 decoder.debug_check_bounds::<Self>(offset);
727 let prim = decoder.read_num::<u32>(offset);
728
729 *self = Self::from_primitive_allow_unknown(prim);
730 Ok(())
731 }
732 }
733 unsafe impl fidl::encoding::TypeMarker for RebootReason {
734 type Owned = Self;
735
736 #[inline(always)]
737 fn inline_align(_context: fidl::encoding::Context) -> usize {
738 std::mem::align_of::<u16>()
739 }
740
741 #[inline(always)]
742 fn inline_size(_context: fidl::encoding::Context) -> usize {
743 std::mem::size_of::<u16>()
744 }
745
746 #[inline(always)]
747 fn encode_is_copy() -> bool {
748 false
749 }
750
751 #[inline(always)]
752 fn decode_is_copy() -> bool {
753 false
754 }
755 }
756
757 impl fidl::encoding::ValueTypeMarker for RebootReason {
758 type Borrowed<'a> = Self;
759 #[inline(always)]
760 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
761 *value
762 }
763 }
764
765 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RebootReason {
766 #[inline]
767 unsafe fn encode(
768 self,
769 encoder: &mut fidl::encoding::Encoder<'_, D>,
770 offset: usize,
771 _depth: fidl::encoding::Depth,
772 ) -> fidl::Result<()> {
773 encoder.debug_check_bounds::<Self>(offset);
774 encoder.write_num(self.into_primitive(), offset);
775 Ok(())
776 }
777 }
778
779 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RebootReason {
780 #[inline(always)]
781 fn new_empty() -> Self {
782 Self::unknown()
783 }
784
785 #[inline]
786 unsafe fn decode(
787 &mut self,
788 decoder: &mut fidl::encoding::Decoder<'_, D>,
789 offset: usize,
790 _depth: fidl::encoding::Depth,
791 ) -> fidl::Result<()> {
792 decoder.debug_check_bounds::<Self>(offset);
793 let prim = decoder.read_num::<u16>(offset);
794
795 *self = Self::from_primitive_allow_unknown(prim);
796 Ok(())
797 }
798 }
799
800 impl fidl::encoding::ValueTypeMarker for Annotation {
801 type Borrowed<'a> = &'a Self;
802 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
803 value
804 }
805 }
806
807 unsafe impl fidl::encoding::TypeMarker for Annotation {
808 type Owned = Self;
809
810 #[inline(always)]
811 fn inline_align(_context: fidl::encoding::Context) -> usize {
812 8
813 }
814
815 #[inline(always)]
816 fn inline_size(_context: fidl::encoding::Context) -> usize {
817 32
818 }
819 }
820
821 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Annotation, D>
822 for &Annotation
823 {
824 #[inline]
825 unsafe fn encode(
826 self,
827 encoder: &mut fidl::encoding::Encoder<'_, D>,
828 offset: usize,
829 _depth: fidl::encoding::Depth,
830 ) -> fidl::Result<()> {
831 encoder.debug_check_bounds::<Annotation>(offset);
832 fidl::encoding::Encode::<Annotation, D>::encode(
834 (
835 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
836 <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
837 ),
838 encoder, offset, _depth
839 )
840 }
841 }
842 unsafe impl<
843 D: fidl::encoding::ResourceDialect,
844 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
845 T1: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>, D>,
846 > fidl::encoding::Encode<Annotation, D> for (T0, T1)
847 {
848 #[inline]
849 unsafe fn encode(
850 self,
851 encoder: &mut fidl::encoding::Encoder<'_, D>,
852 offset: usize,
853 depth: fidl::encoding::Depth,
854 ) -> fidl::Result<()> {
855 encoder.debug_check_bounds::<Annotation>(offset);
856 self.0.encode(encoder, offset + 0, depth)?;
860 self.1.encode(encoder, offset + 16, depth)?;
861 Ok(())
862 }
863 }
864
865 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Annotation {
866 #[inline(always)]
867 fn new_empty() -> Self {
868 Self {
869 key: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
870 value: fidl::new_empty!(fidl::encoding::BoundedString<1024>, D),
871 }
872 }
873
874 #[inline]
875 unsafe fn decode(
876 &mut self,
877 decoder: &mut fidl::encoding::Decoder<'_, D>,
878 offset: usize,
879 _depth: fidl::encoding::Depth,
880 ) -> fidl::Result<()> {
881 decoder.debug_check_bounds::<Self>(offset);
882 fidl::decode!(
884 fidl::encoding::BoundedString<128>,
885 D,
886 &mut self.key,
887 decoder,
888 offset + 0,
889 _depth
890 )?;
891 fidl::decode!(
892 fidl::encoding::BoundedString<1024>,
893 D,
894 &mut self.value,
895 decoder,
896 offset + 16,
897 _depth
898 )?;
899 Ok(())
900 }
901 }
902
903 impl fidl::encoding::ValueTypeMarker for ComponentDataRegisterUpsertRequest {
904 type Borrowed<'a> = &'a Self;
905 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
906 value
907 }
908 }
909
910 unsafe impl fidl::encoding::TypeMarker for ComponentDataRegisterUpsertRequest {
911 type Owned = Self;
912
913 #[inline(always)]
914 fn inline_align(_context: fidl::encoding::Context) -> usize {
915 8
916 }
917
918 #[inline(always)]
919 fn inline_size(_context: fidl::encoding::Context) -> usize {
920 16
921 }
922 }
923
924 unsafe impl<D: fidl::encoding::ResourceDialect>
925 fidl::encoding::Encode<ComponentDataRegisterUpsertRequest, D>
926 for &ComponentDataRegisterUpsertRequest
927 {
928 #[inline]
929 unsafe fn encode(
930 self,
931 encoder: &mut fidl::encoding::Encoder<'_, D>,
932 offset: usize,
933 _depth: fidl::encoding::Depth,
934 ) -> fidl::Result<()> {
935 encoder.debug_check_bounds::<ComponentDataRegisterUpsertRequest>(offset);
936 fidl::encoding::Encode::<ComponentDataRegisterUpsertRequest, D>::encode(
938 (<ComponentData as fidl::encoding::ValueTypeMarker>::borrow(&self.data),),
939 encoder,
940 offset,
941 _depth,
942 )
943 }
944 }
945 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ComponentData, D>>
946 fidl::encoding::Encode<ComponentDataRegisterUpsertRequest, D> for (T0,)
947 {
948 #[inline]
949 unsafe fn encode(
950 self,
951 encoder: &mut fidl::encoding::Encoder<'_, D>,
952 offset: usize,
953 depth: fidl::encoding::Depth,
954 ) -> fidl::Result<()> {
955 encoder.debug_check_bounds::<ComponentDataRegisterUpsertRequest>(offset);
956 self.0.encode(encoder, offset + 0, depth)?;
960 Ok(())
961 }
962 }
963
964 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
965 for ComponentDataRegisterUpsertRequest
966 {
967 #[inline(always)]
968 fn new_empty() -> Self {
969 Self { data: fidl::new_empty!(ComponentData, D) }
970 }
971
972 #[inline]
973 unsafe fn decode(
974 &mut self,
975 decoder: &mut fidl::encoding::Decoder<'_, D>,
976 offset: usize,
977 _depth: fidl::encoding::Depth,
978 ) -> fidl::Result<()> {
979 decoder.debug_check_bounds::<Self>(offset);
980 fidl::decode!(ComponentData, D, &mut self.data, decoder, offset + 0, _depth)?;
982 Ok(())
983 }
984 }
985
986 impl fidl::encoding::ValueTypeMarker for CrashReporterFileReportResponse {
987 type Borrowed<'a> = &'a Self;
988 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
989 value
990 }
991 }
992
993 unsafe impl fidl::encoding::TypeMarker for CrashReporterFileReportResponse {
994 type Owned = Self;
995
996 #[inline(always)]
997 fn inline_align(_context: fidl::encoding::Context) -> usize {
998 8
999 }
1000
1001 #[inline(always)]
1002 fn inline_size(_context: fidl::encoding::Context) -> usize {
1003 16
1004 }
1005 }
1006
1007 unsafe impl<D: fidl::encoding::ResourceDialect>
1008 fidl::encoding::Encode<CrashReporterFileReportResponse, D>
1009 for &CrashReporterFileReportResponse
1010 {
1011 #[inline]
1012 unsafe fn encode(
1013 self,
1014 encoder: &mut fidl::encoding::Encoder<'_, D>,
1015 offset: usize,
1016 _depth: fidl::encoding::Depth,
1017 ) -> fidl::Result<()> {
1018 encoder.debug_check_bounds::<CrashReporterFileReportResponse>(offset);
1019 fidl::encoding::Encode::<CrashReporterFileReportResponse, D>::encode(
1021 (<FileReportResults as fidl::encoding::ValueTypeMarker>::borrow(&self.results),),
1022 encoder,
1023 offset,
1024 _depth,
1025 )
1026 }
1027 }
1028 unsafe impl<
1029 D: fidl::encoding::ResourceDialect,
1030 T0: fidl::encoding::Encode<FileReportResults, D>,
1031 > fidl::encoding::Encode<CrashReporterFileReportResponse, D> for (T0,)
1032 {
1033 #[inline]
1034 unsafe fn encode(
1035 self,
1036 encoder: &mut fidl::encoding::Encoder<'_, D>,
1037 offset: usize,
1038 depth: fidl::encoding::Depth,
1039 ) -> fidl::Result<()> {
1040 encoder.debug_check_bounds::<CrashReporterFileReportResponse>(offset);
1041 self.0.encode(encoder, offset + 0, depth)?;
1045 Ok(())
1046 }
1047 }
1048
1049 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1050 for CrashReporterFileReportResponse
1051 {
1052 #[inline(always)]
1053 fn new_empty() -> Self {
1054 Self { results: fidl::new_empty!(FileReportResults, D) }
1055 }
1056
1057 #[inline]
1058 unsafe fn decode(
1059 &mut self,
1060 decoder: &mut fidl::encoding::Decoder<'_, D>,
1061 offset: usize,
1062 _depth: fidl::encoding::Depth,
1063 ) -> fidl::Result<()> {
1064 decoder.debug_check_bounds::<Self>(offset);
1065 fidl::decode!(FileReportResults, D, &mut self.results, decoder, offset + 0, _depth)?;
1067 Ok(())
1068 }
1069 }
1070
1071 impl fidl::encoding::ValueTypeMarker for CrashReportingProductRegisterUpsertRequest {
1072 type Borrowed<'a> = &'a Self;
1073 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1074 value
1075 }
1076 }
1077
1078 unsafe impl fidl::encoding::TypeMarker for CrashReportingProductRegisterUpsertRequest {
1079 type Owned = Self;
1080
1081 #[inline(always)]
1082 fn inline_align(_context: fidl::encoding::Context) -> usize {
1083 8
1084 }
1085
1086 #[inline(always)]
1087 fn inline_size(_context: fidl::encoding::Context) -> usize {
1088 32
1089 }
1090 }
1091
1092 unsafe impl<D: fidl::encoding::ResourceDialect>
1093 fidl::encoding::Encode<CrashReportingProductRegisterUpsertRequest, D>
1094 for &CrashReportingProductRegisterUpsertRequest
1095 {
1096 #[inline]
1097 unsafe fn encode(
1098 self,
1099 encoder: &mut fidl::encoding::Encoder<'_, D>,
1100 offset: usize,
1101 _depth: fidl::encoding::Depth,
1102 ) -> fidl::Result<()> {
1103 encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertRequest>(offset);
1104 fidl::encoding::Encode::<CrashReportingProductRegisterUpsertRequest, D>::encode(
1106 (
1107 <fidl::encoding::BoundedString<2083> as fidl::encoding::ValueTypeMarker>::borrow(&self.component_url),
1108 <CrashReportingProduct as fidl::encoding::ValueTypeMarker>::borrow(&self.product),
1109 ),
1110 encoder, offset, _depth
1111 )
1112 }
1113 }
1114 unsafe impl<
1115 D: fidl::encoding::ResourceDialect,
1116 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<2083>, D>,
1117 T1: fidl::encoding::Encode<CrashReportingProduct, D>,
1118 > fidl::encoding::Encode<CrashReportingProductRegisterUpsertRequest, D> for (T0, T1)
1119 {
1120 #[inline]
1121 unsafe fn encode(
1122 self,
1123 encoder: &mut fidl::encoding::Encoder<'_, D>,
1124 offset: usize,
1125 depth: fidl::encoding::Depth,
1126 ) -> fidl::Result<()> {
1127 encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertRequest>(offset);
1128 self.0.encode(encoder, offset + 0, depth)?;
1132 self.1.encode(encoder, offset + 16, depth)?;
1133 Ok(())
1134 }
1135 }
1136
1137 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1138 for CrashReportingProductRegisterUpsertRequest
1139 {
1140 #[inline(always)]
1141 fn new_empty() -> Self {
1142 Self {
1143 component_url: fidl::new_empty!(fidl::encoding::BoundedString<2083>, D),
1144 product: fidl::new_empty!(CrashReportingProduct, D),
1145 }
1146 }
1147
1148 #[inline]
1149 unsafe fn decode(
1150 &mut self,
1151 decoder: &mut fidl::encoding::Decoder<'_, D>,
1152 offset: usize,
1153 _depth: fidl::encoding::Depth,
1154 ) -> fidl::Result<()> {
1155 decoder.debug_check_bounds::<Self>(offset);
1156 fidl::decode!(
1158 fidl::encoding::BoundedString<2083>,
1159 D,
1160 &mut self.component_url,
1161 decoder,
1162 offset + 0,
1163 _depth
1164 )?;
1165 fidl::decode!(
1166 CrashReportingProduct,
1167 D,
1168 &mut self.product,
1169 decoder,
1170 offset + 16,
1171 _depth
1172 )?;
1173 Ok(())
1174 }
1175 }
1176
1177 impl fidl::encoding::ValueTypeMarker for CrashReportingProductRegisterUpsertWithAckRequest {
1178 type Borrowed<'a> = &'a Self;
1179 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1180 value
1181 }
1182 }
1183
1184 unsafe impl fidl::encoding::TypeMarker for CrashReportingProductRegisterUpsertWithAckRequest {
1185 type Owned = Self;
1186
1187 #[inline(always)]
1188 fn inline_align(_context: fidl::encoding::Context) -> usize {
1189 8
1190 }
1191
1192 #[inline(always)]
1193 fn inline_size(_context: fidl::encoding::Context) -> usize {
1194 32
1195 }
1196 }
1197
1198 unsafe impl<D: fidl::encoding::ResourceDialect>
1199 fidl::encoding::Encode<CrashReportingProductRegisterUpsertWithAckRequest, D>
1200 for &CrashReportingProductRegisterUpsertWithAckRequest
1201 {
1202 #[inline]
1203 unsafe fn encode(
1204 self,
1205 encoder: &mut fidl::encoding::Encoder<'_, D>,
1206 offset: usize,
1207 _depth: fidl::encoding::Depth,
1208 ) -> fidl::Result<()> {
1209 encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertWithAckRequest>(offset);
1210 fidl::encoding::Encode::<CrashReportingProductRegisterUpsertWithAckRequest, D>::encode(
1212 (
1213 <fidl::encoding::BoundedString<2083> as fidl::encoding::ValueTypeMarker>::borrow(&self.component_url),
1214 <CrashReportingProduct as fidl::encoding::ValueTypeMarker>::borrow(&self.product),
1215 ),
1216 encoder, offset, _depth
1217 )
1218 }
1219 }
1220 unsafe impl<
1221 D: fidl::encoding::ResourceDialect,
1222 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<2083>, D>,
1223 T1: fidl::encoding::Encode<CrashReportingProduct, D>,
1224 > fidl::encoding::Encode<CrashReportingProductRegisterUpsertWithAckRequest, D> for (T0, T1)
1225 {
1226 #[inline]
1227 unsafe fn encode(
1228 self,
1229 encoder: &mut fidl::encoding::Encoder<'_, D>,
1230 offset: usize,
1231 depth: fidl::encoding::Depth,
1232 ) -> fidl::Result<()> {
1233 encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertWithAckRequest>(offset);
1234 self.0.encode(encoder, offset + 0, depth)?;
1238 self.1.encode(encoder, offset + 16, depth)?;
1239 Ok(())
1240 }
1241 }
1242
1243 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1244 for CrashReportingProductRegisterUpsertWithAckRequest
1245 {
1246 #[inline(always)]
1247 fn new_empty() -> Self {
1248 Self {
1249 component_url: fidl::new_empty!(fidl::encoding::BoundedString<2083>, D),
1250 product: fidl::new_empty!(CrashReportingProduct, D),
1251 }
1252 }
1253
1254 #[inline]
1255 unsafe fn decode(
1256 &mut self,
1257 decoder: &mut fidl::encoding::Decoder<'_, D>,
1258 offset: usize,
1259 _depth: fidl::encoding::Depth,
1260 ) -> fidl::Result<()> {
1261 decoder.debug_check_bounds::<Self>(offset);
1262 fidl::decode!(
1264 fidl::encoding::BoundedString<2083>,
1265 D,
1266 &mut self.component_url,
1267 decoder,
1268 offset + 0,
1269 _depth
1270 )?;
1271 fidl::decode!(
1272 CrashReportingProduct,
1273 D,
1274 &mut self.product,
1275 decoder,
1276 offset + 16,
1277 _depth
1278 )?;
1279 Ok(())
1280 }
1281 }
1282
1283 impl fidl::encoding::ValueTypeMarker for DataProviderGetAnnotationsRequest {
1284 type Borrowed<'a> = &'a Self;
1285 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1286 value
1287 }
1288 }
1289
1290 unsafe impl fidl::encoding::TypeMarker for DataProviderGetAnnotationsRequest {
1291 type Owned = Self;
1292
1293 #[inline(always)]
1294 fn inline_align(_context: fidl::encoding::Context) -> usize {
1295 8
1296 }
1297
1298 #[inline(always)]
1299 fn inline_size(_context: fidl::encoding::Context) -> usize {
1300 16
1301 }
1302 }
1303
1304 unsafe impl<D: fidl::encoding::ResourceDialect>
1305 fidl::encoding::Encode<DataProviderGetAnnotationsRequest, D>
1306 for &DataProviderGetAnnotationsRequest
1307 {
1308 #[inline]
1309 unsafe fn encode(
1310 self,
1311 encoder: &mut fidl::encoding::Encoder<'_, D>,
1312 offset: usize,
1313 _depth: fidl::encoding::Depth,
1314 ) -> fidl::Result<()> {
1315 encoder.debug_check_bounds::<DataProviderGetAnnotationsRequest>(offset);
1316 fidl::encoding::Encode::<DataProviderGetAnnotationsRequest, D>::encode(
1318 (<GetAnnotationsParameters as fidl::encoding::ValueTypeMarker>::borrow(
1319 &self.params,
1320 ),),
1321 encoder,
1322 offset,
1323 _depth,
1324 )
1325 }
1326 }
1327 unsafe impl<
1328 D: fidl::encoding::ResourceDialect,
1329 T0: fidl::encoding::Encode<GetAnnotationsParameters, D>,
1330 > fidl::encoding::Encode<DataProviderGetAnnotationsRequest, D> for (T0,)
1331 {
1332 #[inline]
1333 unsafe fn encode(
1334 self,
1335 encoder: &mut fidl::encoding::Encoder<'_, D>,
1336 offset: usize,
1337 depth: fidl::encoding::Depth,
1338 ) -> fidl::Result<()> {
1339 encoder.debug_check_bounds::<DataProviderGetAnnotationsRequest>(offset);
1340 self.0.encode(encoder, offset + 0, depth)?;
1344 Ok(())
1345 }
1346 }
1347
1348 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1349 for DataProviderGetAnnotationsRequest
1350 {
1351 #[inline(always)]
1352 fn new_empty() -> Self {
1353 Self { params: fidl::new_empty!(GetAnnotationsParameters, D) }
1354 }
1355
1356 #[inline]
1357 unsafe fn decode(
1358 &mut self,
1359 decoder: &mut fidl::encoding::Decoder<'_, D>,
1360 offset: usize,
1361 _depth: fidl::encoding::Depth,
1362 ) -> fidl::Result<()> {
1363 decoder.debug_check_bounds::<Self>(offset);
1364 fidl::decode!(
1366 GetAnnotationsParameters,
1367 D,
1368 &mut self.params,
1369 decoder,
1370 offset + 0,
1371 _depth
1372 )?;
1373 Ok(())
1374 }
1375 }
1376
1377 impl fidl::encoding::ValueTypeMarker for DataProviderGetAnnotationsResponse {
1378 type Borrowed<'a> = &'a Self;
1379 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1380 value
1381 }
1382 }
1383
1384 unsafe impl fidl::encoding::TypeMarker for DataProviderGetAnnotationsResponse {
1385 type Owned = Self;
1386
1387 #[inline(always)]
1388 fn inline_align(_context: fidl::encoding::Context) -> usize {
1389 8
1390 }
1391
1392 #[inline(always)]
1393 fn inline_size(_context: fidl::encoding::Context) -> usize {
1394 16
1395 }
1396 }
1397
1398 unsafe impl<D: fidl::encoding::ResourceDialect>
1399 fidl::encoding::Encode<DataProviderGetAnnotationsResponse, D>
1400 for &DataProviderGetAnnotationsResponse
1401 {
1402 #[inline]
1403 unsafe fn encode(
1404 self,
1405 encoder: &mut fidl::encoding::Encoder<'_, D>,
1406 offset: usize,
1407 _depth: fidl::encoding::Depth,
1408 ) -> fidl::Result<()> {
1409 encoder.debug_check_bounds::<DataProviderGetAnnotationsResponse>(offset);
1410 fidl::encoding::Encode::<DataProviderGetAnnotationsResponse, D>::encode(
1412 (<Annotations as fidl::encoding::ValueTypeMarker>::borrow(&self.annotations),),
1413 encoder,
1414 offset,
1415 _depth,
1416 )
1417 }
1418 }
1419 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Annotations, D>>
1420 fidl::encoding::Encode<DataProviderGetAnnotationsResponse, D> for (T0,)
1421 {
1422 #[inline]
1423 unsafe fn encode(
1424 self,
1425 encoder: &mut fidl::encoding::Encoder<'_, D>,
1426 offset: usize,
1427 depth: fidl::encoding::Depth,
1428 ) -> fidl::Result<()> {
1429 encoder.debug_check_bounds::<DataProviderGetAnnotationsResponse>(offset);
1430 self.0.encode(encoder, offset + 0, depth)?;
1434 Ok(())
1435 }
1436 }
1437
1438 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1439 for DataProviderGetAnnotationsResponse
1440 {
1441 #[inline(always)]
1442 fn new_empty() -> Self {
1443 Self { annotations: fidl::new_empty!(Annotations, D) }
1444 }
1445
1446 #[inline]
1447 unsafe fn decode(
1448 &mut self,
1449 decoder: &mut fidl::encoding::Decoder<'_, D>,
1450 offset: usize,
1451 _depth: fidl::encoding::Depth,
1452 ) -> fidl::Result<()> {
1453 decoder.debug_check_bounds::<Self>(offset);
1454 fidl::decode!(Annotations, D, &mut self.annotations, decoder, offset + 0, _depth)?;
1456 Ok(())
1457 }
1458 }
1459
1460 impl fidl::encoding::ValueTypeMarker for DeviceIdProviderGetIdResponse {
1461 type Borrowed<'a> = &'a Self;
1462 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1463 value
1464 }
1465 }
1466
1467 unsafe impl fidl::encoding::TypeMarker for DeviceIdProviderGetIdResponse {
1468 type Owned = Self;
1469
1470 #[inline(always)]
1471 fn inline_align(_context: fidl::encoding::Context) -> usize {
1472 8
1473 }
1474
1475 #[inline(always)]
1476 fn inline_size(_context: fidl::encoding::Context) -> usize {
1477 16
1478 }
1479 }
1480
1481 unsafe impl<D: fidl::encoding::ResourceDialect>
1482 fidl::encoding::Encode<DeviceIdProviderGetIdResponse, D>
1483 for &DeviceIdProviderGetIdResponse
1484 {
1485 #[inline]
1486 unsafe fn encode(
1487 self,
1488 encoder: &mut fidl::encoding::Encoder<'_, D>,
1489 offset: usize,
1490 _depth: fidl::encoding::Depth,
1491 ) -> fidl::Result<()> {
1492 encoder.debug_check_bounds::<DeviceIdProviderGetIdResponse>(offset);
1493 fidl::encoding::Encode::<DeviceIdProviderGetIdResponse, D>::encode(
1495 (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
1496 &self.feedback_id,
1497 ),),
1498 encoder,
1499 offset,
1500 _depth,
1501 )
1502 }
1503 }
1504 unsafe impl<
1505 D: fidl::encoding::ResourceDialect,
1506 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
1507 > fidl::encoding::Encode<DeviceIdProviderGetIdResponse, D> for (T0,)
1508 {
1509 #[inline]
1510 unsafe fn encode(
1511 self,
1512 encoder: &mut fidl::encoding::Encoder<'_, D>,
1513 offset: usize,
1514 depth: fidl::encoding::Depth,
1515 ) -> fidl::Result<()> {
1516 encoder.debug_check_bounds::<DeviceIdProviderGetIdResponse>(offset);
1517 self.0.encode(encoder, offset + 0, depth)?;
1521 Ok(())
1522 }
1523 }
1524
1525 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1526 for DeviceIdProviderGetIdResponse
1527 {
1528 #[inline(always)]
1529 fn new_empty() -> Self {
1530 Self { feedback_id: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
1531 }
1532
1533 #[inline]
1534 unsafe fn decode(
1535 &mut self,
1536 decoder: &mut fidl::encoding::Decoder<'_, D>,
1537 offset: usize,
1538 _depth: fidl::encoding::Depth,
1539 ) -> fidl::Result<()> {
1540 decoder.debug_check_bounds::<Self>(offset);
1541 fidl::decode!(
1543 fidl::encoding::BoundedString<64>,
1544 D,
1545 &mut self.feedback_id,
1546 decoder,
1547 offset + 0,
1548 _depth
1549 )?;
1550 Ok(())
1551 }
1552 }
1553
1554 impl fidl::encoding::ValueTypeMarker for LastRebootInfoProviderGetResponse {
1555 type Borrowed<'a> = &'a Self;
1556 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1557 value
1558 }
1559 }
1560
1561 unsafe impl fidl::encoding::TypeMarker for LastRebootInfoProviderGetResponse {
1562 type Owned = Self;
1563
1564 #[inline(always)]
1565 fn inline_align(_context: fidl::encoding::Context) -> usize {
1566 8
1567 }
1568
1569 #[inline(always)]
1570 fn inline_size(_context: fidl::encoding::Context) -> usize {
1571 16
1572 }
1573 }
1574
1575 unsafe impl<D: fidl::encoding::ResourceDialect>
1576 fidl::encoding::Encode<LastRebootInfoProviderGetResponse, D>
1577 for &LastRebootInfoProviderGetResponse
1578 {
1579 #[inline]
1580 unsafe fn encode(
1581 self,
1582 encoder: &mut fidl::encoding::Encoder<'_, D>,
1583 offset: usize,
1584 _depth: fidl::encoding::Depth,
1585 ) -> fidl::Result<()> {
1586 encoder.debug_check_bounds::<LastRebootInfoProviderGetResponse>(offset);
1587 fidl::encoding::Encode::<LastRebootInfoProviderGetResponse, D>::encode(
1589 (<LastReboot as fidl::encoding::ValueTypeMarker>::borrow(&self.last_reboot),),
1590 encoder,
1591 offset,
1592 _depth,
1593 )
1594 }
1595 }
1596 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LastReboot, D>>
1597 fidl::encoding::Encode<LastRebootInfoProviderGetResponse, D> for (T0,)
1598 {
1599 #[inline]
1600 unsafe fn encode(
1601 self,
1602 encoder: &mut fidl::encoding::Encoder<'_, D>,
1603 offset: usize,
1604 depth: fidl::encoding::Depth,
1605 ) -> fidl::Result<()> {
1606 encoder.debug_check_bounds::<LastRebootInfoProviderGetResponse>(offset);
1607 self.0.encode(encoder, offset + 0, depth)?;
1611 Ok(())
1612 }
1613 }
1614
1615 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1616 for LastRebootInfoProviderGetResponse
1617 {
1618 #[inline(always)]
1619 fn new_empty() -> Self {
1620 Self { last_reboot: fidl::new_empty!(LastReboot, D) }
1621 }
1622
1623 #[inline]
1624 unsafe fn decode(
1625 &mut self,
1626 decoder: &mut fidl::encoding::Decoder<'_, D>,
1627 offset: usize,
1628 _depth: fidl::encoding::Depth,
1629 ) -> fidl::Result<()> {
1630 decoder.debug_check_bounds::<Self>(offset);
1631 fidl::decode!(LastReboot, D, &mut self.last_reboot, decoder, offset + 0, _depth)?;
1633 Ok(())
1634 }
1635 }
1636
1637 impl Annotations {
1638 #[inline(always)]
1639 fn max_ordinal_present(&self) -> u64 {
1640 if let Some(_) = self.annotations2 {
1641 return 2;
1642 }
1643 0
1644 }
1645 }
1646
1647 impl fidl::encoding::ValueTypeMarker for Annotations {
1648 type Borrowed<'a> = &'a Self;
1649 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1650 value
1651 }
1652 }
1653
1654 unsafe impl fidl::encoding::TypeMarker for Annotations {
1655 type Owned = Self;
1656
1657 #[inline(always)]
1658 fn inline_align(_context: fidl::encoding::Context) -> usize {
1659 8
1660 }
1661
1662 #[inline(always)]
1663 fn inline_size(_context: fidl::encoding::Context) -> usize {
1664 16
1665 }
1666 }
1667
1668 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Annotations, D>
1669 for &Annotations
1670 {
1671 unsafe fn encode(
1672 self,
1673 encoder: &mut fidl::encoding::Encoder<'_, D>,
1674 offset: usize,
1675 mut depth: fidl::encoding::Depth,
1676 ) -> fidl::Result<()> {
1677 encoder.debug_check_bounds::<Annotations>(offset);
1678 let max_ordinal: u64 = self.max_ordinal_present();
1680 encoder.write_num(max_ordinal, offset);
1681 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1682 if max_ordinal == 0 {
1684 return Ok(());
1685 }
1686 depth.increment()?;
1687 let envelope_size = 8;
1688 let bytes_len = max_ordinal as usize * envelope_size;
1689 #[allow(unused_variables)]
1690 let offset = encoder.out_of_line_offset(bytes_len);
1691 let mut _prev_end_offset: usize = 0;
1692 if 2 > max_ordinal {
1693 return Ok(());
1694 }
1695
1696 let cur_offset: usize = (2 - 1) * envelope_size;
1699
1700 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1702
1703 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 512>, D>(
1708 self.annotations2.as_ref().map(<fidl::encoding::Vector<Annotation, 512> as fidl::encoding::ValueTypeMarker>::borrow),
1709 encoder, offset + cur_offset, depth
1710 )?;
1711
1712 _prev_end_offset = cur_offset + envelope_size;
1713
1714 Ok(())
1715 }
1716 }
1717
1718 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Annotations {
1719 #[inline(always)]
1720 fn new_empty() -> Self {
1721 Self::default()
1722 }
1723
1724 unsafe fn decode(
1725 &mut self,
1726 decoder: &mut fidl::encoding::Decoder<'_, D>,
1727 offset: usize,
1728 mut depth: fidl::encoding::Depth,
1729 ) -> fidl::Result<()> {
1730 decoder.debug_check_bounds::<Self>(offset);
1731 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1732 None => return Err(fidl::Error::NotNullable),
1733 Some(len) => len,
1734 };
1735 if len == 0 {
1737 return Ok(());
1738 };
1739 depth.increment()?;
1740 let envelope_size = 8;
1741 let bytes_len = len * envelope_size;
1742 let offset = decoder.out_of_line_offset(bytes_len)?;
1743 let mut _next_ordinal_to_read = 0;
1745 let mut next_offset = offset;
1746 let end_offset = offset + bytes_len;
1747 _next_ordinal_to_read += 1;
1748 if next_offset >= end_offset {
1749 return Ok(());
1750 }
1751
1752 while _next_ordinal_to_read < 2 {
1754 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1755 _next_ordinal_to_read += 1;
1756 next_offset += envelope_size;
1757 }
1758
1759 let next_out_of_line = decoder.next_out_of_line();
1760 let handles_before = decoder.remaining_handles();
1761 if let Some((inlined, num_bytes, num_handles)) =
1762 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1763 {
1764 let member_inline_size = <fidl::encoding::Vector<Annotation, 512> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1765 if inlined != (member_inline_size <= 4) {
1766 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1767 }
1768 let inner_offset;
1769 let mut inner_depth = depth.clone();
1770 if inlined {
1771 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1772 inner_offset = next_offset;
1773 } else {
1774 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1775 inner_depth.increment()?;
1776 }
1777 let val_ref = self.annotations2.get_or_insert_with(
1778 || fidl::new_empty!(fidl::encoding::Vector<Annotation, 512>, D),
1779 );
1780 fidl::decode!(fidl::encoding::Vector<Annotation, 512>, D, val_ref, decoder, inner_offset, inner_depth)?;
1781 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1782 {
1783 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1784 }
1785 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1786 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1787 }
1788 }
1789
1790 next_offset += envelope_size;
1791
1792 while next_offset < end_offset {
1794 _next_ordinal_to_read += 1;
1795 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1796 next_offset += envelope_size;
1797 }
1798
1799 Ok(())
1800 }
1801 }
1802
1803 impl ComponentData {
1804 #[inline(always)]
1805 fn max_ordinal_present(&self) -> u64 {
1806 if let Some(_) = self.annotations {
1807 return 2;
1808 }
1809 if let Some(_) = self.namespace {
1810 return 1;
1811 }
1812 0
1813 }
1814 }
1815
1816 impl fidl::encoding::ValueTypeMarker for ComponentData {
1817 type Borrowed<'a> = &'a Self;
1818 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1819 value
1820 }
1821 }
1822
1823 unsafe impl fidl::encoding::TypeMarker for ComponentData {
1824 type Owned = Self;
1825
1826 #[inline(always)]
1827 fn inline_align(_context: fidl::encoding::Context) -> usize {
1828 8
1829 }
1830
1831 #[inline(always)]
1832 fn inline_size(_context: fidl::encoding::Context) -> usize {
1833 16
1834 }
1835 }
1836
1837 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ComponentData, D>
1838 for &ComponentData
1839 {
1840 unsafe fn encode(
1841 self,
1842 encoder: &mut fidl::encoding::Encoder<'_, D>,
1843 offset: usize,
1844 mut depth: fidl::encoding::Depth,
1845 ) -> fidl::Result<()> {
1846 encoder.debug_check_bounds::<ComponentData>(offset);
1847 let max_ordinal: u64 = self.max_ordinal_present();
1849 encoder.write_num(max_ordinal, offset);
1850 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1851 if max_ordinal == 0 {
1853 return Ok(());
1854 }
1855 depth.increment()?;
1856 let envelope_size = 8;
1857 let bytes_len = max_ordinal as usize * envelope_size;
1858 #[allow(unused_variables)]
1859 let offset = encoder.out_of_line_offset(bytes_len);
1860 let mut _prev_end_offset: usize = 0;
1861 if 1 > max_ordinal {
1862 return Ok(());
1863 }
1864
1865 let cur_offset: usize = (1 - 1) * envelope_size;
1868
1869 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1871
1872 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<32>, D>(
1877 self.namespace.as_ref().map(
1878 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
1879 ),
1880 encoder,
1881 offset + cur_offset,
1882 depth,
1883 )?;
1884
1885 _prev_end_offset = cur_offset + envelope_size;
1886 if 2 > max_ordinal {
1887 return Ok(());
1888 }
1889
1890 let cur_offset: usize = (2 - 1) * envelope_size;
1893
1894 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1896
1897 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 16>, D>(
1902 self.annotations.as_ref().map(<fidl::encoding::Vector<Annotation, 16> as fidl::encoding::ValueTypeMarker>::borrow),
1903 encoder, offset + cur_offset, depth
1904 )?;
1905
1906 _prev_end_offset = cur_offset + envelope_size;
1907
1908 Ok(())
1909 }
1910 }
1911
1912 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ComponentData {
1913 #[inline(always)]
1914 fn new_empty() -> Self {
1915 Self::default()
1916 }
1917
1918 unsafe fn decode(
1919 &mut self,
1920 decoder: &mut fidl::encoding::Decoder<'_, D>,
1921 offset: usize,
1922 mut depth: fidl::encoding::Depth,
1923 ) -> fidl::Result<()> {
1924 decoder.debug_check_bounds::<Self>(offset);
1925 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1926 None => return Err(fidl::Error::NotNullable),
1927 Some(len) => len,
1928 };
1929 if len == 0 {
1931 return Ok(());
1932 };
1933 depth.increment()?;
1934 let envelope_size = 8;
1935 let bytes_len = len * envelope_size;
1936 let offset = decoder.out_of_line_offset(bytes_len)?;
1937 let mut _next_ordinal_to_read = 0;
1939 let mut next_offset = offset;
1940 let end_offset = offset + bytes_len;
1941 _next_ordinal_to_read += 1;
1942 if next_offset >= end_offset {
1943 return Ok(());
1944 }
1945
1946 while _next_ordinal_to_read < 1 {
1948 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1949 _next_ordinal_to_read += 1;
1950 next_offset += envelope_size;
1951 }
1952
1953 let next_out_of_line = decoder.next_out_of_line();
1954 let handles_before = decoder.remaining_handles();
1955 if let Some((inlined, num_bytes, num_handles)) =
1956 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1957 {
1958 let member_inline_size =
1959 <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
1960 decoder.context,
1961 );
1962 if inlined != (member_inline_size <= 4) {
1963 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1964 }
1965 let inner_offset;
1966 let mut inner_depth = depth.clone();
1967 if inlined {
1968 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1969 inner_offset = next_offset;
1970 } else {
1971 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1972 inner_depth.increment()?;
1973 }
1974 let val_ref = self
1975 .namespace
1976 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<32>, D));
1977 fidl::decode!(
1978 fidl::encoding::BoundedString<32>,
1979 D,
1980 val_ref,
1981 decoder,
1982 inner_offset,
1983 inner_depth
1984 )?;
1985 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1986 {
1987 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1988 }
1989 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1990 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1991 }
1992 }
1993
1994 next_offset += envelope_size;
1995 _next_ordinal_to_read += 1;
1996 if next_offset >= end_offset {
1997 return Ok(());
1998 }
1999
2000 while _next_ordinal_to_read < 2 {
2002 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2003 _next_ordinal_to_read += 1;
2004 next_offset += envelope_size;
2005 }
2006
2007 let next_out_of_line = decoder.next_out_of_line();
2008 let handles_before = decoder.remaining_handles();
2009 if let Some((inlined, num_bytes, num_handles)) =
2010 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2011 {
2012 let member_inline_size = <fidl::encoding::Vector<Annotation, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2013 if inlined != (member_inline_size <= 4) {
2014 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2015 }
2016 let inner_offset;
2017 let mut inner_depth = depth.clone();
2018 if inlined {
2019 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2020 inner_offset = next_offset;
2021 } else {
2022 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2023 inner_depth.increment()?;
2024 }
2025 let val_ref = self.annotations.get_or_insert_with(
2026 || fidl::new_empty!(fidl::encoding::Vector<Annotation, 16>, D),
2027 );
2028 fidl::decode!(fidl::encoding::Vector<Annotation, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
2029 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2030 {
2031 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2032 }
2033 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2034 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2035 }
2036 }
2037
2038 next_offset += envelope_size;
2039
2040 while next_offset < end_offset {
2042 _next_ordinal_to_read += 1;
2043 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2044 next_offset += envelope_size;
2045 }
2046
2047 Ok(())
2048 }
2049 }
2050
2051 impl CrashReportingProduct {
2052 #[inline(always)]
2053 fn max_ordinal_present(&self) -> u64 {
2054 if let Some(_) = self.channel {
2055 return 3;
2056 }
2057 if let Some(_) = self.version {
2058 return 2;
2059 }
2060 if let Some(_) = self.name {
2061 return 1;
2062 }
2063 0
2064 }
2065 }
2066
2067 impl fidl::encoding::ValueTypeMarker for CrashReportingProduct {
2068 type Borrowed<'a> = &'a Self;
2069 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2070 value
2071 }
2072 }
2073
2074 unsafe impl fidl::encoding::TypeMarker for CrashReportingProduct {
2075 type Owned = Self;
2076
2077 #[inline(always)]
2078 fn inline_align(_context: fidl::encoding::Context) -> usize {
2079 8
2080 }
2081
2082 #[inline(always)]
2083 fn inline_size(_context: fidl::encoding::Context) -> usize {
2084 16
2085 }
2086 }
2087
2088 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CrashReportingProduct, D>
2089 for &CrashReportingProduct
2090 {
2091 unsafe fn encode(
2092 self,
2093 encoder: &mut fidl::encoding::Encoder<'_, D>,
2094 offset: usize,
2095 mut depth: fidl::encoding::Depth,
2096 ) -> fidl::Result<()> {
2097 encoder.debug_check_bounds::<CrashReportingProduct>(offset);
2098 let max_ordinal: u64 = self.max_ordinal_present();
2100 encoder.write_num(max_ordinal, offset);
2101 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2102 if max_ordinal == 0 {
2104 return Ok(());
2105 }
2106 depth.increment()?;
2107 let envelope_size = 8;
2108 let bytes_len = max_ordinal as usize * envelope_size;
2109 #[allow(unused_variables)]
2110 let offset = encoder.out_of_line_offset(bytes_len);
2111 let mut _prev_end_offset: usize = 0;
2112 if 1 > max_ordinal {
2113 return Ok(());
2114 }
2115
2116 let cur_offset: usize = (1 - 1) * envelope_size;
2119
2120 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2122
2123 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2128 self.name.as_ref().map(
2129 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2130 ),
2131 encoder,
2132 offset + cur_offset,
2133 depth,
2134 )?;
2135
2136 _prev_end_offset = cur_offset + envelope_size;
2137 if 2 > max_ordinal {
2138 return Ok(());
2139 }
2140
2141 let cur_offset: usize = (2 - 1) * envelope_size;
2144
2145 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2147
2148 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2153 self.version.as_ref().map(
2154 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2155 ),
2156 encoder,
2157 offset + cur_offset,
2158 depth,
2159 )?;
2160
2161 _prev_end_offset = cur_offset + envelope_size;
2162 if 3 > max_ordinal {
2163 return Ok(());
2164 }
2165
2166 let cur_offset: usize = (3 - 1) * envelope_size;
2169
2170 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2172
2173 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2178 self.channel.as_ref().map(
2179 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2180 ),
2181 encoder,
2182 offset + cur_offset,
2183 depth,
2184 )?;
2185
2186 _prev_end_offset = cur_offset + envelope_size;
2187
2188 Ok(())
2189 }
2190 }
2191
2192 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CrashReportingProduct {
2193 #[inline(always)]
2194 fn new_empty() -> Self {
2195 Self::default()
2196 }
2197
2198 unsafe fn decode(
2199 &mut self,
2200 decoder: &mut fidl::encoding::Decoder<'_, D>,
2201 offset: usize,
2202 mut depth: fidl::encoding::Depth,
2203 ) -> fidl::Result<()> {
2204 decoder.debug_check_bounds::<Self>(offset);
2205 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2206 None => return Err(fidl::Error::NotNullable),
2207 Some(len) => len,
2208 };
2209 if len == 0 {
2211 return Ok(());
2212 };
2213 depth.increment()?;
2214 let envelope_size = 8;
2215 let bytes_len = len * envelope_size;
2216 let offset = decoder.out_of_line_offset(bytes_len)?;
2217 let mut _next_ordinal_to_read = 0;
2219 let mut next_offset = offset;
2220 let end_offset = offset + bytes_len;
2221 _next_ordinal_to_read += 1;
2222 if next_offset >= end_offset {
2223 return Ok(());
2224 }
2225
2226 while _next_ordinal_to_read < 1 {
2228 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2229 _next_ordinal_to_read += 1;
2230 next_offset += envelope_size;
2231 }
2232
2233 let next_out_of_line = decoder.next_out_of_line();
2234 let handles_before = decoder.remaining_handles();
2235 if let Some((inlined, num_bytes, num_handles)) =
2236 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2237 {
2238 let member_inline_size =
2239 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2240 decoder.context,
2241 );
2242 if inlined != (member_inline_size <= 4) {
2243 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2244 }
2245 let inner_offset;
2246 let mut inner_depth = depth.clone();
2247 if inlined {
2248 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2249 inner_offset = next_offset;
2250 } else {
2251 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2252 inner_depth.increment()?;
2253 }
2254 let val_ref = self
2255 .name
2256 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2257 fidl::decode!(
2258 fidl::encoding::UnboundedString,
2259 D,
2260 val_ref,
2261 decoder,
2262 inner_offset,
2263 inner_depth
2264 )?;
2265 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2266 {
2267 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2268 }
2269 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2270 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2271 }
2272 }
2273
2274 next_offset += envelope_size;
2275 _next_ordinal_to_read += 1;
2276 if next_offset >= end_offset {
2277 return Ok(());
2278 }
2279
2280 while _next_ordinal_to_read < 2 {
2282 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2283 _next_ordinal_to_read += 1;
2284 next_offset += envelope_size;
2285 }
2286
2287 let next_out_of_line = decoder.next_out_of_line();
2288 let handles_before = decoder.remaining_handles();
2289 if let Some((inlined, num_bytes, num_handles)) =
2290 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2291 {
2292 let member_inline_size =
2293 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2294 decoder.context,
2295 );
2296 if inlined != (member_inline_size <= 4) {
2297 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2298 }
2299 let inner_offset;
2300 let mut inner_depth = depth.clone();
2301 if inlined {
2302 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2303 inner_offset = next_offset;
2304 } else {
2305 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2306 inner_depth.increment()?;
2307 }
2308 let val_ref = self
2309 .version
2310 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2311 fidl::decode!(
2312 fidl::encoding::UnboundedString,
2313 D,
2314 val_ref,
2315 decoder,
2316 inner_offset,
2317 inner_depth
2318 )?;
2319 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2320 {
2321 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2322 }
2323 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2324 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2325 }
2326 }
2327
2328 next_offset += envelope_size;
2329 _next_ordinal_to_read += 1;
2330 if next_offset >= end_offset {
2331 return Ok(());
2332 }
2333
2334 while _next_ordinal_to_read < 3 {
2336 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2337 _next_ordinal_to_read += 1;
2338 next_offset += envelope_size;
2339 }
2340
2341 let next_out_of_line = decoder.next_out_of_line();
2342 let handles_before = decoder.remaining_handles();
2343 if let Some((inlined, num_bytes, num_handles)) =
2344 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2345 {
2346 let member_inline_size =
2347 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2348 decoder.context,
2349 );
2350 if inlined != (member_inline_size <= 4) {
2351 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2352 }
2353 let inner_offset;
2354 let mut inner_depth = depth.clone();
2355 if inlined {
2356 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2357 inner_offset = next_offset;
2358 } else {
2359 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2360 inner_depth.increment()?;
2361 }
2362 let val_ref = self
2363 .channel
2364 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2365 fidl::decode!(
2366 fidl::encoding::UnboundedString,
2367 D,
2368 val_ref,
2369 decoder,
2370 inner_offset,
2371 inner_depth
2372 )?;
2373 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2374 {
2375 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2376 }
2377 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2378 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2379 }
2380 }
2381
2382 next_offset += envelope_size;
2383
2384 while next_offset < end_offset {
2386 _next_ordinal_to_read += 1;
2387 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2388 next_offset += envelope_size;
2389 }
2390
2391 Ok(())
2392 }
2393 }
2394
2395 impl FileReportResults {
2396 #[inline(always)]
2397 fn max_ordinal_present(&self) -> u64 {
2398 if let Some(_) = self.report_id {
2399 return 2;
2400 }
2401 if let Some(_) = self.result {
2402 return 1;
2403 }
2404 0
2405 }
2406 }
2407
2408 impl fidl::encoding::ValueTypeMarker for FileReportResults {
2409 type Borrowed<'a> = &'a Self;
2410 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2411 value
2412 }
2413 }
2414
2415 unsafe impl fidl::encoding::TypeMarker for FileReportResults {
2416 type Owned = Self;
2417
2418 #[inline(always)]
2419 fn inline_align(_context: fidl::encoding::Context) -> usize {
2420 8
2421 }
2422
2423 #[inline(always)]
2424 fn inline_size(_context: fidl::encoding::Context) -> usize {
2425 16
2426 }
2427 }
2428
2429 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileReportResults, D>
2430 for &FileReportResults
2431 {
2432 unsafe fn encode(
2433 self,
2434 encoder: &mut fidl::encoding::Encoder<'_, D>,
2435 offset: usize,
2436 mut depth: fidl::encoding::Depth,
2437 ) -> fidl::Result<()> {
2438 encoder.debug_check_bounds::<FileReportResults>(offset);
2439 let max_ordinal: u64 = self.max_ordinal_present();
2441 encoder.write_num(max_ordinal, offset);
2442 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2443 if max_ordinal == 0 {
2445 return Ok(());
2446 }
2447 depth.increment()?;
2448 let envelope_size = 8;
2449 let bytes_len = max_ordinal as usize * envelope_size;
2450 #[allow(unused_variables)]
2451 let offset = encoder.out_of_line_offset(bytes_len);
2452 let mut _prev_end_offset: usize = 0;
2453 if 1 > max_ordinal {
2454 return Ok(());
2455 }
2456
2457 let cur_offset: usize = (1 - 1) * envelope_size;
2460
2461 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2463
2464 fidl::encoding::encode_in_envelope_optional::<FilingSuccess, D>(
2469 self.result
2470 .as_ref()
2471 .map(<FilingSuccess as fidl::encoding::ValueTypeMarker>::borrow),
2472 encoder,
2473 offset + cur_offset,
2474 depth,
2475 )?;
2476
2477 _prev_end_offset = cur_offset + envelope_size;
2478 if 2 > max_ordinal {
2479 return Ok(());
2480 }
2481
2482 let cur_offset: usize = (2 - 1) * envelope_size;
2485
2486 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2488
2489 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<64>, D>(
2494 self.report_id.as_ref().map(
2495 <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow,
2496 ),
2497 encoder,
2498 offset + cur_offset,
2499 depth,
2500 )?;
2501
2502 _prev_end_offset = cur_offset + envelope_size;
2503
2504 Ok(())
2505 }
2506 }
2507
2508 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileReportResults {
2509 #[inline(always)]
2510 fn new_empty() -> Self {
2511 Self::default()
2512 }
2513
2514 unsafe fn decode(
2515 &mut self,
2516 decoder: &mut fidl::encoding::Decoder<'_, D>,
2517 offset: usize,
2518 mut depth: fidl::encoding::Depth,
2519 ) -> fidl::Result<()> {
2520 decoder.debug_check_bounds::<Self>(offset);
2521 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2522 None => return Err(fidl::Error::NotNullable),
2523 Some(len) => len,
2524 };
2525 if len == 0 {
2527 return Ok(());
2528 };
2529 depth.increment()?;
2530 let envelope_size = 8;
2531 let bytes_len = len * envelope_size;
2532 let offset = decoder.out_of_line_offset(bytes_len)?;
2533 let mut _next_ordinal_to_read = 0;
2535 let mut next_offset = offset;
2536 let end_offset = offset + bytes_len;
2537 _next_ordinal_to_read += 1;
2538 if next_offset >= end_offset {
2539 return Ok(());
2540 }
2541
2542 while _next_ordinal_to_read < 1 {
2544 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2545 _next_ordinal_to_read += 1;
2546 next_offset += envelope_size;
2547 }
2548
2549 let next_out_of_line = decoder.next_out_of_line();
2550 let handles_before = decoder.remaining_handles();
2551 if let Some((inlined, num_bytes, num_handles)) =
2552 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2553 {
2554 let member_inline_size =
2555 <FilingSuccess as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2556 if inlined != (member_inline_size <= 4) {
2557 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2558 }
2559 let inner_offset;
2560 let mut inner_depth = depth.clone();
2561 if inlined {
2562 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2563 inner_offset = next_offset;
2564 } else {
2565 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2566 inner_depth.increment()?;
2567 }
2568 let val_ref = self.result.get_or_insert_with(|| fidl::new_empty!(FilingSuccess, D));
2569 fidl::decode!(FilingSuccess, D, val_ref, decoder, inner_offset, inner_depth)?;
2570 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2571 {
2572 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2573 }
2574 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2575 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2576 }
2577 }
2578
2579 next_offset += envelope_size;
2580 _next_ordinal_to_read += 1;
2581 if next_offset >= end_offset {
2582 return Ok(());
2583 }
2584
2585 while _next_ordinal_to_read < 2 {
2587 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2588 _next_ordinal_to_read += 1;
2589 next_offset += envelope_size;
2590 }
2591
2592 let next_out_of_line = decoder.next_out_of_line();
2593 let handles_before = decoder.remaining_handles();
2594 if let Some((inlined, num_bytes, num_handles)) =
2595 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2596 {
2597 let member_inline_size =
2598 <fidl::encoding::BoundedString<64> as fidl::encoding::TypeMarker>::inline_size(
2599 decoder.context,
2600 );
2601 if inlined != (member_inline_size <= 4) {
2602 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2603 }
2604 let inner_offset;
2605 let mut inner_depth = depth.clone();
2606 if inlined {
2607 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2608 inner_offset = next_offset;
2609 } else {
2610 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2611 inner_depth.increment()?;
2612 }
2613 let val_ref = self
2614 .report_id
2615 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<64>, D));
2616 fidl::decode!(
2617 fidl::encoding::BoundedString<64>,
2618 D,
2619 val_ref,
2620 decoder,
2621 inner_offset,
2622 inner_depth
2623 )?;
2624 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2625 {
2626 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2627 }
2628 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2629 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2630 }
2631 }
2632
2633 next_offset += envelope_size;
2634
2635 while next_offset < end_offset {
2637 _next_ordinal_to_read += 1;
2638 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2639 next_offset += envelope_size;
2640 }
2641
2642 Ok(())
2643 }
2644 }
2645
2646 impl GetAnnotationsParameters {
2647 #[inline(always)]
2648 fn max_ordinal_present(&self) -> u64 {
2649 if let Some(_) = self.collection_timeout_per_annotation {
2650 return 1;
2651 }
2652 0
2653 }
2654 }
2655
2656 impl fidl::encoding::ValueTypeMarker for GetAnnotationsParameters {
2657 type Borrowed<'a> = &'a Self;
2658 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2659 value
2660 }
2661 }
2662
2663 unsafe impl fidl::encoding::TypeMarker for GetAnnotationsParameters {
2664 type Owned = Self;
2665
2666 #[inline(always)]
2667 fn inline_align(_context: fidl::encoding::Context) -> usize {
2668 8
2669 }
2670
2671 #[inline(always)]
2672 fn inline_size(_context: fidl::encoding::Context) -> usize {
2673 16
2674 }
2675 }
2676
2677 unsafe impl<D: fidl::encoding::ResourceDialect>
2678 fidl::encoding::Encode<GetAnnotationsParameters, D> for &GetAnnotationsParameters
2679 {
2680 unsafe fn encode(
2681 self,
2682 encoder: &mut fidl::encoding::Encoder<'_, D>,
2683 offset: usize,
2684 mut depth: fidl::encoding::Depth,
2685 ) -> fidl::Result<()> {
2686 encoder.debug_check_bounds::<GetAnnotationsParameters>(offset);
2687 let max_ordinal: u64 = self.max_ordinal_present();
2689 encoder.write_num(max_ordinal, offset);
2690 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2691 if max_ordinal == 0 {
2693 return Ok(());
2694 }
2695 depth.increment()?;
2696 let envelope_size = 8;
2697 let bytes_len = max_ordinal as usize * envelope_size;
2698 #[allow(unused_variables)]
2699 let offset = encoder.out_of_line_offset(bytes_len);
2700 let mut _prev_end_offset: usize = 0;
2701 if 1 > max_ordinal {
2702 return Ok(());
2703 }
2704
2705 let cur_offset: usize = (1 - 1) * envelope_size;
2708
2709 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2711
2712 fidl::encoding::encode_in_envelope_optional::<i64, D>(
2717 self.collection_timeout_per_annotation
2718 .as_ref()
2719 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2720 encoder,
2721 offset + cur_offset,
2722 depth,
2723 )?;
2724
2725 _prev_end_offset = cur_offset + envelope_size;
2726
2727 Ok(())
2728 }
2729 }
2730
2731 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2732 for GetAnnotationsParameters
2733 {
2734 #[inline(always)]
2735 fn new_empty() -> Self {
2736 Self::default()
2737 }
2738
2739 unsafe fn decode(
2740 &mut self,
2741 decoder: &mut fidl::encoding::Decoder<'_, D>,
2742 offset: usize,
2743 mut depth: fidl::encoding::Depth,
2744 ) -> fidl::Result<()> {
2745 decoder.debug_check_bounds::<Self>(offset);
2746 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2747 None => return Err(fidl::Error::NotNullable),
2748 Some(len) => len,
2749 };
2750 if len == 0 {
2752 return Ok(());
2753 };
2754 depth.increment()?;
2755 let envelope_size = 8;
2756 let bytes_len = len * envelope_size;
2757 let offset = decoder.out_of_line_offset(bytes_len)?;
2758 let mut _next_ordinal_to_read = 0;
2760 let mut next_offset = offset;
2761 let end_offset = offset + bytes_len;
2762 _next_ordinal_to_read += 1;
2763 if next_offset >= end_offset {
2764 return Ok(());
2765 }
2766
2767 while _next_ordinal_to_read < 1 {
2769 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2770 _next_ordinal_to_read += 1;
2771 next_offset += envelope_size;
2772 }
2773
2774 let next_out_of_line = decoder.next_out_of_line();
2775 let handles_before = decoder.remaining_handles();
2776 if let Some((inlined, num_bytes, num_handles)) =
2777 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2778 {
2779 let member_inline_size =
2780 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2781 if inlined != (member_inline_size <= 4) {
2782 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2783 }
2784 let inner_offset;
2785 let mut inner_depth = depth.clone();
2786 if inlined {
2787 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2788 inner_offset = next_offset;
2789 } else {
2790 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2791 inner_depth.increment()?;
2792 }
2793 let val_ref = self
2794 .collection_timeout_per_annotation
2795 .get_or_insert_with(|| fidl::new_empty!(i64, D));
2796 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
2797 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2798 {
2799 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2800 }
2801 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2802 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2803 }
2804 }
2805
2806 next_offset += envelope_size;
2807
2808 while next_offset < end_offset {
2810 _next_ordinal_to_read += 1;
2811 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2812 next_offset += envelope_size;
2813 }
2814
2815 Ok(())
2816 }
2817 }
2818
2819 impl LastReboot {
2820 #[inline(always)]
2821 fn max_ordinal_present(&self) -> u64 {
2822 if let Some(_) = self.runtime {
2823 return 5;
2824 }
2825 if let Some(_) = self.planned {
2826 return 4;
2827 }
2828 if let Some(_) = self.uptime {
2829 return 3;
2830 }
2831 if let Some(_) = self.reason {
2832 return 2;
2833 }
2834 if let Some(_) = self.graceful {
2835 return 1;
2836 }
2837 0
2838 }
2839 }
2840
2841 impl fidl::encoding::ValueTypeMarker for LastReboot {
2842 type Borrowed<'a> = &'a Self;
2843 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2844 value
2845 }
2846 }
2847
2848 unsafe impl fidl::encoding::TypeMarker for LastReboot {
2849 type Owned = Self;
2850
2851 #[inline(always)]
2852 fn inline_align(_context: fidl::encoding::Context) -> usize {
2853 8
2854 }
2855
2856 #[inline(always)]
2857 fn inline_size(_context: fidl::encoding::Context) -> usize {
2858 16
2859 }
2860 }
2861
2862 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LastReboot, D>
2863 for &LastReboot
2864 {
2865 unsafe fn encode(
2866 self,
2867 encoder: &mut fidl::encoding::Encoder<'_, D>,
2868 offset: usize,
2869 mut depth: fidl::encoding::Depth,
2870 ) -> fidl::Result<()> {
2871 encoder.debug_check_bounds::<LastReboot>(offset);
2872 let max_ordinal: u64 = self.max_ordinal_present();
2874 encoder.write_num(max_ordinal, offset);
2875 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2876 if max_ordinal == 0 {
2878 return Ok(());
2879 }
2880 depth.increment()?;
2881 let envelope_size = 8;
2882 let bytes_len = max_ordinal as usize * envelope_size;
2883 #[allow(unused_variables)]
2884 let offset = encoder.out_of_line_offset(bytes_len);
2885 let mut _prev_end_offset: usize = 0;
2886 if 1 > max_ordinal {
2887 return Ok(());
2888 }
2889
2890 let cur_offset: usize = (1 - 1) * envelope_size;
2893
2894 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2896
2897 fidl::encoding::encode_in_envelope_optional::<bool, D>(
2902 self.graceful.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2903 encoder,
2904 offset + cur_offset,
2905 depth,
2906 )?;
2907
2908 _prev_end_offset = cur_offset + envelope_size;
2909 if 2 > max_ordinal {
2910 return Ok(());
2911 }
2912
2913 let cur_offset: usize = (2 - 1) * envelope_size;
2916
2917 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2919
2920 fidl::encoding::encode_in_envelope_optional::<RebootReason, D>(
2925 self.reason.as_ref().map(<RebootReason as fidl::encoding::ValueTypeMarker>::borrow),
2926 encoder,
2927 offset + cur_offset,
2928 depth,
2929 )?;
2930
2931 _prev_end_offset = cur_offset + envelope_size;
2932 if 3 > max_ordinal {
2933 return Ok(());
2934 }
2935
2936 let cur_offset: usize = (3 - 1) * envelope_size;
2939
2940 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2942
2943 fidl::encoding::encode_in_envelope_optional::<i64, D>(
2948 self.uptime.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2949 encoder,
2950 offset + cur_offset,
2951 depth,
2952 )?;
2953
2954 _prev_end_offset = cur_offset + envelope_size;
2955 if 4 > max_ordinal {
2956 return Ok(());
2957 }
2958
2959 let cur_offset: usize = (4 - 1) * envelope_size;
2962
2963 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2965
2966 fidl::encoding::encode_in_envelope_optional::<bool, D>(
2971 self.planned.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2972 encoder,
2973 offset + cur_offset,
2974 depth,
2975 )?;
2976
2977 _prev_end_offset = cur_offset + envelope_size;
2978 if 5 > max_ordinal {
2979 return Ok(());
2980 }
2981
2982 let cur_offset: usize = (5 - 1) * envelope_size;
2985
2986 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2988
2989 fidl::encoding::encode_in_envelope_optional::<i64, D>(
2994 self.runtime.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2995 encoder,
2996 offset + cur_offset,
2997 depth,
2998 )?;
2999
3000 _prev_end_offset = cur_offset + envelope_size;
3001
3002 Ok(())
3003 }
3004 }
3005
3006 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LastReboot {
3007 #[inline(always)]
3008 fn new_empty() -> Self {
3009 Self::default()
3010 }
3011
3012 unsafe fn decode(
3013 &mut self,
3014 decoder: &mut fidl::encoding::Decoder<'_, D>,
3015 offset: usize,
3016 mut depth: fidl::encoding::Depth,
3017 ) -> fidl::Result<()> {
3018 decoder.debug_check_bounds::<Self>(offset);
3019 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3020 None => return Err(fidl::Error::NotNullable),
3021 Some(len) => len,
3022 };
3023 if len == 0 {
3025 return Ok(());
3026 };
3027 depth.increment()?;
3028 let envelope_size = 8;
3029 let bytes_len = len * envelope_size;
3030 let offset = decoder.out_of_line_offset(bytes_len)?;
3031 let mut _next_ordinal_to_read = 0;
3033 let mut next_offset = offset;
3034 let end_offset = offset + bytes_len;
3035 _next_ordinal_to_read += 1;
3036 if next_offset >= end_offset {
3037 return Ok(());
3038 }
3039
3040 while _next_ordinal_to_read < 1 {
3042 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3043 _next_ordinal_to_read += 1;
3044 next_offset += envelope_size;
3045 }
3046
3047 let next_out_of_line = decoder.next_out_of_line();
3048 let handles_before = decoder.remaining_handles();
3049 if let Some((inlined, num_bytes, num_handles)) =
3050 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3051 {
3052 let member_inline_size =
3053 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3054 if inlined != (member_inline_size <= 4) {
3055 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3056 }
3057 let inner_offset;
3058 let mut inner_depth = depth.clone();
3059 if inlined {
3060 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3061 inner_offset = next_offset;
3062 } else {
3063 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3064 inner_depth.increment()?;
3065 }
3066 let val_ref = self.graceful.get_or_insert_with(|| fidl::new_empty!(bool, D));
3067 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3068 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3069 {
3070 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3071 }
3072 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3073 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3074 }
3075 }
3076
3077 next_offset += envelope_size;
3078 _next_ordinal_to_read += 1;
3079 if next_offset >= end_offset {
3080 return Ok(());
3081 }
3082
3083 while _next_ordinal_to_read < 2 {
3085 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3086 _next_ordinal_to_read += 1;
3087 next_offset += envelope_size;
3088 }
3089
3090 let next_out_of_line = decoder.next_out_of_line();
3091 let handles_before = decoder.remaining_handles();
3092 if let Some((inlined, num_bytes, num_handles)) =
3093 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3094 {
3095 let member_inline_size =
3096 <RebootReason as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3097 if inlined != (member_inline_size <= 4) {
3098 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3099 }
3100 let inner_offset;
3101 let mut inner_depth = depth.clone();
3102 if inlined {
3103 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3104 inner_offset = next_offset;
3105 } else {
3106 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3107 inner_depth.increment()?;
3108 }
3109 let val_ref = self.reason.get_or_insert_with(|| fidl::new_empty!(RebootReason, D));
3110 fidl::decode!(RebootReason, D, val_ref, decoder, inner_offset, inner_depth)?;
3111 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3112 {
3113 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3114 }
3115 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3116 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3117 }
3118 }
3119
3120 next_offset += envelope_size;
3121 _next_ordinal_to_read += 1;
3122 if next_offset >= end_offset {
3123 return Ok(());
3124 }
3125
3126 while _next_ordinal_to_read < 3 {
3128 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3129 _next_ordinal_to_read += 1;
3130 next_offset += envelope_size;
3131 }
3132
3133 let next_out_of_line = decoder.next_out_of_line();
3134 let handles_before = decoder.remaining_handles();
3135 if let Some((inlined, num_bytes, num_handles)) =
3136 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3137 {
3138 let member_inline_size =
3139 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3140 if inlined != (member_inline_size <= 4) {
3141 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3142 }
3143 let inner_offset;
3144 let mut inner_depth = depth.clone();
3145 if inlined {
3146 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3147 inner_offset = next_offset;
3148 } else {
3149 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3150 inner_depth.increment()?;
3151 }
3152 let val_ref = self.uptime.get_or_insert_with(|| fidl::new_empty!(i64, D));
3153 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3154 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3155 {
3156 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3157 }
3158 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3159 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3160 }
3161 }
3162
3163 next_offset += envelope_size;
3164 _next_ordinal_to_read += 1;
3165 if next_offset >= end_offset {
3166 return Ok(());
3167 }
3168
3169 while _next_ordinal_to_read < 4 {
3171 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3172 _next_ordinal_to_read += 1;
3173 next_offset += envelope_size;
3174 }
3175
3176 let next_out_of_line = decoder.next_out_of_line();
3177 let handles_before = decoder.remaining_handles();
3178 if let Some((inlined, num_bytes, num_handles)) =
3179 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3180 {
3181 let member_inline_size =
3182 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3183 if inlined != (member_inline_size <= 4) {
3184 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3185 }
3186 let inner_offset;
3187 let mut inner_depth = depth.clone();
3188 if inlined {
3189 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3190 inner_offset = next_offset;
3191 } else {
3192 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3193 inner_depth.increment()?;
3194 }
3195 let val_ref = self.planned.get_or_insert_with(|| fidl::new_empty!(bool, D));
3196 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3197 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3198 {
3199 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3200 }
3201 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3202 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3203 }
3204 }
3205
3206 next_offset += envelope_size;
3207 _next_ordinal_to_read += 1;
3208 if next_offset >= end_offset {
3209 return Ok(());
3210 }
3211
3212 while _next_ordinal_to_read < 5 {
3214 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3215 _next_ordinal_to_read += 1;
3216 next_offset += envelope_size;
3217 }
3218
3219 let next_out_of_line = decoder.next_out_of_line();
3220 let handles_before = decoder.remaining_handles();
3221 if let Some((inlined, num_bytes, num_handles)) =
3222 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3223 {
3224 let member_inline_size =
3225 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3226 if inlined != (member_inline_size <= 4) {
3227 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3228 }
3229 let inner_offset;
3230 let mut inner_depth = depth.clone();
3231 if inlined {
3232 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3233 inner_offset = next_offset;
3234 } else {
3235 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3236 inner_depth.increment()?;
3237 }
3238 let val_ref = self.runtime.get_or_insert_with(|| fidl::new_empty!(i64, D));
3239 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3240 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3241 {
3242 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3243 }
3244 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3245 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3246 }
3247 }
3248
3249 next_offset += envelope_size;
3250
3251 while next_offset < end_offset {
3253 _next_ordinal_to_read += 1;
3254 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3255 next_offset += envelope_size;
3256 }
3257
3258 Ok(())
3259 }
3260 }
3261}