fidl_fuchsia_kernel_common/
fidl_fuchsia_kernel_common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![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
11/// Maximum number of bytes in a command string
12pub const DEBUG_COMMAND_MAX: u32 = 1024;
13
14#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15#[repr(C)]
16pub struct CounterUpdateInspectVmoResponse {
17    pub status: i32,
18}
19
20impl fidl::Persistable for CounterUpdateInspectVmoResponse {}
21
22#[derive(Clone, Debug, PartialEq)]
23pub struct CpuStats {
24    /// This is the total number of CPUs on the actual device. This may not be the same as the length
25    /// of the vector `per_cpu_stats` as it is possible the underlying syscall will not return stats
26    /// for all CPUs.
27    pub actual_num_cpus: u64,
28    pub per_cpu_stats: Option<Vec<PerCpuStats>>,
29}
30
31impl fidl::Persistable for CpuStats {}
32
33#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
34pub struct DebugBrokerSendDebugCommandRequest {
35    pub command: String,
36}
37
38impl fidl::Persistable for DebugBrokerSendDebugCommandRequest {}
39
40#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
41#[repr(C)]
42pub struct DebugBrokerSendDebugCommandResponse {
43    pub status: i32,
44}
45
46impl fidl::Persistable for DebugBrokerSendDebugCommandResponse {}
47
48#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
49pub struct DebugBrokerSetTracingEnabledRequest {
50    pub enabled: bool,
51}
52
53impl fidl::Persistable for DebugBrokerSetTracingEnabledRequest {}
54
55#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
56#[repr(C)]
57pub struct DebugBrokerSetTracingEnabledResponse {
58    pub status: i32,
59}
60
61impl fidl::Persistable for DebugBrokerSetTracingEnabledResponse {}
62
63#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
64#[repr(C)]
65pub struct StatsGetCpuLoadRequest {
66    pub duration: i64,
67}
68
69impl fidl::Persistable for StatsGetCpuLoadRequest {}
70
71#[derive(Clone, Debug, PartialEq, PartialOrd)]
72pub struct StatsGetCpuLoadResponse {
73    pub per_cpu_load: Vec<f32>,
74}
75
76impl fidl::Persistable for StatsGetCpuLoadResponse {}
77
78#[derive(Clone, Debug, PartialEq)]
79pub struct StatsGetCpuStatsResponse {
80    pub stats: CpuStats,
81}
82
83impl fidl::Persistable for StatsGetCpuStatsResponse {}
84
85#[derive(Clone, Debug, PartialEq)]
86pub struct StatsGetMemoryStatsExtendedResponse {
87    pub stats: MemoryStatsExtended,
88}
89
90impl fidl::Persistable for StatsGetMemoryStatsExtendedResponse {}
91
92#[derive(Clone, Debug, PartialEq)]
93pub struct StatsGetMemoryStatsResponse {
94    pub stats: MemoryStats,
95}
96
97impl fidl::Persistable for StatsGetMemoryStatsResponse {}
98
99#[derive(Clone, Debug, Default, PartialEq)]
100pub struct MemoryStats {
101    pub total_bytes: Option<u64>,
102    pub free_bytes: Option<u64>,
103    pub wired_bytes: Option<u64>,
104    pub total_heap_bytes: Option<u64>,
105    pub free_heap_bytes: Option<u64>,
106    pub vmo_bytes: Option<u64>,
107    pub mmu_overhead_bytes: Option<u64>,
108    pub ipc_bytes: Option<u64>,
109    pub other_bytes: Option<u64>,
110    pub free_loaned_bytes: Option<u64>,
111    pub cache_bytes: Option<u64>,
112    pub slab_bytes: Option<u64>,
113    pub zram_bytes: Option<u64>,
114    pub vmo_reclaim_total_bytes: Option<u64>,
115    pub vmo_reclaim_newest_bytes: Option<u64>,
116    pub vmo_reclaim_oldest_bytes: Option<u64>,
117    pub vmo_reclaim_disabled_bytes: Option<u64>,
118    pub vmo_discardable_locked_bytes: Option<u64>,
119    pub vmo_discardable_unlocked_bytes: Option<u64>,
120    #[doc(hidden)]
121    pub __source_breaking: fidl::marker::SourceBreaking,
122}
123
124impl fidl::Persistable for MemoryStats {}
125
126#[derive(Clone, Debug, Default, PartialEq)]
127pub struct MemoryStatsCompression {
128    pub uncompressed_storage_bytes: Option<u64>,
129    pub compressed_storage_bytes: Option<u64>,
130    pub compressed_fragmentation_bytes: Option<u64>,
131    pub compression_time: Option<i64>,
132    pub decompression_time: Option<i64>,
133    pub total_page_compression_attempts: Option<u64>,
134    pub failed_page_compression_attempts: Option<u64>,
135    pub total_page_decompressions: Option<u64>,
136    pub compressed_page_evictions: Option<u64>,
137    pub eager_page_compressions: Option<u64>,
138    pub memory_pressure_page_compressions: Option<u64>,
139    pub critical_memory_page_compressions: Option<u64>,
140    pub pages_decompressed_unit_ns: Option<u64>,
141    pub pages_decompressed_within_log_time: Option<[u64; 8]>,
142    #[doc(hidden)]
143    pub __source_breaking: fidl::marker::SourceBreaking,
144}
145
146impl fidl::Persistable for MemoryStatsCompression {}
147
148#[derive(Clone, Debug, Default, PartialEq)]
149pub struct MemoryStatsExtended {
150    pub total_bytes: Option<u64>,
151    pub free_bytes: Option<u64>,
152    pub wired_bytes: Option<u64>,
153    pub total_heap_bytes: Option<u64>,
154    pub free_heap_bytes: Option<u64>,
155    pub vmo_bytes: Option<u64>,
156    pub vmo_pager_total_bytes: Option<u64>,
157    pub vmo_pager_newest_bytes: Option<u64>,
158    pub vmo_pager_oldest_bytes: Option<u64>,
159    pub vmo_discardable_locked_bytes: Option<u64>,
160    pub vmo_discardable_unlocked_bytes: Option<u64>,
161    pub mmu_overhead_bytes: Option<u64>,
162    pub ipc_bytes: Option<u64>,
163    pub other_bytes: Option<u64>,
164    #[doc(hidden)]
165    pub __source_breaking: fidl::marker::SourceBreaking,
166}
167
168impl fidl::Persistable for MemoryStatsExtended {}
169
170#[derive(Clone, Debug, Default, PartialEq)]
171pub struct PerCpuStats {
172    pub cpu_number: Option<u32>,
173    pub flags: Option<u32>,
174    pub idle_time: Option<i64>,
175    pub reschedules: Option<u64>,
176    pub context_switches: Option<u64>,
177    pub irq_preempts: Option<u64>,
178    pub yields: Option<u64>,
179    pub ints: Option<u64>,
180    pub timer_ints: Option<u64>,
181    pub timers: Option<u64>,
182    pub page_faults: Option<u64>,
183    pub exceptions: Option<u64>,
184    pub syscalls: Option<u64>,
185    pub reschedule_ipis: Option<u64>,
186    pub generic_ipis: Option<u64>,
187    #[doc(hidden)]
188    pub __source_breaking: fidl::marker::SourceBreaking,
189}
190
191impl fidl::Persistable for PerCpuStats {}
192
193mod internal {
194    use super::*;
195
196    impl fidl::encoding::ValueTypeMarker for CounterUpdateInspectVmoResponse {
197        type Borrowed<'a> = &'a Self;
198        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
199            value
200        }
201    }
202
203    unsafe impl fidl::encoding::TypeMarker for CounterUpdateInspectVmoResponse {
204        type Owned = Self;
205
206        #[inline(always)]
207        fn inline_align(_context: fidl::encoding::Context) -> usize {
208            4
209        }
210
211        #[inline(always)]
212        fn inline_size(_context: fidl::encoding::Context) -> usize {
213            4
214        }
215        #[inline(always)]
216        fn encode_is_copy() -> bool {
217            true
218        }
219
220        #[inline(always)]
221        fn decode_is_copy() -> bool {
222            true
223        }
224    }
225
226    unsafe impl<D: fidl::encoding::ResourceDialect>
227        fidl::encoding::Encode<CounterUpdateInspectVmoResponse, D>
228        for &CounterUpdateInspectVmoResponse
229    {
230        #[inline]
231        unsafe fn encode(
232            self,
233            encoder: &mut fidl::encoding::Encoder<'_, D>,
234            offset: usize,
235            _depth: fidl::encoding::Depth,
236        ) -> fidl::Result<()> {
237            encoder.debug_check_bounds::<CounterUpdateInspectVmoResponse>(offset);
238            unsafe {
239                // Copy the object into the buffer.
240                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
241                (buf_ptr as *mut CounterUpdateInspectVmoResponse)
242                    .write_unaligned((self as *const CounterUpdateInspectVmoResponse).read());
243                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
244                // done second because the memcpy will write garbage to these bytes.
245            }
246            Ok(())
247        }
248    }
249    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
250        fidl::encoding::Encode<CounterUpdateInspectVmoResponse, D> for (T0,)
251    {
252        #[inline]
253        unsafe fn encode(
254            self,
255            encoder: &mut fidl::encoding::Encoder<'_, D>,
256            offset: usize,
257            depth: fidl::encoding::Depth,
258        ) -> fidl::Result<()> {
259            encoder.debug_check_bounds::<CounterUpdateInspectVmoResponse>(offset);
260            // Zero out padding regions. There's no need to apply masks
261            // because the unmasked parts will be overwritten by fields.
262            // Write the fields.
263            self.0.encode(encoder, offset + 0, depth)?;
264            Ok(())
265        }
266    }
267
268    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
269        for CounterUpdateInspectVmoResponse
270    {
271        #[inline(always)]
272        fn new_empty() -> Self {
273            Self { status: fidl::new_empty!(i32, D) }
274        }
275
276        #[inline]
277        unsafe fn decode(
278            &mut self,
279            decoder: &mut fidl::encoding::Decoder<'_, D>,
280            offset: usize,
281            _depth: fidl::encoding::Depth,
282        ) -> fidl::Result<()> {
283            decoder.debug_check_bounds::<Self>(offset);
284            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
285            // Verify that padding bytes are zero.
286            // Copy from the buffer into the object.
287            unsafe {
288                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
289            }
290            Ok(())
291        }
292    }
293
294    impl fidl::encoding::ValueTypeMarker for CpuStats {
295        type Borrowed<'a> = &'a Self;
296        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
297            value
298        }
299    }
300
301    unsafe impl fidl::encoding::TypeMarker for CpuStats {
302        type Owned = Self;
303
304        #[inline(always)]
305        fn inline_align(_context: fidl::encoding::Context) -> usize {
306            8
307        }
308
309        #[inline(always)]
310        fn inline_size(_context: fidl::encoding::Context) -> usize {
311            24
312        }
313    }
314
315    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CpuStats, D> for &CpuStats {
316        #[inline]
317        unsafe fn encode(
318            self,
319            encoder: &mut fidl::encoding::Encoder<'_, D>,
320            offset: usize,
321            _depth: fidl::encoding::Depth,
322        ) -> fidl::Result<()> {
323            encoder.debug_check_bounds::<CpuStats>(offset);
324            // Delegate to tuple encoding.
325            fidl::encoding::Encode::<CpuStats, D>::encode(
326                (
327                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.actual_num_cpus),
328                    <fidl::encoding::Optional<fidl::encoding::Vector<PerCpuStats, 512>> as fidl::encoding::ValueTypeMarker>::borrow(&self.per_cpu_stats),
329                ),
330                encoder, offset, _depth
331            )
332        }
333    }
334    unsafe impl<
335            D: fidl::encoding::ResourceDialect,
336            T0: fidl::encoding::Encode<u64, D>,
337            T1: fidl::encoding::Encode<
338                fidl::encoding::Optional<fidl::encoding::Vector<PerCpuStats, 512>>,
339                D,
340            >,
341        > fidl::encoding::Encode<CpuStats, D> for (T0, T1)
342    {
343        #[inline]
344        unsafe fn encode(
345            self,
346            encoder: &mut fidl::encoding::Encoder<'_, D>,
347            offset: usize,
348            depth: fidl::encoding::Depth,
349        ) -> fidl::Result<()> {
350            encoder.debug_check_bounds::<CpuStats>(offset);
351            // Zero out padding regions. There's no need to apply masks
352            // because the unmasked parts will be overwritten by fields.
353            // Write the fields.
354            self.0.encode(encoder, offset + 0, depth)?;
355            self.1.encode(encoder, offset + 8, depth)?;
356            Ok(())
357        }
358    }
359
360    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CpuStats {
361        #[inline(always)]
362        fn new_empty() -> Self {
363            Self {
364                actual_num_cpus: fidl::new_empty!(u64, D),
365                per_cpu_stats: fidl::new_empty!(
366                    fidl::encoding::Optional<fidl::encoding::Vector<PerCpuStats, 512>>,
367                    D
368                ),
369            }
370        }
371
372        #[inline]
373        unsafe fn decode(
374            &mut self,
375            decoder: &mut fidl::encoding::Decoder<'_, D>,
376            offset: usize,
377            _depth: fidl::encoding::Depth,
378        ) -> fidl::Result<()> {
379            decoder.debug_check_bounds::<Self>(offset);
380            // Verify that padding bytes are zero.
381            fidl::decode!(u64, D, &mut self.actual_num_cpus, decoder, offset + 0, _depth)?;
382            fidl::decode!(
383                fidl::encoding::Optional<fidl::encoding::Vector<PerCpuStats, 512>>,
384                D,
385                &mut self.per_cpu_stats,
386                decoder,
387                offset + 8,
388                _depth
389            )?;
390            Ok(())
391        }
392    }
393
394    impl fidl::encoding::ValueTypeMarker for DebugBrokerSendDebugCommandRequest {
395        type Borrowed<'a> = &'a Self;
396        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
397            value
398        }
399    }
400
401    unsafe impl fidl::encoding::TypeMarker for DebugBrokerSendDebugCommandRequest {
402        type Owned = Self;
403
404        #[inline(always)]
405        fn inline_align(_context: fidl::encoding::Context) -> usize {
406            8
407        }
408
409        #[inline(always)]
410        fn inline_size(_context: fidl::encoding::Context) -> usize {
411            16
412        }
413    }
414
415    unsafe impl<D: fidl::encoding::ResourceDialect>
416        fidl::encoding::Encode<DebugBrokerSendDebugCommandRequest, D>
417        for &DebugBrokerSendDebugCommandRequest
418    {
419        #[inline]
420        unsafe fn encode(
421            self,
422            encoder: &mut fidl::encoding::Encoder<'_, D>,
423            offset: usize,
424            _depth: fidl::encoding::Depth,
425        ) -> fidl::Result<()> {
426            encoder.debug_check_bounds::<DebugBrokerSendDebugCommandRequest>(offset);
427            // Delegate to tuple encoding.
428            fidl::encoding::Encode::<DebugBrokerSendDebugCommandRequest, D>::encode(
429                (<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(
430                    &self.command,
431                ),),
432                encoder,
433                offset,
434                _depth,
435            )
436        }
437    }
438    unsafe impl<
439            D: fidl::encoding::ResourceDialect,
440            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>, D>,
441        > fidl::encoding::Encode<DebugBrokerSendDebugCommandRequest, D> for (T0,)
442    {
443        #[inline]
444        unsafe fn encode(
445            self,
446            encoder: &mut fidl::encoding::Encoder<'_, D>,
447            offset: usize,
448            depth: fidl::encoding::Depth,
449        ) -> fidl::Result<()> {
450            encoder.debug_check_bounds::<DebugBrokerSendDebugCommandRequest>(offset);
451            // Zero out padding regions. There's no need to apply masks
452            // because the unmasked parts will be overwritten by fields.
453            // Write the fields.
454            self.0.encode(encoder, offset + 0, depth)?;
455            Ok(())
456        }
457    }
458
459    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
460        for DebugBrokerSendDebugCommandRequest
461    {
462        #[inline(always)]
463        fn new_empty() -> Self {
464            Self { command: fidl::new_empty!(fidl::encoding::BoundedString<1024>, D) }
465        }
466
467        #[inline]
468        unsafe fn decode(
469            &mut self,
470            decoder: &mut fidl::encoding::Decoder<'_, D>,
471            offset: usize,
472            _depth: fidl::encoding::Depth,
473        ) -> fidl::Result<()> {
474            decoder.debug_check_bounds::<Self>(offset);
475            // Verify that padding bytes are zero.
476            fidl::decode!(
477                fidl::encoding::BoundedString<1024>,
478                D,
479                &mut self.command,
480                decoder,
481                offset + 0,
482                _depth
483            )?;
484            Ok(())
485        }
486    }
487
488    impl fidl::encoding::ValueTypeMarker for DebugBrokerSendDebugCommandResponse {
489        type Borrowed<'a> = &'a Self;
490        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
491            value
492        }
493    }
494
495    unsafe impl fidl::encoding::TypeMarker for DebugBrokerSendDebugCommandResponse {
496        type Owned = Self;
497
498        #[inline(always)]
499        fn inline_align(_context: fidl::encoding::Context) -> usize {
500            4
501        }
502
503        #[inline(always)]
504        fn inline_size(_context: fidl::encoding::Context) -> usize {
505            4
506        }
507        #[inline(always)]
508        fn encode_is_copy() -> bool {
509            true
510        }
511
512        #[inline(always)]
513        fn decode_is_copy() -> bool {
514            true
515        }
516    }
517
518    unsafe impl<D: fidl::encoding::ResourceDialect>
519        fidl::encoding::Encode<DebugBrokerSendDebugCommandResponse, D>
520        for &DebugBrokerSendDebugCommandResponse
521    {
522        #[inline]
523        unsafe fn encode(
524            self,
525            encoder: &mut fidl::encoding::Encoder<'_, D>,
526            offset: usize,
527            _depth: fidl::encoding::Depth,
528        ) -> fidl::Result<()> {
529            encoder.debug_check_bounds::<DebugBrokerSendDebugCommandResponse>(offset);
530            unsafe {
531                // Copy the object into the buffer.
532                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
533                (buf_ptr as *mut DebugBrokerSendDebugCommandResponse)
534                    .write_unaligned((self as *const DebugBrokerSendDebugCommandResponse).read());
535                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
536                // done second because the memcpy will write garbage to these bytes.
537            }
538            Ok(())
539        }
540    }
541    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
542        fidl::encoding::Encode<DebugBrokerSendDebugCommandResponse, D> for (T0,)
543    {
544        #[inline]
545        unsafe fn encode(
546            self,
547            encoder: &mut fidl::encoding::Encoder<'_, D>,
548            offset: usize,
549            depth: fidl::encoding::Depth,
550        ) -> fidl::Result<()> {
551            encoder.debug_check_bounds::<DebugBrokerSendDebugCommandResponse>(offset);
552            // Zero out padding regions. There's no need to apply masks
553            // because the unmasked parts will be overwritten by fields.
554            // Write the fields.
555            self.0.encode(encoder, offset + 0, depth)?;
556            Ok(())
557        }
558    }
559
560    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
561        for DebugBrokerSendDebugCommandResponse
562    {
563        #[inline(always)]
564        fn new_empty() -> Self {
565            Self { status: fidl::new_empty!(i32, D) }
566        }
567
568        #[inline]
569        unsafe fn decode(
570            &mut self,
571            decoder: &mut fidl::encoding::Decoder<'_, D>,
572            offset: usize,
573            _depth: fidl::encoding::Depth,
574        ) -> fidl::Result<()> {
575            decoder.debug_check_bounds::<Self>(offset);
576            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
577            // Verify that padding bytes are zero.
578            // Copy from the buffer into the object.
579            unsafe {
580                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
581            }
582            Ok(())
583        }
584    }
585
586    impl fidl::encoding::ValueTypeMarker for DebugBrokerSetTracingEnabledRequest {
587        type Borrowed<'a> = &'a Self;
588        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
589            value
590        }
591    }
592
593    unsafe impl fidl::encoding::TypeMarker for DebugBrokerSetTracingEnabledRequest {
594        type Owned = Self;
595
596        #[inline(always)]
597        fn inline_align(_context: fidl::encoding::Context) -> usize {
598            1
599        }
600
601        #[inline(always)]
602        fn inline_size(_context: fidl::encoding::Context) -> usize {
603            1
604        }
605    }
606
607    unsafe impl<D: fidl::encoding::ResourceDialect>
608        fidl::encoding::Encode<DebugBrokerSetTracingEnabledRequest, D>
609        for &DebugBrokerSetTracingEnabledRequest
610    {
611        #[inline]
612        unsafe fn encode(
613            self,
614            encoder: &mut fidl::encoding::Encoder<'_, D>,
615            offset: usize,
616            _depth: fidl::encoding::Depth,
617        ) -> fidl::Result<()> {
618            encoder.debug_check_bounds::<DebugBrokerSetTracingEnabledRequest>(offset);
619            // Delegate to tuple encoding.
620            fidl::encoding::Encode::<DebugBrokerSetTracingEnabledRequest, D>::encode(
621                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
622                encoder,
623                offset,
624                _depth,
625            )
626        }
627    }
628    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
629        fidl::encoding::Encode<DebugBrokerSetTracingEnabledRequest, D> for (T0,)
630    {
631        #[inline]
632        unsafe fn encode(
633            self,
634            encoder: &mut fidl::encoding::Encoder<'_, D>,
635            offset: usize,
636            depth: fidl::encoding::Depth,
637        ) -> fidl::Result<()> {
638            encoder.debug_check_bounds::<DebugBrokerSetTracingEnabledRequest>(offset);
639            // Zero out padding regions. There's no need to apply masks
640            // because the unmasked parts will be overwritten by fields.
641            // Write the fields.
642            self.0.encode(encoder, offset + 0, depth)?;
643            Ok(())
644        }
645    }
646
647    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
648        for DebugBrokerSetTracingEnabledRequest
649    {
650        #[inline(always)]
651        fn new_empty() -> Self {
652            Self { enabled: fidl::new_empty!(bool, D) }
653        }
654
655        #[inline]
656        unsafe fn decode(
657            &mut self,
658            decoder: &mut fidl::encoding::Decoder<'_, D>,
659            offset: usize,
660            _depth: fidl::encoding::Depth,
661        ) -> fidl::Result<()> {
662            decoder.debug_check_bounds::<Self>(offset);
663            // Verify that padding bytes are zero.
664            fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
665            Ok(())
666        }
667    }
668
669    impl fidl::encoding::ValueTypeMarker for DebugBrokerSetTracingEnabledResponse {
670        type Borrowed<'a> = &'a Self;
671        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
672            value
673        }
674    }
675
676    unsafe impl fidl::encoding::TypeMarker for DebugBrokerSetTracingEnabledResponse {
677        type Owned = Self;
678
679        #[inline(always)]
680        fn inline_align(_context: fidl::encoding::Context) -> usize {
681            4
682        }
683
684        #[inline(always)]
685        fn inline_size(_context: fidl::encoding::Context) -> usize {
686            4
687        }
688        #[inline(always)]
689        fn encode_is_copy() -> bool {
690            true
691        }
692
693        #[inline(always)]
694        fn decode_is_copy() -> bool {
695            true
696        }
697    }
698
699    unsafe impl<D: fidl::encoding::ResourceDialect>
700        fidl::encoding::Encode<DebugBrokerSetTracingEnabledResponse, D>
701        for &DebugBrokerSetTracingEnabledResponse
702    {
703        #[inline]
704        unsafe fn encode(
705            self,
706            encoder: &mut fidl::encoding::Encoder<'_, D>,
707            offset: usize,
708            _depth: fidl::encoding::Depth,
709        ) -> fidl::Result<()> {
710            encoder.debug_check_bounds::<DebugBrokerSetTracingEnabledResponse>(offset);
711            unsafe {
712                // Copy the object into the buffer.
713                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
714                (buf_ptr as *mut DebugBrokerSetTracingEnabledResponse)
715                    .write_unaligned((self as *const DebugBrokerSetTracingEnabledResponse).read());
716                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
717                // done second because the memcpy will write garbage to these bytes.
718            }
719            Ok(())
720        }
721    }
722    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
723        fidl::encoding::Encode<DebugBrokerSetTracingEnabledResponse, D> for (T0,)
724    {
725        #[inline]
726        unsafe fn encode(
727            self,
728            encoder: &mut fidl::encoding::Encoder<'_, D>,
729            offset: usize,
730            depth: fidl::encoding::Depth,
731        ) -> fidl::Result<()> {
732            encoder.debug_check_bounds::<DebugBrokerSetTracingEnabledResponse>(offset);
733            // Zero out padding regions. There's no need to apply masks
734            // because the unmasked parts will be overwritten by fields.
735            // Write the fields.
736            self.0.encode(encoder, offset + 0, depth)?;
737            Ok(())
738        }
739    }
740
741    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
742        for DebugBrokerSetTracingEnabledResponse
743    {
744        #[inline(always)]
745        fn new_empty() -> Self {
746            Self { status: fidl::new_empty!(i32, D) }
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 buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
758            // Verify that padding bytes are zero.
759            // Copy from the buffer into the object.
760            unsafe {
761                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
762            }
763            Ok(())
764        }
765    }
766
767    impl fidl::encoding::ValueTypeMarker for StatsGetCpuLoadRequest {
768        type Borrowed<'a> = &'a Self;
769        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
770            value
771        }
772    }
773
774    unsafe impl fidl::encoding::TypeMarker for StatsGetCpuLoadRequest {
775        type Owned = Self;
776
777        #[inline(always)]
778        fn inline_align(_context: fidl::encoding::Context) -> usize {
779            8
780        }
781
782        #[inline(always)]
783        fn inline_size(_context: fidl::encoding::Context) -> usize {
784            8
785        }
786        #[inline(always)]
787        fn encode_is_copy() -> bool {
788            true
789        }
790
791        #[inline(always)]
792        fn decode_is_copy() -> bool {
793            true
794        }
795    }
796
797    unsafe impl<D: fidl::encoding::ResourceDialect>
798        fidl::encoding::Encode<StatsGetCpuLoadRequest, D> for &StatsGetCpuLoadRequest
799    {
800        #[inline]
801        unsafe fn encode(
802            self,
803            encoder: &mut fidl::encoding::Encoder<'_, D>,
804            offset: usize,
805            _depth: fidl::encoding::Depth,
806        ) -> fidl::Result<()> {
807            encoder.debug_check_bounds::<StatsGetCpuLoadRequest>(offset);
808            unsafe {
809                // Copy the object into the buffer.
810                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
811                (buf_ptr as *mut StatsGetCpuLoadRequest)
812                    .write_unaligned((self as *const StatsGetCpuLoadRequest).read());
813                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
814                // done second because the memcpy will write garbage to these bytes.
815            }
816            Ok(())
817        }
818    }
819    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
820        fidl::encoding::Encode<StatsGetCpuLoadRequest, D> for (T0,)
821    {
822        #[inline]
823        unsafe fn encode(
824            self,
825            encoder: &mut fidl::encoding::Encoder<'_, D>,
826            offset: usize,
827            depth: fidl::encoding::Depth,
828        ) -> fidl::Result<()> {
829            encoder.debug_check_bounds::<StatsGetCpuLoadRequest>(offset);
830            // Zero out padding regions. There's no need to apply masks
831            // because the unmasked parts will be overwritten by fields.
832            // Write the fields.
833            self.0.encode(encoder, offset + 0, depth)?;
834            Ok(())
835        }
836    }
837
838    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
839        for StatsGetCpuLoadRequest
840    {
841        #[inline(always)]
842        fn new_empty() -> Self {
843            Self { duration: fidl::new_empty!(i64, D) }
844        }
845
846        #[inline]
847        unsafe fn decode(
848            &mut self,
849            decoder: &mut fidl::encoding::Decoder<'_, D>,
850            offset: usize,
851            _depth: fidl::encoding::Depth,
852        ) -> fidl::Result<()> {
853            decoder.debug_check_bounds::<Self>(offset);
854            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
855            // Verify that padding bytes are zero.
856            // Copy from the buffer into the object.
857            unsafe {
858                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
859            }
860            Ok(())
861        }
862    }
863
864    impl fidl::encoding::ValueTypeMarker for StatsGetCpuLoadResponse {
865        type Borrowed<'a> = &'a Self;
866        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
867            value
868        }
869    }
870
871    unsafe impl fidl::encoding::TypeMarker for StatsGetCpuLoadResponse {
872        type Owned = Self;
873
874        #[inline(always)]
875        fn inline_align(_context: fidl::encoding::Context) -> usize {
876            8
877        }
878
879        #[inline(always)]
880        fn inline_size(_context: fidl::encoding::Context) -> usize {
881            16
882        }
883    }
884
885    unsafe impl<D: fidl::encoding::ResourceDialect>
886        fidl::encoding::Encode<StatsGetCpuLoadResponse, D> for &StatsGetCpuLoadResponse
887    {
888        #[inline]
889        unsafe fn encode(
890            self,
891            encoder: &mut fidl::encoding::Encoder<'_, D>,
892            offset: usize,
893            _depth: fidl::encoding::Depth,
894        ) -> fidl::Result<()> {
895            encoder.debug_check_bounds::<StatsGetCpuLoadResponse>(offset);
896            // Delegate to tuple encoding.
897            fidl::encoding::Encode::<StatsGetCpuLoadResponse, D>::encode(
898                (<fidl::encoding::Vector<f32, 512> as fidl::encoding::ValueTypeMarker>::borrow(
899                    &self.per_cpu_load,
900                ),),
901                encoder,
902                offset,
903                _depth,
904            )
905        }
906    }
907    unsafe impl<
908            D: fidl::encoding::ResourceDialect,
909            T0: fidl::encoding::Encode<fidl::encoding::Vector<f32, 512>, D>,
910        > fidl::encoding::Encode<StatsGetCpuLoadResponse, D> for (T0,)
911    {
912        #[inline]
913        unsafe fn encode(
914            self,
915            encoder: &mut fidl::encoding::Encoder<'_, D>,
916            offset: usize,
917            depth: fidl::encoding::Depth,
918        ) -> fidl::Result<()> {
919            encoder.debug_check_bounds::<StatsGetCpuLoadResponse>(offset);
920            // Zero out padding regions. There's no need to apply masks
921            // because the unmasked parts will be overwritten by fields.
922            // Write the fields.
923            self.0.encode(encoder, offset + 0, depth)?;
924            Ok(())
925        }
926    }
927
928    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
929        for StatsGetCpuLoadResponse
930    {
931        #[inline(always)]
932        fn new_empty() -> Self {
933            Self { per_cpu_load: fidl::new_empty!(fidl::encoding::Vector<f32, 512>, D) }
934        }
935
936        #[inline]
937        unsafe fn decode(
938            &mut self,
939            decoder: &mut fidl::encoding::Decoder<'_, D>,
940            offset: usize,
941            _depth: fidl::encoding::Depth,
942        ) -> fidl::Result<()> {
943            decoder.debug_check_bounds::<Self>(offset);
944            // Verify that padding bytes are zero.
945            fidl::decode!(fidl::encoding::Vector<f32, 512>, D, &mut self.per_cpu_load, decoder, offset + 0, _depth)?;
946            Ok(())
947        }
948    }
949
950    impl fidl::encoding::ValueTypeMarker for StatsGetCpuStatsResponse {
951        type Borrowed<'a> = &'a Self;
952        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
953            value
954        }
955    }
956
957    unsafe impl fidl::encoding::TypeMarker for StatsGetCpuStatsResponse {
958        type Owned = Self;
959
960        #[inline(always)]
961        fn inline_align(_context: fidl::encoding::Context) -> usize {
962            8
963        }
964
965        #[inline(always)]
966        fn inline_size(_context: fidl::encoding::Context) -> usize {
967            24
968        }
969    }
970
971    unsafe impl<D: fidl::encoding::ResourceDialect>
972        fidl::encoding::Encode<StatsGetCpuStatsResponse, D> for &StatsGetCpuStatsResponse
973    {
974        #[inline]
975        unsafe fn encode(
976            self,
977            encoder: &mut fidl::encoding::Encoder<'_, D>,
978            offset: usize,
979            _depth: fidl::encoding::Depth,
980        ) -> fidl::Result<()> {
981            encoder.debug_check_bounds::<StatsGetCpuStatsResponse>(offset);
982            // Delegate to tuple encoding.
983            fidl::encoding::Encode::<StatsGetCpuStatsResponse, D>::encode(
984                (<CpuStats as fidl::encoding::ValueTypeMarker>::borrow(&self.stats),),
985                encoder,
986                offset,
987                _depth,
988            )
989        }
990    }
991    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CpuStats, D>>
992        fidl::encoding::Encode<StatsGetCpuStatsResponse, D> for (T0,)
993    {
994        #[inline]
995        unsafe fn encode(
996            self,
997            encoder: &mut fidl::encoding::Encoder<'_, D>,
998            offset: usize,
999            depth: fidl::encoding::Depth,
1000        ) -> fidl::Result<()> {
1001            encoder.debug_check_bounds::<StatsGetCpuStatsResponse>(offset);
1002            // Zero out padding regions. There's no need to apply masks
1003            // because the unmasked parts will be overwritten by fields.
1004            // Write the fields.
1005            self.0.encode(encoder, offset + 0, depth)?;
1006            Ok(())
1007        }
1008    }
1009
1010    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1011        for StatsGetCpuStatsResponse
1012    {
1013        #[inline(always)]
1014        fn new_empty() -> Self {
1015            Self { stats: fidl::new_empty!(CpuStats, D) }
1016        }
1017
1018        #[inline]
1019        unsafe fn decode(
1020            &mut self,
1021            decoder: &mut fidl::encoding::Decoder<'_, D>,
1022            offset: usize,
1023            _depth: fidl::encoding::Depth,
1024        ) -> fidl::Result<()> {
1025            decoder.debug_check_bounds::<Self>(offset);
1026            // Verify that padding bytes are zero.
1027            fidl::decode!(CpuStats, D, &mut self.stats, decoder, offset + 0, _depth)?;
1028            Ok(())
1029        }
1030    }
1031
1032    impl fidl::encoding::ValueTypeMarker for StatsGetMemoryStatsExtendedResponse {
1033        type Borrowed<'a> = &'a Self;
1034        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1035            value
1036        }
1037    }
1038
1039    unsafe impl fidl::encoding::TypeMarker for StatsGetMemoryStatsExtendedResponse {
1040        type Owned = Self;
1041
1042        #[inline(always)]
1043        fn inline_align(_context: fidl::encoding::Context) -> usize {
1044            8
1045        }
1046
1047        #[inline(always)]
1048        fn inline_size(_context: fidl::encoding::Context) -> usize {
1049            16
1050        }
1051    }
1052
1053    unsafe impl<D: fidl::encoding::ResourceDialect>
1054        fidl::encoding::Encode<StatsGetMemoryStatsExtendedResponse, D>
1055        for &StatsGetMemoryStatsExtendedResponse
1056    {
1057        #[inline]
1058        unsafe fn encode(
1059            self,
1060            encoder: &mut fidl::encoding::Encoder<'_, D>,
1061            offset: usize,
1062            _depth: fidl::encoding::Depth,
1063        ) -> fidl::Result<()> {
1064            encoder.debug_check_bounds::<StatsGetMemoryStatsExtendedResponse>(offset);
1065            // Delegate to tuple encoding.
1066            fidl::encoding::Encode::<StatsGetMemoryStatsExtendedResponse, D>::encode(
1067                (<MemoryStatsExtended as fidl::encoding::ValueTypeMarker>::borrow(&self.stats),),
1068                encoder,
1069                offset,
1070                _depth,
1071            )
1072        }
1073    }
1074    unsafe impl<
1075            D: fidl::encoding::ResourceDialect,
1076            T0: fidl::encoding::Encode<MemoryStatsExtended, D>,
1077        > fidl::encoding::Encode<StatsGetMemoryStatsExtendedResponse, D> for (T0,)
1078    {
1079        #[inline]
1080        unsafe fn encode(
1081            self,
1082            encoder: &mut fidl::encoding::Encoder<'_, D>,
1083            offset: usize,
1084            depth: fidl::encoding::Depth,
1085        ) -> fidl::Result<()> {
1086            encoder.debug_check_bounds::<StatsGetMemoryStatsExtendedResponse>(offset);
1087            // Zero out padding regions. There's no need to apply masks
1088            // because the unmasked parts will be overwritten by fields.
1089            // Write the fields.
1090            self.0.encode(encoder, offset + 0, depth)?;
1091            Ok(())
1092        }
1093    }
1094
1095    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1096        for StatsGetMemoryStatsExtendedResponse
1097    {
1098        #[inline(always)]
1099        fn new_empty() -> Self {
1100            Self { stats: fidl::new_empty!(MemoryStatsExtended, D) }
1101        }
1102
1103        #[inline]
1104        unsafe fn decode(
1105            &mut self,
1106            decoder: &mut fidl::encoding::Decoder<'_, D>,
1107            offset: usize,
1108            _depth: fidl::encoding::Depth,
1109        ) -> fidl::Result<()> {
1110            decoder.debug_check_bounds::<Self>(offset);
1111            // Verify that padding bytes are zero.
1112            fidl::decode!(MemoryStatsExtended, D, &mut self.stats, decoder, offset + 0, _depth)?;
1113            Ok(())
1114        }
1115    }
1116
1117    impl fidl::encoding::ValueTypeMarker for StatsGetMemoryStatsResponse {
1118        type Borrowed<'a> = &'a Self;
1119        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1120            value
1121        }
1122    }
1123
1124    unsafe impl fidl::encoding::TypeMarker for StatsGetMemoryStatsResponse {
1125        type Owned = Self;
1126
1127        #[inline(always)]
1128        fn inline_align(_context: fidl::encoding::Context) -> usize {
1129            8
1130        }
1131
1132        #[inline(always)]
1133        fn inline_size(_context: fidl::encoding::Context) -> usize {
1134            16
1135        }
1136    }
1137
1138    unsafe impl<D: fidl::encoding::ResourceDialect>
1139        fidl::encoding::Encode<StatsGetMemoryStatsResponse, D> for &StatsGetMemoryStatsResponse
1140    {
1141        #[inline]
1142        unsafe fn encode(
1143            self,
1144            encoder: &mut fidl::encoding::Encoder<'_, D>,
1145            offset: usize,
1146            _depth: fidl::encoding::Depth,
1147        ) -> fidl::Result<()> {
1148            encoder.debug_check_bounds::<StatsGetMemoryStatsResponse>(offset);
1149            // Delegate to tuple encoding.
1150            fidl::encoding::Encode::<StatsGetMemoryStatsResponse, D>::encode(
1151                (<MemoryStats as fidl::encoding::ValueTypeMarker>::borrow(&self.stats),),
1152                encoder,
1153                offset,
1154                _depth,
1155            )
1156        }
1157    }
1158    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<MemoryStats, D>>
1159        fidl::encoding::Encode<StatsGetMemoryStatsResponse, D> for (T0,)
1160    {
1161        #[inline]
1162        unsafe fn encode(
1163            self,
1164            encoder: &mut fidl::encoding::Encoder<'_, D>,
1165            offset: usize,
1166            depth: fidl::encoding::Depth,
1167        ) -> fidl::Result<()> {
1168            encoder.debug_check_bounds::<StatsGetMemoryStatsResponse>(offset);
1169            // Zero out padding regions. There's no need to apply masks
1170            // because the unmasked parts will be overwritten by fields.
1171            // Write the fields.
1172            self.0.encode(encoder, offset + 0, depth)?;
1173            Ok(())
1174        }
1175    }
1176
1177    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1178        for StatsGetMemoryStatsResponse
1179    {
1180        #[inline(always)]
1181        fn new_empty() -> Self {
1182            Self { stats: fidl::new_empty!(MemoryStats, D) }
1183        }
1184
1185        #[inline]
1186        unsafe fn decode(
1187            &mut self,
1188            decoder: &mut fidl::encoding::Decoder<'_, D>,
1189            offset: usize,
1190            _depth: fidl::encoding::Depth,
1191        ) -> fidl::Result<()> {
1192            decoder.debug_check_bounds::<Self>(offset);
1193            // Verify that padding bytes are zero.
1194            fidl::decode!(MemoryStats, D, &mut self.stats, decoder, offset + 0, _depth)?;
1195            Ok(())
1196        }
1197    }
1198
1199    impl MemoryStats {
1200        #[inline(always)]
1201        fn max_ordinal_present(&self) -> u64 {
1202            if let Some(_) = self.vmo_discardable_unlocked_bytes {
1203                return 19;
1204            }
1205            if let Some(_) = self.vmo_discardable_locked_bytes {
1206                return 18;
1207            }
1208            if let Some(_) = self.vmo_reclaim_disabled_bytes {
1209                return 17;
1210            }
1211            if let Some(_) = self.vmo_reclaim_oldest_bytes {
1212                return 16;
1213            }
1214            if let Some(_) = self.vmo_reclaim_newest_bytes {
1215                return 15;
1216            }
1217            if let Some(_) = self.vmo_reclaim_total_bytes {
1218                return 14;
1219            }
1220            if let Some(_) = self.zram_bytes {
1221                return 13;
1222            }
1223            if let Some(_) = self.slab_bytes {
1224                return 12;
1225            }
1226            if let Some(_) = self.cache_bytes {
1227                return 11;
1228            }
1229            if let Some(_) = self.free_loaned_bytes {
1230                return 10;
1231            }
1232            if let Some(_) = self.other_bytes {
1233                return 9;
1234            }
1235            if let Some(_) = self.ipc_bytes {
1236                return 8;
1237            }
1238            if let Some(_) = self.mmu_overhead_bytes {
1239                return 7;
1240            }
1241            if let Some(_) = self.vmo_bytes {
1242                return 6;
1243            }
1244            if let Some(_) = self.free_heap_bytes {
1245                return 5;
1246            }
1247            if let Some(_) = self.total_heap_bytes {
1248                return 4;
1249            }
1250            if let Some(_) = self.wired_bytes {
1251                return 3;
1252            }
1253            if let Some(_) = self.free_bytes {
1254                return 2;
1255            }
1256            if let Some(_) = self.total_bytes {
1257                return 1;
1258            }
1259            0
1260        }
1261    }
1262
1263    impl fidl::encoding::ValueTypeMarker for MemoryStats {
1264        type Borrowed<'a> = &'a Self;
1265        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1266            value
1267        }
1268    }
1269
1270    unsafe impl fidl::encoding::TypeMarker for MemoryStats {
1271        type Owned = Self;
1272
1273        #[inline(always)]
1274        fn inline_align(_context: fidl::encoding::Context) -> usize {
1275            8
1276        }
1277
1278        #[inline(always)]
1279        fn inline_size(_context: fidl::encoding::Context) -> usize {
1280            16
1281        }
1282    }
1283
1284    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MemoryStats, D>
1285        for &MemoryStats
1286    {
1287        unsafe fn encode(
1288            self,
1289            encoder: &mut fidl::encoding::Encoder<'_, D>,
1290            offset: usize,
1291            mut depth: fidl::encoding::Depth,
1292        ) -> fidl::Result<()> {
1293            encoder.debug_check_bounds::<MemoryStats>(offset);
1294            // Vector header
1295            let max_ordinal: u64 = self.max_ordinal_present();
1296            encoder.write_num(max_ordinal, offset);
1297            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1298            // Calling encoder.out_of_line_offset(0) is not allowed.
1299            if max_ordinal == 0 {
1300                return Ok(());
1301            }
1302            depth.increment()?;
1303            let envelope_size = 8;
1304            let bytes_len = max_ordinal as usize * envelope_size;
1305            #[allow(unused_variables)]
1306            let offset = encoder.out_of_line_offset(bytes_len);
1307            let mut _prev_end_offset: usize = 0;
1308            if 1 > max_ordinal {
1309                return Ok(());
1310            }
1311
1312            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1313            // are envelope_size bytes.
1314            let cur_offset: usize = (1 - 1) * envelope_size;
1315
1316            // Zero reserved fields.
1317            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1318
1319            // Safety:
1320            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1321            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1322            //   envelope_size bytes, there is always sufficient room.
1323            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1324                self.total_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1325                encoder,
1326                offset + cur_offset,
1327                depth,
1328            )?;
1329
1330            _prev_end_offset = cur_offset + envelope_size;
1331            if 2 > max_ordinal {
1332                return Ok(());
1333            }
1334
1335            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1336            // are envelope_size bytes.
1337            let cur_offset: usize = (2 - 1) * envelope_size;
1338
1339            // Zero reserved fields.
1340            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1341
1342            // Safety:
1343            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1344            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1345            //   envelope_size bytes, there is always sufficient room.
1346            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1347                self.free_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1348                encoder,
1349                offset + cur_offset,
1350                depth,
1351            )?;
1352
1353            _prev_end_offset = cur_offset + envelope_size;
1354            if 3 > max_ordinal {
1355                return Ok(());
1356            }
1357
1358            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1359            // are envelope_size bytes.
1360            let cur_offset: usize = (3 - 1) * envelope_size;
1361
1362            // Zero reserved fields.
1363            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1364
1365            // Safety:
1366            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1367            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1368            //   envelope_size bytes, there is always sufficient room.
1369            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1370                self.wired_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1371                encoder,
1372                offset + cur_offset,
1373                depth,
1374            )?;
1375
1376            _prev_end_offset = cur_offset + envelope_size;
1377            if 4 > max_ordinal {
1378                return Ok(());
1379            }
1380
1381            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1382            // are envelope_size bytes.
1383            let cur_offset: usize = (4 - 1) * envelope_size;
1384
1385            // Zero reserved fields.
1386            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1387
1388            // Safety:
1389            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1390            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1391            //   envelope_size bytes, there is always sufficient room.
1392            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1393                self.total_heap_bytes
1394                    .as_ref()
1395                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1396                encoder,
1397                offset + cur_offset,
1398                depth,
1399            )?;
1400
1401            _prev_end_offset = cur_offset + envelope_size;
1402            if 5 > max_ordinal {
1403                return Ok(());
1404            }
1405
1406            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1407            // are envelope_size bytes.
1408            let cur_offset: usize = (5 - 1) * envelope_size;
1409
1410            // Zero reserved fields.
1411            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1412
1413            // Safety:
1414            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1415            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1416            //   envelope_size bytes, there is always sufficient room.
1417            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1418                self.free_heap_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1419                encoder,
1420                offset + cur_offset,
1421                depth,
1422            )?;
1423
1424            _prev_end_offset = cur_offset + envelope_size;
1425            if 6 > max_ordinal {
1426                return Ok(());
1427            }
1428
1429            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1430            // are envelope_size bytes.
1431            let cur_offset: usize = (6 - 1) * envelope_size;
1432
1433            // Zero reserved fields.
1434            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1435
1436            // Safety:
1437            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1438            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1439            //   envelope_size bytes, there is always sufficient room.
1440            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1441                self.vmo_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1442                encoder,
1443                offset + cur_offset,
1444                depth,
1445            )?;
1446
1447            _prev_end_offset = cur_offset + envelope_size;
1448            if 7 > max_ordinal {
1449                return Ok(());
1450            }
1451
1452            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1453            // are envelope_size bytes.
1454            let cur_offset: usize = (7 - 1) * envelope_size;
1455
1456            // Zero reserved fields.
1457            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1458
1459            // Safety:
1460            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1461            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1462            //   envelope_size bytes, there is always sufficient room.
1463            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1464                self.mmu_overhead_bytes
1465                    .as_ref()
1466                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1467                encoder,
1468                offset + cur_offset,
1469                depth,
1470            )?;
1471
1472            _prev_end_offset = cur_offset + envelope_size;
1473            if 8 > max_ordinal {
1474                return Ok(());
1475            }
1476
1477            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1478            // are envelope_size bytes.
1479            let cur_offset: usize = (8 - 1) * envelope_size;
1480
1481            // Zero reserved fields.
1482            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1483
1484            // Safety:
1485            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1486            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1487            //   envelope_size bytes, there is always sufficient room.
1488            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1489                self.ipc_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1490                encoder,
1491                offset + cur_offset,
1492                depth,
1493            )?;
1494
1495            _prev_end_offset = cur_offset + envelope_size;
1496            if 9 > max_ordinal {
1497                return Ok(());
1498            }
1499
1500            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1501            // are envelope_size bytes.
1502            let cur_offset: usize = (9 - 1) * envelope_size;
1503
1504            // Zero reserved fields.
1505            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1506
1507            // Safety:
1508            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1509            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1510            //   envelope_size bytes, there is always sufficient room.
1511            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1512                self.other_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1513                encoder,
1514                offset + cur_offset,
1515                depth,
1516            )?;
1517
1518            _prev_end_offset = cur_offset + envelope_size;
1519            if 10 > max_ordinal {
1520                return Ok(());
1521            }
1522
1523            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1524            // are envelope_size bytes.
1525            let cur_offset: usize = (10 - 1) * envelope_size;
1526
1527            // Zero reserved fields.
1528            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1529
1530            // Safety:
1531            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1532            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1533            //   envelope_size bytes, there is always sufficient room.
1534            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1535                self.free_loaned_bytes
1536                    .as_ref()
1537                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1538                encoder,
1539                offset + cur_offset,
1540                depth,
1541            )?;
1542
1543            _prev_end_offset = cur_offset + envelope_size;
1544            if 11 > max_ordinal {
1545                return Ok(());
1546            }
1547
1548            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1549            // are envelope_size bytes.
1550            let cur_offset: usize = (11 - 1) * envelope_size;
1551
1552            // Zero reserved fields.
1553            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1554
1555            // Safety:
1556            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1557            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1558            //   envelope_size bytes, there is always sufficient room.
1559            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1560                self.cache_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1561                encoder,
1562                offset + cur_offset,
1563                depth,
1564            )?;
1565
1566            _prev_end_offset = cur_offset + envelope_size;
1567            if 12 > max_ordinal {
1568                return Ok(());
1569            }
1570
1571            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1572            // are envelope_size bytes.
1573            let cur_offset: usize = (12 - 1) * envelope_size;
1574
1575            // Zero reserved fields.
1576            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1577
1578            // Safety:
1579            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1580            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1581            //   envelope_size bytes, there is always sufficient room.
1582            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1583                self.slab_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1584                encoder,
1585                offset + cur_offset,
1586                depth,
1587            )?;
1588
1589            _prev_end_offset = cur_offset + envelope_size;
1590            if 13 > max_ordinal {
1591                return Ok(());
1592            }
1593
1594            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1595            // are envelope_size bytes.
1596            let cur_offset: usize = (13 - 1) * envelope_size;
1597
1598            // Zero reserved fields.
1599            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1600
1601            // Safety:
1602            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1603            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1604            //   envelope_size bytes, there is always sufficient room.
1605            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1606                self.zram_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1607                encoder,
1608                offset + cur_offset,
1609                depth,
1610            )?;
1611
1612            _prev_end_offset = cur_offset + envelope_size;
1613            if 14 > max_ordinal {
1614                return Ok(());
1615            }
1616
1617            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1618            // are envelope_size bytes.
1619            let cur_offset: usize = (14 - 1) * envelope_size;
1620
1621            // Zero reserved fields.
1622            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1623
1624            // Safety:
1625            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1626            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1627            //   envelope_size bytes, there is always sufficient room.
1628            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1629                self.vmo_reclaim_total_bytes
1630                    .as_ref()
1631                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1632                encoder,
1633                offset + cur_offset,
1634                depth,
1635            )?;
1636
1637            _prev_end_offset = cur_offset + envelope_size;
1638            if 15 > max_ordinal {
1639                return Ok(());
1640            }
1641
1642            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1643            // are envelope_size bytes.
1644            let cur_offset: usize = (15 - 1) * envelope_size;
1645
1646            // Zero reserved fields.
1647            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1648
1649            // Safety:
1650            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1651            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1652            //   envelope_size bytes, there is always sufficient room.
1653            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1654                self.vmo_reclaim_newest_bytes
1655                    .as_ref()
1656                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1657                encoder,
1658                offset + cur_offset,
1659                depth,
1660            )?;
1661
1662            _prev_end_offset = cur_offset + envelope_size;
1663            if 16 > max_ordinal {
1664                return Ok(());
1665            }
1666
1667            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1668            // are envelope_size bytes.
1669            let cur_offset: usize = (16 - 1) * envelope_size;
1670
1671            // Zero reserved fields.
1672            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1673
1674            // Safety:
1675            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1676            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1677            //   envelope_size bytes, there is always sufficient room.
1678            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1679                self.vmo_reclaim_oldest_bytes
1680                    .as_ref()
1681                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1682                encoder,
1683                offset + cur_offset,
1684                depth,
1685            )?;
1686
1687            _prev_end_offset = cur_offset + envelope_size;
1688            if 17 > max_ordinal {
1689                return Ok(());
1690            }
1691
1692            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1693            // are envelope_size bytes.
1694            let cur_offset: usize = (17 - 1) * envelope_size;
1695
1696            // Zero reserved fields.
1697            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1698
1699            // Safety:
1700            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1701            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1702            //   envelope_size bytes, there is always sufficient room.
1703            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1704                self.vmo_reclaim_disabled_bytes
1705                    .as_ref()
1706                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1707                encoder,
1708                offset + cur_offset,
1709                depth,
1710            )?;
1711
1712            _prev_end_offset = cur_offset + envelope_size;
1713            if 18 > max_ordinal {
1714                return Ok(());
1715            }
1716
1717            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1718            // are envelope_size bytes.
1719            let cur_offset: usize = (18 - 1) * envelope_size;
1720
1721            // Zero reserved fields.
1722            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1723
1724            // Safety:
1725            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1726            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1727            //   envelope_size bytes, there is always sufficient room.
1728            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1729                self.vmo_discardable_locked_bytes
1730                    .as_ref()
1731                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1732                encoder,
1733                offset + cur_offset,
1734                depth,
1735            )?;
1736
1737            _prev_end_offset = cur_offset + envelope_size;
1738            if 19 > max_ordinal {
1739                return Ok(());
1740            }
1741
1742            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1743            // are envelope_size bytes.
1744            let cur_offset: usize = (19 - 1) * envelope_size;
1745
1746            // Zero reserved fields.
1747            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1748
1749            // Safety:
1750            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1751            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1752            //   envelope_size bytes, there is always sufficient room.
1753            fidl::encoding::encode_in_envelope_optional::<u64, D>(
1754                self.vmo_discardable_unlocked_bytes
1755                    .as_ref()
1756                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
1757                encoder,
1758                offset + cur_offset,
1759                depth,
1760            )?;
1761
1762            _prev_end_offset = cur_offset + envelope_size;
1763
1764            Ok(())
1765        }
1766    }
1767
1768    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MemoryStats {
1769        #[inline(always)]
1770        fn new_empty() -> Self {
1771            Self::default()
1772        }
1773
1774        unsafe fn decode(
1775            &mut self,
1776            decoder: &mut fidl::encoding::Decoder<'_, D>,
1777            offset: usize,
1778            mut depth: fidl::encoding::Depth,
1779        ) -> fidl::Result<()> {
1780            decoder.debug_check_bounds::<Self>(offset);
1781            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1782                None => return Err(fidl::Error::NotNullable),
1783                Some(len) => len,
1784            };
1785            // Calling decoder.out_of_line_offset(0) is not allowed.
1786            if len == 0 {
1787                return Ok(());
1788            };
1789            depth.increment()?;
1790            let envelope_size = 8;
1791            let bytes_len = len * envelope_size;
1792            let offset = decoder.out_of_line_offset(bytes_len)?;
1793            // Decode the envelope for each type.
1794            let mut _next_ordinal_to_read = 0;
1795            let mut next_offset = offset;
1796            let end_offset = offset + bytes_len;
1797            _next_ordinal_to_read += 1;
1798            if next_offset >= end_offset {
1799                return Ok(());
1800            }
1801
1802            // Decode unknown envelopes for gaps in ordinals.
1803            while _next_ordinal_to_read < 1 {
1804                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1805                _next_ordinal_to_read += 1;
1806                next_offset += envelope_size;
1807            }
1808
1809            let next_out_of_line = decoder.next_out_of_line();
1810            let handles_before = decoder.remaining_handles();
1811            if let Some((inlined, num_bytes, num_handles)) =
1812                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1813            {
1814                let member_inline_size =
1815                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1816                if inlined != (member_inline_size <= 4) {
1817                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1818                }
1819                let inner_offset;
1820                let mut inner_depth = depth.clone();
1821                if inlined {
1822                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1823                    inner_offset = next_offset;
1824                } else {
1825                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1826                    inner_depth.increment()?;
1827                }
1828                let val_ref = self.total_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
1829                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
1830                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1831                {
1832                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1833                }
1834                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1835                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1836                }
1837            }
1838
1839            next_offset += envelope_size;
1840            _next_ordinal_to_read += 1;
1841            if next_offset >= end_offset {
1842                return Ok(());
1843            }
1844
1845            // Decode unknown envelopes for gaps in ordinals.
1846            while _next_ordinal_to_read < 2 {
1847                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1848                _next_ordinal_to_read += 1;
1849                next_offset += envelope_size;
1850            }
1851
1852            let next_out_of_line = decoder.next_out_of_line();
1853            let handles_before = decoder.remaining_handles();
1854            if let Some((inlined, num_bytes, num_handles)) =
1855                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1856            {
1857                let member_inline_size =
1858                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1859                if inlined != (member_inline_size <= 4) {
1860                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1861                }
1862                let inner_offset;
1863                let mut inner_depth = depth.clone();
1864                if inlined {
1865                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1866                    inner_offset = next_offset;
1867                } else {
1868                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1869                    inner_depth.increment()?;
1870                }
1871                let val_ref = self.free_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
1872                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
1873                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1874                {
1875                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1876                }
1877                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1878                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1879                }
1880            }
1881
1882            next_offset += envelope_size;
1883            _next_ordinal_to_read += 1;
1884            if next_offset >= end_offset {
1885                return Ok(());
1886            }
1887
1888            // Decode unknown envelopes for gaps in ordinals.
1889            while _next_ordinal_to_read < 3 {
1890                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1891                _next_ordinal_to_read += 1;
1892                next_offset += envelope_size;
1893            }
1894
1895            let next_out_of_line = decoder.next_out_of_line();
1896            let handles_before = decoder.remaining_handles();
1897            if let Some((inlined, num_bytes, num_handles)) =
1898                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1899            {
1900                let member_inline_size =
1901                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1902                if inlined != (member_inline_size <= 4) {
1903                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1904                }
1905                let inner_offset;
1906                let mut inner_depth = depth.clone();
1907                if inlined {
1908                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1909                    inner_offset = next_offset;
1910                } else {
1911                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1912                    inner_depth.increment()?;
1913                }
1914                let val_ref = self.wired_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
1915                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
1916                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1917                {
1918                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1919                }
1920                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1921                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1922                }
1923            }
1924
1925            next_offset += envelope_size;
1926            _next_ordinal_to_read += 1;
1927            if next_offset >= end_offset {
1928                return Ok(());
1929            }
1930
1931            // Decode unknown envelopes for gaps in ordinals.
1932            while _next_ordinal_to_read < 4 {
1933                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1934                _next_ordinal_to_read += 1;
1935                next_offset += envelope_size;
1936            }
1937
1938            let next_out_of_line = decoder.next_out_of_line();
1939            let handles_before = decoder.remaining_handles();
1940            if let Some((inlined, num_bytes, num_handles)) =
1941                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1942            {
1943                let member_inline_size =
1944                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1945                if inlined != (member_inline_size <= 4) {
1946                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1947                }
1948                let inner_offset;
1949                let mut inner_depth = depth.clone();
1950                if inlined {
1951                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1952                    inner_offset = next_offset;
1953                } else {
1954                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1955                    inner_depth.increment()?;
1956                }
1957                let val_ref = self.total_heap_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
1958                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
1959                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1960                {
1961                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1962                }
1963                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1964                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1965                }
1966            }
1967
1968            next_offset += envelope_size;
1969            _next_ordinal_to_read += 1;
1970            if next_offset >= end_offset {
1971                return Ok(());
1972            }
1973
1974            // Decode unknown envelopes for gaps in ordinals.
1975            while _next_ordinal_to_read < 5 {
1976                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1977                _next_ordinal_to_read += 1;
1978                next_offset += envelope_size;
1979            }
1980
1981            let next_out_of_line = decoder.next_out_of_line();
1982            let handles_before = decoder.remaining_handles();
1983            if let Some((inlined, num_bytes, num_handles)) =
1984                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1985            {
1986                let member_inline_size =
1987                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1988                if inlined != (member_inline_size <= 4) {
1989                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1990                }
1991                let inner_offset;
1992                let mut inner_depth = depth.clone();
1993                if inlined {
1994                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1995                    inner_offset = next_offset;
1996                } else {
1997                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1998                    inner_depth.increment()?;
1999                }
2000                let val_ref = self.free_heap_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
2001                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2002                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2003                {
2004                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2005                }
2006                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2007                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2008                }
2009            }
2010
2011            next_offset += envelope_size;
2012            _next_ordinal_to_read += 1;
2013            if next_offset >= end_offset {
2014                return Ok(());
2015            }
2016
2017            // Decode unknown envelopes for gaps in ordinals.
2018            while _next_ordinal_to_read < 6 {
2019                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2020                _next_ordinal_to_read += 1;
2021                next_offset += envelope_size;
2022            }
2023
2024            let next_out_of_line = decoder.next_out_of_line();
2025            let handles_before = decoder.remaining_handles();
2026            if let Some((inlined, num_bytes, num_handles)) =
2027                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2028            {
2029                let member_inline_size =
2030                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2031                if inlined != (member_inline_size <= 4) {
2032                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2033                }
2034                let inner_offset;
2035                let mut inner_depth = depth.clone();
2036                if inlined {
2037                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2038                    inner_offset = next_offset;
2039                } else {
2040                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2041                    inner_depth.increment()?;
2042                }
2043                let val_ref = self.vmo_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
2044                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2045                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2046                {
2047                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2048                }
2049                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2050                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2051                }
2052            }
2053
2054            next_offset += envelope_size;
2055            _next_ordinal_to_read += 1;
2056            if next_offset >= end_offset {
2057                return Ok(());
2058            }
2059
2060            // Decode unknown envelopes for gaps in ordinals.
2061            while _next_ordinal_to_read < 7 {
2062                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2063                _next_ordinal_to_read += 1;
2064                next_offset += envelope_size;
2065            }
2066
2067            let next_out_of_line = decoder.next_out_of_line();
2068            let handles_before = decoder.remaining_handles();
2069            if let Some((inlined, num_bytes, num_handles)) =
2070                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2071            {
2072                let member_inline_size =
2073                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2074                if inlined != (member_inline_size <= 4) {
2075                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2076                }
2077                let inner_offset;
2078                let mut inner_depth = depth.clone();
2079                if inlined {
2080                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2081                    inner_offset = next_offset;
2082                } else {
2083                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2084                    inner_depth.increment()?;
2085                }
2086                let val_ref =
2087                    self.mmu_overhead_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
2088                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2089                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2090                {
2091                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2092                }
2093                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2094                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2095                }
2096            }
2097
2098            next_offset += envelope_size;
2099            _next_ordinal_to_read += 1;
2100            if next_offset >= end_offset {
2101                return Ok(());
2102            }
2103
2104            // Decode unknown envelopes for gaps in ordinals.
2105            while _next_ordinal_to_read < 8 {
2106                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2107                _next_ordinal_to_read += 1;
2108                next_offset += envelope_size;
2109            }
2110
2111            let next_out_of_line = decoder.next_out_of_line();
2112            let handles_before = decoder.remaining_handles();
2113            if let Some((inlined, num_bytes, num_handles)) =
2114                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2115            {
2116                let member_inline_size =
2117                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2118                if inlined != (member_inline_size <= 4) {
2119                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2120                }
2121                let inner_offset;
2122                let mut inner_depth = depth.clone();
2123                if inlined {
2124                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2125                    inner_offset = next_offset;
2126                } else {
2127                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2128                    inner_depth.increment()?;
2129                }
2130                let val_ref = self.ipc_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
2131                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2132                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2133                {
2134                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2135                }
2136                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2137                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2138                }
2139            }
2140
2141            next_offset += envelope_size;
2142            _next_ordinal_to_read += 1;
2143            if next_offset >= end_offset {
2144                return Ok(());
2145            }
2146
2147            // Decode unknown envelopes for gaps in ordinals.
2148            while _next_ordinal_to_read < 9 {
2149                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2150                _next_ordinal_to_read += 1;
2151                next_offset += envelope_size;
2152            }
2153
2154            let next_out_of_line = decoder.next_out_of_line();
2155            let handles_before = decoder.remaining_handles();
2156            if let Some((inlined, num_bytes, num_handles)) =
2157                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2158            {
2159                let member_inline_size =
2160                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2161                if inlined != (member_inline_size <= 4) {
2162                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2163                }
2164                let inner_offset;
2165                let mut inner_depth = depth.clone();
2166                if inlined {
2167                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2168                    inner_offset = next_offset;
2169                } else {
2170                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2171                    inner_depth.increment()?;
2172                }
2173                let val_ref = self.other_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
2174                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2175                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2176                {
2177                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2178                }
2179                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2180                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2181                }
2182            }
2183
2184            next_offset += envelope_size;
2185            _next_ordinal_to_read += 1;
2186            if next_offset >= end_offset {
2187                return Ok(());
2188            }
2189
2190            // Decode unknown envelopes for gaps in ordinals.
2191            while _next_ordinal_to_read < 10 {
2192                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2193                _next_ordinal_to_read += 1;
2194                next_offset += envelope_size;
2195            }
2196
2197            let next_out_of_line = decoder.next_out_of_line();
2198            let handles_before = decoder.remaining_handles();
2199            if let Some((inlined, num_bytes, num_handles)) =
2200                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2201            {
2202                let member_inline_size =
2203                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2204                if inlined != (member_inline_size <= 4) {
2205                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2206                }
2207                let inner_offset;
2208                let mut inner_depth = depth.clone();
2209                if inlined {
2210                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2211                    inner_offset = next_offset;
2212                } else {
2213                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2214                    inner_depth.increment()?;
2215                }
2216                let val_ref =
2217                    self.free_loaned_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
2218                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2219                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2220                {
2221                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2222                }
2223                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2224                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2225                }
2226            }
2227
2228            next_offset += envelope_size;
2229            _next_ordinal_to_read += 1;
2230            if next_offset >= end_offset {
2231                return Ok(());
2232            }
2233
2234            // Decode unknown envelopes for gaps in ordinals.
2235            while _next_ordinal_to_read < 11 {
2236                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2237                _next_ordinal_to_read += 1;
2238                next_offset += envelope_size;
2239            }
2240
2241            let next_out_of_line = decoder.next_out_of_line();
2242            let handles_before = decoder.remaining_handles();
2243            if let Some((inlined, num_bytes, num_handles)) =
2244                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2245            {
2246                let member_inline_size =
2247                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2248                if inlined != (member_inline_size <= 4) {
2249                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2250                }
2251                let inner_offset;
2252                let mut inner_depth = depth.clone();
2253                if inlined {
2254                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2255                    inner_offset = next_offset;
2256                } else {
2257                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2258                    inner_depth.increment()?;
2259                }
2260                let val_ref = self.cache_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
2261                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2262                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2263                {
2264                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2265                }
2266                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2267                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2268                }
2269            }
2270
2271            next_offset += envelope_size;
2272            _next_ordinal_to_read += 1;
2273            if next_offset >= end_offset {
2274                return Ok(());
2275            }
2276
2277            // Decode unknown envelopes for gaps in ordinals.
2278            while _next_ordinal_to_read < 12 {
2279                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2280                _next_ordinal_to_read += 1;
2281                next_offset += envelope_size;
2282            }
2283
2284            let next_out_of_line = decoder.next_out_of_line();
2285            let handles_before = decoder.remaining_handles();
2286            if let Some((inlined, num_bytes, num_handles)) =
2287                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2288            {
2289                let member_inline_size =
2290                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2291                if inlined != (member_inline_size <= 4) {
2292                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2293                }
2294                let inner_offset;
2295                let mut inner_depth = depth.clone();
2296                if inlined {
2297                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2298                    inner_offset = next_offset;
2299                } else {
2300                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2301                    inner_depth.increment()?;
2302                }
2303                let val_ref = self.slab_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
2304                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2305                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2306                {
2307                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2308                }
2309                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2310                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2311                }
2312            }
2313
2314            next_offset += envelope_size;
2315            _next_ordinal_to_read += 1;
2316            if next_offset >= end_offset {
2317                return Ok(());
2318            }
2319
2320            // Decode unknown envelopes for gaps in ordinals.
2321            while _next_ordinal_to_read < 13 {
2322                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2323                _next_ordinal_to_read += 1;
2324                next_offset += envelope_size;
2325            }
2326
2327            let next_out_of_line = decoder.next_out_of_line();
2328            let handles_before = decoder.remaining_handles();
2329            if let Some((inlined, num_bytes, num_handles)) =
2330                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2331            {
2332                let member_inline_size =
2333                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2334                if inlined != (member_inline_size <= 4) {
2335                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2336                }
2337                let inner_offset;
2338                let mut inner_depth = depth.clone();
2339                if inlined {
2340                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2341                    inner_offset = next_offset;
2342                } else {
2343                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2344                    inner_depth.increment()?;
2345                }
2346                let val_ref = self.zram_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
2347                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2348                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2349                {
2350                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2351                }
2352                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2353                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2354                }
2355            }
2356
2357            next_offset += envelope_size;
2358            _next_ordinal_to_read += 1;
2359            if next_offset >= end_offset {
2360                return Ok(());
2361            }
2362
2363            // Decode unknown envelopes for gaps in ordinals.
2364            while _next_ordinal_to_read < 14 {
2365                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2366                _next_ordinal_to_read += 1;
2367                next_offset += envelope_size;
2368            }
2369
2370            let next_out_of_line = decoder.next_out_of_line();
2371            let handles_before = decoder.remaining_handles();
2372            if let Some((inlined, num_bytes, num_handles)) =
2373                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2374            {
2375                let member_inline_size =
2376                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2377                if inlined != (member_inline_size <= 4) {
2378                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2379                }
2380                let inner_offset;
2381                let mut inner_depth = depth.clone();
2382                if inlined {
2383                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2384                    inner_offset = next_offset;
2385                } else {
2386                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2387                    inner_depth.increment()?;
2388                }
2389                let val_ref =
2390                    self.vmo_reclaim_total_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
2391                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2392                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2393                {
2394                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2395                }
2396                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2397                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2398                }
2399            }
2400
2401            next_offset += envelope_size;
2402            _next_ordinal_to_read += 1;
2403            if next_offset >= end_offset {
2404                return Ok(());
2405            }
2406
2407            // Decode unknown envelopes for gaps in ordinals.
2408            while _next_ordinal_to_read < 15 {
2409                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2410                _next_ordinal_to_read += 1;
2411                next_offset += envelope_size;
2412            }
2413
2414            let next_out_of_line = decoder.next_out_of_line();
2415            let handles_before = decoder.remaining_handles();
2416            if let Some((inlined, num_bytes, num_handles)) =
2417                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2418            {
2419                let member_inline_size =
2420                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2421                if inlined != (member_inline_size <= 4) {
2422                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2423                }
2424                let inner_offset;
2425                let mut inner_depth = depth.clone();
2426                if inlined {
2427                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2428                    inner_offset = next_offset;
2429                } else {
2430                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2431                    inner_depth.increment()?;
2432                }
2433                let val_ref =
2434                    self.vmo_reclaim_newest_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
2435                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2436                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2437                {
2438                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2439                }
2440                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2441                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2442                }
2443            }
2444
2445            next_offset += envelope_size;
2446            _next_ordinal_to_read += 1;
2447            if next_offset >= end_offset {
2448                return Ok(());
2449            }
2450
2451            // Decode unknown envelopes for gaps in ordinals.
2452            while _next_ordinal_to_read < 16 {
2453                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2454                _next_ordinal_to_read += 1;
2455                next_offset += envelope_size;
2456            }
2457
2458            let next_out_of_line = decoder.next_out_of_line();
2459            let handles_before = decoder.remaining_handles();
2460            if let Some((inlined, num_bytes, num_handles)) =
2461                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2462            {
2463                let member_inline_size =
2464                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2465                if inlined != (member_inline_size <= 4) {
2466                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2467                }
2468                let inner_offset;
2469                let mut inner_depth = depth.clone();
2470                if inlined {
2471                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2472                    inner_offset = next_offset;
2473                } else {
2474                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2475                    inner_depth.increment()?;
2476                }
2477                let val_ref =
2478                    self.vmo_reclaim_oldest_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
2479                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2480                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2481                {
2482                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2483                }
2484                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2485                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2486                }
2487            }
2488
2489            next_offset += envelope_size;
2490            _next_ordinal_to_read += 1;
2491            if next_offset >= end_offset {
2492                return Ok(());
2493            }
2494
2495            // Decode unknown envelopes for gaps in ordinals.
2496            while _next_ordinal_to_read < 17 {
2497                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2498                _next_ordinal_to_read += 1;
2499                next_offset += envelope_size;
2500            }
2501
2502            let next_out_of_line = decoder.next_out_of_line();
2503            let handles_before = decoder.remaining_handles();
2504            if let Some((inlined, num_bytes, num_handles)) =
2505                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2506            {
2507                let member_inline_size =
2508                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2509                if inlined != (member_inline_size <= 4) {
2510                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2511                }
2512                let inner_offset;
2513                let mut inner_depth = depth.clone();
2514                if inlined {
2515                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2516                    inner_offset = next_offset;
2517                } else {
2518                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2519                    inner_depth.increment()?;
2520                }
2521                let val_ref =
2522                    self.vmo_reclaim_disabled_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
2523                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2524                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2525                {
2526                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2527                }
2528                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2529                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2530                }
2531            }
2532
2533            next_offset += envelope_size;
2534            _next_ordinal_to_read += 1;
2535            if next_offset >= end_offset {
2536                return Ok(());
2537            }
2538
2539            // Decode unknown envelopes for gaps in ordinals.
2540            while _next_ordinal_to_read < 18 {
2541                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2542                _next_ordinal_to_read += 1;
2543                next_offset += envelope_size;
2544            }
2545
2546            let next_out_of_line = decoder.next_out_of_line();
2547            let handles_before = decoder.remaining_handles();
2548            if let Some((inlined, num_bytes, num_handles)) =
2549                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2550            {
2551                let member_inline_size =
2552                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2553                if inlined != (member_inline_size <= 4) {
2554                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2555                }
2556                let inner_offset;
2557                let mut inner_depth = depth.clone();
2558                if inlined {
2559                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2560                    inner_offset = next_offset;
2561                } else {
2562                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2563                    inner_depth.increment()?;
2564                }
2565                let val_ref = self
2566                    .vmo_discardable_locked_bytes
2567                    .get_or_insert_with(|| fidl::new_empty!(u64, D));
2568                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2569                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2570                {
2571                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2572                }
2573                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2574                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2575                }
2576            }
2577
2578            next_offset += envelope_size;
2579            _next_ordinal_to_read += 1;
2580            if next_offset >= end_offset {
2581                return Ok(());
2582            }
2583
2584            // Decode unknown envelopes for gaps in ordinals.
2585            while _next_ordinal_to_read < 19 {
2586                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2587                _next_ordinal_to_read += 1;
2588                next_offset += envelope_size;
2589            }
2590
2591            let next_out_of_line = decoder.next_out_of_line();
2592            let handles_before = decoder.remaining_handles();
2593            if let Some((inlined, num_bytes, num_handles)) =
2594                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2595            {
2596                let member_inline_size =
2597                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2598                if inlined != (member_inline_size <= 4) {
2599                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2600                }
2601                let inner_offset;
2602                let mut inner_depth = depth.clone();
2603                if inlined {
2604                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2605                    inner_offset = next_offset;
2606                } else {
2607                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2608                    inner_depth.increment()?;
2609                }
2610                let val_ref = self
2611                    .vmo_discardable_unlocked_bytes
2612                    .get_or_insert_with(|| fidl::new_empty!(u64, D));
2613                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2614                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2615                {
2616                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2617                }
2618                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2619                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2620                }
2621            }
2622
2623            next_offset += envelope_size;
2624
2625            // Decode the remaining unknown envelopes.
2626            while next_offset < end_offset {
2627                _next_ordinal_to_read += 1;
2628                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2629                next_offset += envelope_size;
2630            }
2631
2632            Ok(())
2633        }
2634    }
2635
2636    impl MemoryStatsCompression {
2637        #[inline(always)]
2638        fn max_ordinal_present(&self) -> u64 {
2639            if let Some(_) = self.pages_decompressed_within_log_time {
2640                return 14;
2641            }
2642            if let Some(_) = self.pages_decompressed_unit_ns {
2643                return 13;
2644            }
2645            if let Some(_) = self.critical_memory_page_compressions {
2646                return 12;
2647            }
2648            if let Some(_) = self.memory_pressure_page_compressions {
2649                return 11;
2650            }
2651            if let Some(_) = self.eager_page_compressions {
2652                return 10;
2653            }
2654            if let Some(_) = self.compressed_page_evictions {
2655                return 9;
2656            }
2657            if let Some(_) = self.total_page_decompressions {
2658                return 8;
2659            }
2660            if let Some(_) = self.failed_page_compression_attempts {
2661                return 7;
2662            }
2663            if let Some(_) = self.total_page_compression_attempts {
2664                return 6;
2665            }
2666            if let Some(_) = self.decompression_time {
2667                return 5;
2668            }
2669            if let Some(_) = self.compression_time {
2670                return 4;
2671            }
2672            if let Some(_) = self.compressed_fragmentation_bytes {
2673                return 3;
2674            }
2675            if let Some(_) = self.compressed_storage_bytes {
2676                return 2;
2677            }
2678            if let Some(_) = self.uncompressed_storage_bytes {
2679                return 1;
2680            }
2681            0
2682        }
2683    }
2684
2685    impl fidl::encoding::ValueTypeMarker for MemoryStatsCompression {
2686        type Borrowed<'a> = &'a Self;
2687        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2688            value
2689        }
2690    }
2691
2692    unsafe impl fidl::encoding::TypeMarker for MemoryStatsCompression {
2693        type Owned = Self;
2694
2695        #[inline(always)]
2696        fn inline_align(_context: fidl::encoding::Context) -> usize {
2697            8
2698        }
2699
2700        #[inline(always)]
2701        fn inline_size(_context: fidl::encoding::Context) -> usize {
2702            16
2703        }
2704    }
2705
2706    unsafe impl<D: fidl::encoding::ResourceDialect>
2707        fidl::encoding::Encode<MemoryStatsCompression, D> for &MemoryStatsCompression
2708    {
2709        unsafe fn encode(
2710            self,
2711            encoder: &mut fidl::encoding::Encoder<'_, D>,
2712            offset: usize,
2713            mut depth: fidl::encoding::Depth,
2714        ) -> fidl::Result<()> {
2715            encoder.debug_check_bounds::<MemoryStatsCompression>(offset);
2716            // Vector header
2717            let max_ordinal: u64 = self.max_ordinal_present();
2718            encoder.write_num(max_ordinal, offset);
2719            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2720            // Calling encoder.out_of_line_offset(0) is not allowed.
2721            if max_ordinal == 0 {
2722                return Ok(());
2723            }
2724            depth.increment()?;
2725            let envelope_size = 8;
2726            let bytes_len = max_ordinal as usize * envelope_size;
2727            #[allow(unused_variables)]
2728            let offset = encoder.out_of_line_offset(bytes_len);
2729            let mut _prev_end_offset: usize = 0;
2730            if 1 > max_ordinal {
2731                return Ok(());
2732            }
2733
2734            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2735            // are envelope_size bytes.
2736            let cur_offset: usize = (1 - 1) * envelope_size;
2737
2738            // Zero reserved fields.
2739            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2740
2741            // Safety:
2742            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2743            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2744            //   envelope_size bytes, there is always sufficient room.
2745            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2746                self.uncompressed_storage_bytes
2747                    .as_ref()
2748                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2749                encoder,
2750                offset + cur_offset,
2751                depth,
2752            )?;
2753
2754            _prev_end_offset = cur_offset + envelope_size;
2755            if 2 > max_ordinal {
2756                return Ok(());
2757            }
2758
2759            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2760            // are envelope_size bytes.
2761            let cur_offset: usize = (2 - 1) * envelope_size;
2762
2763            // Zero reserved fields.
2764            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2765
2766            // Safety:
2767            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2768            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2769            //   envelope_size bytes, there is always sufficient room.
2770            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2771                self.compressed_storage_bytes
2772                    .as_ref()
2773                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2774                encoder,
2775                offset + cur_offset,
2776                depth,
2777            )?;
2778
2779            _prev_end_offset = cur_offset + envelope_size;
2780            if 3 > max_ordinal {
2781                return Ok(());
2782            }
2783
2784            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2785            // are envelope_size bytes.
2786            let cur_offset: usize = (3 - 1) * envelope_size;
2787
2788            // Zero reserved fields.
2789            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2790
2791            // Safety:
2792            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2793            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2794            //   envelope_size bytes, there is always sufficient room.
2795            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2796                self.compressed_fragmentation_bytes
2797                    .as_ref()
2798                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2799                encoder,
2800                offset + cur_offset,
2801                depth,
2802            )?;
2803
2804            _prev_end_offset = cur_offset + envelope_size;
2805            if 4 > max_ordinal {
2806                return Ok(());
2807            }
2808
2809            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2810            // are envelope_size bytes.
2811            let cur_offset: usize = (4 - 1) * envelope_size;
2812
2813            // Zero reserved fields.
2814            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2815
2816            // Safety:
2817            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2818            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2819            //   envelope_size bytes, there is always sufficient room.
2820            fidl::encoding::encode_in_envelope_optional::<i64, D>(
2821                self.compression_time
2822                    .as_ref()
2823                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2824                encoder,
2825                offset + cur_offset,
2826                depth,
2827            )?;
2828
2829            _prev_end_offset = cur_offset + envelope_size;
2830            if 5 > max_ordinal {
2831                return Ok(());
2832            }
2833
2834            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2835            // are envelope_size bytes.
2836            let cur_offset: usize = (5 - 1) * envelope_size;
2837
2838            // Zero reserved fields.
2839            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2840
2841            // Safety:
2842            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2843            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2844            //   envelope_size bytes, there is always sufficient room.
2845            fidl::encoding::encode_in_envelope_optional::<i64, D>(
2846                self.decompression_time
2847                    .as_ref()
2848                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2849                encoder,
2850                offset + cur_offset,
2851                depth,
2852            )?;
2853
2854            _prev_end_offset = cur_offset + envelope_size;
2855            if 6 > max_ordinal {
2856                return Ok(());
2857            }
2858
2859            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2860            // are envelope_size bytes.
2861            let cur_offset: usize = (6 - 1) * envelope_size;
2862
2863            // Zero reserved fields.
2864            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2865
2866            // Safety:
2867            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2868            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2869            //   envelope_size bytes, there is always sufficient room.
2870            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2871                self.total_page_compression_attempts
2872                    .as_ref()
2873                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2874                encoder,
2875                offset + cur_offset,
2876                depth,
2877            )?;
2878
2879            _prev_end_offset = cur_offset + envelope_size;
2880            if 7 > max_ordinal {
2881                return Ok(());
2882            }
2883
2884            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2885            // are envelope_size bytes.
2886            let cur_offset: usize = (7 - 1) * envelope_size;
2887
2888            // Zero reserved fields.
2889            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2890
2891            // Safety:
2892            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2893            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2894            //   envelope_size bytes, there is always sufficient room.
2895            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2896                self.failed_page_compression_attempts
2897                    .as_ref()
2898                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2899                encoder,
2900                offset + cur_offset,
2901                depth,
2902            )?;
2903
2904            _prev_end_offset = cur_offset + envelope_size;
2905            if 8 > max_ordinal {
2906                return Ok(());
2907            }
2908
2909            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2910            // are envelope_size bytes.
2911            let cur_offset: usize = (8 - 1) * envelope_size;
2912
2913            // Zero reserved fields.
2914            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2915
2916            // Safety:
2917            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2918            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2919            //   envelope_size bytes, there is always sufficient room.
2920            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2921                self.total_page_decompressions
2922                    .as_ref()
2923                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2924                encoder,
2925                offset + cur_offset,
2926                depth,
2927            )?;
2928
2929            _prev_end_offset = cur_offset + envelope_size;
2930            if 9 > max_ordinal {
2931                return Ok(());
2932            }
2933
2934            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2935            // are envelope_size bytes.
2936            let cur_offset: usize = (9 - 1) * envelope_size;
2937
2938            // Zero reserved fields.
2939            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2940
2941            // Safety:
2942            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2943            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2944            //   envelope_size bytes, there is always sufficient room.
2945            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2946                self.compressed_page_evictions
2947                    .as_ref()
2948                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2949                encoder,
2950                offset + cur_offset,
2951                depth,
2952            )?;
2953
2954            _prev_end_offset = cur_offset + envelope_size;
2955            if 10 > max_ordinal {
2956                return Ok(());
2957            }
2958
2959            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2960            // are envelope_size bytes.
2961            let cur_offset: usize = (10 - 1) * envelope_size;
2962
2963            // Zero reserved fields.
2964            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2965
2966            // Safety:
2967            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2968            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2969            //   envelope_size bytes, there is always sufficient room.
2970            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2971                self.eager_page_compressions
2972                    .as_ref()
2973                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2974                encoder,
2975                offset + cur_offset,
2976                depth,
2977            )?;
2978
2979            _prev_end_offset = cur_offset + envelope_size;
2980            if 11 > max_ordinal {
2981                return Ok(());
2982            }
2983
2984            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2985            // are envelope_size bytes.
2986            let cur_offset: usize = (11 - 1) * envelope_size;
2987
2988            // Zero reserved fields.
2989            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2990
2991            // Safety:
2992            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2993            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2994            //   envelope_size bytes, there is always sufficient room.
2995            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2996                self.memory_pressure_page_compressions
2997                    .as_ref()
2998                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2999                encoder,
3000                offset + cur_offset,
3001                depth,
3002            )?;
3003
3004            _prev_end_offset = cur_offset + envelope_size;
3005            if 12 > max_ordinal {
3006                return Ok(());
3007            }
3008
3009            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3010            // are envelope_size bytes.
3011            let cur_offset: usize = (12 - 1) * envelope_size;
3012
3013            // Zero reserved fields.
3014            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3015
3016            // Safety:
3017            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3018            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3019            //   envelope_size bytes, there is always sufficient room.
3020            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3021                self.critical_memory_page_compressions
3022                    .as_ref()
3023                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3024                encoder,
3025                offset + cur_offset,
3026                depth,
3027            )?;
3028
3029            _prev_end_offset = cur_offset + envelope_size;
3030            if 13 > max_ordinal {
3031                return Ok(());
3032            }
3033
3034            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3035            // are envelope_size bytes.
3036            let cur_offset: usize = (13 - 1) * envelope_size;
3037
3038            // Zero reserved fields.
3039            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3040
3041            // Safety:
3042            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3043            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3044            //   envelope_size bytes, there is always sufficient room.
3045            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3046                self.pages_decompressed_unit_ns
3047                    .as_ref()
3048                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3049                encoder,
3050                offset + cur_offset,
3051                depth,
3052            )?;
3053
3054            _prev_end_offset = cur_offset + envelope_size;
3055            if 14 > max_ordinal {
3056                return Ok(());
3057            }
3058
3059            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3060            // are envelope_size bytes.
3061            let cur_offset: usize = (14 - 1) * envelope_size;
3062
3063            // Zero reserved fields.
3064            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3065
3066            // Safety:
3067            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3068            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3069            //   envelope_size bytes, there is always sufficient room.
3070            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u64, 8>, D>(
3071                self.pages_decompressed_within_log_time.as_ref().map(
3072                    <fidl::encoding::Array<u64, 8> as fidl::encoding::ValueTypeMarker>::borrow,
3073                ),
3074                encoder,
3075                offset + cur_offset,
3076                depth,
3077            )?;
3078
3079            _prev_end_offset = cur_offset + envelope_size;
3080
3081            Ok(())
3082        }
3083    }
3084
3085    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3086        for MemoryStatsCompression
3087    {
3088        #[inline(always)]
3089        fn new_empty() -> Self {
3090            Self::default()
3091        }
3092
3093        unsafe fn decode(
3094            &mut self,
3095            decoder: &mut fidl::encoding::Decoder<'_, D>,
3096            offset: usize,
3097            mut depth: fidl::encoding::Depth,
3098        ) -> fidl::Result<()> {
3099            decoder.debug_check_bounds::<Self>(offset);
3100            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3101                None => return Err(fidl::Error::NotNullable),
3102                Some(len) => len,
3103            };
3104            // Calling decoder.out_of_line_offset(0) is not allowed.
3105            if len == 0 {
3106                return Ok(());
3107            };
3108            depth.increment()?;
3109            let envelope_size = 8;
3110            let bytes_len = len * envelope_size;
3111            let offset = decoder.out_of_line_offset(bytes_len)?;
3112            // Decode the envelope for each type.
3113            let mut _next_ordinal_to_read = 0;
3114            let mut next_offset = offset;
3115            let end_offset = offset + bytes_len;
3116            _next_ordinal_to_read += 1;
3117            if next_offset >= end_offset {
3118                return Ok(());
3119            }
3120
3121            // Decode unknown envelopes for gaps in ordinals.
3122            while _next_ordinal_to_read < 1 {
3123                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3124                _next_ordinal_to_read += 1;
3125                next_offset += envelope_size;
3126            }
3127
3128            let next_out_of_line = decoder.next_out_of_line();
3129            let handles_before = decoder.remaining_handles();
3130            if let Some((inlined, num_bytes, num_handles)) =
3131                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3132            {
3133                let member_inline_size =
3134                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3135                if inlined != (member_inline_size <= 4) {
3136                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3137                }
3138                let inner_offset;
3139                let mut inner_depth = depth.clone();
3140                if inlined {
3141                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3142                    inner_offset = next_offset;
3143                } else {
3144                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3145                    inner_depth.increment()?;
3146                }
3147                let val_ref =
3148                    self.uncompressed_storage_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
3149                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3150                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3151                {
3152                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3153                }
3154                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3155                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3156                }
3157            }
3158
3159            next_offset += envelope_size;
3160            _next_ordinal_to_read += 1;
3161            if next_offset >= end_offset {
3162                return Ok(());
3163            }
3164
3165            // Decode unknown envelopes for gaps in ordinals.
3166            while _next_ordinal_to_read < 2 {
3167                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3168                _next_ordinal_to_read += 1;
3169                next_offset += envelope_size;
3170            }
3171
3172            let next_out_of_line = decoder.next_out_of_line();
3173            let handles_before = decoder.remaining_handles();
3174            if let Some((inlined, num_bytes, num_handles)) =
3175                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3176            {
3177                let member_inline_size =
3178                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3179                if inlined != (member_inline_size <= 4) {
3180                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3181                }
3182                let inner_offset;
3183                let mut inner_depth = depth.clone();
3184                if inlined {
3185                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3186                    inner_offset = next_offset;
3187                } else {
3188                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3189                    inner_depth.increment()?;
3190                }
3191                let val_ref =
3192                    self.compressed_storage_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
3193                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3194                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3195                {
3196                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3197                }
3198                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3199                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3200                }
3201            }
3202
3203            next_offset += envelope_size;
3204            _next_ordinal_to_read += 1;
3205            if next_offset >= end_offset {
3206                return Ok(());
3207            }
3208
3209            // Decode unknown envelopes for gaps in ordinals.
3210            while _next_ordinal_to_read < 3 {
3211                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3212                _next_ordinal_to_read += 1;
3213                next_offset += envelope_size;
3214            }
3215
3216            let next_out_of_line = decoder.next_out_of_line();
3217            let handles_before = decoder.remaining_handles();
3218            if let Some((inlined, num_bytes, num_handles)) =
3219                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3220            {
3221                let member_inline_size =
3222                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3223                if inlined != (member_inline_size <= 4) {
3224                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3225                }
3226                let inner_offset;
3227                let mut inner_depth = depth.clone();
3228                if inlined {
3229                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3230                    inner_offset = next_offset;
3231                } else {
3232                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3233                    inner_depth.increment()?;
3234                }
3235                let val_ref = self
3236                    .compressed_fragmentation_bytes
3237                    .get_or_insert_with(|| fidl::new_empty!(u64, D));
3238                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3239                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3240                {
3241                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3242                }
3243                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3244                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3245                }
3246            }
3247
3248            next_offset += envelope_size;
3249            _next_ordinal_to_read += 1;
3250            if next_offset >= end_offset {
3251                return Ok(());
3252            }
3253
3254            // Decode unknown envelopes for gaps in ordinals.
3255            while _next_ordinal_to_read < 4 {
3256                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3257                _next_ordinal_to_read += 1;
3258                next_offset += envelope_size;
3259            }
3260
3261            let next_out_of_line = decoder.next_out_of_line();
3262            let handles_before = decoder.remaining_handles();
3263            if let Some((inlined, num_bytes, num_handles)) =
3264                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3265            {
3266                let member_inline_size =
3267                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3268                if inlined != (member_inline_size <= 4) {
3269                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3270                }
3271                let inner_offset;
3272                let mut inner_depth = depth.clone();
3273                if inlined {
3274                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3275                    inner_offset = next_offset;
3276                } else {
3277                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3278                    inner_depth.increment()?;
3279                }
3280                let val_ref = self.compression_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
3281                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3282                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3283                {
3284                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3285                }
3286                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3287                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3288                }
3289            }
3290
3291            next_offset += envelope_size;
3292            _next_ordinal_to_read += 1;
3293            if next_offset >= end_offset {
3294                return Ok(());
3295            }
3296
3297            // Decode unknown envelopes for gaps in ordinals.
3298            while _next_ordinal_to_read < 5 {
3299                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3300                _next_ordinal_to_read += 1;
3301                next_offset += envelope_size;
3302            }
3303
3304            let next_out_of_line = decoder.next_out_of_line();
3305            let handles_before = decoder.remaining_handles();
3306            if let Some((inlined, num_bytes, num_handles)) =
3307                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3308            {
3309                let member_inline_size =
3310                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3311                if inlined != (member_inline_size <= 4) {
3312                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3313                }
3314                let inner_offset;
3315                let mut inner_depth = depth.clone();
3316                if inlined {
3317                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3318                    inner_offset = next_offset;
3319                } else {
3320                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3321                    inner_depth.increment()?;
3322                }
3323                let val_ref =
3324                    self.decompression_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
3325                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3326                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3327                {
3328                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3329                }
3330                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3331                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3332                }
3333            }
3334
3335            next_offset += envelope_size;
3336            _next_ordinal_to_read += 1;
3337            if next_offset >= end_offset {
3338                return Ok(());
3339            }
3340
3341            // Decode unknown envelopes for gaps in ordinals.
3342            while _next_ordinal_to_read < 6 {
3343                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3344                _next_ordinal_to_read += 1;
3345                next_offset += envelope_size;
3346            }
3347
3348            let next_out_of_line = decoder.next_out_of_line();
3349            let handles_before = decoder.remaining_handles();
3350            if let Some((inlined, num_bytes, num_handles)) =
3351                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3352            {
3353                let member_inline_size =
3354                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3355                if inlined != (member_inline_size <= 4) {
3356                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3357                }
3358                let inner_offset;
3359                let mut inner_depth = depth.clone();
3360                if inlined {
3361                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3362                    inner_offset = next_offset;
3363                } else {
3364                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3365                    inner_depth.increment()?;
3366                }
3367                let val_ref = self
3368                    .total_page_compression_attempts
3369                    .get_or_insert_with(|| fidl::new_empty!(u64, D));
3370                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3371                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3372                {
3373                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3374                }
3375                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3376                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3377                }
3378            }
3379
3380            next_offset += envelope_size;
3381            _next_ordinal_to_read += 1;
3382            if next_offset >= end_offset {
3383                return Ok(());
3384            }
3385
3386            // Decode unknown envelopes for gaps in ordinals.
3387            while _next_ordinal_to_read < 7 {
3388                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3389                _next_ordinal_to_read += 1;
3390                next_offset += envelope_size;
3391            }
3392
3393            let next_out_of_line = decoder.next_out_of_line();
3394            let handles_before = decoder.remaining_handles();
3395            if let Some((inlined, num_bytes, num_handles)) =
3396                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3397            {
3398                let member_inline_size =
3399                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3400                if inlined != (member_inline_size <= 4) {
3401                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3402                }
3403                let inner_offset;
3404                let mut inner_depth = depth.clone();
3405                if inlined {
3406                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3407                    inner_offset = next_offset;
3408                } else {
3409                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3410                    inner_depth.increment()?;
3411                }
3412                let val_ref = self
3413                    .failed_page_compression_attempts
3414                    .get_or_insert_with(|| fidl::new_empty!(u64, D));
3415                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3416                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3417                {
3418                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3419                }
3420                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3421                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3422                }
3423            }
3424
3425            next_offset += envelope_size;
3426            _next_ordinal_to_read += 1;
3427            if next_offset >= end_offset {
3428                return Ok(());
3429            }
3430
3431            // Decode unknown envelopes for gaps in ordinals.
3432            while _next_ordinal_to_read < 8 {
3433                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3434                _next_ordinal_to_read += 1;
3435                next_offset += envelope_size;
3436            }
3437
3438            let next_out_of_line = decoder.next_out_of_line();
3439            let handles_before = decoder.remaining_handles();
3440            if let Some((inlined, num_bytes, num_handles)) =
3441                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3442            {
3443                let member_inline_size =
3444                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3445                if inlined != (member_inline_size <= 4) {
3446                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3447                }
3448                let inner_offset;
3449                let mut inner_depth = depth.clone();
3450                if inlined {
3451                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3452                    inner_offset = next_offset;
3453                } else {
3454                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3455                    inner_depth.increment()?;
3456                }
3457                let val_ref =
3458                    self.total_page_decompressions.get_or_insert_with(|| fidl::new_empty!(u64, D));
3459                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3460                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3461                {
3462                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3463                }
3464                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3465                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3466                }
3467            }
3468
3469            next_offset += envelope_size;
3470            _next_ordinal_to_read += 1;
3471            if next_offset >= end_offset {
3472                return Ok(());
3473            }
3474
3475            // Decode unknown envelopes for gaps in ordinals.
3476            while _next_ordinal_to_read < 9 {
3477                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3478                _next_ordinal_to_read += 1;
3479                next_offset += envelope_size;
3480            }
3481
3482            let next_out_of_line = decoder.next_out_of_line();
3483            let handles_before = decoder.remaining_handles();
3484            if let Some((inlined, num_bytes, num_handles)) =
3485                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3486            {
3487                let member_inline_size =
3488                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3489                if inlined != (member_inline_size <= 4) {
3490                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3491                }
3492                let inner_offset;
3493                let mut inner_depth = depth.clone();
3494                if inlined {
3495                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3496                    inner_offset = next_offset;
3497                } else {
3498                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3499                    inner_depth.increment()?;
3500                }
3501                let val_ref =
3502                    self.compressed_page_evictions.get_or_insert_with(|| fidl::new_empty!(u64, D));
3503                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3504                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3505                {
3506                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3507                }
3508                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3509                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3510                }
3511            }
3512
3513            next_offset += envelope_size;
3514            _next_ordinal_to_read += 1;
3515            if next_offset >= end_offset {
3516                return Ok(());
3517            }
3518
3519            // Decode unknown envelopes for gaps in ordinals.
3520            while _next_ordinal_to_read < 10 {
3521                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3522                _next_ordinal_to_read += 1;
3523                next_offset += envelope_size;
3524            }
3525
3526            let next_out_of_line = decoder.next_out_of_line();
3527            let handles_before = decoder.remaining_handles();
3528            if let Some((inlined, num_bytes, num_handles)) =
3529                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3530            {
3531                let member_inline_size =
3532                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3533                if inlined != (member_inline_size <= 4) {
3534                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3535                }
3536                let inner_offset;
3537                let mut inner_depth = depth.clone();
3538                if inlined {
3539                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3540                    inner_offset = next_offset;
3541                } else {
3542                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3543                    inner_depth.increment()?;
3544                }
3545                let val_ref =
3546                    self.eager_page_compressions.get_or_insert_with(|| fidl::new_empty!(u64, D));
3547                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3548                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3549                {
3550                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3551                }
3552                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3553                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3554                }
3555            }
3556
3557            next_offset += envelope_size;
3558            _next_ordinal_to_read += 1;
3559            if next_offset >= end_offset {
3560                return Ok(());
3561            }
3562
3563            // Decode unknown envelopes for gaps in ordinals.
3564            while _next_ordinal_to_read < 11 {
3565                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3566                _next_ordinal_to_read += 1;
3567                next_offset += envelope_size;
3568            }
3569
3570            let next_out_of_line = decoder.next_out_of_line();
3571            let handles_before = decoder.remaining_handles();
3572            if let Some((inlined, num_bytes, num_handles)) =
3573                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3574            {
3575                let member_inline_size =
3576                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3577                if inlined != (member_inline_size <= 4) {
3578                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3579                }
3580                let inner_offset;
3581                let mut inner_depth = depth.clone();
3582                if inlined {
3583                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3584                    inner_offset = next_offset;
3585                } else {
3586                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3587                    inner_depth.increment()?;
3588                }
3589                let val_ref = self
3590                    .memory_pressure_page_compressions
3591                    .get_or_insert_with(|| fidl::new_empty!(u64, D));
3592                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3593                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3594                {
3595                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3596                }
3597                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3598                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3599                }
3600            }
3601
3602            next_offset += envelope_size;
3603            _next_ordinal_to_read += 1;
3604            if next_offset >= end_offset {
3605                return Ok(());
3606            }
3607
3608            // Decode unknown envelopes for gaps in ordinals.
3609            while _next_ordinal_to_read < 12 {
3610                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3611                _next_ordinal_to_read += 1;
3612                next_offset += envelope_size;
3613            }
3614
3615            let next_out_of_line = decoder.next_out_of_line();
3616            let handles_before = decoder.remaining_handles();
3617            if let Some((inlined, num_bytes, num_handles)) =
3618                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3619            {
3620                let member_inline_size =
3621                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3622                if inlined != (member_inline_size <= 4) {
3623                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3624                }
3625                let inner_offset;
3626                let mut inner_depth = depth.clone();
3627                if inlined {
3628                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3629                    inner_offset = next_offset;
3630                } else {
3631                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3632                    inner_depth.increment()?;
3633                }
3634                let val_ref = self
3635                    .critical_memory_page_compressions
3636                    .get_or_insert_with(|| fidl::new_empty!(u64, D));
3637                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3638                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3639                {
3640                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3641                }
3642                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3643                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3644                }
3645            }
3646
3647            next_offset += envelope_size;
3648            _next_ordinal_to_read += 1;
3649            if next_offset >= end_offset {
3650                return Ok(());
3651            }
3652
3653            // Decode unknown envelopes for gaps in ordinals.
3654            while _next_ordinal_to_read < 13 {
3655                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3656                _next_ordinal_to_read += 1;
3657                next_offset += envelope_size;
3658            }
3659
3660            let next_out_of_line = decoder.next_out_of_line();
3661            let handles_before = decoder.remaining_handles();
3662            if let Some((inlined, num_bytes, num_handles)) =
3663                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3664            {
3665                let member_inline_size =
3666                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3667                if inlined != (member_inline_size <= 4) {
3668                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3669                }
3670                let inner_offset;
3671                let mut inner_depth = depth.clone();
3672                if inlined {
3673                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3674                    inner_offset = next_offset;
3675                } else {
3676                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3677                    inner_depth.increment()?;
3678                }
3679                let val_ref =
3680                    self.pages_decompressed_unit_ns.get_or_insert_with(|| fidl::new_empty!(u64, D));
3681                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3682                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3683                {
3684                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3685                }
3686                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3687                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3688                }
3689            }
3690
3691            next_offset += envelope_size;
3692            _next_ordinal_to_read += 1;
3693            if next_offset >= end_offset {
3694                return Ok(());
3695            }
3696
3697            // Decode unknown envelopes for gaps in ordinals.
3698            while _next_ordinal_to_read < 14 {
3699                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3700                _next_ordinal_to_read += 1;
3701                next_offset += envelope_size;
3702            }
3703
3704            let next_out_of_line = decoder.next_out_of_line();
3705            let handles_before = decoder.remaining_handles();
3706            if let Some((inlined, num_bytes, num_handles)) =
3707                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3708            {
3709                let member_inline_size =
3710                    <fidl::encoding::Array<u64, 8> as fidl::encoding::TypeMarker>::inline_size(
3711                        decoder.context,
3712                    );
3713                if inlined != (member_inline_size <= 4) {
3714                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3715                }
3716                let inner_offset;
3717                let mut inner_depth = depth.clone();
3718                if inlined {
3719                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3720                    inner_offset = next_offset;
3721                } else {
3722                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3723                    inner_depth.increment()?;
3724                }
3725                let val_ref = self
3726                    .pages_decompressed_within_log_time
3727                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u64, 8>, D));
3728                fidl::decode!(fidl::encoding::Array<u64, 8>, D, val_ref, decoder, inner_offset, inner_depth)?;
3729                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3730                {
3731                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3732                }
3733                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3734                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3735                }
3736            }
3737
3738            next_offset += envelope_size;
3739
3740            // Decode the remaining unknown envelopes.
3741            while next_offset < end_offset {
3742                _next_ordinal_to_read += 1;
3743                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3744                next_offset += envelope_size;
3745            }
3746
3747            Ok(())
3748        }
3749    }
3750
3751    impl MemoryStatsExtended {
3752        #[inline(always)]
3753        fn max_ordinal_present(&self) -> u64 {
3754            if let Some(_) = self.other_bytes {
3755                return 14;
3756            }
3757            if let Some(_) = self.ipc_bytes {
3758                return 13;
3759            }
3760            if let Some(_) = self.mmu_overhead_bytes {
3761                return 12;
3762            }
3763            if let Some(_) = self.vmo_discardable_unlocked_bytes {
3764                return 11;
3765            }
3766            if let Some(_) = self.vmo_discardable_locked_bytes {
3767                return 10;
3768            }
3769            if let Some(_) = self.vmo_pager_oldest_bytes {
3770                return 9;
3771            }
3772            if let Some(_) = self.vmo_pager_newest_bytes {
3773                return 8;
3774            }
3775            if let Some(_) = self.vmo_pager_total_bytes {
3776                return 7;
3777            }
3778            if let Some(_) = self.vmo_bytes {
3779                return 6;
3780            }
3781            if let Some(_) = self.free_heap_bytes {
3782                return 5;
3783            }
3784            if let Some(_) = self.total_heap_bytes {
3785                return 4;
3786            }
3787            if let Some(_) = self.wired_bytes {
3788                return 3;
3789            }
3790            if let Some(_) = self.free_bytes {
3791                return 2;
3792            }
3793            if let Some(_) = self.total_bytes {
3794                return 1;
3795            }
3796            0
3797        }
3798    }
3799
3800    impl fidl::encoding::ValueTypeMarker for MemoryStatsExtended {
3801        type Borrowed<'a> = &'a Self;
3802        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3803            value
3804        }
3805    }
3806
3807    unsafe impl fidl::encoding::TypeMarker for MemoryStatsExtended {
3808        type Owned = Self;
3809
3810        #[inline(always)]
3811        fn inline_align(_context: fidl::encoding::Context) -> usize {
3812            8
3813        }
3814
3815        #[inline(always)]
3816        fn inline_size(_context: fidl::encoding::Context) -> usize {
3817            16
3818        }
3819    }
3820
3821    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MemoryStatsExtended, D>
3822        for &MemoryStatsExtended
3823    {
3824        unsafe fn encode(
3825            self,
3826            encoder: &mut fidl::encoding::Encoder<'_, D>,
3827            offset: usize,
3828            mut depth: fidl::encoding::Depth,
3829        ) -> fidl::Result<()> {
3830            encoder.debug_check_bounds::<MemoryStatsExtended>(offset);
3831            // Vector header
3832            let max_ordinal: u64 = self.max_ordinal_present();
3833            encoder.write_num(max_ordinal, offset);
3834            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3835            // Calling encoder.out_of_line_offset(0) is not allowed.
3836            if max_ordinal == 0 {
3837                return Ok(());
3838            }
3839            depth.increment()?;
3840            let envelope_size = 8;
3841            let bytes_len = max_ordinal as usize * envelope_size;
3842            #[allow(unused_variables)]
3843            let offset = encoder.out_of_line_offset(bytes_len);
3844            let mut _prev_end_offset: usize = 0;
3845            if 1 > max_ordinal {
3846                return Ok(());
3847            }
3848
3849            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3850            // are envelope_size bytes.
3851            let cur_offset: usize = (1 - 1) * envelope_size;
3852
3853            // Zero reserved fields.
3854            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3855
3856            // Safety:
3857            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3858            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3859            //   envelope_size bytes, there is always sufficient room.
3860            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3861                self.total_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3862                encoder,
3863                offset + cur_offset,
3864                depth,
3865            )?;
3866
3867            _prev_end_offset = cur_offset + envelope_size;
3868            if 2 > max_ordinal {
3869                return Ok(());
3870            }
3871
3872            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3873            // are envelope_size bytes.
3874            let cur_offset: usize = (2 - 1) * envelope_size;
3875
3876            // Zero reserved fields.
3877            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3878
3879            // Safety:
3880            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3881            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3882            //   envelope_size bytes, there is always sufficient room.
3883            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3884                self.free_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3885                encoder,
3886                offset + cur_offset,
3887                depth,
3888            )?;
3889
3890            _prev_end_offset = cur_offset + envelope_size;
3891            if 3 > max_ordinal {
3892                return Ok(());
3893            }
3894
3895            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3896            // are envelope_size bytes.
3897            let cur_offset: usize = (3 - 1) * envelope_size;
3898
3899            // Zero reserved fields.
3900            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3901
3902            // Safety:
3903            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3904            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3905            //   envelope_size bytes, there is always sufficient room.
3906            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3907                self.wired_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3908                encoder,
3909                offset + cur_offset,
3910                depth,
3911            )?;
3912
3913            _prev_end_offset = cur_offset + envelope_size;
3914            if 4 > max_ordinal {
3915                return Ok(());
3916            }
3917
3918            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3919            // are envelope_size bytes.
3920            let cur_offset: usize = (4 - 1) * envelope_size;
3921
3922            // Zero reserved fields.
3923            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3924
3925            // Safety:
3926            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3927            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3928            //   envelope_size bytes, there is always sufficient room.
3929            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3930                self.total_heap_bytes
3931                    .as_ref()
3932                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3933                encoder,
3934                offset + cur_offset,
3935                depth,
3936            )?;
3937
3938            _prev_end_offset = cur_offset + envelope_size;
3939            if 5 > max_ordinal {
3940                return Ok(());
3941            }
3942
3943            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3944            // are envelope_size bytes.
3945            let cur_offset: usize = (5 - 1) * envelope_size;
3946
3947            // Zero reserved fields.
3948            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3949
3950            // Safety:
3951            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3952            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3953            //   envelope_size bytes, there is always sufficient room.
3954            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3955                self.free_heap_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3956                encoder,
3957                offset + cur_offset,
3958                depth,
3959            )?;
3960
3961            _prev_end_offset = cur_offset + envelope_size;
3962            if 6 > max_ordinal {
3963                return Ok(());
3964            }
3965
3966            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3967            // are envelope_size bytes.
3968            let cur_offset: usize = (6 - 1) * envelope_size;
3969
3970            // Zero reserved fields.
3971            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3972
3973            // Safety:
3974            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3975            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3976            //   envelope_size bytes, there is always sufficient room.
3977            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3978                self.vmo_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3979                encoder,
3980                offset + cur_offset,
3981                depth,
3982            )?;
3983
3984            _prev_end_offset = cur_offset + envelope_size;
3985            if 7 > max_ordinal {
3986                return Ok(());
3987            }
3988
3989            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3990            // are envelope_size bytes.
3991            let cur_offset: usize = (7 - 1) * envelope_size;
3992
3993            // Zero reserved fields.
3994            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3995
3996            // Safety:
3997            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3998            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3999            //   envelope_size bytes, there is always sufficient room.
4000            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4001                self.vmo_pager_total_bytes
4002                    .as_ref()
4003                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4004                encoder,
4005                offset + cur_offset,
4006                depth,
4007            )?;
4008
4009            _prev_end_offset = cur_offset + envelope_size;
4010            if 8 > max_ordinal {
4011                return Ok(());
4012            }
4013
4014            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4015            // are envelope_size bytes.
4016            let cur_offset: usize = (8 - 1) * envelope_size;
4017
4018            // Zero reserved fields.
4019            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4020
4021            // Safety:
4022            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4023            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4024            //   envelope_size bytes, there is always sufficient room.
4025            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4026                self.vmo_pager_newest_bytes
4027                    .as_ref()
4028                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4029                encoder,
4030                offset + cur_offset,
4031                depth,
4032            )?;
4033
4034            _prev_end_offset = cur_offset + envelope_size;
4035            if 9 > max_ordinal {
4036                return Ok(());
4037            }
4038
4039            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4040            // are envelope_size bytes.
4041            let cur_offset: usize = (9 - 1) * envelope_size;
4042
4043            // Zero reserved fields.
4044            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4045
4046            // Safety:
4047            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4048            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4049            //   envelope_size bytes, there is always sufficient room.
4050            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4051                self.vmo_pager_oldest_bytes
4052                    .as_ref()
4053                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4054                encoder,
4055                offset + cur_offset,
4056                depth,
4057            )?;
4058
4059            _prev_end_offset = cur_offset + envelope_size;
4060            if 10 > max_ordinal {
4061                return Ok(());
4062            }
4063
4064            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4065            // are envelope_size bytes.
4066            let cur_offset: usize = (10 - 1) * envelope_size;
4067
4068            // Zero reserved fields.
4069            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4070
4071            // Safety:
4072            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4073            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4074            //   envelope_size bytes, there is always sufficient room.
4075            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4076                self.vmo_discardable_locked_bytes
4077                    .as_ref()
4078                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4079                encoder,
4080                offset + cur_offset,
4081                depth,
4082            )?;
4083
4084            _prev_end_offset = cur_offset + envelope_size;
4085            if 11 > max_ordinal {
4086                return Ok(());
4087            }
4088
4089            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4090            // are envelope_size bytes.
4091            let cur_offset: usize = (11 - 1) * envelope_size;
4092
4093            // Zero reserved fields.
4094            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4095
4096            // Safety:
4097            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4098            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4099            //   envelope_size bytes, there is always sufficient room.
4100            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4101                self.vmo_discardable_unlocked_bytes
4102                    .as_ref()
4103                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4104                encoder,
4105                offset + cur_offset,
4106                depth,
4107            )?;
4108
4109            _prev_end_offset = cur_offset + envelope_size;
4110            if 12 > max_ordinal {
4111                return Ok(());
4112            }
4113
4114            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4115            // are envelope_size bytes.
4116            let cur_offset: usize = (12 - 1) * envelope_size;
4117
4118            // Zero reserved fields.
4119            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4120
4121            // Safety:
4122            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4123            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4124            //   envelope_size bytes, there is always sufficient room.
4125            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4126                self.mmu_overhead_bytes
4127                    .as_ref()
4128                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4129                encoder,
4130                offset + cur_offset,
4131                depth,
4132            )?;
4133
4134            _prev_end_offset = cur_offset + envelope_size;
4135            if 13 > max_ordinal {
4136                return Ok(());
4137            }
4138
4139            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4140            // are envelope_size bytes.
4141            let cur_offset: usize = (13 - 1) * envelope_size;
4142
4143            // Zero reserved fields.
4144            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4145
4146            // Safety:
4147            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4148            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4149            //   envelope_size bytes, there is always sufficient room.
4150            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4151                self.ipc_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4152                encoder,
4153                offset + cur_offset,
4154                depth,
4155            )?;
4156
4157            _prev_end_offset = cur_offset + envelope_size;
4158            if 14 > max_ordinal {
4159                return Ok(());
4160            }
4161
4162            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4163            // are envelope_size bytes.
4164            let cur_offset: usize = (14 - 1) * envelope_size;
4165
4166            // Zero reserved fields.
4167            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4168
4169            // Safety:
4170            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4171            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4172            //   envelope_size bytes, there is always sufficient room.
4173            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4174                self.other_bytes.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4175                encoder,
4176                offset + cur_offset,
4177                depth,
4178            )?;
4179
4180            _prev_end_offset = cur_offset + envelope_size;
4181
4182            Ok(())
4183        }
4184    }
4185
4186    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MemoryStatsExtended {
4187        #[inline(always)]
4188        fn new_empty() -> Self {
4189            Self::default()
4190        }
4191
4192        unsafe fn decode(
4193            &mut self,
4194            decoder: &mut fidl::encoding::Decoder<'_, D>,
4195            offset: usize,
4196            mut depth: fidl::encoding::Depth,
4197        ) -> fidl::Result<()> {
4198            decoder.debug_check_bounds::<Self>(offset);
4199            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4200                None => return Err(fidl::Error::NotNullable),
4201                Some(len) => len,
4202            };
4203            // Calling decoder.out_of_line_offset(0) is not allowed.
4204            if len == 0 {
4205                return Ok(());
4206            };
4207            depth.increment()?;
4208            let envelope_size = 8;
4209            let bytes_len = len * envelope_size;
4210            let offset = decoder.out_of_line_offset(bytes_len)?;
4211            // Decode the envelope for each type.
4212            let mut _next_ordinal_to_read = 0;
4213            let mut next_offset = offset;
4214            let end_offset = offset + bytes_len;
4215            _next_ordinal_to_read += 1;
4216            if next_offset >= end_offset {
4217                return Ok(());
4218            }
4219
4220            // Decode unknown envelopes for gaps in ordinals.
4221            while _next_ordinal_to_read < 1 {
4222                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4223                _next_ordinal_to_read += 1;
4224                next_offset += envelope_size;
4225            }
4226
4227            let next_out_of_line = decoder.next_out_of_line();
4228            let handles_before = decoder.remaining_handles();
4229            if let Some((inlined, num_bytes, num_handles)) =
4230                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4231            {
4232                let member_inline_size =
4233                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4234                if inlined != (member_inline_size <= 4) {
4235                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4236                }
4237                let inner_offset;
4238                let mut inner_depth = depth.clone();
4239                if inlined {
4240                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4241                    inner_offset = next_offset;
4242                } else {
4243                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4244                    inner_depth.increment()?;
4245                }
4246                let val_ref = self.total_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
4247                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4248                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4249                {
4250                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4251                }
4252                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4253                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4254                }
4255            }
4256
4257            next_offset += envelope_size;
4258            _next_ordinal_to_read += 1;
4259            if next_offset >= end_offset {
4260                return Ok(());
4261            }
4262
4263            // Decode unknown envelopes for gaps in ordinals.
4264            while _next_ordinal_to_read < 2 {
4265                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4266                _next_ordinal_to_read += 1;
4267                next_offset += envelope_size;
4268            }
4269
4270            let next_out_of_line = decoder.next_out_of_line();
4271            let handles_before = decoder.remaining_handles();
4272            if let Some((inlined, num_bytes, num_handles)) =
4273                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4274            {
4275                let member_inline_size =
4276                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4277                if inlined != (member_inline_size <= 4) {
4278                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4279                }
4280                let inner_offset;
4281                let mut inner_depth = depth.clone();
4282                if inlined {
4283                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4284                    inner_offset = next_offset;
4285                } else {
4286                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4287                    inner_depth.increment()?;
4288                }
4289                let val_ref = self.free_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
4290                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4291                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4292                {
4293                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4294                }
4295                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4296                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4297                }
4298            }
4299
4300            next_offset += envelope_size;
4301            _next_ordinal_to_read += 1;
4302            if next_offset >= end_offset {
4303                return Ok(());
4304            }
4305
4306            // Decode unknown envelopes for gaps in ordinals.
4307            while _next_ordinal_to_read < 3 {
4308                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4309                _next_ordinal_to_read += 1;
4310                next_offset += envelope_size;
4311            }
4312
4313            let next_out_of_line = decoder.next_out_of_line();
4314            let handles_before = decoder.remaining_handles();
4315            if let Some((inlined, num_bytes, num_handles)) =
4316                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4317            {
4318                let member_inline_size =
4319                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4320                if inlined != (member_inline_size <= 4) {
4321                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4322                }
4323                let inner_offset;
4324                let mut inner_depth = depth.clone();
4325                if inlined {
4326                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4327                    inner_offset = next_offset;
4328                } else {
4329                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4330                    inner_depth.increment()?;
4331                }
4332                let val_ref = self.wired_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
4333                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4334                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4335                {
4336                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4337                }
4338                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4339                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4340                }
4341            }
4342
4343            next_offset += envelope_size;
4344            _next_ordinal_to_read += 1;
4345            if next_offset >= end_offset {
4346                return Ok(());
4347            }
4348
4349            // Decode unknown envelopes for gaps in ordinals.
4350            while _next_ordinal_to_read < 4 {
4351                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4352                _next_ordinal_to_read += 1;
4353                next_offset += envelope_size;
4354            }
4355
4356            let next_out_of_line = decoder.next_out_of_line();
4357            let handles_before = decoder.remaining_handles();
4358            if let Some((inlined, num_bytes, num_handles)) =
4359                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4360            {
4361                let member_inline_size =
4362                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4363                if inlined != (member_inline_size <= 4) {
4364                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4365                }
4366                let inner_offset;
4367                let mut inner_depth = depth.clone();
4368                if inlined {
4369                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4370                    inner_offset = next_offset;
4371                } else {
4372                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4373                    inner_depth.increment()?;
4374                }
4375                let val_ref = self.total_heap_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
4376                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4377                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4378                {
4379                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4380                }
4381                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4382                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4383                }
4384            }
4385
4386            next_offset += envelope_size;
4387            _next_ordinal_to_read += 1;
4388            if next_offset >= end_offset {
4389                return Ok(());
4390            }
4391
4392            // Decode unknown envelopes for gaps in ordinals.
4393            while _next_ordinal_to_read < 5 {
4394                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4395                _next_ordinal_to_read += 1;
4396                next_offset += envelope_size;
4397            }
4398
4399            let next_out_of_line = decoder.next_out_of_line();
4400            let handles_before = decoder.remaining_handles();
4401            if let Some((inlined, num_bytes, num_handles)) =
4402                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4403            {
4404                let member_inline_size =
4405                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4406                if inlined != (member_inline_size <= 4) {
4407                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4408                }
4409                let inner_offset;
4410                let mut inner_depth = depth.clone();
4411                if inlined {
4412                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4413                    inner_offset = next_offset;
4414                } else {
4415                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4416                    inner_depth.increment()?;
4417                }
4418                let val_ref = self.free_heap_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
4419                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4420                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4421                {
4422                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4423                }
4424                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4425                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4426                }
4427            }
4428
4429            next_offset += envelope_size;
4430            _next_ordinal_to_read += 1;
4431            if next_offset >= end_offset {
4432                return Ok(());
4433            }
4434
4435            // Decode unknown envelopes for gaps in ordinals.
4436            while _next_ordinal_to_read < 6 {
4437                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4438                _next_ordinal_to_read += 1;
4439                next_offset += envelope_size;
4440            }
4441
4442            let next_out_of_line = decoder.next_out_of_line();
4443            let handles_before = decoder.remaining_handles();
4444            if let Some((inlined, num_bytes, num_handles)) =
4445                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4446            {
4447                let member_inline_size =
4448                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4449                if inlined != (member_inline_size <= 4) {
4450                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4451                }
4452                let inner_offset;
4453                let mut inner_depth = depth.clone();
4454                if inlined {
4455                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4456                    inner_offset = next_offset;
4457                } else {
4458                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4459                    inner_depth.increment()?;
4460                }
4461                let val_ref = self.vmo_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
4462                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4463                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4464                {
4465                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4466                }
4467                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4468                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4469                }
4470            }
4471
4472            next_offset += envelope_size;
4473            _next_ordinal_to_read += 1;
4474            if next_offset >= end_offset {
4475                return Ok(());
4476            }
4477
4478            // Decode unknown envelopes for gaps in ordinals.
4479            while _next_ordinal_to_read < 7 {
4480                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4481                _next_ordinal_to_read += 1;
4482                next_offset += envelope_size;
4483            }
4484
4485            let next_out_of_line = decoder.next_out_of_line();
4486            let handles_before = decoder.remaining_handles();
4487            if let Some((inlined, num_bytes, num_handles)) =
4488                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4489            {
4490                let member_inline_size =
4491                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4492                if inlined != (member_inline_size <= 4) {
4493                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4494                }
4495                let inner_offset;
4496                let mut inner_depth = depth.clone();
4497                if inlined {
4498                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4499                    inner_offset = next_offset;
4500                } else {
4501                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4502                    inner_depth.increment()?;
4503                }
4504                let val_ref =
4505                    self.vmo_pager_total_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
4506                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4507                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4508                {
4509                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4510                }
4511                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4512                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4513                }
4514            }
4515
4516            next_offset += envelope_size;
4517            _next_ordinal_to_read += 1;
4518            if next_offset >= end_offset {
4519                return Ok(());
4520            }
4521
4522            // Decode unknown envelopes for gaps in ordinals.
4523            while _next_ordinal_to_read < 8 {
4524                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4525                _next_ordinal_to_read += 1;
4526                next_offset += envelope_size;
4527            }
4528
4529            let next_out_of_line = decoder.next_out_of_line();
4530            let handles_before = decoder.remaining_handles();
4531            if let Some((inlined, num_bytes, num_handles)) =
4532                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4533            {
4534                let member_inline_size =
4535                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4536                if inlined != (member_inline_size <= 4) {
4537                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4538                }
4539                let inner_offset;
4540                let mut inner_depth = depth.clone();
4541                if inlined {
4542                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4543                    inner_offset = next_offset;
4544                } else {
4545                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4546                    inner_depth.increment()?;
4547                }
4548                let val_ref =
4549                    self.vmo_pager_newest_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
4550                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4551                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4552                {
4553                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4554                }
4555                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4556                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4557                }
4558            }
4559
4560            next_offset += envelope_size;
4561            _next_ordinal_to_read += 1;
4562            if next_offset >= end_offset {
4563                return Ok(());
4564            }
4565
4566            // Decode unknown envelopes for gaps in ordinals.
4567            while _next_ordinal_to_read < 9 {
4568                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4569                _next_ordinal_to_read += 1;
4570                next_offset += envelope_size;
4571            }
4572
4573            let next_out_of_line = decoder.next_out_of_line();
4574            let handles_before = decoder.remaining_handles();
4575            if let Some((inlined, num_bytes, num_handles)) =
4576                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4577            {
4578                let member_inline_size =
4579                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4580                if inlined != (member_inline_size <= 4) {
4581                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4582                }
4583                let inner_offset;
4584                let mut inner_depth = depth.clone();
4585                if inlined {
4586                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4587                    inner_offset = next_offset;
4588                } else {
4589                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4590                    inner_depth.increment()?;
4591                }
4592                let val_ref =
4593                    self.vmo_pager_oldest_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
4594                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4595                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4596                {
4597                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4598                }
4599                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4600                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4601                }
4602            }
4603
4604            next_offset += envelope_size;
4605            _next_ordinal_to_read += 1;
4606            if next_offset >= end_offset {
4607                return Ok(());
4608            }
4609
4610            // Decode unknown envelopes for gaps in ordinals.
4611            while _next_ordinal_to_read < 10 {
4612                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4613                _next_ordinal_to_read += 1;
4614                next_offset += envelope_size;
4615            }
4616
4617            let next_out_of_line = decoder.next_out_of_line();
4618            let handles_before = decoder.remaining_handles();
4619            if let Some((inlined, num_bytes, num_handles)) =
4620                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4621            {
4622                let member_inline_size =
4623                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4624                if inlined != (member_inline_size <= 4) {
4625                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4626                }
4627                let inner_offset;
4628                let mut inner_depth = depth.clone();
4629                if inlined {
4630                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4631                    inner_offset = next_offset;
4632                } else {
4633                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4634                    inner_depth.increment()?;
4635                }
4636                let val_ref = self
4637                    .vmo_discardable_locked_bytes
4638                    .get_or_insert_with(|| fidl::new_empty!(u64, D));
4639                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4640                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4641                {
4642                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4643                }
4644                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4645                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4646                }
4647            }
4648
4649            next_offset += envelope_size;
4650            _next_ordinal_to_read += 1;
4651            if next_offset >= end_offset {
4652                return Ok(());
4653            }
4654
4655            // Decode unknown envelopes for gaps in ordinals.
4656            while _next_ordinal_to_read < 11 {
4657                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4658                _next_ordinal_to_read += 1;
4659                next_offset += envelope_size;
4660            }
4661
4662            let next_out_of_line = decoder.next_out_of_line();
4663            let handles_before = decoder.remaining_handles();
4664            if let Some((inlined, num_bytes, num_handles)) =
4665                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4666            {
4667                let member_inline_size =
4668                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4669                if inlined != (member_inline_size <= 4) {
4670                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4671                }
4672                let inner_offset;
4673                let mut inner_depth = depth.clone();
4674                if inlined {
4675                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4676                    inner_offset = next_offset;
4677                } else {
4678                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4679                    inner_depth.increment()?;
4680                }
4681                let val_ref = self
4682                    .vmo_discardable_unlocked_bytes
4683                    .get_or_insert_with(|| fidl::new_empty!(u64, D));
4684                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4685                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4686                {
4687                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4688                }
4689                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4690                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4691                }
4692            }
4693
4694            next_offset += envelope_size;
4695            _next_ordinal_to_read += 1;
4696            if next_offset >= end_offset {
4697                return Ok(());
4698            }
4699
4700            // Decode unknown envelopes for gaps in ordinals.
4701            while _next_ordinal_to_read < 12 {
4702                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4703                _next_ordinal_to_read += 1;
4704                next_offset += envelope_size;
4705            }
4706
4707            let next_out_of_line = decoder.next_out_of_line();
4708            let handles_before = decoder.remaining_handles();
4709            if let Some((inlined, num_bytes, num_handles)) =
4710                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4711            {
4712                let member_inline_size =
4713                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4714                if inlined != (member_inline_size <= 4) {
4715                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4716                }
4717                let inner_offset;
4718                let mut inner_depth = depth.clone();
4719                if inlined {
4720                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4721                    inner_offset = next_offset;
4722                } else {
4723                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4724                    inner_depth.increment()?;
4725                }
4726                let val_ref =
4727                    self.mmu_overhead_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
4728                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4729                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4730                {
4731                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4732                }
4733                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4734                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4735                }
4736            }
4737
4738            next_offset += envelope_size;
4739            _next_ordinal_to_read += 1;
4740            if next_offset >= end_offset {
4741                return Ok(());
4742            }
4743
4744            // Decode unknown envelopes for gaps in ordinals.
4745            while _next_ordinal_to_read < 13 {
4746                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4747                _next_ordinal_to_read += 1;
4748                next_offset += envelope_size;
4749            }
4750
4751            let next_out_of_line = decoder.next_out_of_line();
4752            let handles_before = decoder.remaining_handles();
4753            if let Some((inlined, num_bytes, num_handles)) =
4754                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4755            {
4756                let member_inline_size =
4757                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4758                if inlined != (member_inline_size <= 4) {
4759                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4760                }
4761                let inner_offset;
4762                let mut inner_depth = depth.clone();
4763                if inlined {
4764                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4765                    inner_offset = next_offset;
4766                } else {
4767                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4768                    inner_depth.increment()?;
4769                }
4770                let val_ref = self.ipc_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
4771                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4772                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4773                {
4774                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4775                }
4776                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4777                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4778                }
4779            }
4780
4781            next_offset += envelope_size;
4782            _next_ordinal_to_read += 1;
4783            if next_offset >= end_offset {
4784                return Ok(());
4785            }
4786
4787            // Decode unknown envelopes for gaps in ordinals.
4788            while _next_ordinal_to_read < 14 {
4789                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4790                _next_ordinal_to_read += 1;
4791                next_offset += envelope_size;
4792            }
4793
4794            let next_out_of_line = decoder.next_out_of_line();
4795            let handles_before = decoder.remaining_handles();
4796            if let Some((inlined, num_bytes, num_handles)) =
4797                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4798            {
4799                let member_inline_size =
4800                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4801                if inlined != (member_inline_size <= 4) {
4802                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4803                }
4804                let inner_offset;
4805                let mut inner_depth = depth.clone();
4806                if inlined {
4807                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4808                    inner_offset = next_offset;
4809                } else {
4810                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4811                    inner_depth.increment()?;
4812                }
4813                let val_ref = self.other_bytes.get_or_insert_with(|| fidl::new_empty!(u64, D));
4814                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4815                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4816                {
4817                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4818                }
4819                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4820                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4821                }
4822            }
4823
4824            next_offset += envelope_size;
4825
4826            // Decode the remaining unknown envelopes.
4827            while next_offset < end_offset {
4828                _next_ordinal_to_read += 1;
4829                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4830                next_offset += envelope_size;
4831            }
4832
4833            Ok(())
4834        }
4835    }
4836
4837    impl PerCpuStats {
4838        #[inline(always)]
4839        fn max_ordinal_present(&self) -> u64 {
4840            if let Some(_) = self.generic_ipis {
4841                return 15;
4842            }
4843            if let Some(_) = self.reschedule_ipis {
4844                return 14;
4845            }
4846            if let Some(_) = self.syscalls {
4847                return 13;
4848            }
4849            if let Some(_) = self.exceptions {
4850                return 12;
4851            }
4852            if let Some(_) = self.page_faults {
4853                return 11;
4854            }
4855            if let Some(_) = self.timers {
4856                return 10;
4857            }
4858            if let Some(_) = self.timer_ints {
4859                return 9;
4860            }
4861            if let Some(_) = self.ints {
4862                return 8;
4863            }
4864            if let Some(_) = self.yields {
4865                return 7;
4866            }
4867            if let Some(_) = self.irq_preempts {
4868                return 6;
4869            }
4870            if let Some(_) = self.context_switches {
4871                return 5;
4872            }
4873            if let Some(_) = self.reschedules {
4874                return 4;
4875            }
4876            if let Some(_) = self.idle_time {
4877                return 3;
4878            }
4879            if let Some(_) = self.flags {
4880                return 2;
4881            }
4882            if let Some(_) = self.cpu_number {
4883                return 1;
4884            }
4885            0
4886        }
4887    }
4888
4889    impl fidl::encoding::ValueTypeMarker for PerCpuStats {
4890        type Borrowed<'a> = &'a Self;
4891        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4892            value
4893        }
4894    }
4895
4896    unsafe impl fidl::encoding::TypeMarker for PerCpuStats {
4897        type Owned = Self;
4898
4899        #[inline(always)]
4900        fn inline_align(_context: fidl::encoding::Context) -> usize {
4901            8
4902        }
4903
4904        #[inline(always)]
4905        fn inline_size(_context: fidl::encoding::Context) -> usize {
4906            16
4907        }
4908    }
4909
4910    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PerCpuStats, D>
4911        for &PerCpuStats
4912    {
4913        unsafe fn encode(
4914            self,
4915            encoder: &mut fidl::encoding::Encoder<'_, D>,
4916            offset: usize,
4917            mut depth: fidl::encoding::Depth,
4918        ) -> fidl::Result<()> {
4919            encoder.debug_check_bounds::<PerCpuStats>(offset);
4920            // Vector header
4921            let max_ordinal: u64 = self.max_ordinal_present();
4922            encoder.write_num(max_ordinal, offset);
4923            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4924            // Calling encoder.out_of_line_offset(0) is not allowed.
4925            if max_ordinal == 0 {
4926                return Ok(());
4927            }
4928            depth.increment()?;
4929            let envelope_size = 8;
4930            let bytes_len = max_ordinal as usize * envelope_size;
4931            #[allow(unused_variables)]
4932            let offset = encoder.out_of_line_offset(bytes_len);
4933            let mut _prev_end_offset: usize = 0;
4934            if 1 > max_ordinal {
4935                return Ok(());
4936            }
4937
4938            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4939            // are envelope_size bytes.
4940            let cur_offset: usize = (1 - 1) * envelope_size;
4941
4942            // Zero reserved fields.
4943            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4944
4945            // Safety:
4946            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4947            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4948            //   envelope_size bytes, there is always sufficient room.
4949            fidl::encoding::encode_in_envelope_optional::<u32, D>(
4950                self.cpu_number.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4951                encoder,
4952                offset + cur_offset,
4953                depth,
4954            )?;
4955
4956            _prev_end_offset = cur_offset + envelope_size;
4957            if 2 > max_ordinal {
4958                return Ok(());
4959            }
4960
4961            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4962            // are envelope_size bytes.
4963            let cur_offset: usize = (2 - 1) * envelope_size;
4964
4965            // Zero reserved fields.
4966            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4967
4968            // Safety:
4969            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4970            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4971            //   envelope_size bytes, there is always sufficient room.
4972            fidl::encoding::encode_in_envelope_optional::<u32, D>(
4973                self.flags.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4974                encoder,
4975                offset + cur_offset,
4976                depth,
4977            )?;
4978
4979            _prev_end_offset = cur_offset + envelope_size;
4980            if 3 > max_ordinal {
4981                return Ok(());
4982            }
4983
4984            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4985            // are envelope_size bytes.
4986            let cur_offset: usize = (3 - 1) * envelope_size;
4987
4988            // Zero reserved fields.
4989            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4990
4991            // Safety:
4992            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4993            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4994            //   envelope_size bytes, there is always sufficient room.
4995            fidl::encoding::encode_in_envelope_optional::<i64, D>(
4996                self.idle_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
4997                encoder,
4998                offset + cur_offset,
4999                depth,
5000            )?;
5001
5002            _prev_end_offset = cur_offset + envelope_size;
5003            if 4 > max_ordinal {
5004                return Ok(());
5005            }
5006
5007            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5008            // are envelope_size bytes.
5009            let cur_offset: usize = (4 - 1) * envelope_size;
5010
5011            // Zero reserved fields.
5012            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5013
5014            // Safety:
5015            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5016            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5017            //   envelope_size bytes, there is always sufficient room.
5018            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5019                self.reschedules.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5020                encoder,
5021                offset + cur_offset,
5022                depth,
5023            )?;
5024
5025            _prev_end_offset = cur_offset + envelope_size;
5026            if 5 > max_ordinal {
5027                return Ok(());
5028            }
5029
5030            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5031            // are envelope_size bytes.
5032            let cur_offset: usize = (5 - 1) * envelope_size;
5033
5034            // Zero reserved fields.
5035            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5036
5037            // Safety:
5038            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5039            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5040            //   envelope_size bytes, there is always sufficient room.
5041            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5042                self.context_switches
5043                    .as_ref()
5044                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5045                encoder,
5046                offset + cur_offset,
5047                depth,
5048            )?;
5049
5050            _prev_end_offset = cur_offset + envelope_size;
5051            if 6 > max_ordinal {
5052                return Ok(());
5053            }
5054
5055            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5056            // are envelope_size bytes.
5057            let cur_offset: usize = (6 - 1) * envelope_size;
5058
5059            // Zero reserved fields.
5060            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5061
5062            // Safety:
5063            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5064            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5065            //   envelope_size bytes, there is always sufficient room.
5066            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5067                self.irq_preempts.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5068                encoder,
5069                offset + cur_offset,
5070                depth,
5071            )?;
5072
5073            _prev_end_offset = cur_offset + envelope_size;
5074            if 7 > max_ordinal {
5075                return Ok(());
5076            }
5077
5078            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5079            // are envelope_size bytes.
5080            let cur_offset: usize = (7 - 1) * envelope_size;
5081
5082            // Zero reserved fields.
5083            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5084
5085            // Safety:
5086            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5087            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5088            //   envelope_size bytes, there is always sufficient room.
5089            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5090                self.yields.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5091                encoder,
5092                offset + cur_offset,
5093                depth,
5094            )?;
5095
5096            _prev_end_offset = cur_offset + envelope_size;
5097            if 8 > max_ordinal {
5098                return Ok(());
5099            }
5100
5101            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5102            // are envelope_size bytes.
5103            let cur_offset: usize = (8 - 1) * envelope_size;
5104
5105            // Zero reserved fields.
5106            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5107
5108            // Safety:
5109            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5110            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5111            //   envelope_size bytes, there is always sufficient room.
5112            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5113                self.ints.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5114                encoder,
5115                offset + cur_offset,
5116                depth,
5117            )?;
5118
5119            _prev_end_offset = cur_offset + envelope_size;
5120            if 9 > max_ordinal {
5121                return Ok(());
5122            }
5123
5124            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5125            // are envelope_size bytes.
5126            let cur_offset: usize = (9 - 1) * envelope_size;
5127
5128            // Zero reserved fields.
5129            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5130
5131            // Safety:
5132            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5133            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5134            //   envelope_size bytes, there is always sufficient room.
5135            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5136                self.timer_ints.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5137                encoder,
5138                offset + cur_offset,
5139                depth,
5140            )?;
5141
5142            _prev_end_offset = cur_offset + envelope_size;
5143            if 10 > max_ordinal {
5144                return Ok(());
5145            }
5146
5147            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5148            // are envelope_size bytes.
5149            let cur_offset: usize = (10 - 1) * envelope_size;
5150
5151            // Zero reserved fields.
5152            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5153
5154            // Safety:
5155            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5156            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5157            //   envelope_size bytes, there is always sufficient room.
5158            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5159                self.timers.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5160                encoder,
5161                offset + cur_offset,
5162                depth,
5163            )?;
5164
5165            _prev_end_offset = cur_offset + envelope_size;
5166            if 11 > max_ordinal {
5167                return Ok(());
5168            }
5169
5170            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5171            // are envelope_size bytes.
5172            let cur_offset: usize = (11 - 1) * envelope_size;
5173
5174            // Zero reserved fields.
5175            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5176
5177            // Safety:
5178            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5179            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5180            //   envelope_size bytes, there is always sufficient room.
5181            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5182                self.page_faults.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5183                encoder,
5184                offset + cur_offset,
5185                depth,
5186            )?;
5187
5188            _prev_end_offset = cur_offset + envelope_size;
5189            if 12 > max_ordinal {
5190                return Ok(());
5191            }
5192
5193            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5194            // are envelope_size bytes.
5195            let cur_offset: usize = (12 - 1) * envelope_size;
5196
5197            // Zero reserved fields.
5198            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5199
5200            // Safety:
5201            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5202            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5203            //   envelope_size bytes, there is always sufficient room.
5204            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5205                self.exceptions.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5206                encoder,
5207                offset + cur_offset,
5208                depth,
5209            )?;
5210
5211            _prev_end_offset = cur_offset + envelope_size;
5212            if 13 > max_ordinal {
5213                return Ok(());
5214            }
5215
5216            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5217            // are envelope_size bytes.
5218            let cur_offset: usize = (13 - 1) * envelope_size;
5219
5220            // Zero reserved fields.
5221            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5222
5223            // Safety:
5224            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5225            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5226            //   envelope_size bytes, there is always sufficient room.
5227            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5228                self.syscalls.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5229                encoder,
5230                offset + cur_offset,
5231                depth,
5232            )?;
5233
5234            _prev_end_offset = cur_offset + envelope_size;
5235            if 14 > max_ordinal {
5236                return Ok(());
5237            }
5238
5239            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5240            // are envelope_size bytes.
5241            let cur_offset: usize = (14 - 1) * envelope_size;
5242
5243            // Zero reserved fields.
5244            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5245
5246            // Safety:
5247            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5248            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5249            //   envelope_size bytes, there is always sufficient room.
5250            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5251                self.reschedule_ipis.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5252                encoder,
5253                offset + cur_offset,
5254                depth,
5255            )?;
5256
5257            _prev_end_offset = cur_offset + envelope_size;
5258            if 15 > max_ordinal {
5259                return Ok(());
5260            }
5261
5262            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5263            // are envelope_size bytes.
5264            let cur_offset: usize = (15 - 1) * envelope_size;
5265
5266            // Zero reserved fields.
5267            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5268
5269            // Safety:
5270            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5271            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5272            //   envelope_size bytes, there is always sufficient room.
5273            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5274                self.generic_ipis.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5275                encoder,
5276                offset + cur_offset,
5277                depth,
5278            )?;
5279
5280            _prev_end_offset = cur_offset + envelope_size;
5281
5282            Ok(())
5283        }
5284    }
5285
5286    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PerCpuStats {
5287        #[inline(always)]
5288        fn new_empty() -> Self {
5289            Self::default()
5290        }
5291
5292        unsafe fn decode(
5293            &mut self,
5294            decoder: &mut fidl::encoding::Decoder<'_, D>,
5295            offset: usize,
5296            mut depth: fidl::encoding::Depth,
5297        ) -> fidl::Result<()> {
5298            decoder.debug_check_bounds::<Self>(offset);
5299            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5300                None => return Err(fidl::Error::NotNullable),
5301                Some(len) => len,
5302            };
5303            // Calling decoder.out_of_line_offset(0) is not allowed.
5304            if len == 0 {
5305                return Ok(());
5306            };
5307            depth.increment()?;
5308            let envelope_size = 8;
5309            let bytes_len = len * envelope_size;
5310            let offset = decoder.out_of_line_offset(bytes_len)?;
5311            // Decode the envelope for each type.
5312            let mut _next_ordinal_to_read = 0;
5313            let mut next_offset = offset;
5314            let end_offset = offset + bytes_len;
5315            _next_ordinal_to_read += 1;
5316            if next_offset >= end_offset {
5317                return Ok(());
5318            }
5319
5320            // Decode unknown envelopes for gaps in ordinals.
5321            while _next_ordinal_to_read < 1 {
5322                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5323                _next_ordinal_to_read += 1;
5324                next_offset += envelope_size;
5325            }
5326
5327            let next_out_of_line = decoder.next_out_of_line();
5328            let handles_before = decoder.remaining_handles();
5329            if let Some((inlined, num_bytes, num_handles)) =
5330                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5331            {
5332                let member_inline_size =
5333                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5334                if inlined != (member_inline_size <= 4) {
5335                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5336                }
5337                let inner_offset;
5338                let mut inner_depth = depth.clone();
5339                if inlined {
5340                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5341                    inner_offset = next_offset;
5342                } else {
5343                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5344                    inner_depth.increment()?;
5345                }
5346                let val_ref = self.cpu_number.get_or_insert_with(|| fidl::new_empty!(u32, D));
5347                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
5348                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5349                {
5350                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5351                }
5352                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5353                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5354                }
5355            }
5356
5357            next_offset += envelope_size;
5358            _next_ordinal_to_read += 1;
5359            if next_offset >= end_offset {
5360                return Ok(());
5361            }
5362
5363            // Decode unknown envelopes for gaps in ordinals.
5364            while _next_ordinal_to_read < 2 {
5365                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5366                _next_ordinal_to_read += 1;
5367                next_offset += envelope_size;
5368            }
5369
5370            let next_out_of_line = decoder.next_out_of_line();
5371            let handles_before = decoder.remaining_handles();
5372            if let Some((inlined, num_bytes, num_handles)) =
5373                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5374            {
5375                let member_inline_size =
5376                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5377                if inlined != (member_inline_size <= 4) {
5378                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5379                }
5380                let inner_offset;
5381                let mut inner_depth = depth.clone();
5382                if inlined {
5383                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5384                    inner_offset = next_offset;
5385                } else {
5386                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5387                    inner_depth.increment()?;
5388                }
5389                let val_ref = self.flags.get_or_insert_with(|| fidl::new_empty!(u32, D));
5390                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
5391                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5392                {
5393                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5394                }
5395                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5396                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5397                }
5398            }
5399
5400            next_offset += envelope_size;
5401            _next_ordinal_to_read += 1;
5402            if next_offset >= end_offset {
5403                return Ok(());
5404            }
5405
5406            // Decode unknown envelopes for gaps in ordinals.
5407            while _next_ordinal_to_read < 3 {
5408                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5409                _next_ordinal_to_read += 1;
5410                next_offset += envelope_size;
5411            }
5412
5413            let next_out_of_line = decoder.next_out_of_line();
5414            let handles_before = decoder.remaining_handles();
5415            if let Some((inlined, num_bytes, num_handles)) =
5416                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5417            {
5418                let member_inline_size =
5419                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5420                if inlined != (member_inline_size <= 4) {
5421                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5422                }
5423                let inner_offset;
5424                let mut inner_depth = depth.clone();
5425                if inlined {
5426                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5427                    inner_offset = next_offset;
5428                } else {
5429                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5430                    inner_depth.increment()?;
5431                }
5432                let val_ref = self.idle_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
5433                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
5434                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5435                {
5436                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5437                }
5438                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5439                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5440                }
5441            }
5442
5443            next_offset += envelope_size;
5444            _next_ordinal_to_read += 1;
5445            if next_offset >= end_offset {
5446                return Ok(());
5447            }
5448
5449            // Decode unknown envelopes for gaps in ordinals.
5450            while _next_ordinal_to_read < 4 {
5451                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5452                _next_ordinal_to_read += 1;
5453                next_offset += envelope_size;
5454            }
5455
5456            let next_out_of_line = decoder.next_out_of_line();
5457            let handles_before = decoder.remaining_handles();
5458            if let Some((inlined, num_bytes, num_handles)) =
5459                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5460            {
5461                let member_inline_size =
5462                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5463                if inlined != (member_inline_size <= 4) {
5464                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5465                }
5466                let inner_offset;
5467                let mut inner_depth = depth.clone();
5468                if inlined {
5469                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5470                    inner_offset = next_offset;
5471                } else {
5472                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5473                    inner_depth.increment()?;
5474                }
5475                let val_ref = self.reschedules.get_or_insert_with(|| fidl::new_empty!(u64, D));
5476                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5477                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5478                {
5479                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5480                }
5481                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5482                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5483                }
5484            }
5485
5486            next_offset += envelope_size;
5487            _next_ordinal_to_read += 1;
5488            if next_offset >= end_offset {
5489                return Ok(());
5490            }
5491
5492            // Decode unknown envelopes for gaps in ordinals.
5493            while _next_ordinal_to_read < 5 {
5494                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5495                _next_ordinal_to_read += 1;
5496                next_offset += envelope_size;
5497            }
5498
5499            let next_out_of_line = decoder.next_out_of_line();
5500            let handles_before = decoder.remaining_handles();
5501            if let Some((inlined, num_bytes, num_handles)) =
5502                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5503            {
5504                let member_inline_size =
5505                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5506                if inlined != (member_inline_size <= 4) {
5507                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5508                }
5509                let inner_offset;
5510                let mut inner_depth = depth.clone();
5511                if inlined {
5512                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5513                    inner_offset = next_offset;
5514                } else {
5515                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5516                    inner_depth.increment()?;
5517                }
5518                let val_ref = self.context_switches.get_or_insert_with(|| fidl::new_empty!(u64, D));
5519                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5520                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5521                {
5522                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5523                }
5524                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5525                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5526                }
5527            }
5528
5529            next_offset += envelope_size;
5530            _next_ordinal_to_read += 1;
5531            if next_offset >= end_offset {
5532                return Ok(());
5533            }
5534
5535            // Decode unknown envelopes for gaps in ordinals.
5536            while _next_ordinal_to_read < 6 {
5537                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5538                _next_ordinal_to_read += 1;
5539                next_offset += envelope_size;
5540            }
5541
5542            let next_out_of_line = decoder.next_out_of_line();
5543            let handles_before = decoder.remaining_handles();
5544            if let Some((inlined, num_bytes, num_handles)) =
5545                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5546            {
5547                let member_inline_size =
5548                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5549                if inlined != (member_inline_size <= 4) {
5550                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5551                }
5552                let inner_offset;
5553                let mut inner_depth = depth.clone();
5554                if inlined {
5555                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5556                    inner_offset = next_offset;
5557                } else {
5558                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5559                    inner_depth.increment()?;
5560                }
5561                let val_ref = self.irq_preempts.get_or_insert_with(|| fidl::new_empty!(u64, D));
5562                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5563                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5564                {
5565                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5566                }
5567                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5568                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5569                }
5570            }
5571
5572            next_offset += envelope_size;
5573            _next_ordinal_to_read += 1;
5574            if next_offset >= end_offset {
5575                return Ok(());
5576            }
5577
5578            // Decode unknown envelopes for gaps in ordinals.
5579            while _next_ordinal_to_read < 7 {
5580                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5581                _next_ordinal_to_read += 1;
5582                next_offset += envelope_size;
5583            }
5584
5585            let next_out_of_line = decoder.next_out_of_line();
5586            let handles_before = decoder.remaining_handles();
5587            if let Some((inlined, num_bytes, num_handles)) =
5588                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5589            {
5590                let member_inline_size =
5591                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5592                if inlined != (member_inline_size <= 4) {
5593                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5594                }
5595                let inner_offset;
5596                let mut inner_depth = depth.clone();
5597                if inlined {
5598                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5599                    inner_offset = next_offset;
5600                } else {
5601                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5602                    inner_depth.increment()?;
5603                }
5604                let val_ref = self.yields.get_or_insert_with(|| fidl::new_empty!(u64, D));
5605                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5606                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5607                {
5608                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5609                }
5610                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5611                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5612                }
5613            }
5614
5615            next_offset += envelope_size;
5616            _next_ordinal_to_read += 1;
5617            if next_offset >= end_offset {
5618                return Ok(());
5619            }
5620
5621            // Decode unknown envelopes for gaps in ordinals.
5622            while _next_ordinal_to_read < 8 {
5623                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5624                _next_ordinal_to_read += 1;
5625                next_offset += envelope_size;
5626            }
5627
5628            let next_out_of_line = decoder.next_out_of_line();
5629            let handles_before = decoder.remaining_handles();
5630            if let Some((inlined, num_bytes, num_handles)) =
5631                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5632            {
5633                let member_inline_size =
5634                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5635                if inlined != (member_inline_size <= 4) {
5636                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5637                }
5638                let inner_offset;
5639                let mut inner_depth = depth.clone();
5640                if inlined {
5641                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5642                    inner_offset = next_offset;
5643                } else {
5644                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5645                    inner_depth.increment()?;
5646                }
5647                let val_ref = self.ints.get_or_insert_with(|| fidl::new_empty!(u64, D));
5648                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5649                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5650                {
5651                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5652                }
5653                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5654                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5655                }
5656            }
5657
5658            next_offset += envelope_size;
5659            _next_ordinal_to_read += 1;
5660            if next_offset >= end_offset {
5661                return Ok(());
5662            }
5663
5664            // Decode unknown envelopes for gaps in ordinals.
5665            while _next_ordinal_to_read < 9 {
5666                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5667                _next_ordinal_to_read += 1;
5668                next_offset += envelope_size;
5669            }
5670
5671            let next_out_of_line = decoder.next_out_of_line();
5672            let handles_before = decoder.remaining_handles();
5673            if let Some((inlined, num_bytes, num_handles)) =
5674                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5675            {
5676                let member_inline_size =
5677                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5678                if inlined != (member_inline_size <= 4) {
5679                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5680                }
5681                let inner_offset;
5682                let mut inner_depth = depth.clone();
5683                if inlined {
5684                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5685                    inner_offset = next_offset;
5686                } else {
5687                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5688                    inner_depth.increment()?;
5689                }
5690                let val_ref = self.timer_ints.get_or_insert_with(|| fidl::new_empty!(u64, D));
5691                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5692                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5693                {
5694                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5695                }
5696                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5697                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5698                }
5699            }
5700
5701            next_offset += envelope_size;
5702            _next_ordinal_to_read += 1;
5703            if next_offset >= end_offset {
5704                return Ok(());
5705            }
5706
5707            // Decode unknown envelopes for gaps in ordinals.
5708            while _next_ordinal_to_read < 10 {
5709                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5710                _next_ordinal_to_read += 1;
5711                next_offset += envelope_size;
5712            }
5713
5714            let next_out_of_line = decoder.next_out_of_line();
5715            let handles_before = decoder.remaining_handles();
5716            if let Some((inlined, num_bytes, num_handles)) =
5717                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5718            {
5719                let member_inline_size =
5720                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5721                if inlined != (member_inline_size <= 4) {
5722                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5723                }
5724                let inner_offset;
5725                let mut inner_depth = depth.clone();
5726                if inlined {
5727                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5728                    inner_offset = next_offset;
5729                } else {
5730                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5731                    inner_depth.increment()?;
5732                }
5733                let val_ref = self.timers.get_or_insert_with(|| fidl::new_empty!(u64, D));
5734                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5735                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5736                {
5737                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5738                }
5739                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5740                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5741                }
5742            }
5743
5744            next_offset += envelope_size;
5745            _next_ordinal_to_read += 1;
5746            if next_offset >= end_offset {
5747                return Ok(());
5748            }
5749
5750            // Decode unknown envelopes for gaps in ordinals.
5751            while _next_ordinal_to_read < 11 {
5752                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5753                _next_ordinal_to_read += 1;
5754                next_offset += envelope_size;
5755            }
5756
5757            let next_out_of_line = decoder.next_out_of_line();
5758            let handles_before = decoder.remaining_handles();
5759            if let Some((inlined, num_bytes, num_handles)) =
5760                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5761            {
5762                let member_inline_size =
5763                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5764                if inlined != (member_inline_size <= 4) {
5765                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5766                }
5767                let inner_offset;
5768                let mut inner_depth = depth.clone();
5769                if inlined {
5770                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5771                    inner_offset = next_offset;
5772                } else {
5773                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5774                    inner_depth.increment()?;
5775                }
5776                let val_ref = self.page_faults.get_or_insert_with(|| fidl::new_empty!(u64, D));
5777                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5778                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5779                {
5780                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5781                }
5782                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5783                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5784                }
5785            }
5786
5787            next_offset += envelope_size;
5788            _next_ordinal_to_read += 1;
5789            if next_offset >= end_offset {
5790                return Ok(());
5791            }
5792
5793            // Decode unknown envelopes for gaps in ordinals.
5794            while _next_ordinal_to_read < 12 {
5795                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5796                _next_ordinal_to_read += 1;
5797                next_offset += envelope_size;
5798            }
5799
5800            let next_out_of_line = decoder.next_out_of_line();
5801            let handles_before = decoder.remaining_handles();
5802            if let Some((inlined, num_bytes, num_handles)) =
5803                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5804            {
5805                let member_inline_size =
5806                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5807                if inlined != (member_inline_size <= 4) {
5808                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5809                }
5810                let inner_offset;
5811                let mut inner_depth = depth.clone();
5812                if inlined {
5813                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5814                    inner_offset = next_offset;
5815                } else {
5816                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5817                    inner_depth.increment()?;
5818                }
5819                let val_ref = self.exceptions.get_or_insert_with(|| fidl::new_empty!(u64, D));
5820                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5821                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5822                {
5823                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5824                }
5825                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5826                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5827                }
5828            }
5829
5830            next_offset += envelope_size;
5831            _next_ordinal_to_read += 1;
5832            if next_offset >= end_offset {
5833                return Ok(());
5834            }
5835
5836            // Decode unknown envelopes for gaps in ordinals.
5837            while _next_ordinal_to_read < 13 {
5838                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5839                _next_ordinal_to_read += 1;
5840                next_offset += envelope_size;
5841            }
5842
5843            let next_out_of_line = decoder.next_out_of_line();
5844            let handles_before = decoder.remaining_handles();
5845            if let Some((inlined, num_bytes, num_handles)) =
5846                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5847            {
5848                let member_inline_size =
5849                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5850                if inlined != (member_inline_size <= 4) {
5851                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5852                }
5853                let inner_offset;
5854                let mut inner_depth = depth.clone();
5855                if inlined {
5856                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5857                    inner_offset = next_offset;
5858                } else {
5859                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5860                    inner_depth.increment()?;
5861                }
5862                let val_ref = self.syscalls.get_or_insert_with(|| fidl::new_empty!(u64, D));
5863                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5864                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5865                {
5866                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5867                }
5868                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5869                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5870                }
5871            }
5872
5873            next_offset += envelope_size;
5874            _next_ordinal_to_read += 1;
5875            if next_offset >= end_offset {
5876                return Ok(());
5877            }
5878
5879            // Decode unknown envelopes for gaps in ordinals.
5880            while _next_ordinal_to_read < 14 {
5881                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5882                _next_ordinal_to_read += 1;
5883                next_offset += envelope_size;
5884            }
5885
5886            let next_out_of_line = decoder.next_out_of_line();
5887            let handles_before = decoder.remaining_handles();
5888            if let Some((inlined, num_bytes, num_handles)) =
5889                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5890            {
5891                let member_inline_size =
5892                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5893                if inlined != (member_inline_size <= 4) {
5894                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5895                }
5896                let inner_offset;
5897                let mut inner_depth = depth.clone();
5898                if inlined {
5899                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5900                    inner_offset = next_offset;
5901                } else {
5902                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5903                    inner_depth.increment()?;
5904                }
5905                let val_ref = self.reschedule_ipis.get_or_insert_with(|| fidl::new_empty!(u64, D));
5906                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5907                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5908                {
5909                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5910                }
5911                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5912                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5913                }
5914            }
5915
5916            next_offset += envelope_size;
5917            _next_ordinal_to_read += 1;
5918            if next_offset >= end_offset {
5919                return Ok(());
5920            }
5921
5922            // Decode unknown envelopes for gaps in ordinals.
5923            while _next_ordinal_to_read < 15 {
5924                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5925                _next_ordinal_to_read += 1;
5926                next_offset += envelope_size;
5927            }
5928
5929            let next_out_of_line = decoder.next_out_of_line();
5930            let handles_before = decoder.remaining_handles();
5931            if let Some((inlined, num_bytes, num_handles)) =
5932                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5933            {
5934                let member_inline_size =
5935                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5936                if inlined != (member_inline_size <= 4) {
5937                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5938                }
5939                let inner_offset;
5940                let mut inner_depth = depth.clone();
5941                if inlined {
5942                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5943                    inner_offset = next_offset;
5944                } else {
5945                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5946                    inner_depth.increment()?;
5947                }
5948                let val_ref = self.generic_ipis.get_or_insert_with(|| fidl::new_empty!(u64, D));
5949                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5950                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5951                {
5952                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5953                }
5954                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5955                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5956                }
5957            }
5958
5959            next_offset += envelope_size;
5960
5961            // Decode the remaining unknown envelopes.
5962            while next_offset < end_offset {
5963                _next_ordinal_to_read += 1;
5964                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5965                next_offset += envelope_size;
5966            }
5967
5968            Ok(())
5969        }
5970    }
5971}