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