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