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