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