1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub type PixelScale = [f32; 2];
15
16pub const BUFFER_SIZE: u32 = 200;
28
29pub const MAX_VIEW_COUNT: u32 = 300;
39
40bitflags! {
41 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
42 pub struct Error: u32 {
43 const CHANNEL_OVERFLOW = 1;
47 const BUFFER_OVERFLOW = 2;
50 const VIEWS_OVERFLOW = 4;
54 }
55}
56
57impl Error {
58 #[inline(always)]
59 pub fn from_bits_allow_unknown(bits: u32) -> Self {
60 Self::from_bits_retain(bits)
61 }
62
63 #[inline(always)]
64 pub fn has_unknown_bits(&self) -> bool {
65 self.get_unknown_bits() != 0
66 }
67
68 #[inline(always)]
69 pub fn get_unknown_bits(&self) -> u32 {
70 self.bits() & !Self::all().bits()
71 }
72}
73
74#[derive(Clone, Debug, PartialEq)]
84pub struct AlignedExtent {
85 pub min: fidl_fuchsia_math::PointF,
87 pub max: fidl_fuchsia_math::PointF,
89}
90
91impl fidl::Persistable for AlignedExtent {}
92
93#[derive(Clone, Debug, PartialEq)]
101pub struct Layout {
102 pub extent: AlignedExtent,
105 pub pixel_scale: [f32; 2],
108 pub inset: fidl_fuchsia_math::InsetF,
111}
112
113impl fidl::Persistable for Layout {}
114
115#[derive(Clone, Debug, PartialEq)]
136pub struct RotatableExtent {
137 pub origin: fidl_fuchsia_math::PointF,
139 pub width: f32,
142 pub height: f32,
145 pub angle_degrees: f32,
147}
148
149impl fidl::Persistable for RotatableExtent {}
150
151#[derive(Clone, Debug, Default, PartialEq)]
153pub struct ViewDescriptor {
154 pub view_ref_koid: Option<u64>,
156 pub layout: Option<Layout>,
164 pub extent_in_context: Option<RotatableExtent>,
176 pub extent_in_parent: Option<RotatableExtent>,
179 pub children: Option<Vec<u32>>,
198 #[doc(hidden)]
199 pub __source_breaking: fidl::marker::SourceBreaking,
200}
201
202impl fidl::Persistable for ViewDescriptor {}
203
204#[derive(Clone, Debug, Default, PartialEq)]
206pub struct ViewTreeSnapshot {
207 pub time: Option<i64>,
209 pub views: Option<Vec<ViewDescriptor>>,
214 #[doc(hidden)]
215 pub __source_breaking: fidl::marker::SourceBreaking,
216}
217
218impl fidl::Persistable for ViewTreeSnapshot {}
219
220#[derive(Clone, Debug, Default, PartialEq)]
222pub struct WatchResponse {
223 pub epoch_end: Option<i64>,
225 pub updates: Option<Vec<ViewTreeSnapshot>>,
227 pub error: Option<Error>,
230 #[doc(hidden)]
231 pub __source_breaking: fidl::marker::SourceBreaking,
232}
233
234impl fidl::Persistable for WatchResponse {}
235
236mod internal {
237 use super::*;
238 unsafe impl fidl::encoding::TypeMarker for Error {
239 type Owned = Self;
240
241 #[inline(always)]
242 fn inline_align(_context: fidl::encoding::Context) -> usize {
243 4
244 }
245
246 #[inline(always)]
247 fn inline_size(_context: fidl::encoding::Context) -> usize {
248 4
249 }
250 }
251
252 impl fidl::encoding::ValueTypeMarker for Error {
253 type Borrowed<'a> = Self;
254 #[inline(always)]
255 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
256 *value
257 }
258 }
259
260 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Error {
261 #[inline]
262 unsafe fn encode(
263 self,
264 encoder: &mut fidl::encoding::Encoder<'_, D>,
265 offset: usize,
266 _depth: fidl::encoding::Depth,
267 ) -> fidl::Result<()> {
268 encoder.debug_check_bounds::<Self>(offset);
269 encoder.write_num(self.bits(), offset);
270 Ok(())
271 }
272 }
273
274 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Error {
275 #[inline(always)]
276 fn new_empty() -> Self {
277 Self::empty()
278 }
279
280 #[inline]
281 unsafe fn decode(
282 &mut self,
283 decoder: &mut fidl::encoding::Decoder<'_, D>,
284 offset: usize,
285 _depth: fidl::encoding::Depth,
286 ) -> fidl::Result<()> {
287 decoder.debug_check_bounds::<Self>(offset);
288 let prim = decoder.read_num::<u32>(offset);
289 *self = Self::from_bits_allow_unknown(prim);
290 Ok(())
291 }
292 }
293
294 impl fidl::encoding::ValueTypeMarker for AlignedExtent {
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 AlignedExtent {
302 type Owned = Self;
303
304 #[inline(always)]
305 fn inline_align(_context: fidl::encoding::Context) -> usize {
306 4
307 }
308
309 #[inline(always)]
310 fn inline_size(_context: fidl::encoding::Context) -> usize {
311 16
312 }
313 }
314
315 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AlignedExtent, D>
316 for &AlignedExtent
317 {
318 #[inline]
319 unsafe fn encode(
320 self,
321 encoder: &mut fidl::encoding::Encoder<'_, D>,
322 offset: usize,
323 _depth: fidl::encoding::Depth,
324 ) -> fidl::Result<()> {
325 encoder.debug_check_bounds::<AlignedExtent>(offset);
326 fidl::encoding::Encode::<AlignedExtent, D>::encode(
328 (
329 <fidl_fuchsia_math::PointF as fidl::encoding::ValueTypeMarker>::borrow(
330 &self.min,
331 ),
332 <fidl_fuchsia_math::PointF as fidl::encoding::ValueTypeMarker>::borrow(
333 &self.max,
334 ),
335 ),
336 encoder,
337 offset,
338 _depth,
339 )
340 }
341 }
342 unsafe impl<
343 D: fidl::encoding::ResourceDialect,
344 T0: fidl::encoding::Encode<fidl_fuchsia_math::PointF, D>,
345 T1: fidl::encoding::Encode<fidl_fuchsia_math::PointF, D>,
346 > fidl::encoding::Encode<AlignedExtent, D> for (T0, T1)
347 {
348 #[inline]
349 unsafe fn encode(
350 self,
351 encoder: &mut fidl::encoding::Encoder<'_, D>,
352 offset: usize,
353 depth: fidl::encoding::Depth,
354 ) -> fidl::Result<()> {
355 encoder.debug_check_bounds::<AlignedExtent>(offset);
356 self.0.encode(encoder, offset + 0, depth)?;
360 self.1.encode(encoder, offset + 8, depth)?;
361 Ok(())
362 }
363 }
364
365 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AlignedExtent {
366 #[inline(always)]
367 fn new_empty() -> Self {
368 Self {
369 min: fidl::new_empty!(fidl_fuchsia_math::PointF, D),
370 max: fidl::new_empty!(fidl_fuchsia_math::PointF, D),
371 }
372 }
373
374 #[inline]
375 unsafe fn decode(
376 &mut self,
377 decoder: &mut fidl::encoding::Decoder<'_, D>,
378 offset: usize,
379 _depth: fidl::encoding::Depth,
380 ) -> fidl::Result<()> {
381 decoder.debug_check_bounds::<Self>(offset);
382 fidl::decode!(
384 fidl_fuchsia_math::PointF,
385 D,
386 &mut self.min,
387 decoder,
388 offset + 0,
389 _depth
390 )?;
391 fidl::decode!(
392 fidl_fuchsia_math::PointF,
393 D,
394 &mut self.max,
395 decoder,
396 offset + 8,
397 _depth
398 )?;
399 Ok(())
400 }
401 }
402
403 impl fidl::encoding::ValueTypeMarker for Layout {
404 type Borrowed<'a> = &'a Self;
405 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
406 value
407 }
408 }
409
410 unsafe impl fidl::encoding::TypeMarker for Layout {
411 type Owned = Self;
412
413 #[inline(always)]
414 fn inline_align(_context: fidl::encoding::Context) -> usize {
415 4
416 }
417
418 #[inline(always)]
419 fn inline_size(_context: fidl::encoding::Context) -> usize {
420 40
421 }
422 }
423
424 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Layout, D> for &Layout {
425 #[inline]
426 unsafe fn encode(
427 self,
428 encoder: &mut fidl::encoding::Encoder<'_, D>,
429 offset: usize,
430 _depth: fidl::encoding::Depth,
431 ) -> fidl::Result<()> {
432 encoder.debug_check_bounds::<Layout>(offset);
433 fidl::encoding::Encode::<Layout, D>::encode(
435 (
436 <AlignedExtent as fidl::encoding::ValueTypeMarker>::borrow(&self.extent),
437 <fidl::encoding::Array<f32, 2> as fidl::encoding::ValueTypeMarker>::borrow(
438 &self.pixel_scale,
439 ),
440 <fidl_fuchsia_math::InsetF as fidl::encoding::ValueTypeMarker>::borrow(
441 &self.inset,
442 ),
443 ),
444 encoder,
445 offset,
446 _depth,
447 )
448 }
449 }
450 unsafe impl<
451 D: fidl::encoding::ResourceDialect,
452 T0: fidl::encoding::Encode<AlignedExtent, D>,
453 T1: fidl::encoding::Encode<fidl::encoding::Array<f32, 2>, D>,
454 T2: fidl::encoding::Encode<fidl_fuchsia_math::InsetF, D>,
455 > fidl::encoding::Encode<Layout, D> for (T0, T1, T2)
456 {
457 #[inline]
458 unsafe fn encode(
459 self,
460 encoder: &mut fidl::encoding::Encoder<'_, D>,
461 offset: usize,
462 depth: fidl::encoding::Depth,
463 ) -> fidl::Result<()> {
464 encoder.debug_check_bounds::<Layout>(offset);
465 self.0.encode(encoder, offset + 0, depth)?;
469 self.1.encode(encoder, offset + 16, depth)?;
470 self.2.encode(encoder, offset + 24, depth)?;
471 Ok(())
472 }
473 }
474
475 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Layout {
476 #[inline(always)]
477 fn new_empty() -> Self {
478 Self {
479 extent: fidl::new_empty!(AlignedExtent, D),
480 pixel_scale: fidl::new_empty!(fidl::encoding::Array<f32, 2>, D),
481 inset: fidl::new_empty!(fidl_fuchsia_math::InsetF, D),
482 }
483 }
484
485 #[inline]
486 unsafe fn decode(
487 &mut self,
488 decoder: &mut fidl::encoding::Decoder<'_, D>,
489 offset: usize,
490 _depth: fidl::encoding::Depth,
491 ) -> fidl::Result<()> {
492 decoder.debug_check_bounds::<Self>(offset);
493 fidl::decode!(AlignedExtent, D, &mut self.extent, decoder, offset + 0, _depth)?;
495 fidl::decode!(fidl::encoding::Array<f32, 2>, D, &mut self.pixel_scale, decoder, offset + 16, _depth)?;
496 fidl::decode!(
497 fidl_fuchsia_math::InsetF,
498 D,
499 &mut self.inset,
500 decoder,
501 offset + 24,
502 _depth
503 )?;
504 Ok(())
505 }
506 }
507
508 impl fidl::encoding::ValueTypeMarker for RotatableExtent {
509 type Borrowed<'a> = &'a Self;
510 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
511 value
512 }
513 }
514
515 unsafe impl fidl::encoding::TypeMarker for RotatableExtent {
516 type Owned = Self;
517
518 #[inline(always)]
519 fn inline_align(_context: fidl::encoding::Context) -> usize {
520 4
521 }
522
523 #[inline(always)]
524 fn inline_size(_context: fidl::encoding::Context) -> usize {
525 20
526 }
527 }
528
529 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RotatableExtent, D>
530 for &RotatableExtent
531 {
532 #[inline]
533 unsafe fn encode(
534 self,
535 encoder: &mut fidl::encoding::Encoder<'_, D>,
536 offset: usize,
537 _depth: fidl::encoding::Depth,
538 ) -> fidl::Result<()> {
539 encoder.debug_check_bounds::<RotatableExtent>(offset);
540 fidl::encoding::Encode::<RotatableExtent, D>::encode(
542 (
543 <fidl_fuchsia_math::PointF as fidl::encoding::ValueTypeMarker>::borrow(
544 &self.origin,
545 ),
546 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
547 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
548 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.angle_degrees),
549 ),
550 encoder,
551 offset,
552 _depth,
553 )
554 }
555 }
556 unsafe impl<
557 D: fidl::encoding::ResourceDialect,
558 T0: fidl::encoding::Encode<fidl_fuchsia_math::PointF, D>,
559 T1: fidl::encoding::Encode<f32, D>,
560 T2: fidl::encoding::Encode<f32, D>,
561 T3: fidl::encoding::Encode<f32, D>,
562 > fidl::encoding::Encode<RotatableExtent, D> for (T0, T1, T2, T3)
563 {
564 #[inline]
565 unsafe fn encode(
566 self,
567 encoder: &mut fidl::encoding::Encoder<'_, D>,
568 offset: usize,
569 depth: fidl::encoding::Depth,
570 ) -> fidl::Result<()> {
571 encoder.debug_check_bounds::<RotatableExtent>(offset);
572 self.0.encode(encoder, offset + 0, depth)?;
576 self.1.encode(encoder, offset + 8, depth)?;
577 self.2.encode(encoder, offset + 12, depth)?;
578 self.3.encode(encoder, offset + 16, depth)?;
579 Ok(())
580 }
581 }
582
583 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RotatableExtent {
584 #[inline(always)]
585 fn new_empty() -> Self {
586 Self {
587 origin: fidl::new_empty!(fidl_fuchsia_math::PointF, D),
588 width: fidl::new_empty!(f32, D),
589 height: fidl::new_empty!(f32, D),
590 angle_degrees: fidl::new_empty!(f32, D),
591 }
592 }
593
594 #[inline]
595 unsafe fn decode(
596 &mut self,
597 decoder: &mut fidl::encoding::Decoder<'_, D>,
598 offset: usize,
599 _depth: fidl::encoding::Depth,
600 ) -> fidl::Result<()> {
601 decoder.debug_check_bounds::<Self>(offset);
602 fidl::decode!(
604 fidl_fuchsia_math::PointF,
605 D,
606 &mut self.origin,
607 decoder,
608 offset + 0,
609 _depth
610 )?;
611 fidl::decode!(f32, D, &mut self.width, decoder, offset + 8, _depth)?;
612 fidl::decode!(f32, D, &mut self.height, decoder, offset + 12, _depth)?;
613 fidl::decode!(f32, D, &mut self.angle_degrees, decoder, offset + 16, _depth)?;
614 Ok(())
615 }
616 }
617
618 impl ViewDescriptor {
619 #[inline(always)]
620 fn max_ordinal_present(&self) -> u64 {
621 if let Some(_) = self.children {
622 return 5;
623 }
624 if let Some(_) = self.extent_in_parent {
625 return 4;
626 }
627 if let Some(_) = self.extent_in_context {
628 return 3;
629 }
630 if let Some(_) = self.layout {
631 return 2;
632 }
633 if let Some(_) = self.view_ref_koid {
634 return 1;
635 }
636 0
637 }
638 }
639
640 impl fidl::encoding::ValueTypeMarker for ViewDescriptor {
641 type Borrowed<'a> = &'a Self;
642 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
643 value
644 }
645 }
646
647 unsafe impl fidl::encoding::TypeMarker for ViewDescriptor {
648 type Owned = Self;
649
650 #[inline(always)]
651 fn inline_align(_context: fidl::encoding::Context) -> usize {
652 8
653 }
654
655 #[inline(always)]
656 fn inline_size(_context: fidl::encoding::Context) -> usize {
657 16
658 }
659 }
660
661 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewDescriptor, D>
662 for &ViewDescriptor
663 {
664 unsafe fn encode(
665 self,
666 encoder: &mut fidl::encoding::Encoder<'_, D>,
667 offset: usize,
668 mut depth: fidl::encoding::Depth,
669 ) -> fidl::Result<()> {
670 encoder.debug_check_bounds::<ViewDescriptor>(offset);
671 let max_ordinal: u64 = self.max_ordinal_present();
673 encoder.write_num(max_ordinal, offset);
674 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
675 if max_ordinal == 0 {
677 return Ok(());
678 }
679 depth.increment()?;
680 let envelope_size = 8;
681 let bytes_len = max_ordinal as usize * envelope_size;
682 #[allow(unused_variables)]
683 let offset = encoder.out_of_line_offset(bytes_len);
684 let mut _prev_end_offset: usize = 0;
685 if 1 > max_ordinal {
686 return Ok(());
687 }
688
689 let cur_offset: usize = (1 - 1) * envelope_size;
692
693 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
695
696 fidl::encoding::encode_in_envelope_optional::<u64, D>(
701 self.view_ref_koid.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
702 encoder,
703 offset + cur_offset,
704 depth,
705 )?;
706
707 _prev_end_offset = cur_offset + envelope_size;
708 if 2 > max_ordinal {
709 return Ok(());
710 }
711
712 let cur_offset: usize = (2 - 1) * envelope_size;
715
716 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
718
719 fidl::encoding::encode_in_envelope_optional::<Layout, D>(
724 self.layout.as_ref().map(<Layout as fidl::encoding::ValueTypeMarker>::borrow),
725 encoder,
726 offset + cur_offset,
727 depth,
728 )?;
729
730 _prev_end_offset = cur_offset + envelope_size;
731 if 3 > max_ordinal {
732 return Ok(());
733 }
734
735 let cur_offset: usize = (3 - 1) * envelope_size;
738
739 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
741
742 fidl::encoding::encode_in_envelope_optional::<RotatableExtent, D>(
747 self.extent_in_context
748 .as_ref()
749 .map(<RotatableExtent as fidl::encoding::ValueTypeMarker>::borrow),
750 encoder,
751 offset + cur_offset,
752 depth,
753 )?;
754
755 _prev_end_offset = cur_offset + envelope_size;
756 if 4 > max_ordinal {
757 return Ok(());
758 }
759
760 let cur_offset: usize = (4 - 1) * envelope_size;
763
764 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
766
767 fidl::encoding::encode_in_envelope_optional::<RotatableExtent, D>(
772 self.extent_in_parent
773 .as_ref()
774 .map(<RotatableExtent as fidl::encoding::ValueTypeMarker>::borrow),
775 encoder,
776 offset + cur_offset,
777 depth,
778 )?;
779
780 _prev_end_offset = cur_offset + envelope_size;
781 if 5 > max_ordinal {
782 return Ok(());
783 }
784
785 let cur_offset: usize = (5 - 1) * envelope_size;
788
789 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
791
792 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u32, 300>, D>(
797 self.children.as_ref().map(
798 <fidl::encoding::Vector<u32, 300> as fidl::encoding::ValueTypeMarker>::borrow,
799 ),
800 encoder,
801 offset + cur_offset,
802 depth,
803 )?;
804
805 _prev_end_offset = cur_offset + envelope_size;
806
807 Ok(())
808 }
809 }
810
811 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewDescriptor {
812 #[inline(always)]
813 fn new_empty() -> Self {
814 Self::default()
815 }
816
817 unsafe fn decode(
818 &mut self,
819 decoder: &mut fidl::encoding::Decoder<'_, D>,
820 offset: usize,
821 mut depth: fidl::encoding::Depth,
822 ) -> fidl::Result<()> {
823 decoder.debug_check_bounds::<Self>(offset);
824 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
825 None => return Err(fidl::Error::NotNullable),
826 Some(len) => len,
827 };
828 if len == 0 {
830 return Ok(());
831 };
832 depth.increment()?;
833 let envelope_size = 8;
834 let bytes_len = len * envelope_size;
835 let offset = decoder.out_of_line_offset(bytes_len)?;
836 let mut _next_ordinal_to_read = 0;
838 let mut next_offset = offset;
839 let end_offset = offset + bytes_len;
840 _next_ordinal_to_read += 1;
841 if next_offset >= end_offset {
842 return Ok(());
843 }
844
845 while _next_ordinal_to_read < 1 {
847 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
848 _next_ordinal_to_read += 1;
849 next_offset += envelope_size;
850 }
851
852 let next_out_of_line = decoder.next_out_of_line();
853 let handles_before = decoder.remaining_handles();
854 if let Some((inlined, num_bytes, num_handles)) =
855 fidl::encoding::decode_envelope_header(decoder, next_offset)?
856 {
857 let member_inline_size =
858 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
859 if inlined != (member_inline_size <= 4) {
860 return Err(fidl::Error::InvalidInlineBitInEnvelope);
861 }
862 let inner_offset;
863 let mut inner_depth = depth.clone();
864 if inlined {
865 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
866 inner_offset = next_offset;
867 } else {
868 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
869 inner_depth.increment()?;
870 }
871 let val_ref = self.view_ref_koid.get_or_insert_with(|| fidl::new_empty!(u64, D));
872 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
873 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
874 {
875 return Err(fidl::Error::InvalidNumBytesInEnvelope);
876 }
877 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
878 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
879 }
880 }
881
882 next_offset += envelope_size;
883 _next_ordinal_to_read += 1;
884 if next_offset >= end_offset {
885 return Ok(());
886 }
887
888 while _next_ordinal_to_read < 2 {
890 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
891 _next_ordinal_to_read += 1;
892 next_offset += envelope_size;
893 }
894
895 let next_out_of_line = decoder.next_out_of_line();
896 let handles_before = decoder.remaining_handles();
897 if let Some((inlined, num_bytes, num_handles)) =
898 fidl::encoding::decode_envelope_header(decoder, next_offset)?
899 {
900 let member_inline_size =
901 <Layout as fidl::encoding::TypeMarker>::inline_size(decoder.context);
902 if inlined != (member_inline_size <= 4) {
903 return Err(fidl::Error::InvalidInlineBitInEnvelope);
904 }
905 let inner_offset;
906 let mut inner_depth = depth.clone();
907 if inlined {
908 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
909 inner_offset = next_offset;
910 } else {
911 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
912 inner_depth.increment()?;
913 }
914 let val_ref = self.layout.get_or_insert_with(|| fidl::new_empty!(Layout, D));
915 fidl::decode!(Layout, D, val_ref, decoder, inner_offset, inner_depth)?;
916 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
917 {
918 return Err(fidl::Error::InvalidNumBytesInEnvelope);
919 }
920 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
921 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
922 }
923 }
924
925 next_offset += envelope_size;
926 _next_ordinal_to_read += 1;
927 if next_offset >= end_offset {
928 return Ok(());
929 }
930
931 while _next_ordinal_to_read < 3 {
933 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
934 _next_ordinal_to_read += 1;
935 next_offset += envelope_size;
936 }
937
938 let next_out_of_line = decoder.next_out_of_line();
939 let handles_before = decoder.remaining_handles();
940 if let Some((inlined, num_bytes, num_handles)) =
941 fidl::encoding::decode_envelope_header(decoder, next_offset)?
942 {
943 let member_inline_size =
944 <RotatableExtent as fidl::encoding::TypeMarker>::inline_size(decoder.context);
945 if inlined != (member_inline_size <= 4) {
946 return Err(fidl::Error::InvalidInlineBitInEnvelope);
947 }
948 let inner_offset;
949 let mut inner_depth = depth.clone();
950 if inlined {
951 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
952 inner_offset = next_offset;
953 } else {
954 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
955 inner_depth.increment()?;
956 }
957 let val_ref = self
958 .extent_in_context
959 .get_or_insert_with(|| fidl::new_empty!(RotatableExtent, D));
960 fidl::decode!(RotatableExtent, D, val_ref, decoder, inner_offset, inner_depth)?;
961 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
962 {
963 return Err(fidl::Error::InvalidNumBytesInEnvelope);
964 }
965 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
966 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
967 }
968 }
969
970 next_offset += envelope_size;
971 _next_ordinal_to_read += 1;
972 if next_offset >= end_offset {
973 return Ok(());
974 }
975
976 while _next_ordinal_to_read < 4 {
978 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
979 _next_ordinal_to_read += 1;
980 next_offset += envelope_size;
981 }
982
983 let next_out_of_line = decoder.next_out_of_line();
984 let handles_before = decoder.remaining_handles();
985 if let Some((inlined, num_bytes, num_handles)) =
986 fidl::encoding::decode_envelope_header(decoder, next_offset)?
987 {
988 let member_inline_size =
989 <RotatableExtent as fidl::encoding::TypeMarker>::inline_size(decoder.context);
990 if inlined != (member_inline_size <= 4) {
991 return Err(fidl::Error::InvalidInlineBitInEnvelope);
992 }
993 let inner_offset;
994 let mut inner_depth = depth.clone();
995 if inlined {
996 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
997 inner_offset = next_offset;
998 } else {
999 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1000 inner_depth.increment()?;
1001 }
1002 let val_ref = self
1003 .extent_in_parent
1004 .get_or_insert_with(|| fidl::new_empty!(RotatableExtent, D));
1005 fidl::decode!(RotatableExtent, D, val_ref, decoder, inner_offset, inner_depth)?;
1006 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1007 {
1008 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1009 }
1010 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1011 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1012 }
1013 }
1014
1015 next_offset += envelope_size;
1016 _next_ordinal_to_read += 1;
1017 if next_offset >= end_offset {
1018 return Ok(());
1019 }
1020
1021 while _next_ordinal_to_read < 5 {
1023 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1024 _next_ordinal_to_read += 1;
1025 next_offset += envelope_size;
1026 }
1027
1028 let next_out_of_line = decoder.next_out_of_line();
1029 let handles_before = decoder.remaining_handles();
1030 if let Some((inlined, num_bytes, num_handles)) =
1031 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1032 {
1033 let member_inline_size =
1034 <fidl::encoding::Vector<u32, 300> as fidl::encoding::TypeMarker>::inline_size(
1035 decoder.context,
1036 );
1037 if inlined != (member_inline_size <= 4) {
1038 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1039 }
1040 let inner_offset;
1041 let mut inner_depth = depth.clone();
1042 if inlined {
1043 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1044 inner_offset = next_offset;
1045 } else {
1046 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1047 inner_depth.increment()?;
1048 }
1049 let val_ref = self
1050 .children
1051 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u32, 300>, D));
1052 fidl::decode!(fidl::encoding::Vector<u32, 300>, D, val_ref, decoder, inner_offset, inner_depth)?;
1053 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1054 {
1055 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1056 }
1057 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1058 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1059 }
1060 }
1061
1062 next_offset += envelope_size;
1063
1064 while next_offset < end_offset {
1066 _next_ordinal_to_read += 1;
1067 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1068 next_offset += envelope_size;
1069 }
1070
1071 Ok(())
1072 }
1073 }
1074
1075 impl ViewTreeSnapshot {
1076 #[inline(always)]
1077 fn max_ordinal_present(&self) -> u64 {
1078 if let Some(_) = self.views {
1079 return 2;
1080 }
1081 if let Some(_) = self.time {
1082 return 1;
1083 }
1084 0
1085 }
1086 }
1087
1088 impl fidl::encoding::ValueTypeMarker for ViewTreeSnapshot {
1089 type Borrowed<'a> = &'a Self;
1090 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1091 value
1092 }
1093 }
1094
1095 unsafe impl fidl::encoding::TypeMarker for ViewTreeSnapshot {
1096 type Owned = Self;
1097
1098 #[inline(always)]
1099 fn inline_align(_context: fidl::encoding::Context) -> usize {
1100 8
1101 }
1102
1103 #[inline(always)]
1104 fn inline_size(_context: fidl::encoding::Context) -> usize {
1105 16
1106 }
1107 }
1108
1109 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewTreeSnapshot, D>
1110 for &ViewTreeSnapshot
1111 {
1112 unsafe fn encode(
1113 self,
1114 encoder: &mut fidl::encoding::Encoder<'_, D>,
1115 offset: usize,
1116 mut depth: fidl::encoding::Depth,
1117 ) -> fidl::Result<()> {
1118 encoder.debug_check_bounds::<ViewTreeSnapshot>(offset);
1119 let max_ordinal: u64 = self.max_ordinal_present();
1121 encoder.write_num(max_ordinal, offset);
1122 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1123 if max_ordinal == 0 {
1125 return Ok(());
1126 }
1127 depth.increment()?;
1128 let envelope_size = 8;
1129 let bytes_len = max_ordinal as usize * envelope_size;
1130 #[allow(unused_variables)]
1131 let offset = encoder.out_of_line_offset(bytes_len);
1132 let mut _prev_end_offset: usize = 0;
1133 if 1 > max_ordinal {
1134 return Ok(());
1135 }
1136
1137 let cur_offset: usize = (1 - 1) * envelope_size;
1140
1141 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1143
1144 fidl::encoding::encode_in_envelope_optional::<i64, D>(
1149 self.time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
1150 encoder,
1151 offset + cur_offset,
1152 depth,
1153 )?;
1154
1155 _prev_end_offset = cur_offset + envelope_size;
1156 if 2 > max_ordinal {
1157 return Ok(());
1158 }
1159
1160 let cur_offset: usize = (2 - 1) * envelope_size;
1163
1164 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1166
1167 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<ViewDescriptor, 300>, D>(
1172 self.views.as_ref().map(<fidl::encoding::Vector<ViewDescriptor, 300> as fidl::encoding::ValueTypeMarker>::borrow),
1173 encoder, offset + cur_offset, depth
1174 )?;
1175
1176 _prev_end_offset = cur_offset + envelope_size;
1177
1178 Ok(())
1179 }
1180 }
1181
1182 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewTreeSnapshot {
1183 #[inline(always)]
1184 fn new_empty() -> Self {
1185 Self::default()
1186 }
1187
1188 unsafe fn decode(
1189 &mut self,
1190 decoder: &mut fidl::encoding::Decoder<'_, D>,
1191 offset: usize,
1192 mut depth: fidl::encoding::Depth,
1193 ) -> fidl::Result<()> {
1194 decoder.debug_check_bounds::<Self>(offset);
1195 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1196 None => return Err(fidl::Error::NotNullable),
1197 Some(len) => len,
1198 };
1199 if len == 0 {
1201 return Ok(());
1202 };
1203 depth.increment()?;
1204 let envelope_size = 8;
1205 let bytes_len = len * envelope_size;
1206 let offset = decoder.out_of_line_offset(bytes_len)?;
1207 let mut _next_ordinal_to_read = 0;
1209 let mut next_offset = offset;
1210 let end_offset = offset + bytes_len;
1211 _next_ordinal_to_read += 1;
1212 if next_offset >= end_offset {
1213 return Ok(());
1214 }
1215
1216 while _next_ordinal_to_read < 1 {
1218 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1219 _next_ordinal_to_read += 1;
1220 next_offset += envelope_size;
1221 }
1222
1223 let next_out_of_line = decoder.next_out_of_line();
1224 let handles_before = decoder.remaining_handles();
1225 if let Some((inlined, num_bytes, num_handles)) =
1226 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1227 {
1228 let member_inline_size =
1229 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1230 if inlined != (member_inline_size <= 4) {
1231 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1232 }
1233 let inner_offset;
1234 let mut inner_depth = depth.clone();
1235 if inlined {
1236 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1237 inner_offset = next_offset;
1238 } else {
1239 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1240 inner_depth.increment()?;
1241 }
1242 let val_ref = self.time.get_or_insert_with(|| fidl::new_empty!(i64, D));
1243 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
1244 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1245 {
1246 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1247 }
1248 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1249 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1250 }
1251 }
1252
1253 next_offset += envelope_size;
1254 _next_ordinal_to_read += 1;
1255 if next_offset >= end_offset {
1256 return Ok(());
1257 }
1258
1259 while _next_ordinal_to_read < 2 {
1261 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1262 _next_ordinal_to_read += 1;
1263 next_offset += envelope_size;
1264 }
1265
1266 let next_out_of_line = decoder.next_out_of_line();
1267 let handles_before = decoder.remaining_handles();
1268 if let Some((inlined, num_bytes, num_handles)) =
1269 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1270 {
1271 let member_inline_size = <fidl::encoding::Vector<ViewDescriptor, 300> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1272 if inlined != (member_inline_size <= 4) {
1273 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1274 }
1275 let inner_offset;
1276 let mut inner_depth = depth.clone();
1277 if inlined {
1278 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1279 inner_offset = next_offset;
1280 } else {
1281 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1282 inner_depth.increment()?;
1283 }
1284 let val_ref = self.views.get_or_insert_with(
1285 || fidl::new_empty!(fidl::encoding::Vector<ViewDescriptor, 300>, D),
1286 );
1287 fidl::decode!(fidl::encoding::Vector<ViewDescriptor, 300>, D, val_ref, decoder, inner_offset, inner_depth)?;
1288 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1289 {
1290 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1291 }
1292 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1293 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1294 }
1295 }
1296
1297 next_offset += envelope_size;
1298
1299 while next_offset < end_offset {
1301 _next_ordinal_to_read += 1;
1302 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1303 next_offset += envelope_size;
1304 }
1305
1306 Ok(())
1307 }
1308 }
1309
1310 impl WatchResponse {
1311 #[inline(always)]
1312 fn max_ordinal_present(&self) -> u64 {
1313 if let Some(_) = self.error {
1314 return 3;
1315 }
1316 if let Some(_) = self.updates {
1317 return 2;
1318 }
1319 if let Some(_) = self.epoch_end {
1320 return 1;
1321 }
1322 0
1323 }
1324 }
1325
1326 impl fidl::encoding::ValueTypeMarker for WatchResponse {
1327 type Borrowed<'a> = &'a Self;
1328 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1329 value
1330 }
1331 }
1332
1333 unsafe impl fidl::encoding::TypeMarker for WatchResponse {
1334 type Owned = Self;
1335
1336 #[inline(always)]
1337 fn inline_align(_context: fidl::encoding::Context) -> usize {
1338 8
1339 }
1340
1341 #[inline(always)]
1342 fn inline_size(_context: fidl::encoding::Context) -> usize {
1343 16
1344 }
1345 }
1346
1347 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WatchResponse, D>
1348 for &WatchResponse
1349 {
1350 unsafe fn encode(
1351 self,
1352 encoder: &mut fidl::encoding::Encoder<'_, D>,
1353 offset: usize,
1354 mut depth: fidl::encoding::Depth,
1355 ) -> fidl::Result<()> {
1356 encoder.debug_check_bounds::<WatchResponse>(offset);
1357 let max_ordinal: u64 = self.max_ordinal_present();
1359 encoder.write_num(max_ordinal, offset);
1360 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1361 if max_ordinal == 0 {
1363 return Ok(());
1364 }
1365 depth.increment()?;
1366 let envelope_size = 8;
1367 let bytes_len = max_ordinal as usize * envelope_size;
1368 #[allow(unused_variables)]
1369 let offset = encoder.out_of_line_offset(bytes_len);
1370 let mut _prev_end_offset: usize = 0;
1371 if 1 > max_ordinal {
1372 return Ok(());
1373 }
1374
1375 let cur_offset: usize = (1 - 1) * envelope_size;
1378
1379 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1381
1382 fidl::encoding::encode_in_envelope_optional::<i64, D>(
1387 self.epoch_end.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
1388 encoder,
1389 offset + cur_offset,
1390 depth,
1391 )?;
1392
1393 _prev_end_offset = cur_offset + envelope_size;
1394 if 2 > max_ordinal {
1395 return Ok(());
1396 }
1397
1398 let cur_offset: usize = (2 - 1) * envelope_size;
1401
1402 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1404
1405 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<ViewTreeSnapshot, 200>, D>(
1410 self.updates.as_ref().map(<fidl::encoding::Vector<ViewTreeSnapshot, 200> as fidl::encoding::ValueTypeMarker>::borrow),
1411 encoder, offset + cur_offset, depth
1412 )?;
1413
1414 _prev_end_offset = cur_offset + envelope_size;
1415 if 3 > max_ordinal {
1416 return Ok(());
1417 }
1418
1419 let cur_offset: usize = (3 - 1) * envelope_size;
1422
1423 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1425
1426 fidl::encoding::encode_in_envelope_optional::<Error, D>(
1431 self.error.as_ref().map(<Error as fidl::encoding::ValueTypeMarker>::borrow),
1432 encoder,
1433 offset + cur_offset,
1434 depth,
1435 )?;
1436
1437 _prev_end_offset = cur_offset + envelope_size;
1438
1439 Ok(())
1440 }
1441 }
1442
1443 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WatchResponse {
1444 #[inline(always)]
1445 fn new_empty() -> Self {
1446 Self::default()
1447 }
1448
1449 unsafe fn decode(
1450 &mut self,
1451 decoder: &mut fidl::encoding::Decoder<'_, D>,
1452 offset: usize,
1453 mut depth: fidl::encoding::Depth,
1454 ) -> fidl::Result<()> {
1455 decoder.debug_check_bounds::<Self>(offset);
1456 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1457 None => return Err(fidl::Error::NotNullable),
1458 Some(len) => len,
1459 };
1460 if len == 0 {
1462 return Ok(());
1463 };
1464 depth.increment()?;
1465 let envelope_size = 8;
1466 let bytes_len = len * envelope_size;
1467 let offset = decoder.out_of_line_offset(bytes_len)?;
1468 let mut _next_ordinal_to_read = 0;
1470 let mut next_offset = offset;
1471 let end_offset = offset + bytes_len;
1472 _next_ordinal_to_read += 1;
1473 if next_offset >= end_offset {
1474 return Ok(());
1475 }
1476
1477 while _next_ordinal_to_read < 1 {
1479 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1480 _next_ordinal_to_read += 1;
1481 next_offset += envelope_size;
1482 }
1483
1484 let next_out_of_line = decoder.next_out_of_line();
1485 let handles_before = decoder.remaining_handles();
1486 if let Some((inlined, num_bytes, num_handles)) =
1487 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1488 {
1489 let member_inline_size =
1490 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1491 if inlined != (member_inline_size <= 4) {
1492 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1493 }
1494 let inner_offset;
1495 let mut inner_depth = depth.clone();
1496 if inlined {
1497 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1498 inner_offset = next_offset;
1499 } else {
1500 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1501 inner_depth.increment()?;
1502 }
1503 let val_ref = self.epoch_end.get_or_insert_with(|| fidl::new_empty!(i64, D));
1504 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
1505 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1506 {
1507 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1508 }
1509 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1510 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1511 }
1512 }
1513
1514 next_offset += envelope_size;
1515 _next_ordinal_to_read += 1;
1516 if next_offset >= end_offset {
1517 return Ok(());
1518 }
1519
1520 while _next_ordinal_to_read < 2 {
1522 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1523 _next_ordinal_to_read += 1;
1524 next_offset += envelope_size;
1525 }
1526
1527 let next_out_of_line = decoder.next_out_of_line();
1528 let handles_before = decoder.remaining_handles();
1529 if let Some((inlined, num_bytes, num_handles)) =
1530 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1531 {
1532 let member_inline_size = <fidl::encoding::Vector<ViewTreeSnapshot, 200> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1533 if inlined != (member_inline_size <= 4) {
1534 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1535 }
1536 let inner_offset;
1537 let mut inner_depth = depth.clone();
1538 if inlined {
1539 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1540 inner_offset = next_offset;
1541 } else {
1542 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1543 inner_depth.increment()?;
1544 }
1545 let val_ref = self.updates.get_or_insert_with(
1546 || fidl::new_empty!(fidl::encoding::Vector<ViewTreeSnapshot, 200>, D),
1547 );
1548 fidl::decode!(fidl::encoding::Vector<ViewTreeSnapshot, 200>, D, val_ref, decoder, inner_offset, inner_depth)?;
1549 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1550 {
1551 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1552 }
1553 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1554 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1555 }
1556 }
1557
1558 next_offset += envelope_size;
1559 _next_ordinal_to_read += 1;
1560 if next_offset >= end_offset {
1561 return Ok(());
1562 }
1563
1564 while _next_ordinal_to_read < 3 {
1566 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1567 _next_ordinal_to_read += 1;
1568 next_offset += envelope_size;
1569 }
1570
1571 let next_out_of_line = decoder.next_out_of_line();
1572 let handles_before = decoder.remaining_handles();
1573 if let Some((inlined, num_bytes, num_handles)) =
1574 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1575 {
1576 let member_inline_size =
1577 <Error as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1578 if inlined != (member_inline_size <= 4) {
1579 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1580 }
1581 let inner_offset;
1582 let mut inner_depth = depth.clone();
1583 if inlined {
1584 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1585 inner_offset = next_offset;
1586 } else {
1587 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1588 inner_depth.increment()?;
1589 }
1590 let val_ref = self.error.get_or_insert_with(|| fidl::new_empty!(Error, D));
1591 fidl::decode!(Error, D, val_ref, decoder, inner_offset, inner_depth)?;
1592 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1593 {
1594 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1595 }
1596 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1597 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1598 }
1599 }
1600
1601 next_offset += envelope_size;
1602
1603 while next_offset < end_offset {
1605 _next_ordinal_to_read += 1;
1606 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1607 next_offset += envelope_size;
1608 }
1609
1610 Ok(())
1611 }
1612 }
1613}