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 UserRequestDeviceStuck,
222 DeveloperRequest,
225 RetrySystemUpdate,
227 HighTemperature,
229 SessionFailure,
232 SysmgrFailure,
235 FactoryDataReset,
238 CriticalComponentFailure,
240 ZbiSwap,
242 AndroidUnexpectedReason,
244 AndroidNoReason,
246 AndroidRescueParty,
248 AndroidCriticalProcessFailure,
250 BatteryDrained,
252 SystemUpdate,
254 NetstackMigration,
256 #[doc(hidden)]
257 __SourceBreaking {
258 unknown_ordinal: u16,
259 },
260}
261
262#[macro_export]
264macro_rules! RebootReasonUnknown {
265 () => {
266 _
267 };
268}
269
270impl RebootReason {
271 #[inline]
272 pub fn from_primitive(prim: u16) -> Option<Self> {
273 match prim {
274 0 => Some(Self::Unknown),
275 2 => Some(Self::Cold),
276 3 => Some(Self::BriefPowerLoss),
277 4 => Some(Self::Brownout),
278 5 => Some(Self::KernelPanic),
279 6 => Some(Self::SystemOutOfMemory),
280 7 => Some(Self::HardwareWatchdogTimeout),
281 8 => Some(Self::SoftwareWatchdogTimeout),
282 19 => Some(Self::RootJobTermination),
283 9 => Some(Self::UserRequest),
284 26 => Some(Self::UserRequestDeviceStuck),
285 22 => Some(Self::DeveloperRequest),
286 17 => Some(Self::RetrySystemUpdate),
287 11 => Some(Self::HighTemperature),
288 12 => Some(Self::SessionFailure),
289 15 => Some(Self::SysmgrFailure),
290 14 => Some(Self::FactoryDataReset),
291 16 => Some(Self::CriticalComponentFailure),
292 18 => Some(Self::ZbiSwap),
293 21 => Some(Self::AndroidUnexpectedReason),
294 25 => Some(Self::AndroidNoReason),
295 23 => Some(Self::AndroidRescueParty),
296 24 => Some(Self::AndroidCriticalProcessFailure),
297 27 => Some(Self::BatteryDrained),
298 10 => Some(Self::SystemUpdate),
299 20 => Some(Self::NetstackMigration),
300 _ => None,
301 }
302 }
303
304 #[inline]
305 pub fn from_primitive_allow_unknown(prim: u16) -> Self {
306 match prim {
307 0 => Self::Unknown,
308 2 => Self::Cold,
309 3 => Self::BriefPowerLoss,
310 4 => Self::Brownout,
311 5 => Self::KernelPanic,
312 6 => Self::SystemOutOfMemory,
313 7 => Self::HardwareWatchdogTimeout,
314 8 => Self::SoftwareWatchdogTimeout,
315 19 => Self::RootJobTermination,
316 9 => Self::UserRequest,
317 26 => Self::UserRequestDeviceStuck,
318 22 => Self::DeveloperRequest,
319 17 => Self::RetrySystemUpdate,
320 11 => Self::HighTemperature,
321 12 => Self::SessionFailure,
322 15 => Self::SysmgrFailure,
323 14 => Self::FactoryDataReset,
324 16 => Self::CriticalComponentFailure,
325 18 => Self::ZbiSwap,
326 21 => Self::AndroidUnexpectedReason,
327 25 => Self::AndroidNoReason,
328 23 => Self::AndroidRescueParty,
329 24 => Self::AndroidCriticalProcessFailure,
330 27 => Self::BatteryDrained,
331 10 => Self::SystemUpdate,
332 20 => Self::NetstackMigration,
333 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
334 }
335 }
336
337 #[inline]
338 pub fn unknown() -> Self {
339 Self::__SourceBreaking { unknown_ordinal: 0x0 }
340 }
341
342 #[inline]
343 pub const fn into_primitive(self) -> u16 {
344 match self {
345 Self::Unknown => 0,
346 Self::Cold => 2,
347 Self::BriefPowerLoss => 3,
348 Self::Brownout => 4,
349 Self::KernelPanic => 5,
350 Self::SystemOutOfMemory => 6,
351 Self::HardwareWatchdogTimeout => 7,
352 Self::SoftwareWatchdogTimeout => 8,
353 Self::RootJobTermination => 19,
354 Self::UserRequest => 9,
355 Self::UserRequestDeviceStuck => 26,
356 Self::DeveloperRequest => 22,
357 Self::RetrySystemUpdate => 17,
358 Self::HighTemperature => 11,
359 Self::SessionFailure => 12,
360 Self::SysmgrFailure => 15,
361 Self::FactoryDataReset => 14,
362 Self::CriticalComponentFailure => 16,
363 Self::ZbiSwap => 18,
364 Self::AndroidUnexpectedReason => 21,
365 Self::AndroidNoReason => 25,
366 Self::AndroidRescueParty => 23,
367 Self::AndroidCriticalProcessFailure => 24,
368 Self::BatteryDrained => 27,
369 Self::SystemUpdate => 10,
370 Self::NetstackMigration => 20,
371 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
372 }
373 }
374
375 #[inline]
376 pub fn is_unknown(&self) -> bool {
377 match self {
378 Self::__SourceBreaking { unknown_ordinal: _ } => true,
379 _ => false,
380 }
381 }
382}
383
384#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
386pub enum ShutdownAction {
387 Poweroff,
388 Reboot,
389 RebootToRecovery,
390 RebootToBootloader,
391 #[doc(hidden)]
392 __SourceBreaking {
393 unknown_ordinal: u32,
394 },
395}
396
397#[macro_export]
399macro_rules! ShutdownActionUnknown {
400 () => {
401 _
402 };
403}
404
405impl ShutdownAction {
406 #[inline]
407 pub fn from_primitive(prim: u32) -> Option<Self> {
408 match prim {
409 1 => Some(Self::Poweroff),
410 2 => Some(Self::Reboot),
411 3 => Some(Self::RebootToRecovery),
412 4 => Some(Self::RebootToBootloader),
413 _ => None,
414 }
415 }
416
417 #[inline]
418 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
419 match prim {
420 1 => Self::Poweroff,
421 2 => Self::Reboot,
422 3 => Self::RebootToRecovery,
423 4 => Self::RebootToBootloader,
424 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
425 }
426 }
427
428 #[inline]
429 pub fn unknown() -> Self {
430 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
431 }
432
433 #[inline]
434 pub const fn into_primitive(self) -> u32 {
435 match self {
436 Self::Poweroff => 1,
437 Self::Reboot => 2,
438 Self::RebootToRecovery => 3,
439 Self::RebootToBootloader => 4,
440 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
441 }
442 }
443
444 #[inline]
445 pub fn is_unknown(&self) -> bool {
446 match self {
447 Self::__SourceBreaking { unknown_ordinal: _ } => true,
448 _ => false,
449 }
450 }
451}
452
453#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
456pub struct Annotation {
457 pub key: String,
458 pub value: String,
459}
460
461impl fidl::Persistable for Annotation {}
462
463#[derive(Clone, Debug, PartialEq)]
464pub struct ComponentDataRegisterUpsertRequest {
465 pub data: ComponentData,
466}
467
468impl fidl::Persistable for ComponentDataRegisterUpsertRequest {}
469
470#[derive(Clone, Debug, PartialEq)]
471pub struct CrashReporterFileReportResponse {
472 pub results: FileReportResults,
473}
474
475impl fidl::Persistable for CrashReporterFileReportResponse {}
476
477#[derive(Clone, Debug, PartialEq)]
478pub struct CrashReportingProductRegisterUpsertRequest {
479 pub component_url: String,
480 pub product: CrashReportingProduct,
481}
482
483impl fidl::Persistable for CrashReportingProductRegisterUpsertRequest {}
484
485#[derive(Clone, Debug, PartialEq)]
486pub struct CrashReportingProductRegisterUpsertWithAckRequest {
487 pub component_url: String,
488 pub product: CrashReportingProduct,
489}
490
491impl fidl::Persistable for CrashReportingProductRegisterUpsertWithAckRequest {}
492
493#[derive(Clone, Debug, PartialEq)]
494pub struct DataProviderGetAnnotationsRequest {
495 pub params: GetAnnotationsParameters,
496}
497
498impl fidl::Persistable for DataProviderGetAnnotationsRequest {}
499
500#[derive(Clone, Debug, PartialEq)]
501pub struct DataProviderGetAnnotationsResponse {
502 pub annotations: Annotations,
503}
504
505impl fidl::Persistable for DataProviderGetAnnotationsResponse {}
506
507#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
508pub struct DeviceIdProviderGetIdResponse {
509 pub feedback_id: String,
510}
511
512impl fidl::Persistable for DeviceIdProviderGetIdResponse {}
513
514#[derive(Clone, Debug, PartialEq)]
515pub struct LastRebootInfoProviderGetResponse {
516 pub last_reboot: LastReboot,
517}
518
519impl fidl::Persistable for LastRebootInfoProviderGetResponse {}
520
521#[derive(Clone, Debug, Default, PartialEq)]
526pub struct Annotations {
527 pub annotations2: Option<Vec<Annotation>>,
529 #[doc(hidden)]
530 pub __source_breaking: fidl::marker::SourceBreaking,
531}
532
533impl fidl::Persistable for Annotations {}
534
535#[derive(Clone, Debug, Default, PartialEq)]
537pub struct ComponentData {
538 pub namespace: Option<String>,
553 pub annotations: Option<Vec<Annotation>>,
562 #[doc(hidden)]
563 pub __source_breaking: fidl::marker::SourceBreaking,
564}
565
566impl fidl::Persistable for ComponentData {}
567
568#[derive(Clone, Debug, Default, PartialEq)]
570pub struct CrashReportingProduct {
571 pub name: Option<String>,
577 pub version: Option<String>,
584 pub channel: Option<String>,
588 #[doc(hidden)]
589 pub __source_breaking: fidl::marker::SourceBreaking,
590}
591
592impl fidl::Persistable for CrashReportingProduct {}
593
594#[derive(Clone, Debug, Default, PartialEq)]
595pub struct FileReportResults {
596 pub result: Option<FilingSuccess>,
598 pub report_id: Option<String>,
600 #[doc(hidden)]
601 pub __source_breaking: fidl::marker::SourceBreaking,
602}
603
604impl fidl::Persistable for FileReportResults {}
605
606#[derive(Clone, Debug, Default, PartialEq)]
608pub struct GetAnnotationsParameters {
609 pub collection_timeout_per_annotation: Option<i64>,
616 #[doc(hidden)]
617 pub __source_breaking: fidl::marker::SourceBreaking,
618}
619
620impl fidl::Persistable for GetAnnotationsParameters {}
621
622#[derive(Clone, Debug, Default, PartialEq)]
624pub struct LastReboot {
625 pub graceful: Option<bool>,
636 pub reason: Option<RebootReason>,
638 pub uptime: Option<i64>,
641 pub planned: Option<bool>,
649 pub runtime: Option<i64>,
652 pub action: Option<ShutdownAction>,
654 #[doc(hidden)]
655 pub __source_breaking: fidl::marker::SourceBreaking,
656}
657
658impl fidl::Persistable for LastReboot {}
659
660pub mod component_data_register_ordinals {
661 pub const UPSERT: u64 = 0xa25b7c4e125c0a1;
662}
663
664pub mod crash_reporter_ordinals {
665 pub const FILE_REPORT: u64 = 0x6f660f55b3160dd4;
666}
667
668pub mod crash_reporting_product_register_ordinals {
669 pub const UPSERT: u64 = 0x668cdc9615c91d7f;
670 pub const UPSERT_WITH_ACK: u64 = 0x4a4f1279b3439c9d;
671}
672
673pub mod data_provider_ordinals {
674 pub const GET_SNAPSHOT: u64 = 0x753649a04e5d0bc0;
675 pub const GET_ANNOTATIONS: u64 = 0x367b4b6afe4345d8;
676}
677
678pub mod device_id_provider_ordinals {
679 pub const GET_ID: u64 = 0xea7f28a243488dc;
680}
681
682pub mod last_reboot_info_provider_ordinals {
683 pub const GET: u64 = 0xbc32d10e081ffac;
684}
685
686mod internal {
687 use super::*;
688 unsafe impl fidl::encoding::TypeMarker for FilingError {
689 type Owned = Self;
690
691 #[inline(always)]
692 fn inline_align(_context: fidl::encoding::Context) -> usize {
693 std::mem::align_of::<u32>()
694 }
695
696 #[inline(always)]
697 fn inline_size(_context: fidl::encoding::Context) -> usize {
698 std::mem::size_of::<u32>()
699 }
700
701 #[inline(always)]
702 fn encode_is_copy() -> bool {
703 false
704 }
705
706 #[inline(always)]
707 fn decode_is_copy() -> bool {
708 false
709 }
710 }
711
712 impl fidl::encoding::ValueTypeMarker for FilingError {
713 type Borrowed<'a> = Self;
714 #[inline(always)]
715 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
716 *value
717 }
718 }
719
720 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilingError {
721 #[inline]
722 unsafe fn encode(
723 self,
724 encoder: &mut fidl::encoding::Encoder<'_, D>,
725 offset: usize,
726 _depth: fidl::encoding::Depth,
727 ) -> fidl::Result<()> {
728 encoder.debug_check_bounds::<Self>(offset);
729 encoder.write_num(self.into_primitive(), offset);
730 Ok(())
731 }
732 }
733
734 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilingError {
735 #[inline(always)]
736 fn new_empty() -> Self {
737 Self::unknown()
738 }
739
740 #[inline]
741 unsafe fn decode(
742 &mut self,
743 decoder: &mut fidl::encoding::Decoder<'_, D>,
744 offset: usize,
745 _depth: fidl::encoding::Depth,
746 ) -> fidl::Result<()> {
747 decoder.debug_check_bounds::<Self>(offset);
748 let prim = decoder.read_num::<u32>(offset);
749
750 *self = Self::from_primitive_allow_unknown(prim);
751 Ok(())
752 }
753 }
754 unsafe impl fidl::encoding::TypeMarker for FilingSuccess {
755 type Owned = Self;
756
757 #[inline(always)]
758 fn inline_align(_context: fidl::encoding::Context) -> usize {
759 std::mem::align_of::<u32>()
760 }
761
762 #[inline(always)]
763 fn inline_size(_context: fidl::encoding::Context) -> usize {
764 std::mem::size_of::<u32>()
765 }
766
767 #[inline(always)]
768 fn encode_is_copy() -> bool {
769 false
770 }
771
772 #[inline(always)]
773 fn decode_is_copy() -> bool {
774 false
775 }
776 }
777
778 impl fidl::encoding::ValueTypeMarker for FilingSuccess {
779 type Borrowed<'a> = Self;
780 #[inline(always)]
781 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
782 *value
783 }
784 }
785
786 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FilingSuccess {
787 #[inline]
788 unsafe fn encode(
789 self,
790 encoder: &mut fidl::encoding::Encoder<'_, D>,
791 offset: usize,
792 _depth: fidl::encoding::Depth,
793 ) -> fidl::Result<()> {
794 encoder.debug_check_bounds::<Self>(offset);
795 encoder.write_num(self.into_primitive(), offset);
796 Ok(())
797 }
798 }
799
800 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilingSuccess {
801 #[inline(always)]
802 fn new_empty() -> Self {
803 Self::unknown()
804 }
805
806 #[inline]
807 unsafe fn decode(
808 &mut self,
809 decoder: &mut fidl::encoding::Decoder<'_, D>,
810 offset: usize,
811 _depth: fidl::encoding::Depth,
812 ) -> fidl::Result<()> {
813 decoder.debug_check_bounds::<Self>(offset);
814 let prim = decoder.read_num::<u32>(offset);
815
816 *self = Self::from_primitive_allow_unknown(prim);
817 Ok(())
818 }
819 }
820 unsafe impl fidl::encoding::TypeMarker for RebootReason {
821 type Owned = Self;
822
823 #[inline(always)]
824 fn inline_align(_context: fidl::encoding::Context) -> usize {
825 std::mem::align_of::<u16>()
826 }
827
828 #[inline(always)]
829 fn inline_size(_context: fidl::encoding::Context) -> usize {
830 std::mem::size_of::<u16>()
831 }
832
833 #[inline(always)]
834 fn encode_is_copy() -> bool {
835 false
836 }
837
838 #[inline(always)]
839 fn decode_is_copy() -> bool {
840 false
841 }
842 }
843
844 impl fidl::encoding::ValueTypeMarker for RebootReason {
845 type Borrowed<'a> = Self;
846 #[inline(always)]
847 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
848 *value
849 }
850 }
851
852 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RebootReason {
853 #[inline]
854 unsafe fn encode(
855 self,
856 encoder: &mut fidl::encoding::Encoder<'_, D>,
857 offset: usize,
858 _depth: fidl::encoding::Depth,
859 ) -> fidl::Result<()> {
860 encoder.debug_check_bounds::<Self>(offset);
861 encoder.write_num(self.into_primitive(), offset);
862 Ok(())
863 }
864 }
865
866 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RebootReason {
867 #[inline(always)]
868 fn new_empty() -> Self {
869 Self::unknown()
870 }
871
872 #[inline]
873 unsafe fn decode(
874 &mut self,
875 decoder: &mut fidl::encoding::Decoder<'_, D>,
876 offset: usize,
877 _depth: fidl::encoding::Depth,
878 ) -> fidl::Result<()> {
879 decoder.debug_check_bounds::<Self>(offset);
880 let prim = decoder.read_num::<u16>(offset);
881
882 *self = Self::from_primitive_allow_unknown(prim);
883 Ok(())
884 }
885 }
886 unsafe impl fidl::encoding::TypeMarker for ShutdownAction {
887 type Owned = Self;
888
889 #[inline(always)]
890 fn inline_align(_context: fidl::encoding::Context) -> usize {
891 std::mem::align_of::<u32>()
892 }
893
894 #[inline(always)]
895 fn inline_size(_context: fidl::encoding::Context) -> usize {
896 std::mem::size_of::<u32>()
897 }
898
899 #[inline(always)]
900 fn encode_is_copy() -> bool {
901 false
902 }
903
904 #[inline(always)]
905 fn decode_is_copy() -> bool {
906 false
907 }
908 }
909
910 impl fidl::encoding::ValueTypeMarker for ShutdownAction {
911 type Borrowed<'a> = Self;
912 #[inline(always)]
913 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
914 *value
915 }
916 }
917
918 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ShutdownAction {
919 #[inline]
920 unsafe fn encode(
921 self,
922 encoder: &mut fidl::encoding::Encoder<'_, D>,
923 offset: usize,
924 _depth: fidl::encoding::Depth,
925 ) -> fidl::Result<()> {
926 encoder.debug_check_bounds::<Self>(offset);
927 encoder.write_num(self.into_primitive(), offset);
928 Ok(())
929 }
930 }
931
932 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShutdownAction {
933 #[inline(always)]
934 fn new_empty() -> Self {
935 Self::unknown()
936 }
937
938 #[inline]
939 unsafe fn decode(
940 &mut self,
941 decoder: &mut fidl::encoding::Decoder<'_, D>,
942 offset: usize,
943 _depth: fidl::encoding::Depth,
944 ) -> fidl::Result<()> {
945 decoder.debug_check_bounds::<Self>(offset);
946 let prim = decoder.read_num::<u32>(offset);
947
948 *self = Self::from_primitive_allow_unknown(prim);
949 Ok(())
950 }
951 }
952
953 impl fidl::encoding::ValueTypeMarker for Annotation {
954 type Borrowed<'a> = &'a Self;
955 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
956 value
957 }
958 }
959
960 unsafe impl fidl::encoding::TypeMarker for Annotation {
961 type Owned = Self;
962
963 #[inline(always)]
964 fn inline_align(_context: fidl::encoding::Context) -> usize {
965 8
966 }
967
968 #[inline(always)]
969 fn inline_size(_context: fidl::encoding::Context) -> usize {
970 32
971 }
972 }
973
974 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Annotation, D>
975 for &Annotation
976 {
977 #[inline]
978 unsafe fn encode(
979 self,
980 encoder: &mut fidl::encoding::Encoder<'_, D>,
981 offset: usize,
982 _depth: fidl::encoding::Depth,
983 ) -> fidl::Result<()> {
984 encoder.debug_check_bounds::<Annotation>(offset);
985 fidl::encoding::Encode::<Annotation, D>::encode(
987 (
988 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
989 <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
990 ),
991 encoder, offset, _depth
992 )
993 }
994 }
995 unsafe impl<
996 D: fidl::encoding::ResourceDialect,
997 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
998 T1: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>, D>,
999 > fidl::encoding::Encode<Annotation, D> for (T0, T1)
1000 {
1001 #[inline]
1002 unsafe fn encode(
1003 self,
1004 encoder: &mut fidl::encoding::Encoder<'_, D>,
1005 offset: usize,
1006 depth: fidl::encoding::Depth,
1007 ) -> fidl::Result<()> {
1008 encoder.debug_check_bounds::<Annotation>(offset);
1009 self.0.encode(encoder, offset + 0, depth)?;
1013 self.1.encode(encoder, offset + 16, depth)?;
1014 Ok(())
1015 }
1016 }
1017
1018 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Annotation {
1019 #[inline(always)]
1020 fn new_empty() -> Self {
1021 Self {
1022 key: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
1023 value: fidl::new_empty!(fidl::encoding::BoundedString<1024>, D),
1024 }
1025 }
1026
1027 #[inline]
1028 unsafe fn decode(
1029 &mut self,
1030 decoder: &mut fidl::encoding::Decoder<'_, D>,
1031 offset: usize,
1032 _depth: fidl::encoding::Depth,
1033 ) -> fidl::Result<()> {
1034 decoder.debug_check_bounds::<Self>(offset);
1035 fidl::decode!(
1037 fidl::encoding::BoundedString<128>,
1038 D,
1039 &mut self.key,
1040 decoder,
1041 offset + 0,
1042 _depth
1043 )?;
1044 fidl::decode!(
1045 fidl::encoding::BoundedString<1024>,
1046 D,
1047 &mut self.value,
1048 decoder,
1049 offset + 16,
1050 _depth
1051 )?;
1052 Ok(())
1053 }
1054 }
1055
1056 impl fidl::encoding::ValueTypeMarker for ComponentDataRegisterUpsertRequest {
1057 type Borrowed<'a> = &'a Self;
1058 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1059 value
1060 }
1061 }
1062
1063 unsafe impl fidl::encoding::TypeMarker for ComponentDataRegisterUpsertRequest {
1064 type Owned = Self;
1065
1066 #[inline(always)]
1067 fn inline_align(_context: fidl::encoding::Context) -> usize {
1068 8
1069 }
1070
1071 #[inline(always)]
1072 fn inline_size(_context: fidl::encoding::Context) -> usize {
1073 16
1074 }
1075 }
1076
1077 unsafe impl<D: fidl::encoding::ResourceDialect>
1078 fidl::encoding::Encode<ComponentDataRegisterUpsertRequest, D>
1079 for &ComponentDataRegisterUpsertRequest
1080 {
1081 #[inline]
1082 unsafe fn encode(
1083 self,
1084 encoder: &mut fidl::encoding::Encoder<'_, D>,
1085 offset: usize,
1086 _depth: fidl::encoding::Depth,
1087 ) -> fidl::Result<()> {
1088 encoder.debug_check_bounds::<ComponentDataRegisterUpsertRequest>(offset);
1089 fidl::encoding::Encode::<ComponentDataRegisterUpsertRequest, D>::encode(
1091 (<ComponentData as fidl::encoding::ValueTypeMarker>::borrow(&self.data),),
1092 encoder,
1093 offset,
1094 _depth,
1095 )
1096 }
1097 }
1098 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ComponentData, D>>
1099 fidl::encoding::Encode<ComponentDataRegisterUpsertRequest, D> for (T0,)
1100 {
1101 #[inline]
1102 unsafe fn encode(
1103 self,
1104 encoder: &mut fidl::encoding::Encoder<'_, D>,
1105 offset: usize,
1106 depth: fidl::encoding::Depth,
1107 ) -> fidl::Result<()> {
1108 encoder.debug_check_bounds::<ComponentDataRegisterUpsertRequest>(offset);
1109 self.0.encode(encoder, offset + 0, depth)?;
1113 Ok(())
1114 }
1115 }
1116
1117 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1118 for ComponentDataRegisterUpsertRequest
1119 {
1120 #[inline(always)]
1121 fn new_empty() -> Self {
1122 Self { data: fidl::new_empty!(ComponentData, D) }
1123 }
1124
1125 #[inline]
1126 unsafe fn decode(
1127 &mut self,
1128 decoder: &mut fidl::encoding::Decoder<'_, D>,
1129 offset: usize,
1130 _depth: fidl::encoding::Depth,
1131 ) -> fidl::Result<()> {
1132 decoder.debug_check_bounds::<Self>(offset);
1133 fidl::decode!(ComponentData, D, &mut self.data, decoder, offset + 0, _depth)?;
1135 Ok(())
1136 }
1137 }
1138
1139 impl fidl::encoding::ValueTypeMarker for CrashReporterFileReportResponse {
1140 type Borrowed<'a> = &'a Self;
1141 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1142 value
1143 }
1144 }
1145
1146 unsafe impl fidl::encoding::TypeMarker for CrashReporterFileReportResponse {
1147 type Owned = Self;
1148
1149 #[inline(always)]
1150 fn inline_align(_context: fidl::encoding::Context) -> usize {
1151 8
1152 }
1153
1154 #[inline(always)]
1155 fn inline_size(_context: fidl::encoding::Context) -> usize {
1156 16
1157 }
1158 }
1159
1160 unsafe impl<D: fidl::encoding::ResourceDialect>
1161 fidl::encoding::Encode<CrashReporterFileReportResponse, D>
1162 for &CrashReporterFileReportResponse
1163 {
1164 #[inline]
1165 unsafe fn encode(
1166 self,
1167 encoder: &mut fidl::encoding::Encoder<'_, D>,
1168 offset: usize,
1169 _depth: fidl::encoding::Depth,
1170 ) -> fidl::Result<()> {
1171 encoder.debug_check_bounds::<CrashReporterFileReportResponse>(offset);
1172 fidl::encoding::Encode::<CrashReporterFileReportResponse, D>::encode(
1174 (<FileReportResults as fidl::encoding::ValueTypeMarker>::borrow(&self.results),),
1175 encoder,
1176 offset,
1177 _depth,
1178 )
1179 }
1180 }
1181 unsafe impl<
1182 D: fidl::encoding::ResourceDialect,
1183 T0: fidl::encoding::Encode<FileReportResults, D>,
1184 > fidl::encoding::Encode<CrashReporterFileReportResponse, D> for (T0,)
1185 {
1186 #[inline]
1187 unsafe fn encode(
1188 self,
1189 encoder: &mut fidl::encoding::Encoder<'_, D>,
1190 offset: usize,
1191 depth: fidl::encoding::Depth,
1192 ) -> fidl::Result<()> {
1193 encoder.debug_check_bounds::<CrashReporterFileReportResponse>(offset);
1194 self.0.encode(encoder, offset + 0, depth)?;
1198 Ok(())
1199 }
1200 }
1201
1202 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1203 for CrashReporterFileReportResponse
1204 {
1205 #[inline(always)]
1206 fn new_empty() -> Self {
1207 Self { results: fidl::new_empty!(FileReportResults, D) }
1208 }
1209
1210 #[inline]
1211 unsafe fn decode(
1212 &mut self,
1213 decoder: &mut fidl::encoding::Decoder<'_, D>,
1214 offset: usize,
1215 _depth: fidl::encoding::Depth,
1216 ) -> fidl::Result<()> {
1217 decoder.debug_check_bounds::<Self>(offset);
1218 fidl::decode!(FileReportResults, D, &mut self.results, decoder, offset + 0, _depth)?;
1220 Ok(())
1221 }
1222 }
1223
1224 impl fidl::encoding::ValueTypeMarker for CrashReportingProductRegisterUpsertRequest {
1225 type Borrowed<'a> = &'a Self;
1226 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1227 value
1228 }
1229 }
1230
1231 unsafe impl fidl::encoding::TypeMarker for CrashReportingProductRegisterUpsertRequest {
1232 type Owned = Self;
1233
1234 #[inline(always)]
1235 fn inline_align(_context: fidl::encoding::Context) -> usize {
1236 8
1237 }
1238
1239 #[inline(always)]
1240 fn inline_size(_context: fidl::encoding::Context) -> usize {
1241 32
1242 }
1243 }
1244
1245 unsafe impl<D: fidl::encoding::ResourceDialect>
1246 fidl::encoding::Encode<CrashReportingProductRegisterUpsertRequest, D>
1247 for &CrashReportingProductRegisterUpsertRequest
1248 {
1249 #[inline]
1250 unsafe fn encode(
1251 self,
1252 encoder: &mut fidl::encoding::Encoder<'_, D>,
1253 offset: usize,
1254 _depth: fidl::encoding::Depth,
1255 ) -> fidl::Result<()> {
1256 encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertRequest>(offset);
1257 fidl::encoding::Encode::<CrashReportingProductRegisterUpsertRequest, D>::encode(
1259 (
1260 <fidl::encoding::BoundedString<2083> as fidl::encoding::ValueTypeMarker>::borrow(&self.component_url),
1261 <CrashReportingProduct as fidl::encoding::ValueTypeMarker>::borrow(&self.product),
1262 ),
1263 encoder, offset, _depth
1264 )
1265 }
1266 }
1267 unsafe impl<
1268 D: fidl::encoding::ResourceDialect,
1269 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<2083>, D>,
1270 T1: fidl::encoding::Encode<CrashReportingProduct, D>,
1271 > fidl::encoding::Encode<CrashReportingProductRegisterUpsertRequest, D> for (T0, T1)
1272 {
1273 #[inline]
1274 unsafe fn encode(
1275 self,
1276 encoder: &mut fidl::encoding::Encoder<'_, D>,
1277 offset: usize,
1278 depth: fidl::encoding::Depth,
1279 ) -> fidl::Result<()> {
1280 encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertRequest>(offset);
1281 self.0.encode(encoder, offset + 0, depth)?;
1285 self.1.encode(encoder, offset + 16, depth)?;
1286 Ok(())
1287 }
1288 }
1289
1290 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1291 for CrashReportingProductRegisterUpsertRequest
1292 {
1293 #[inline(always)]
1294 fn new_empty() -> Self {
1295 Self {
1296 component_url: fidl::new_empty!(fidl::encoding::BoundedString<2083>, D),
1297 product: fidl::new_empty!(CrashReportingProduct, D),
1298 }
1299 }
1300
1301 #[inline]
1302 unsafe fn decode(
1303 &mut self,
1304 decoder: &mut fidl::encoding::Decoder<'_, D>,
1305 offset: usize,
1306 _depth: fidl::encoding::Depth,
1307 ) -> fidl::Result<()> {
1308 decoder.debug_check_bounds::<Self>(offset);
1309 fidl::decode!(
1311 fidl::encoding::BoundedString<2083>,
1312 D,
1313 &mut self.component_url,
1314 decoder,
1315 offset + 0,
1316 _depth
1317 )?;
1318 fidl::decode!(
1319 CrashReportingProduct,
1320 D,
1321 &mut self.product,
1322 decoder,
1323 offset + 16,
1324 _depth
1325 )?;
1326 Ok(())
1327 }
1328 }
1329
1330 impl fidl::encoding::ValueTypeMarker for CrashReportingProductRegisterUpsertWithAckRequest {
1331 type Borrowed<'a> = &'a Self;
1332 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1333 value
1334 }
1335 }
1336
1337 unsafe impl fidl::encoding::TypeMarker for CrashReportingProductRegisterUpsertWithAckRequest {
1338 type Owned = Self;
1339
1340 #[inline(always)]
1341 fn inline_align(_context: fidl::encoding::Context) -> usize {
1342 8
1343 }
1344
1345 #[inline(always)]
1346 fn inline_size(_context: fidl::encoding::Context) -> usize {
1347 32
1348 }
1349 }
1350
1351 unsafe impl<D: fidl::encoding::ResourceDialect>
1352 fidl::encoding::Encode<CrashReportingProductRegisterUpsertWithAckRequest, D>
1353 for &CrashReportingProductRegisterUpsertWithAckRequest
1354 {
1355 #[inline]
1356 unsafe fn encode(
1357 self,
1358 encoder: &mut fidl::encoding::Encoder<'_, D>,
1359 offset: usize,
1360 _depth: fidl::encoding::Depth,
1361 ) -> fidl::Result<()> {
1362 encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertWithAckRequest>(offset);
1363 fidl::encoding::Encode::<CrashReportingProductRegisterUpsertWithAckRequest, D>::encode(
1365 (
1366 <fidl::encoding::BoundedString<2083> as fidl::encoding::ValueTypeMarker>::borrow(&self.component_url),
1367 <CrashReportingProduct as fidl::encoding::ValueTypeMarker>::borrow(&self.product),
1368 ),
1369 encoder, offset, _depth
1370 )
1371 }
1372 }
1373 unsafe impl<
1374 D: fidl::encoding::ResourceDialect,
1375 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<2083>, D>,
1376 T1: fidl::encoding::Encode<CrashReportingProduct, D>,
1377 > fidl::encoding::Encode<CrashReportingProductRegisterUpsertWithAckRequest, D> for (T0, T1)
1378 {
1379 #[inline]
1380 unsafe fn encode(
1381 self,
1382 encoder: &mut fidl::encoding::Encoder<'_, D>,
1383 offset: usize,
1384 depth: fidl::encoding::Depth,
1385 ) -> fidl::Result<()> {
1386 encoder.debug_check_bounds::<CrashReportingProductRegisterUpsertWithAckRequest>(offset);
1387 self.0.encode(encoder, offset + 0, depth)?;
1391 self.1.encode(encoder, offset + 16, depth)?;
1392 Ok(())
1393 }
1394 }
1395
1396 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1397 for CrashReportingProductRegisterUpsertWithAckRequest
1398 {
1399 #[inline(always)]
1400 fn new_empty() -> Self {
1401 Self {
1402 component_url: fidl::new_empty!(fidl::encoding::BoundedString<2083>, D),
1403 product: fidl::new_empty!(CrashReportingProduct, D),
1404 }
1405 }
1406
1407 #[inline]
1408 unsafe fn decode(
1409 &mut self,
1410 decoder: &mut fidl::encoding::Decoder<'_, D>,
1411 offset: usize,
1412 _depth: fidl::encoding::Depth,
1413 ) -> fidl::Result<()> {
1414 decoder.debug_check_bounds::<Self>(offset);
1415 fidl::decode!(
1417 fidl::encoding::BoundedString<2083>,
1418 D,
1419 &mut self.component_url,
1420 decoder,
1421 offset + 0,
1422 _depth
1423 )?;
1424 fidl::decode!(
1425 CrashReportingProduct,
1426 D,
1427 &mut self.product,
1428 decoder,
1429 offset + 16,
1430 _depth
1431 )?;
1432 Ok(())
1433 }
1434 }
1435
1436 impl fidl::encoding::ValueTypeMarker for DataProviderGetAnnotationsRequest {
1437 type Borrowed<'a> = &'a Self;
1438 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1439 value
1440 }
1441 }
1442
1443 unsafe impl fidl::encoding::TypeMarker for DataProviderGetAnnotationsRequest {
1444 type Owned = Self;
1445
1446 #[inline(always)]
1447 fn inline_align(_context: fidl::encoding::Context) -> usize {
1448 8
1449 }
1450
1451 #[inline(always)]
1452 fn inline_size(_context: fidl::encoding::Context) -> usize {
1453 16
1454 }
1455 }
1456
1457 unsafe impl<D: fidl::encoding::ResourceDialect>
1458 fidl::encoding::Encode<DataProviderGetAnnotationsRequest, D>
1459 for &DataProviderGetAnnotationsRequest
1460 {
1461 #[inline]
1462 unsafe fn encode(
1463 self,
1464 encoder: &mut fidl::encoding::Encoder<'_, D>,
1465 offset: usize,
1466 _depth: fidl::encoding::Depth,
1467 ) -> fidl::Result<()> {
1468 encoder.debug_check_bounds::<DataProviderGetAnnotationsRequest>(offset);
1469 fidl::encoding::Encode::<DataProviderGetAnnotationsRequest, D>::encode(
1471 (<GetAnnotationsParameters as fidl::encoding::ValueTypeMarker>::borrow(
1472 &self.params,
1473 ),),
1474 encoder,
1475 offset,
1476 _depth,
1477 )
1478 }
1479 }
1480 unsafe impl<
1481 D: fidl::encoding::ResourceDialect,
1482 T0: fidl::encoding::Encode<GetAnnotationsParameters, D>,
1483 > fidl::encoding::Encode<DataProviderGetAnnotationsRequest, D> for (T0,)
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::<DataProviderGetAnnotationsRequest>(offset);
1493 self.0.encode(encoder, offset + 0, depth)?;
1497 Ok(())
1498 }
1499 }
1500
1501 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1502 for DataProviderGetAnnotationsRequest
1503 {
1504 #[inline(always)]
1505 fn new_empty() -> Self {
1506 Self { params: fidl::new_empty!(GetAnnotationsParameters, D) }
1507 }
1508
1509 #[inline]
1510 unsafe fn decode(
1511 &mut self,
1512 decoder: &mut fidl::encoding::Decoder<'_, D>,
1513 offset: usize,
1514 _depth: fidl::encoding::Depth,
1515 ) -> fidl::Result<()> {
1516 decoder.debug_check_bounds::<Self>(offset);
1517 fidl::decode!(
1519 GetAnnotationsParameters,
1520 D,
1521 &mut self.params,
1522 decoder,
1523 offset + 0,
1524 _depth
1525 )?;
1526 Ok(())
1527 }
1528 }
1529
1530 impl fidl::encoding::ValueTypeMarker for DataProviderGetAnnotationsResponse {
1531 type Borrowed<'a> = &'a Self;
1532 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1533 value
1534 }
1535 }
1536
1537 unsafe impl fidl::encoding::TypeMarker for DataProviderGetAnnotationsResponse {
1538 type Owned = Self;
1539
1540 #[inline(always)]
1541 fn inline_align(_context: fidl::encoding::Context) -> usize {
1542 8
1543 }
1544
1545 #[inline(always)]
1546 fn inline_size(_context: fidl::encoding::Context) -> usize {
1547 16
1548 }
1549 }
1550
1551 unsafe impl<D: fidl::encoding::ResourceDialect>
1552 fidl::encoding::Encode<DataProviderGetAnnotationsResponse, D>
1553 for &DataProviderGetAnnotationsResponse
1554 {
1555 #[inline]
1556 unsafe fn encode(
1557 self,
1558 encoder: &mut fidl::encoding::Encoder<'_, D>,
1559 offset: usize,
1560 _depth: fidl::encoding::Depth,
1561 ) -> fidl::Result<()> {
1562 encoder.debug_check_bounds::<DataProviderGetAnnotationsResponse>(offset);
1563 fidl::encoding::Encode::<DataProviderGetAnnotationsResponse, D>::encode(
1565 (<Annotations as fidl::encoding::ValueTypeMarker>::borrow(&self.annotations),),
1566 encoder,
1567 offset,
1568 _depth,
1569 )
1570 }
1571 }
1572 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Annotations, D>>
1573 fidl::encoding::Encode<DataProviderGetAnnotationsResponse, D> for (T0,)
1574 {
1575 #[inline]
1576 unsafe fn encode(
1577 self,
1578 encoder: &mut fidl::encoding::Encoder<'_, D>,
1579 offset: usize,
1580 depth: fidl::encoding::Depth,
1581 ) -> fidl::Result<()> {
1582 encoder.debug_check_bounds::<DataProviderGetAnnotationsResponse>(offset);
1583 self.0.encode(encoder, offset + 0, depth)?;
1587 Ok(())
1588 }
1589 }
1590
1591 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1592 for DataProviderGetAnnotationsResponse
1593 {
1594 #[inline(always)]
1595 fn new_empty() -> Self {
1596 Self { annotations: fidl::new_empty!(Annotations, D) }
1597 }
1598
1599 #[inline]
1600 unsafe fn decode(
1601 &mut self,
1602 decoder: &mut fidl::encoding::Decoder<'_, D>,
1603 offset: usize,
1604 _depth: fidl::encoding::Depth,
1605 ) -> fidl::Result<()> {
1606 decoder.debug_check_bounds::<Self>(offset);
1607 fidl::decode!(Annotations, D, &mut self.annotations, decoder, offset + 0, _depth)?;
1609 Ok(())
1610 }
1611 }
1612
1613 impl fidl::encoding::ValueTypeMarker for DeviceIdProviderGetIdResponse {
1614 type Borrowed<'a> = &'a Self;
1615 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1616 value
1617 }
1618 }
1619
1620 unsafe impl fidl::encoding::TypeMarker for DeviceIdProviderGetIdResponse {
1621 type Owned = Self;
1622
1623 #[inline(always)]
1624 fn inline_align(_context: fidl::encoding::Context) -> usize {
1625 8
1626 }
1627
1628 #[inline(always)]
1629 fn inline_size(_context: fidl::encoding::Context) -> usize {
1630 16
1631 }
1632 }
1633
1634 unsafe impl<D: fidl::encoding::ResourceDialect>
1635 fidl::encoding::Encode<DeviceIdProviderGetIdResponse, D>
1636 for &DeviceIdProviderGetIdResponse
1637 {
1638 #[inline]
1639 unsafe fn encode(
1640 self,
1641 encoder: &mut fidl::encoding::Encoder<'_, D>,
1642 offset: usize,
1643 _depth: fidl::encoding::Depth,
1644 ) -> fidl::Result<()> {
1645 encoder.debug_check_bounds::<DeviceIdProviderGetIdResponse>(offset);
1646 fidl::encoding::Encode::<DeviceIdProviderGetIdResponse, D>::encode(
1648 (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
1649 &self.feedback_id,
1650 ),),
1651 encoder,
1652 offset,
1653 _depth,
1654 )
1655 }
1656 }
1657 unsafe impl<
1658 D: fidl::encoding::ResourceDialect,
1659 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
1660 > fidl::encoding::Encode<DeviceIdProviderGetIdResponse, D> for (T0,)
1661 {
1662 #[inline]
1663 unsafe fn encode(
1664 self,
1665 encoder: &mut fidl::encoding::Encoder<'_, D>,
1666 offset: usize,
1667 depth: fidl::encoding::Depth,
1668 ) -> fidl::Result<()> {
1669 encoder.debug_check_bounds::<DeviceIdProviderGetIdResponse>(offset);
1670 self.0.encode(encoder, offset + 0, depth)?;
1674 Ok(())
1675 }
1676 }
1677
1678 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1679 for DeviceIdProviderGetIdResponse
1680 {
1681 #[inline(always)]
1682 fn new_empty() -> Self {
1683 Self { feedback_id: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
1684 }
1685
1686 #[inline]
1687 unsafe fn decode(
1688 &mut self,
1689 decoder: &mut fidl::encoding::Decoder<'_, D>,
1690 offset: usize,
1691 _depth: fidl::encoding::Depth,
1692 ) -> fidl::Result<()> {
1693 decoder.debug_check_bounds::<Self>(offset);
1694 fidl::decode!(
1696 fidl::encoding::BoundedString<64>,
1697 D,
1698 &mut self.feedback_id,
1699 decoder,
1700 offset + 0,
1701 _depth
1702 )?;
1703 Ok(())
1704 }
1705 }
1706
1707 impl fidl::encoding::ValueTypeMarker for LastRebootInfoProviderGetResponse {
1708 type Borrowed<'a> = &'a Self;
1709 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1710 value
1711 }
1712 }
1713
1714 unsafe impl fidl::encoding::TypeMarker for LastRebootInfoProviderGetResponse {
1715 type Owned = Self;
1716
1717 #[inline(always)]
1718 fn inline_align(_context: fidl::encoding::Context) -> usize {
1719 8
1720 }
1721
1722 #[inline(always)]
1723 fn inline_size(_context: fidl::encoding::Context) -> usize {
1724 16
1725 }
1726 }
1727
1728 unsafe impl<D: fidl::encoding::ResourceDialect>
1729 fidl::encoding::Encode<LastRebootInfoProviderGetResponse, D>
1730 for &LastRebootInfoProviderGetResponse
1731 {
1732 #[inline]
1733 unsafe fn encode(
1734 self,
1735 encoder: &mut fidl::encoding::Encoder<'_, D>,
1736 offset: usize,
1737 _depth: fidl::encoding::Depth,
1738 ) -> fidl::Result<()> {
1739 encoder.debug_check_bounds::<LastRebootInfoProviderGetResponse>(offset);
1740 fidl::encoding::Encode::<LastRebootInfoProviderGetResponse, D>::encode(
1742 (<LastReboot as fidl::encoding::ValueTypeMarker>::borrow(&self.last_reboot),),
1743 encoder,
1744 offset,
1745 _depth,
1746 )
1747 }
1748 }
1749 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LastReboot, D>>
1750 fidl::encoding::Encode<LastRebootInfoProviderGetResponse, D> for (T0,)
1751 {
1752 #[inline]
1753 unsafe fn encode(
1754 self,
1755 encoder: &mut fidl::encoding::Encoder<'_, D>,
1756 offset: usize,
1757 depth: fidl::encoding::Depth,
1758 ) -> fidl::Result<()> {
1759 encoder.debug_check_bounds::<LastRebootInfoProviderGetResponse>(offset);
1760 self.0.encode(encoder, offset + 0, depth)?;
1764 Ok(())
1765 }
1766 }
1767
1768 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1769 for LastRebootInfoProviderGetResponse
1770 {
1771 #[inline(always)]
1772 fn new_empty() -> Self {
1773 Self { last_reboot: fidl::new_empty!(LastReboot, D) }
1774 }
1775
1776 #[inline]
1777 unsafe fn decode(
1778 &mut self,
1779 decoder: &mut fidl::encoding::Decoder<'_, D>,
1780 offset: usize,
1781 _depth: fidl::encoding::Depth,
1782 ) -> fidl::Result<()> {
1783 decoder.debug_check_bounds::<Self>(offset);
1784 fidl::decode!(LastReboot, D, &mut self.last_reboot, decoder, offset + 0, _depth)?;
1786 Ok(())
1787 }
1788 }
1789
1790 impl Annotations {
1791 #[inline(always)]
1792 fn max_ordinal_present(&self) -> u64 {
1793 if let Some(_) = self.annotations2 {
1794 return 2;
1795 }
1796 0
1797 }
1798 }
1799
1800 impl fidl::encoding::ValueTypeMarker for Annotations {
1801 type Borrowed<'a> = &'a Self;
1802 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1803 value
1804 }
1805 }
1806
1807 unsafe impl fidl::encoding::TypeMarker for Annotations {
1808 type Owned = Self;
1809
1810 #[inline(always)]
1811 fn inline_align(_context: fidl::encoding::Context) -> usize {
1812 8
1813 }
1814
1815 #[inline(always)]
1816 fn inline_size(_context: fidl::encoding::Context) -> usize {
1817 16
1818 }
1819 }
1820
1821 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Annotations, D>
1822 for &Annotations
1823 {
1824 unsafe fn encode(
1825 self,
1826 encoder: &mut fidl::encoding::Encoder<'_, D>,
1827 offset: usize,
1828 mut depth: fidl::encoding::Depth,
1829 ) -> fidl::Result<()> {
1830 encoder.debug_check_bounds::<Annotations>(offset);
1831 let max_ordinal: u64 = self.max_ordinal_present();
1833 encoder.write_num(max_ordinal, offset);
1834 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1835 if max_ordinal == 0 {
1837 return Ok(());
1838 }
1839 depth.increment()?;
1840 let envelope_size = 8;
1841 let bytes_len = max_ordinal as usize * envelope_size;
1842 #[allow(unused_variables)]
1843 let offset = encoder.out_of_line_offset(bytes_len);
1844 let mut _prev_end_offset: usize = 0;
1845 if 2 > max_ordinal {
1846 return Ok(());
1847 }
1848
1849 let cur_offset: usize = (2 - 1) * envelope_size;
1852
1853 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1855
1856 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 512>, D>(
1861 self.annotations2.as_ref().map(<fidl::encoding::Vector<Annotation, 512> as fidl::encoding::ValueTypeMarker>::borrow),
1862 encoder, offset + cur_offset, depth
1863 )?;
1864
1865 _prev_end_offset = cur_offset + envelope_size;
1866
1867 Ok(())
1868 }
1869 }
1870
1871 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Annotations {
1872 #[inline(always)]
1873 fn new_empty() -> Self {
1874 Self::default()
1875 }
1876
1877 unsafe fn decode(
1878 &mut self,
1879 decoder: &mut fidl::encoding::Decoder<'_, D>,
1880 offset: usize,
1881 mut depth: fidl::encoding::Depth,
1882 ) -> fidl::Result<()> {
1883 decoder.debug_check_bounds::<Self>(offset);
1884 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1885 None => return Err(fidl::Error::NotNullable),
1886 Some(len) => len,
1887 };
1888 if len == 0 {
1890 return Ok(());
1891 };
1892 depth.increment()?;
1893 let envelope_size = 8;
1894 let bytes_len = len * envelope_size;
1895 let offset = decoder.out_of_line_offset(bytes_len)?;
1896 let mut _next_ordinal_to_read = 0;
1898 let mut next_offset = offset;
1899 let end_offset = offset + bytes_len;
1900 _next_ordinal_to_read += 1;
1901 if next_offset >= end_offset {
1902 return Ok(());
1903 }
1904
1905 while _next_ordinal_to_read < 2 {
1907 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1908 _next_ordinal_to_read += 1;
1909 next_offset += envelope_size;
1910 }
1911
1912 let next_out_of_line = decoder.next_out_of_line();
1913 let handles_before = decoder.remaining_handles();
1914 if let Some((inlined, num_bytes, num_handles)) =
1915 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1916 {
1917 let member_inline_size = <fidl::encoding::Vector<Annotation, 512> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1918 if inlined != (member_inline_size <= 4) {
1919 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1920 }
1921 let inner_offset;
1922 let mut inner_depth = depth.clone();
1923 if inlined {
1924 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1925 inner_offset = next_offset;
1926 } else {
1927 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1928 inner_depth.increment()?;
1929 }
1930 let val_ref = self.annotations2.get_or_insert_with(
1931 || fidl::new_empty!(fidl::encoding::Vector<Annotation, 512>, D),
1932 );
1933 fidl::decode!(fidl::encoding::Vector<Annotation, 512>, D, val_ref, decoder, inner_offset, inner_depth)?;
1934 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1935 {
1936 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1937 }
1938 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1939 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1940 }
1941 }
1942
1943 next_offset += envelope_size;
1944
1945 while next_offset < end_offset {
1947 _next_ordinal_to_read += 1;
1948 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1949 next_offset += envelope_size;
1950 }
1951
1952 Ok(())
1953 }
1954 }
1955
1956 impl ComponentData {
1957 #[inline(always)]
1958 fn max_ordinal_present(&self) -> u64 {
1959 if let Some(_) = self.annotations {
1960 return 2;
1961 }
1962 if let Some(_) = self.namespace {
1963 return 1;
1964 }
1965 0
1966 }
1967 }
1968
1969 impl fidl::encoding::ValueTypeMarker for ComponentData {
1970 type Borrowed<'a> = &'a Self;
1971 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1972 value
1973 }
1974 }
1975
1976 unsafe impl fidl::encoding::TypeMarker for ComponentData {
1977 type Owned = Self;
1978
1979 #[inline(always)]
1980 fn inline_align(_context: fidl::encoding::Context) -> usize {
1981 8
1982 }
1983
1984 #[inline(always)]
1985 fn inline_size(_context: fidl::encoding::Context) -> usize {
1986 16
1987 }
1988 }
1989
1990 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ComponentData, D>
1991 for &ComponentData
1992 {
1993 unsafe fn encode(
1994 self,
1995 encoder: &mut fidl::encoding::Encoder<'_, D>,
1996 offset: usize,
1997 mut depth: fidl::encoding::Depth,
1998 ) -> fidl::Result<()> {
1999 encoder.debug_check_bounds::<ComponentData>(offset);
2000 let max_ordinal: u64 = self.max_ordinal_present();
2002 encoder.write_num(max_ordinal, offset);
2003 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2004 if max_ordinal == 0 {
2006 return Ok(());
2007 }
2008 depth.increment()?;
2009 let envelope_size = 8;
2010 let bytes_len = max_ordinal as usize * envelope_size;
2011 #[allow(unused_variables)]
2012 let offset = encoder.out_of_line_offset(bytes_len);
2013 let mut _prev_end_offset: usize = 0;
2014 if 1 > max_ordinal {
2015 return Ok(());
2016 }
2017
2018 let cur_offset: usize = (1 - 1) * envelope_size;
2021
2022 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2024
2025 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<32>, D>(
2030 self.namespace.as_ref().map(
2031 <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
2032 ),
2033 encoder,
2034 offset + cur_offset,
2035 depth,
2036 )?;
2037
2038 _prev_end_offset = cur_offset + envelope_size;
2039 if 2 > max_ordinal {
2040 return Ok(());
2041 }
2042
2043 let cur_offset: usize = (2 - 1) * envelope_size;
2046
2047 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2049
2050 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 16>, D>(
2055 self.annotations.as_ref().map(<fidl::encoding::Vector<Annotation, 16> as fidl::encoding::ValueTypeMarker>::borrow),
2056 encoder, offset + cur_offset, depth
2057 )?;
2058
2059 _prev_end_offset = cur_offset + envelope_size;
2060
2061 Ok(())
2062 }
2063 }
2064
2065 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ComponentData {
2066 #[inline(always)]
2067 fn new_empty() -> Self {
2068 Self::default()
2069 }
2070
2071 unsafe fn decode(
2072 &mut self,
2073 decoder: &mut fidl::encoding::Decoder<'_, D>,
2074 offset: usize,
2075 mut depth: fidl::encoding::Depth,
2076 ) -> fidl::Result<()> {
2077 decoder.debug_check_bounds::<Self>(offset);
2078 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2079 None => return Err(fidl::Error::NotNullable),
2080 Some(len) => len,
2081 };
2082 if len == 0 {
2084 return Ok(());
2085 };
2086 depth.increment()?;
2087 let envelope_size = 8;
2088 let bytes_len = len * envelope_size;
2089 let offset = decoder.out_of_line_offset(bytes_len)?;
2090 let mut _next_ordinal_to_read = 0;
2092 let mut next_offset = offset;
2093 let end_offset = offset + bytes_len;
2094 _next_ordinal_to_read += 1;
2095 if next_offset >= end_offset {
2096 return Ok(());
2097 }
2098
2099 while _next_ordinal_to_read < 1 {
2101 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2102 _next_ordinal_to_read += 1;
2103 next_offset += envelope_size;
2104 }
2105
2106 let next_out_of_line = decoder.next_out_of_line();
2107 let handles_before = decoder.remaining_handles();
2108 if let Some((inlined, num_bytes, num_handles)) =
2109 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2110 {
2111 let member_inline_size =
2112 <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
2113 decoder.context,
2114 );
2115 if inlined != (member_inline_size <= 4) {
2116 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2117 }
2118 let inner_offset;
2119 let mut inner_depth = depth.clone();
2120 if inlined {
2121 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2122 inner_offset = next_offset;
2123 } else {
2124 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2125 inner_depth.increment()?;
2126 }
2127 let val_ref = self
2128 .namespace
2129 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<32>, D));
2130 fidl::decode!(
2131 fidl::encoding::BoundedString<32>,
2132 D,
2133 val_ref,
2134 decoder,
2135 inner_offset,
2136 inner_depth
2137 )?;
2138 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2139 {
2140 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2141 }
2142 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2143 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2144 }
2145 }
2146
2147 next_offset += envelope_size;
2148 _next_ordinal_to_read += 1;
2149 if next_offset >= end_offset {
2150 return Ok(());
2151 }
2152
2153 while _next_ordinal_to_read < 2 {
2155 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2156 _next_ordinal_to_read += 1;
2157 next_offset += envelope_size;
2158 }
2159
2160 let next_out_of_line = decoder.next_out_of_line();
2161 let handles_before = decoder.remaining_handles();
2162 if let Some((inlined, num_bytes, num_handles)) =
2163 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2164 {
2165 let member_inline_size = <fidl::encoding::Vector<Annotation, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2166 if inlined != (member_inline_size <= 4) {
2167 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2168 }
2169 let inner_offset;
2170 let mut inner_depth = depth.clone();
2171 if inlined {
2172 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2173 inner_offset = next_offset;
2174 } else {
2175 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2176 inner_depth.increment()?;
2177 }
2178 let val_ref = self.annotations.get_or_insert_with(
2179 || fidl::new_empty!(fidl::encoding::Vector<Annotation, 16>, D),
2180 );
2181 fidl::decode!(fidl::encoding::Vector<Annotation, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
2182 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2183 {
2184 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2185 }
2186 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2187 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2188 }
2189 }
2190
2191 next_offset += envelope_size;
2192
2193 while next_offset < end_offset {
2195 _next_ordinal_to_read += 1;
2196 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2197 next_offset += envelope_size;
2198 }
2199
2200 Ok(())
2201 }
2202 }
2203
2204 impl CrashReportingProduct {
2205 #[inline(always)]
2206 fn max_ordinal_present(&self) -> u64 {
2207 if let Some(_) = self.channel {
2208 return 3;
2209 }
2210 if let Some(_) = self.version {
2211 return 2;
2212 }
2213 if let Some(_) = self.name {
2214 return 1;
2215 }
2216 0
2217 }
2218 }
2219
2220 impl fidl::encoding::ValueTypeMarker for CrashReportingProduct {
2221 type Borrowed<'a> = &'a Self;
2222 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2223 value
2224 }
2225 }
2226
2227 unsafe impl fidl::encoding::TypeMarker for CrashReportingProduct {
2228 type Owned = Self;
2229
2230 #[inline(always)]
2231 fn inline_align(_context: fidl::encoding::Context) -> usize {
2232 8
2233 }
2234
2235 #[inline(always)]
2236 fn inline_size(_context: fidl::encoding::Context) -> usize {
2237 16
2238 }
2239 }
2240
2241 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CrashReportingProduct, D>
2242 for &CrashReportingProduct
2243 {
2244 unsafe fn encode(
2245 self,
2246 encoder: &mut fidl::encoding::Encoder<'_, D>,
2247 offset: usize,
2248 mut depth: fidl::encoding::Depth,
2249 ) -> fidl::Result<()> {
2250 encoder.debug_check_bounds::<CrashReportingProduct>(offset);
2251 let max_ordinal: u64 = self.max_ordinal_present();
2253 encoder.write_num(max_ordinal, offset);
2254 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2255 if max_ordinal == 0 {
2257 return Ok(());
2258 }
2259 depth.increment()?;
2260 let envelope_size = 8;
2261 let bytes_len = max_ordinal as usize * envelope_size;
2262 #[allow(unused_variables)]
2263 let offset = encoder.out_of_line_offset(bytes_len);
2264 let mut _prev_end_offset: usize = 0;
2265 if 1 > max_ordinal {
2266 return Ok(());
2267 }
2268
2269 let cur_offset: usize = (1 - 1) * envelope_size;
2272
2273 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2275
2276 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2281 self.name.as_ref().map(
2282 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2283 ),
2284 encoder,
2285 offset + cur_offset,
2286 depth,
2287 )?;
2288
2289 _prev_end_offset = cur_offset + envelope_size;
2290 if 2 > max_ordinal {
2291 return Ok(());
2292 }
2293
2294 let cur_offset: usize = (2 - 1) * envelope_size;
2297
2298 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2300
2301 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2306 self.version.as_ref().map(
2307 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2308 ),
2309 encoder,
2310 offset + cur_offset,
2311 depth,
2312 )?;
2313
2314 _prev_end_offset = cur_offset + envelope_size;
2315 if 3 > max_ordinal {
2316 return Ok(());
2317 }
2318
2319 let cur_offset: usize = (3 - 1) * envelope_size;
2322
2323 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2325
2326 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
2331 self.channel.as_ref().map(
2332 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
2333 ),
2334 encoder,
2335 offset + cur_offset,
2336 depth,
2337 )?;
2338
2339 _prev_end_offset = cur_offset + envelope_size;
2340
2341 Ok(())
2342 }
2343 }
2344
2345 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CrashReportingProduct {
2346 #[inline(always)]
2347 fn new_empty() -> Self {
2348 Self::default()
2349 }
2350
2351 unsafe fn decode(
2352 &mut self,
2353 decoder: &mut fidl::encoding::Decoder<'_, D>,
2354 offset: usize,
2355 mut depth: fidl::encoding::Depth,
2356 ) -> fidl::Result<()> {
2357 decoder.debug_check_bounds::<Self>(offset);
2358 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2359 None => return Err(fidl::Error::NotNullable),
2360 Some(len) => len,
2361 };
2362 if len == 0 {
2364 return Ok(());
2365 };
2366 depth.increment()?;
2367 let envelope_size = 8;
2368 let bytes_len = len * envelope_size;
2369 let offset = decoder.out_of_line_offset(bytes_len)?;
2370 let mut _next_ordinal_to_read = 0;
2372 let mut next_offset = offset;
2373 let end_offset = offset + bytes_len;
2374 _next_ordinal_to_read += 1;
2375 if next_offset >= end_offset {
2376 return Ok(());
2377 }
2378
2379 while _next_ordinal_to_read < 1 {
2381 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2382 _next_ordinal_to_read += 1;
2383 next_offset += envelope_size;
2384 }
2385
2386 let next_out_of_line = decoder.next_out_of_line();
2387 let handles_before = decoder.remaining_handles();
2388 if let Some((inlined, num_bytes, num_handles)) =
2389 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2390 {
2391 let member_inline_size =
2392 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2393 decoder.context,
2394 );
2395 if inlined != (member_inline_size <= 4) {
2396 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2397 }
2398 let inner_offset;
2399 let mut inner_depth = depth.clone();
2400 if inlined {
2401 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2402 inner_offset = next_offset;
2403 } else {
2404 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2405 inner_depth.increment()?;
2406 }
2407 let val_ref = self
2408 .name
2409 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2410 fidl::decode!(
2411 fidl::encoding::UnboundedString,
2412 D,
2413 val_ref,
2414 decoder,
2415 inner_offset,
2416 inner_depth
2417 )?;
2418 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2419 {
2420 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2421 }
2422 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2423 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2424 }
2425 }
2426
2427 next_offset += envelope_size;
2428 _next_ordinal_to_read += 1;
2429 if next_offset >= end_offset {
2430 return Ok(());
2431 }
2432
2433 while _next_ordinal_to_read < 2 {
2435 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2436 _next_ordinal_to_read += 1;
2437 next_offset += envelope_size;
2438 }
2439
2440 let next_out_of_line = decoder.next_out_of_line();
2441 let handles_before = decoder.remaining_handles();
2442 if let Some((inlined, num_bytes, num_handles)) =
2443 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2444 {
2445 let member_inline_size =
2446 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2447 decoder.context,
2448 );
2449 if inlined != (member_inline_size <= 4) {
2450 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2451 }
2452 let inner_offset;
2453 let mut inner_depth = depth.clone();
2454 if inlined {
2455 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2456 inner_offset = next_offset;
2457 } else {
2458 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2459 inner_depth.increment()?;
2460 }
2461 let val_ref = self
2462 .version
2463 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2464 fidl::decode!(
2465 fidl::encoding::UnboundedString,
2466 D,
2467 val_ref,
2468 decoder,
2469 inner_offset,
2470 inner_depth
2471 )?;
2472 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2473 {
2474 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2475 }
2476 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2477 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2478 }
2479 }
2480
2481 next_offset += envelope_size;
2482 _next_ordinal_to_read += 1;
2483 if next_offset >= end_offset {
2484 return Ok(());
2485 }
2486
2487 while _next_ordinal_to_read < 3 {
2489 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2490 _next_ordinal_to_read += 1;
2491 next_offset += envelope_size;
2492 }
2493
2494 let next_out_of_line = decoder.next_out_of_line();
2495 let handles_before = decoder.remaining_handles();
2496 if let Some((inlined, num_bytes, num_handles)) =
2497 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2498 {
2499 let member_inline_size =
2500 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
2501 decoder.context,
2502 );
2503 if inlined != (member_inline_size <= 4) {
2504 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2505 }
2506 let inner_offset;
2507 let mut inner_depth = depth.clone();
2508 if inlined {
2509 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2510 inner_offset = next_offset;
2511 } else {
2512 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2513 inner_depth.increment()?;
2514 }
2515 let val_ref = self
2516 .channel
2517 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
2518 fidl::decode!(
2519 fidl::encoding::UnboundedString,
2520 D,
2521 val_ref,
2522 decoder,
2523 inner_offset,
2524 inner_depth
2525 )?;
2526 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2527 {
2528 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2529 }
2530 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2531 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2532 }
2533 }
2534
2535 next_offset += envelope_size;
2536
2537 while next_offset < end_offset {
2539 _next_ordinal_to_read += 1;
2540 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2541 next_offset += envelope_size;
2542 }
2543
2544 Ok(())
2545 }
2546 }
2547
2548 impl FileReportResults {
2549 #[inline(always)]
2550 fn max_ordinal_present(&self) -> u64 {
2551 if let Some(_) = self.report_id {
2552 return 2;
2553 }
2554 if let Some(_) = self.result {
2555 return 1;
2556 }
2557 0
2558 }
2559 }
2560
2561 impl fidl::encoding::ValueTypeMarker for FileReportResults {
2562 type Borrowed<'a> = &'a Self;
2563 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2564 value
2565 }
2566 }
2567
2568 unsafe impl fidl::encoding::TypeMarker for FileReportResults {
2569 type Owned = Self;
2570
2571 #[inline(always)]
2572 fn inline_align(_context: fidl::encoding::Context) -> usize {
2573 8
2574 }
2575
2576 #[inline(always)]
2577 fn inline_size(_context: fidl::encoding::Context) -> usize {
2578 16
2579 }
2580 }
2581
2582 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileReportResults, D>
2583 for &FileReportResults
2584 {
2585 unsafe fn encode(
2586 self,
2587 encoder: &mut fidl::encoding::Encoder<'_, D>,
2588 offset: usize,
2589 mut depth: fidl::encoding::Depth,
2590 ) -> fidl::Result<()> {
2591 encoder.debug_check_bounds::<FileReportResults>(offset);
2592 let max_ordinal: u64 = self.max_ordinal_present();
2594 encoder.write_num(max_ordinal, offset);
2595 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2596 if max_ordinal == 0 {
2598 return Ok(());
2599 }
2600 depth.increment()?;
2601 let envelope_size = 8;
2602 let bytes_len = max_ordinal as usize * envelope_size;
2603 #[allow(unused_variables)]
2604 let offset = encoder.out_of_line_offset(bytes_len);
2605 let mut _prev_end_offset: usize = 0;
2606 if 1 > max_ordinal {
2607 return Ok(());
2608 }
2609
2610 let cur_offset: usize = (1 - 1) * envelope_size;
2613
2614 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2616
2617 fidl::encoding::encode_in_envelope_optional::<FilingSuccess, D>(
2622 self.result
2623 .as_ref()
2624 .map(<FilingSuccess as fidl::encoding::ValueTypeMarker>::borrow),
2625 encoder,
2626 offset + cur_offset,
2627 depth,
2628 )?;
2629
2630 _prev_end_offset = cur_offset + envelope_size;
2631 if 2 > max_ordinal {
2632 return Ok(());
2633 }
2634
2635 let cur_offset: usize = (2 - 1) * envelope_size;
2638
2639 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2641
2642 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<64>, D>(
2647 self.report_id.as_ref().map(
2648 <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow,
2649 ),
2650 encoder,
2651 offset + cur_offset,
2652 depth,
2653 )?;
2654
2655 _prev_end_offset = cur_offset + envelope_size;
2656
2657 Ok(())
2658 }
2659 }
2660
2661 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileReportResults {
2662 #[inline(always)]
2663 fn new_empty() -> Self {
2664 Self::default()
2665 }
2666
2667 unsafe fn decode(
2668 &mut self,
2669 decoder: &mut fidl::encoding::Decoder<'_, D>,
2670 offset: usize,
2671 mut depth: fidl::encoding::Depth,
2672 ) -> fidl::Result<()> {
2673 decoder.debug_check_bounds::<Self>(offset);
2674 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2675 None => return Err(fidl::Error::NotNullable),
2676 Some(len) => len,
2677 };
2678 if len == 0 {
2680 return Ok(());
2681 };
2682 depth.increment()?;
2683 let envelope_size = 8;
2684 let bytes_len = len * envelope_size;
2685 let offset = decoder.out_of_line_offset(bytes_len)?;
2686 let mut _next_ordinal_to_read = 0;
2688 let mut next_offset = offset;
2689 let end_offset = offset + bytes_len;
2690 _next_ordinal_to_read += 1;
2691 if next_offset >= end_offset {
2692 return Ok(());
2693 }
2694
2695 while _next_ordinal_to_read < 1 {
2697 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2698 _next_ordinal_to_read += 1;
2699 next_offset += envelope_size;
2700 }
2701
2702 let next_out_of_line = decoder.next_out_of_line();
2703 let handles_before = decoder.remaining_handles();
2704 if let Some((inlined, num_bytes, num_handles)) =
2705 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2706 {
2707 let member_inline_size =
2708 <FilingSuccess as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2709 if inlined != (member_inline_size <= 4) {
2710 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2711 }
2712 let inner_offset;
2713 let mut inner_depth = depth.clone();
2714 if inlined {
2715 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2716 inner_offset = next_offset;
2717 } else {
2718 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2719 inner_depth.increment()?;
2720 }
2721 let val_ref = self.result.get_or_insert_with(|| fidl::new_empty!(FilingSuccess, D));
2722 fidl::decode!(FilingSuccess, D, val_ref, decoder, inner_offset, inner_depth)?;
2723 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2724 {
2725 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2726 }
2727 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2728 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2729 }
2730 }
2731
2732 next_offset += envelope_size;
2733 _next_ordinal_to_read += 1;
2734 if next_offset >= end_offset {
2735 return Ok(());
2736 }
2737
2738 while _next_ordinal_to_read < 2 {
2740 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2741 _next_ordinal_to_read += 1;
2742 next_offset += envelope_size;
2743 }
2744
2745 let next_out_of_line = decoder.next_out_of_line();
2746 let handles_before = decoder.remaining_handles();
2747 if let Some((inlined, num_bytes, num_handles)) =
2748 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2749 {
2750 let member_inline_size =
2751 <fidl::encoding::BoundedString<64> as fidl::encoding::TypeMarker>::inline_size(
2752 decoder.context,
2753 );
2754 if inlined != (member_inline_size <= 4) {
2755 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2756 }
2757 let inner_offset;
2758 let mut inner_depth = depth.clone();
2759 if inlined {
2760 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2761 inner_offset = next_offset;
2762 } else {
2763 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2764 inner_depth.increment()?;
2765 }
2766 let val_ref = self
2767 .report_id
2768 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<64>, D));
2769 fidl::decode!(
2770 fidl::encoding::BoundedString<64>,
2771 D,
2772 val_ref,
2773 decoder,
2774 inner_offset,
2775 inner_depth
2776 )?;
2777 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2778 {
2779 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2780 }
2781 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2782 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2783 }
2784 }
2785
2786 next_offset += envelope_size;
2787
2788 while next_offset < end_offset {
2790 _next_ordinal_to_read += 1;
2791 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2792 next_offset += envelope_size;
2793 }
2794
2795 Ok(())
2796 }
2797 }
2798
2799 impl GetAnnotationsParameters {
2800 #[inline(always)]
2801 fn max_ordinal_present(&self) -> u64 {
2802 if let Some(_) = self.collection_timeout_per_annotation {
2803 return 1;
2804 }
2805 0
2806 }
2807 }
2808
2809 impl fidl::encoding::ValueTypeMarker for GetAnnotationsParameters {
2810 type Borrowed<'a> = &'a Self;
2811 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2812 value
2813 }
2814 }
2815
2816 unsafe impl fidl::encoding::TypeMarker for GetAnnotationsParameters {
2817 type Owned = Self;
2818
2819 #[inline(always)]
2820 fn inline_align(_context: fidl::encoding::Context) -> usize {
2821 8
2822 }
2823
2824 #[inline(always)]
2825 fn inline_size(_context: fidl::encoding::Context) -> usize {
2826 16
2827 }
2828 }
2829
2830 unsafe impl<D: fidl::encoding::ResourceDialect>
2831 fidl::encoding::Encode<GetAnnotationsParameters, D> for &GetAnnotationsParameters
2832 {
2833 unsafe fn encode(
2834 self,
2835 encoder: &mut fidl::encoding::Encoder<'_, D>,
2836 offset: usize,
2837 mut depth: fidl::encoding::Depth,
2838 ) -> fidl::Result<()> {
2839 encoder.debug_check_bounds::<GetAnnotationsParameters>(offset);
2840 let max_ordinal: u64 = self.max_ordinal_present();
2842 encoder.write_num(max_ordinal, offset);
2843 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2844 if max_ordinal == 0 {
2846 return Ok(());
2847 }
2848 depth.increment()?;
2849 let envelope_size = 8;
2850 let bytes_len = max_ordinal as usize * envelope_size;
2851 #[allow(unused_variables)]
2852 let offset = encoder.out_of_line_offset(bytes_len);
2853 let mut _prev_end_offset: usize = 0;
2854 if 1 > max_ordinal {
2855 return Ok(());
2856 }
2857
2858 let cur_offset: usize = (1 - 1) * envelope_size;
2861
2862 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2864
2865 fidl::encoding::encode_in_envelope_optional::<i64, D>(
2870 self.collection_timeout_per_annotation
2871 .as_ref()
2872 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2873 encoder,
2874 offset + cur_offset,
2875 depth,
2876 )?;
2877
2878 _prev_end_offset = cur_offset + envelope_size;
2879
2880 Ok(())
2881 }
2882 }
2883
2884 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2885 for GetAnnotationsParameters
2886 {
2887 #[inline(always)]
2888 fn new_empty() -> Self {
2889 Self::default()
2890 }
2891
2892 unsafe fn decode(
2893 &mut self,
2894 decoder: &mut fidl::encoding::Decoder<'_, D>,
2895 offset: usize,
2896 mut depth: fidl::encoding::Depth,
2897 ) -> fidl::Result<()> {
2898 decoder.debug_check_bounds::<Self>(offset);
2899 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2900 None => return Err(fidl::Error::NotNullable),
2901 Some(len) => len,
2902 };
2903 if len == 0 {
2905 return Ok(());
2906 };
2907 depth.increment()?;
2908 let envelope_size = 8;
2909 let bytes_len = len * envelope_size;
2910 let offset = decoder.out_of_line_offset(bytes_len)?;
2911 let mut _next_ordinal_to_read = 0;
2913 let mut next_offset = offset;
2914 let end_offset = offset + bytes_len;
2915 _next_ordinal_to_read += 1;
2916 if next_offset >= end_offset {
2917 return Ok(());
2918 }
2919
2920 while _next_ordinal_to_read < 1 {
2922 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2923 _next_ordinal_to_read += 1;
2924 next_offset += envelope_size;
2925 }
2926
2927 let next_out_of_line = decoder.next_out_of_line();
2928 let handles_before = decoder.remaining_handles();
2929 if let Some((inlined, num_bytes, num_handles)) =
2930 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2931 {
2932 let member_inline_size =
2933 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2934 if inlined != (member_inline_size <= 4) {
2935 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2936 }
2937 let inner_offset;
2938 let mut inner_depth = depth.clone();
2939 if inlined {
2940 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2941 inner_offset = next_offset;
2942 } else {
2943 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2944 inner_depth.increment()?;
2945 }
2946 let val_ref = self
2947 .collection_timeout_per_annotation
2948 .get_or_insert_with(|| fidl::new_empty!(i64, D));
2949 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
2950 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2951 {
2952 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2953 }
2954 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2955 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2956 }
2957 }
2958
2959 next_offset += envelope_size;
2960
2961 while next_offset < end_offset {
2963 _next_ordinal_to_read += 1;
2964 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2965 next_offset += envelope_size;
2966 }
2967
2968 Ok(())
2969 }
2970 }
2971
2972 impl LastReboot {
2973 #[inline(always)]
2974 fn max_ordinal_present(&self) -> u64 {
2975 if let Some(_) = self.action {
2976 return 6;
2977 }
2978 if let Some(_) = self.runtime {
2979 return 5;
2980 }
2981 if let Some(_) = self.planned {
2982 return 4;
2983 }
2984 if let Some(_) = self.uptime {
2985 return 3;
2986 }
2987 if let Some(_) = self.reason {
2988 return 2;
2989 }
2990 if let Some(_) = self.graceful {
2991 return 1;
2992 }
2993 0
2994 }
2995 }
2996
2997 impl fidl::encoding::ValueTypeMarker for LastReboot {
2998 type Borrowed<'a> = &'a Self;
2999 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3000 value
3001 }
3002 }
3003
3004 unsafe impl fidl::encoding::TypeMarker for LastReboot {
3005 type Owned = Self;
3006
3007 #[inline(always)]
3008 fn inline_align(_context: fidl::encoding::Context) -> usize {
3009 8
3010 }
3011
3012 #[inline(always)]
3013 fn inline_size(_context: fidl::encoding::Context) -> usize {
3014 16
3015 }
3016 }
3017
3018 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LastReboot, D>
3019 for &LastReboot
3020 {
3021 unsafe fn encode(
3022 self,
3023 encoder: &mut fidl::encoding::Encoder<'_, D>,
3024 offset: usize,
3025 mut depth: fidl::encoding::Depth,
3026 ) -> fidl::Result<()> {
3027 encoder.debug_check_bounds::<LastReboot>(offset);
3028 let max_ordinal: u64 = self.max_ordinal_present();
3030 encoder.write_num(max_ordinal, offset);
3031 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3032 if max_ordinal == 0 {
3034 return Ok(());
3035 }
3036 depth.increment()?;
3037 let envelope_size = 8;
3038 let bytes_len = max_ordinal as usize * envelope_size;
3039 #[allow(unused_variables)]
3040 let offset = encoder.out_of_line_offset(bytes_len);
3041 let mut _prev_end_offset: usize = 0;
3042 if 1 > max_ordinal {
3043 return Ok(());
3044 }
3045
3046 let cur_offset: usize = (1 - 1) * envelope_size;
3049
3050 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3052
3053 fidl::encoding::encode_in_envelope_optional::<bool, D>(
3058 self.graceful.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3059 encoder,
3060 offset + cur_offset,
3061 depth,
3062 )?;
3063
3064 _prev_end_offset = cur_offset + envelope_size;
3065 if 2 > max_ordinal {
3066 return Ok(());
3067 }
3068
3069 let cur_offset: usize = (2 - 1) * envelope_size;
3072
3073 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3075
3076 fidl::encoding::encode_in_envelope_optional::<RebootReason, D>(
3081 self.reason.as_ref().map(<RebootReason as fidl::encoding::ValueTypeMarker>::borrow),
3082 encoder,
3083 offset + cur_offset,
3084 depth,
3085 )?;
3086
3087 _prev_end_offset = cur_offset + envelope_size;
3088 if 3 > max_ordinal {
3089 return Ok(());
3090 }
3091
3092 let cur_offset: usize = (3 - 1) * envelope_size;
3095
3096 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3098
3099 fidl::encoding::encode_in_envelope_optional::<i64, D>(
3104 self.uptime.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3105 encoder,
3106 offset + cur_offset,
3107 depth,
3108 )?;
3109
3110 _prev_end_offset = cur_offset + envelope_size;
3111 if 4 > max_ordinal {
3112 return Ok(());
3113 }
3114
3115 let cur_offset: usize = (4 - 1) * envelope_size;
3118
3119 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3121
3122 fidl::encoding::encode_in_envelope_optional::<bool, D>(
3127 self.planned.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3128 encoder,
3129 offset + cur_offset,
3130 depth,
3131 )?;
3132
3133 _prev_end_offset = cur_offset + envelope_size;
3134 if 5 > max_ordinal {
3135 return Ok(());
3136 }
3137
3138 let cur_offset: usize = (5 - 1) * envelope_size;
3141
3142 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3144
3145 fidl::encoding::encode_in_envelope_optional::<i64, D>(
3150 self.runtime.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3151 encoder,
3152 offset + cur_offset,
3153 depth,
3154 )?;
3155
3156 _prev_end_offset = cur_offset + envelope_size;
3157 if 6 > max_ordinal {
3158 return Ok(());
3159 }
3160
3161 let cur_offset: usize = (6 - 1) * envelope_size;
3164
3165 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3167
3168 fidl::encoding::encode_in_envelope_optional::<ShutdownAction, D>(
3173 self.action
3174 .as_ref()
3175 .map(<ShutdownAction as fidl::encoding::ValueTypeMarker>::borrow),
3176 encoder,
3177 offset + cur_offset,
3178 depth,
3179 )?;
3180
3181 _prev_end_offset = cur_offset + envelope_size;
3182
3183 Ok(())
3184 }
3185 }
3186
3187 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LastReboot {
3188 #[inline(always)]
3189 fn new_empty() -> Self {
3190 Self::default()
3191 }
3192
3193 unsafe fn decode(
3194 &mut self,
3195 decoder: &mut fidl::encoding::Decoder<'_, D>,
3196 offset: usize,
3197 mut depth: fidl::encoding::Depth,
3198 ) -> fidl::Result<()> {
3199 decoder.debug_check_bounds::<Self>(offset);
3200 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3201 None => return Err(fidl::Error::NotNullable),
3202 Some(len) => len,
3203 };
3204 if len == 0 {
3206 return Ok(());
3207 };
3208 depth.increment()?;
3209 let envelope_size = 8;
3210 let bytes_len = len * envelope_size;
3211 let offset = decoder.out_of_line_offset(bytes_len)?;
3212 let mut _next_ordinal_to_read = 0;
3214 let mut next_offset = offset;
3215 let end_offset = offset + bytes_len;
3216 _next_ordinal_to_read += 1;
3217 if next_offset >= end_offset {
3218 return Ok(());
3219 }
3220
3221 while _next_ordinal_to_read < 1 {
3223 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3224 _next_ordinal_to_read += 1;
3225 next_offset += envelope_size;
3226 }
3227
3228 let next_out_of_line = decoder.next_out_of_line();
3229 let handles_before = decoder.remaining_handles();
3230 if let Some((inlined, num_bytes, num_handles)) =
3231 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3232 {
3233 let member_inline_size =
3234 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3235 if inlined != (member_inline_size <= 4) {
3236 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3237 }
3238 let inner_offset;
3239 let mut inner_depth = depth.clone();
3240 if inlined {
3241 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3242 inner_offset = next_offset;
3243 } else {
3244 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3245 inner_depth.increment()?;
3246 }
3247 let val_ref = self.graceful.get_or_insert_with(|| fidl::new_empty!(bool, D));
3248 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3249 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3250 {
3251 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3252 }
3253 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3254 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3255 }
3256 }
3257
3258 next_offset += envelope_size;
3259 _next_ordinal_to_read += 1;
3260 if next_offset >= end_offset {
3261 return Ok(());
3262 }
3263
3264 while _next_ordinal_to_read < 2 {
3266 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3267 _next_ordinal_to_read += 1;
3268 next_offset += envelope_size;
3269 }
3270
3271 let next_out_of_line = decoder.next_out_of_line();
3272 let handles_before = decoder.remaining_handles();
3273 if let Some((inlined, num_bytes, num_handles)) =
3274 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3275 {
3276 let member_inline_size =
3277 <RebootReason as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3278 if inlined != (member_inline_size <= 4) {
3279 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3280 }
3281 let inner_offset;
3282 let mut inner_depth = depth.clone();
3283 if inlined {
3284 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3285 inner_offset = next_offset;
3286 } else {
3287 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3288 inner_depth.increment()?;
3289 }
3290 let val_ref = self.reason.get_or_insert_with(|| fidl::new_empty!(RebootReason, D));
3291 fidl::decode!(RebootReason, D, val_ref, decoder, inner_offset, inner_depth)?;
3292 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3293 {
3294 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3295 }
3296 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3297 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3298 }
3299 }
3300
3301 next_offset += envelope_size;
3302 _next_ordinal_to_read += 1;
3303 if next_offset >= end_offset {
3304 return Ok(());
3305 }
3306
3307 while _next_ordinal_to_read < 3 {
3309 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3310 _next_ordinal_to_read += 1;
3311 next_offset += envelope_size;
3312 }
3313
3314 let next_out_of_line = decoder.next_out_of_line();
3315 let handles_before = decoder.remaining_handles();
3316 if let Some((inlined, num_bytes, num_handles)) =
3317 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3318 {
3319 let member_inline_size =
3320 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3321 if inlined != (member_inline_size <= 4) {
3322 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3323 }
3324 let inner_offset;
3325 let mut inner_depth = depth.clone();
3326 if inlined {
3327 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3328 inner_offset = next_offset;
3329 } else {
3330 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3331 inner_depth.increment()?;
3332 }
3333 let val_ref = self.uptime.get_or_insert_with(|| fidl::new_empty!(i64, D));
3334 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3335 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3336 {
3337 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3338 }
3339 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3340 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3341 }
3342 }
3343
3344 next_offset += envelope_size;
3345 _next_ordinal_to_read += 1;
3346 if next_offset >= end_offset {
3347 return Ok(());
3348 }
3349
3350 while _next_ordinal_to_read < 4 {
3352 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3353 _next_ordinal_to_read += 1;
3354 next_offset += envelope_size;
3355 }
3356
3357 let next_out_of_line = decoder.next_out_of_line();
3358 let handles_before = decoder.remaining_handles();
3359 if let Some((inlined, num_bytes, num_handles)) =
3360 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3361 {
3362 let member_inline_size =
3363 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3364 if inlined != (member_inline_size <= 4) {
3365 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3366 }
3367 let inner_offset;
3368 let mut inner_depth = depth.clone();
3369 if inlined {
3370 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3371 inner_offset = next_offset;
3372 } else {
3373 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3374 inner_depth.increment()?;
3375 }
3376 let val_ref = self.planned.get_or_insert_with(|| fidl::new_empty!(bool, D));
3377 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3378 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3379 {
3380 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3381 }
3382 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3383 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3384 }
3385 }
3386
3387 next_offset += envelope_size;
3388 _next_ordinal_to_read += 1;
3389 if next_offset >= end_offset {
3390 return Ok(());
3391 }
3392
3393 while _next_ordinal_to_read < 5 {
3395 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3396 _next_ordinal_to_read += 1;
3397 next_offset += envelope_size;
3398 }
3399
3400 let next_out_of_line = decoder.next_out_of_line();
3401 let handles_before = decoder.remaining_handles();
3402 if let Some((inlined, num_bytes, num_handles)) =
3403 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3404 {
3405 let member_inline_size =
3406 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3407 if inlined != (member_inline_size <= 4) {
3408 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3409 }
3410 let inner_offset;
3411 let mut inner_depth = depth.clone();
3412 if inlined {
3413 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3414 inner_offset = next_offset;
3415 } else {
3416 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3417 inner_depth.increment()?;
3418 }
3419 let val_ref = self.runtime.get_or_insert_with(|| fidl::new_empty!(i64, D));
3420 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3421 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3422 {
3423 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3424 }
3425 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3426 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3427 }
3428 }
3429
3430 next_offset += envelope_size;
3431 _next_ordinal_to_read += 1;
3432 if next_offset >= end_offset {
3433 return Ok(());
3434 }
3435
3436 while _next_ordinal_to_read < 6 {
3438 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3439 _next_ordinal_to_read += 1;
3440 next_offset += envelope_size;
3441 }
3442
3443 let next_out_of_line = decoder.next_out_of_line();
3444 let handles_before = decoder.remaining_handles();
3445 if let Some((inlined, num_bytes, num_handles)) =
3446 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3447 {
3448 let member_inline_size =
3449 <ShutdownAction as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3450 if inlined != (member_inline_size <= 4) {
3451 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3452 }
3453 let inner_offset;
3454 let mut inner_depth = depth.clone();
3455 if inlined {
3456 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3457 inner_offset = next_offset;
3458 } else {
3459 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3460 inner_depth.increment()?;
3461 }
3462 let val_ref =
3463 self.action.get_or_insert_with(|| fidl::new_empty!(ShutdownAction, D));
3464 fidl::decode!(ShutdownAction, D, val_ref, decoder, inner_offset, inner_depth)?;
3465 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3466 {
3467 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3468 }
3469 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3470 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3471 }
3472 }
3473
3474 next_offset += envelope_size;
3475
3476 while next_offset < end_offset {
3478 _next_ordinal_to_read += 1;
3479 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3480 next_offset += envelope_size;
3481 }
3482
3483 Ok(())
3484 }
3485 }
3486}