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