fidl_fuchsia_recovery_ui_common/
fidl_fuchsia_recovery_ui_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#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
12#[repr(u32)]
13pub enum Status {
14    Active = 1,
15    Paused = 2,
16    Error = 3,
17    Cancelled = 4,
18    Complete = 5,
19}
20
21impl Status {
22    #[inline]
23    pub fn from_primitive(prim: u32) -> Option<Self> {
24        match prim {
25            1 => Some(Self::Active),
26            2 => Some(Self::Paused),
27            3 => Some(Self::Error),
28            4 => Some(Self::Cancelled),
29            5 => Some(Self::Complete),
30            _ => None,
31        }
32    }
33
34    #[inline]
35    pub const fn into_primitive(self) -> u32 {
36        self as u32
37    }
38
39    #[deprecated = "Strict enums should not use `is_unknown`"]
40    #[inline]
41    pub fn is_unknown(&self) -> bool {
42        false
43    }
44}
45
46#[derive(Clone, Debug, PartialEq)]
47pub struct FactoryResetCountdownWatchResponse {
48    pub state: FactoryResetCountdownState,
49}
50
51impl fidl::Persistable for FactoryResetCountdownWatchResponse {}
52
53#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
54pub struct ProgressRendererRenderRequest {
55    pub status: Status,
56    pub percent_complete: f32,
57}
58
59impl fidl::Persistable for ProgressRendererRenderRequest {}
60
61/// Information provided through the FactoryResetCountdown protocol on the
62/// current factory reset state.
63#[derive(Clone, Debug, Default, PartialEq)]
64pub struct FactoryResetCountdownState {
65    /// The time of when factory reset is scheduled to be triggered when a
66    /// countdown for factory reset is in progress with respect to the monotonic
67    /// clock. This field is left unpopulated if no reset is scheduled.
68    pub scheduled_reset_time: Option<i64>,
69    #[doc(hidden)]
70    pub __source_breaking: fidl::marker::SourceBreaking,
71}
72
73impl fidl::Persistable for FactoryResetCountdownState {}
74
75#[derive(Clone, Debug, Default, PartialEq)]
76pub struct ProgressRendererRender2Request {
77    pub status: Option<Status>,
78    /// Optional, only used with status ACTIVE
79    /// No value or an invalid value sets the progress bar to 0%
80    /// Values: [0.0 - 100.0]
81    pub percent_complete: Option<f32>,
82    /// Time to take to move slowly to percent_complete
83    /// Optional, only used with status ACTIVE
84    /// No value indicates an instant jump to percent_complete
85    pub elapsed_time: Option<i64>,
86    #[doc(hidden)]
87    pub __source_breaking: fidl::marker::SourceBreaking,
88}
89
90impl fidl::Persistable for ProgressRendererRender2Request {}
91
92mod internal {
93    use super::*;
94    unsafe impl fidl::encoding::TypeMarker for Status {
95        type Owned = Self;
96
97        #[inline(always)]
98        fn inline_align(_context: fidl::encoding::Context) -> usize {
99            std::mem::align_of::<u32>()
100        }
101
102        #[inline(always)]
103        fn inline_size(_context: fidl::encoding::Context) -> usize {
104            std::mem::size_of::<u32>()
105        }
106
107        #[inline(always)]
108        fn encode_is_copy() -> bool {
109            true
110        }
111
112        #[inline(always)]
113        fn decode_is_copy() -> bool {
114            false
115        }
116    }
117
118    impl fidl::encoding::ValueTypeMarker for Status {
119        type Borrowed<'a> = Self;
120        #[inline(always)]
121        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
122            *value
123        }
124    }
125
126    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Status {
127        #[inline]
128        unsafe fn encode(
129            self,
130            encoder: &mut fidl::encoding::Encoder<'_, D>,
131            offset: usize,
132            _depth: fidl::encoding::Depth,
133        ) -> fidl::Result<()> {
134            encoder.debug_check_bounds::<Self>(offset);
135            encoder.write_num(self.into_primitive(), offset);
136            Ok(())
137        }
138    }
139
140    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Status {
141        #[inline(always)]
142        fn new_empty() -> Self {
143            Self::Active
144        }
145
146        #[inline]
147        unsafe fn decode(
148            &mut self,
149            decoder: &mut fidl::encoding::Decoder<'_, D>,
150            offset: usize,
151            _depth: fidl::encoding::Depth,
152        ) -> fidl::Result<()> {
153            decoder.debug_check_bounds::<Self>(offset);
154            let prim = decoder.read_num::<u32>(offset);
155
156            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
157            Ok(())
158        }
159    }
160
161    impl fidl::encoding::ValueTypeMarker for FactoryResetCountdownWatchResponse {
162        type Borrowed<'a> = &'a Self;
163        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
164            value
165        }
166    }
167
168    unsafe impl fidl::encoding::TypeMarker for FactoryResetCountdownWatchResponse {
169        type Owned = Self;
170
171        #[inline(always)]
172        fn inline_align(_context: fidl::encoding::Context) -> usize {
173            8
174        }
175
176        #[inline(always)]
177        fn inline_size(_context: fidl::encoding::Context) -> usize {
178            16
179        }
180    }
181
182    unsafe impl<D: fidl::encoding::ResourceDialect>
183        fidl::encoding::Encode<FactoryResetCountdownWatchResponse, D>
184        for &FactoryResetCountdownWatchResponse
185    {
186        #[inline]
187        unsafe fn encode(
188            self,
189            encoder: &mut fidl::encoding::Encoder<'_, D>,
190            offset: usize,
191            _depth: fidl::encoding::Depth,
192        ) -> fidl::Result<()> {
193            encoder.debug_check_bounds::<FactoryResetCountdownWatchResponse>(offset);
194            // Delegate to tuple encoding.
195            fidl::encoding::Encode::<FactoryResetCountdownWatchResponse, D>::encode(
196                (<FactoryResetCountdownState as fidl::encoding::ValueTypeMarker>::borrow(
197                    &self.state,
198                ),),
199                encoder,
200                offset,
201                _depth,
202            )
203        }
204    }
205    unsafe impl<
206            D: fidl::encoding::ResourceDialect,
207            T0: fidl::encoding::Encode<FactoryResetCountdownState, D>,
208        > fidl::encoding::Encode<FactoryResetCountdownWatchResponse, D> for (T0,)
209    {
210        #[inline]
211        unsafe fn encode(
212            self,
213            encoder: &mut fidl::encoding::Encoder<'_, D>,
214            offset: usize,
215            depth: fidl::encoding::Depth,
216        ) -> fidl::Result<()> {
217            encoder.debug_check_bounds::<FactoryResetCountdownWatchResponse>(offset);
218            // Zero out padding regions. There's no need to apply masks
219            // because the unmasked parts will be overwritten by fields.
220            // Write the fields.
221            self.0.encode(encoder, offset + 0, depth)?;
222            Ok(())
223        }
224    }
225
226    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
227        for FactoryResetCountdownWatchResponse
228    {
229        #[inline(always)]
230        fn new_empty() -> Self {
231            Self { state: fidl::new_empty!(FactoryResetCountdownState, D) }
232        }
233
234        #[inline]
235        unsafe fn decode(
236            &mut self,
237            decoder: &mut fidl::encoding::Decoder<'_, D>,
238            offset: usize,
239            _depth: fidl::encoding::Depth,
240        ) -> fidl::Result<()> {
241            decoder.debug_check_bounds::<Self>(offset);
242            // Verify that padding bytes are zero.
243            fidl::decode!(
244                FactoryResetCountdownState,
245                D,
246                &mut self.state,
247                decoder,
248                offset + 0,
249                _depth
250            )?;
251            Ok(())
252        }
253    }
254
255    impl fidl::encoding::ValueTypeMarker for ProgressRendererRenderRequest {
256        type Borrowed<'a> = &'a Self;
257        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
258            value
259        }
260    }
261
262    unsafe impl fidl::encoding::TypeMarker for ProgressRendererRenderRequest {
263        type Owned = Self;
264
265        #[inline(always)]
266        fn inline_align(_context: fidl::encoding::Context) -> usize {
267            4
268        }
269
270        #[inline(always)]
271        fn inline_size(_context: fidl::encoding::Context) -> usize {
272            8
273        }
274    }
275
276    unsafe impl<D: fidl::encoding::ResourceDialect>
277        fidl::encoding::Encode<ProgressRendererRenderRequest, D>
278        for &ProgressRendererRenderRequest
279    {
280        #[inline]
281        unsafe fn encode(
282            self,
283            encoder: &mut fidl::encoding::Encoder<'_, D>,
284            offset: usize,
285            _depth: fidl::encoding::Depth,
286        ) -> fidl::Result<()> {
287            encoder.debug_check_bounds::<ProgressRendererRenderRequest>(offset);
288            // Delegate to tuple encoding.
289            fidl::encoding::Encode::<ProgressRendererRenderRequest, D>::encode(
290                (
291                    <Status as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
292                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.percent_complete),
293                ),
294                encoder,
295                offset,
296                _depth,
297            )
298        }
299    }
300    unsafe impl<
301            D: fidl::encoding::ResourceDialect,
302            T0: fidl::encoding::Encode<Status, D>,
303            T1: fidl::encoding::Encode<f32, D>,
304        > fidl::encoding::Encode<ProgressRendererRenderRequest, D> for (T0, T1)
305    {
306        #[inline]
307        unsafe fn encode(
308            self,
309            encoder: &mut fidl::encoding::Encoder<'_, D>,
310            offset: usize,
311            depth: fidl::encoding::Depth,
312        ) -> fidl::Result<()> {
313            encoder.debug_check_bounds::<ProgressRendererRenderRequest>(offset);
314            // Zero out padding regions. There's no need to apply masks
315            // because the unmasked parts will be overwritten by fields.
316            // Write the fields.
317            self.0.encode(encoder, offset + 0, depth)?;
318            self.1.encode(encoder, offset + 4, depth)?;
319            Ok(())
320        }
321    }
322
323    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
324        for ProgressRendererRenderRequest
325    {
326        #[inline(always)]
327        fn new_empty() -> Self {
328            Self { status: fidl::new_empty!(Status, D), percent_complete: fidl::new_empty!(f32, D) }
329        }
330
331        #[inline]
332        unsafe fn decode(
333            &mut self,
334            decoder: &mut fidl::encoding::Decoder<'_, D>,
335            offset: usize,
336            _depth: fidl::encoding::Depth,
337        ) -> fidl::Result<()> {
338            decoder.debug_check_bounds::<Self>(offset);
339            // Verify that padding bytes are zero.
340            fidl::decode!(Status, D, &mut self.status, decoder, offset + 0, _depth)?;
341            fidl::decode!(f32, D, &mut self.percent_complete, decoder, offset + 4, _depth)?;
342            Ok(())
343        }
344    }
345
346    impl FactoryResetCountdownState {
347        #[inline(always)]
348        fn max_ordinal_present(&self) -> u64 {
349            if let Some(_) = self.scheduled_reset_time {
350                return 1;
351            }
352            0
353        }
354    }
355
356    impl fidl::encoding::ValueTypeMarker for FactoryResetCountdownState {
357        type Borrowed<'a> = &'a Self;
358        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
359            value
360        }
361    }
362
363    unsafe impl fidl::encoding::TypeMarker for FactoryResetCountdownState {
364        type Owned = Self;
365
366        #[inline(always)]
367        fn inline_align(_context: fidl::encoding::Context) -> usize {
368            8
369        }
370
371        #[inline(always)]
372        fn inline_size(_context: fidl::encoding::Context) -> usize {
373            16
374        }
375    }
376
377    unsafe impl<D: fidl::encoding::ResourceDialect>
378        fidl::encoding::Encode<FactoryResetCountdownState, D> for &FactoryResetCountdownState
379    {
380        unsafe fn encode(
381            self,
382            encoder: &mut fidl::encoding::Encoder<'_, D>,
383            offset: usize,
384            mut depth: fidl::encoding::Depth,
385        ) -> fidl::Result<()> {
386            encoder.debug_check_bounds::<FactoryResetCountdownState>(offset);
387            // Vector header
388            let max_ordinal: u64 = self.max_ordinal_present();
389            encoder.write_num(max_ordinal, offset);
390            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
391            // Calling encoder.out_of_line_offset(0) is not allowed.
392            if max_ordinal == 0 {
393                return Ok(());
394            }
395            depth.increment()?;
396            let envelope_size = 8;
397            let bytes_len = max_ordinal as usize * envelope_size;
398            #[allow(unused_variables)]
399            let offset = encoder.out_of_line_offset(bytes_len);
400            let mut _prev_end_offset: usize = 0;
401            if 1 > max_ordinal {
402                return Ok(());
403            }
404
405            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
406            // are envelope_size bytes.
407            let cur_offset: usize = (1 - 1) * envelope_size;
408
409            // Zero reserved fields.
410            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
411
412            // Safety:
413            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
414            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
415            //   envelope_size bytes, there is always sufficient room.
416            fidl::encoding::encode_in_envelope_optional::<i64, D>(
417                self.scheduled_reset_time
418                    .as_ref()
419                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
420                encoder,
421                offset + cur_offset,
422                depth,
423            )?;
424
425            _prev_end_offset = cur_offset + envelope_size;
426
427            Ok(())
428        }
429    }
430
431    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
432        for FactoryResetCountdownState
433    {
434        #[inline(always)]
435        fn new_empty() -> Self {
436            Self::default()
437        }
438
439        unsafe fn decode(
440            &mut self,
441            decoder: &mut fidl::encoding::Decoder<'_, D>,
442            offset: usize,
443            mut depth: fidl::encoding::Depth,
444        ) -> fidl::Result<()> {
445            decoder.debug_check_bounds::<Self>(offset);
446            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
447                None => return Err(fidl::Error::NotNullable),
448                Some(len) => len,
449            };
450            // Calling decoder.out_of_line_offset(0) is not allowed.
451            if len == 0 {
452                return Ok(());
453            };
454            depth.increment()?;
455            let envelope_size = 8;
456            let bytes_len = len * envelope_size;
457            let offset = decoder.out_of_line_offset(bytes_len)?;
458            // Decode the envelope for each type.
459            let mut _next_ordinal_to_read = 0;
460            let mut next_offset = offset;
461            let end_offset = offset + bytes_len;
462            _next_ordinal_to_read += 1;
463            if next_offset >= end_offset {
464                return Ok(());
465            }
466
467            // Decode unknown envelopes for gaps in ordinals.
468            while _next_ordinal_to_read < 1 {
469                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
470                _next_ordinal_to_read += 1;
471                next_offset += envelope_size;
472            }
473
474            let next_out_of_line = decoder.next_out_of_line();
475            let handles_before = decoder.remaining_handles();
476            if let Some((inlined, num_bytes, num_handles)) =
477                fidl::encoding::decode_envelope_header(decoder, next_offset)?
478            {
479                let member_inline_size =
480                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
481                if inlined != (member_inline_size <= 4) {
482                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
483                }
484                let inner_offset;
485                let mut inner_depth = depth.clone();
486                if inlined {
487                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
488                    inner_offset = next_offset;
489                } else {
490                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
491                    inner_depth.increment()?;
492                }
493                let val_ref =
494                    self.scheduled_reset_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
495                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
496                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
497                {
498                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
499                }
500                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
501                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
502                }
503            }
504
505            next_offset += envelope_size;
506
507            // Decode the remaining unknown envelopes.
508            while next_offset < end_offset {
509                _next_ordinal_to_read += 1;
510                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
511                next_offset += envelope_size;
512            }
513
514            Ok(())
515        }
516    }
517
518    impl ProgressRendererRender2Request {
519        #[inline(always)]
520        fn max_ordinal_present(&self) -> u64 {
521            if let Some(_) = self.elapsed_time {
522                return 3;
523            }
524            if let Some(_) = self.percent_complete {
525                return 2;
526            }
527            if let Some(_) = self.status {
528                return 1;
529            }
530            0
531        }
532    }
533
534    impl fidl::encoding::ValueTypeMarker for ProgressRendererRender2Request {
535        type Borrowed<'a> = &'a Self;
536        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
537            value
538        }
539    }
540
541    unsafe impl fidl::encoding::TypeMarker for ProgressRendererRender2Request {
542        type Owned = Self;
543
544        #[inline(always)]
545        fn inline_align(_context: fidl::encoding::Context) -> usize {
546            8
547        }
548
549        #[inline(always)]
550        fn inline_size(_context: fidl::encoding::Context) -> usize {
551            16
552        }
553    }
554
555    unsafe impl<D: fidl::encoding::ResourceDialect>
556        fidl::encoding::Encode<ProgressRendererRender2Request, D>
557        for &ProgressRendererRender2Request
558    {
559        unsafe fn encode(
560            self,
561            encoder: &mut fidl::encoding::Encoder<'_, D>,
562            offset: usize,
563            mut depth: fidl::encoding::Depth,
564        ) -> fidl::Result<()> {
565            encoder.debug_check_bounds::<ProgressRendererRender2Request>(offset);
566            // Vector header
567            let max_ordinal: u64 = self.max_ordinal_present();
568            encoder.write_num(max_ordinal, offset);
569            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
570            // Calling encoder.out_of_line_offset(0) is not allowed.
571            if max_ordinal == 0 {
572                return Ok(());
573            }
574            depth.increment()?;
575            let envelope_size = 8;
576            let bytes_len = max_ordinal as usize * envelope_size;
577            #[allow(unused_variables)]
578            let offset = encoder.out_of_line_offset(bytes_len);
579            let mut _prev_end_offset: usize = 0;
580            if 1 > max_ordinal {
581                return Ok(());
582            }
583
584            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
585            // are envelope_size bytes.
586            let cur_offset: usize = (1 - 1) * envelope_size;
587
588            // Zero reserved fields.
589            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
590
591            // Safety:
592            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
593            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
594            //   envelope_size bytes, there is always sufficient room.
595            fidl::encoding::encode_in_envelope_optional::<Status, D>(
596                self.status.as_ref().map(<Status as fidl::encoding::ValueTypeMarker>::borrow),
597                encoder,
598                offset + cur_offset,
599                depth,
600            )?;
601
602            _prev_end_offset = cur_offset + envelope_size;
603            if 2 > max_ordinal {
604                return Ok(());
605            }
606
607            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
608            // are envelope_size bytes.
609            let cur_offset: usize = (2 - 1) * envelope_size;
610
611            // Zero reserved fields.
612            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
613
614            // Safety:
615            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
616            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
617            //   envelope_size bytes, there is always sufficient room.
618            fidl::encoding::encode_in_envelope_optional::<f32, D>(
619                self.percent_complete
620                    .as_ref()
621                    .map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
622                encoder,
623                offset + cur_offset,
624                depth,
625            )?;
626
627            _prev_end_offset = cur_offset + envelope_size;
628            if 3 > max_ordinal {
629                return Ok(());
630            }
631
632            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
633            // are envelope_size bytes.
634            let cur_offset: usize = (3 - 1) * envelope_size;
635
636            // Zero reserved fields.
637            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
638
639            // Safety:
640            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
641            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
642            //   envelope_size bytes, there is always sufficient room.
643            fidl::encoding::encode_in_envelope_optional::<i64, D>(
644                self.elapsed_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
645                encoder,
646                offset + cur_offset,
647                depth,
648            )?;
649
650            _prev_end_offset = cur_offset + envelope_size;
651
652            Ok(())
653        }
654    }
655
656    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
657        for ProgressRendererRender2Request
658    {
659        #[inline(always)]
660        fn new_empty() -> Self {
661            Self::default()
662        }
663
664        unsafe fn decode(
665            &mut self,
666            decoder: &mut fidl::encoding::Decoder<'_, D>,
667            offset: usize,
668            mut depth: fidl::encoding::Depth,
669        ) -> fidl::Result<()> {
670            decoder.debug_check_bounds::<Self>(offset);
671            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
672                None => return Err(fidl::Error::NotNullable),
673                Some(len) => len,
674            };
675            // Calling decoder.out_of_line_offset(0) is not allowed.
676            if len == 0 {
677                return Ok(());
678            };
679            depth.increment()?;
680            let envelope_size = 8;
681            let bytes_len = len * envelope_size;
682            let offset = decoder.out_of_line_offset(bytes_len)?;
683            // Decode the envelope for each type.
684            let mut _next_ordinal_to_read = 0;
685            let mut next_offset = offset;
686            let end_offset = offset + bytes_len;
687            _next_ordinal_to_read += 1;
688            if next_offset >= end_offset {
689                return Ok(());
690            }
691
692            // Decode unknown envelopes for gaps in ordinals.
693            while _next_ordinal_to_read < 1 {
694                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
695                _next_ordinal_to_read += 1;
696                next_offset += envelope_size;
697            }
698
699            let next_out_of_line = decoder.next_out_of_line();
700            let handles_before = decoder.remaining_handles();
701            if let Some((inlined, num_bytes, num_handles)) =
702                fidl::encoding::decode_envelope_header(decoder, next_offset)?
703            {
704                let member_inline_size =
705                    <Status as fidl::encoding::TypeMarker>::inline_size(decoder.context);
706                if inlined != (member_inline_size <= 4) {
707                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
708                }
709                let inner_offset;
710                let mut inner_depth = depth.clone();
711                if inlined {
712                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
713                    inner_offset = next_offset;
714                } else {
715                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
716                    inner_depth.increment()?;
717                }
718                let val_ref = self.status.get_or_insert_with(|| fidl::new_empty!(Status, D));
719                fidl::decode!(Status, D, val_ref, decoder, inner_offset, inner_depth)?;
720                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
721                {
722                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
723                }
724                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
725                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
726                }
727            }
728
729            next_offset += envelope_size;
730            _next_ordinal_to_read += 1;
731            if next_offset >= end_offset {
732                return Ok(());
733            }
734
735            // Decode unknown envelopes for gaps in ordinals.
736            while _next_ordinal_to_read < 2 {
737                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
738                _next_ordinal_to_read += 1;
739                next_offset += envelope_size;
740            }
741
742            let next_out_of_line = decoder.next_out_of_line();
743            let handles_before = decoder.remaining_handles();
744            if let Some((inlined, num_bytes, num_handles)) =
745                fidl::encoding::decode_envelope_header(decoder, next_offset)?
746            {
747                let member_inline_size =
748                    <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
749                if inlined != (member_inline_size <= 4) {
750                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
751                }
752                let inner_offset;
753                let mut inner_depth = depth.clone();
754                if inlined {
755                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
756                    inner_offset = next_offset;
757                } else {
758                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
759                    inner_depth.increment()?;
760                }
761                let val_ref = self.percent_complete.get_or_insert_with(|| fidl::new_empty!(f32, D));
762                fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
763                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
764                {
765                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
766                }
767                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
768                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
769                }
770            }
771
772            next_offset += envelope_size;
773            _next_ordinal_to_read += 1;
774            if next_offset >= end_offset {
775                return Ok(());
776            }
777
778            // Decode unknown envelopes for gaps in ordinals.
779            while _next_ordinal_to_read < 3 {
780                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
781                _next_ordinal_to_read += 1;
782                next_offset += envelope_size;
783            }
784
785            let next_out_of_line = decoder.next_out_of_line();
786            let handles_before = decoder.remaining_handles();
787            if let Some((inlined, num_bytes, num_handles)) =
788                fidl::encoding::decode_envelope_header(decoder, next_offset)?
789            {
790                let member_inline_size =
791                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
792                if inlined != (member_inline_size <= 4) {
793                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
794                }
795                let inner_offset;
796                let mut inner_depth = depth.clone();
797                if inlined {
798                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
799                    inner_offset = next_offset;
800                } else {
801                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
802                    inner_depth.increment()?;
803                }
804                let val_ref = self.elapsed_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
805                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
806                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
807                {
808                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
809                }
810                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
811                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
812                }
813            }
814
815            next_offset += envelope_size;
816
817            // Decode the remaining unknown envelopes.
818            while next_offset < end_offset {
819                _next_ordinal_to_read += 1;
820                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
821                next_offset += envelope_size;
822            }
823
824            Ok(())
825        }
826    }
827}