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 OptionType = u8;
15
16pub const MAX_NUM_OPTION_TYPES: u16 = 256;
19
20pub const MAX_OPTION_BATCH_SIZE: u8 = 16;
22
23pub const MAX_OPTION_BODY_LENGTH: u16 = 2038;
26
27#[derive(Clone, Debug, PartialEq)]
28pub struct OptionWatcherWatchOptionsResponse {
29 pub options: Vec<OptionWatchEntry>,
31 pub dropped: u32,
35}
36
37impl fidl::Persistable for OptionWatcherWatchOptionsResponse {}
38
39#[derive(Clone, Debug, Default, PartialEq)]
46pub struct OptionWatchEntry {
47 pub interface_id: Option<u64>,
52 pub source_address: Option<fidl_fuchsia_net::Ipv6Address>,
57 pub option_type: Option<u8>,
61 pub body: Option<Vec<u8>>,
72 #[doc(hidden)]
73 pub __source_breaking: fidl::marker::SourceBreaking,
74}
75
76impl fidl::Persistable for OptionWatchEntry {}
77
78#[derive(Clone, Debug, Default, PartialEq)]
80pub struct RouterAdvertisementOptionWatcherParams {
81 pub interest_types: Option<Vec<u8>>,
85 pub interest_interface_id: Option<u64>,
91 #[doc(hidden)]
92 pub __source_breaking: fidl::marker::SourceBreaking,
93}
94
95impl fidl::Persistable for RouterAdvertisementOptionWatcherParams {}
96
97mod internal {
98 use super::*;
99
100 impl fidl::encoding::ValueTypeMarker for OptionWatcherWatchOptionsResponse {
101 type Borrowed<'a> = &'a Self;
102 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
103 value
104 }
105 }
106
107 unsafe impl fidl::encoding::TypeMarker for OptionWatcherWatchOptionsResponse {
108 type Owned = Self;
109
110 #[inline(always)]
111 fn inline_align(_context: fidl::encoding::Context) -> usize {
112 8
113 }
114
115 #[inline(always)]
116 fn inline_size(_context: fidl::encoding::Context) -> usize {
117 24
118 }
119 }
120
121 unsafe impl<D: fidl::encoding::ResourceDialect>
122 fidl::encoding::Encode<OptionWatcherWatchOptionsResponse, D>
123 for &OptionWatcherWatchOptionsResponse
124 {
125 #[inline]
126 unsafe fn encode(
127 self,
128 encoder: &mut fidl::encoding::Encoder<'_, D>,
129 offset: usize,
130 _depth: fidl::encoding::Depth,
131 ) -> fidl::Result<()> {
132 encoder.debug_check_bounds::<OptionWatcherWatchOptionsResponse>(offset);
133 fidl::encoding::Encode::<OptionWatcherWatchOptionsResponse, D>::encode(
135 (
136 <fidl::encoding::Vector<OptionWatchEntry, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
137 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.dropped),
138 ),
139 encoder, offset, _depth
140 )
141 }
142 }
143 unsafe impl<
144 D: fidl::encoding::ResourceDialect,
145 T0: fidl::encoding::Encode<fidl::encoding::Vector<OptionWatchEntry, 16>, D>,
146 T1: fidl::encoding::Encode<u32, D>,
147 > fidl::encoding::Encode<OptionWatcherWatchOptionsResponse, D> for (T0, T1)
148 {
149 #[inline]
150 unsafe fn encode(
151 self,
152 encoder: &mut fidl::encoding::Encoder<'_, D>,
153 offset: usize,
154 depth: fidl::encoding::Depth,
155 ) -> fidl::Result<()> {
156 encoder.debug_check_bounds::<OptionWatcherWatchOptionsResponse>(offset);
157 unsafe {
160 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
161 (ptr as *mut u64).write_unaligned(0);
162 }
163 self.0.encode(encoder, offset + 0, depth)?;
165 self.1.encode(encoder, offset + 16, depth)?;
166 Ok(())
167 }
168 }
169
170 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
171 for OptionWatcherWatchOptionsResponse
172 {
173 #[inline(always)]
174 fn new_empty() -> Self {
175 Self {
176 options: fidl::new_empty!(fidl::encoding::Vector<OptionWatchEntry, 16>, D),
177 dropped: fidl::new_empty!(u32, D),
178 }
179 }
180
181 #[inline]
182 unsafe fn decode(
183 &mut self,
184 decoder: &mut fidl::encoding::Decoder<'_, D>,
185 offset: usize,
186 _depth: fidl::encoding::Depth,
187 ) -> fidl::Result<()> {
188 decoder.debug_check_bounds::<Self>(offset);
189 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
191 let padval = unsafe { (ptr as *const u64).read_unaligned() };
192 let mask = 0xffffffff00000000u64;
193 let maskedval = padval & mask;
194 if maskedval != 0 {
195 return Err(fidl::Error::NonZeroPadding {
196 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
197 });
198 }
199 fidl::decode!(fidl::encoding::Vector<OptionWatchEntry, 16>, D, &mut self.options, decoder, offset + 0, _depth)?;
200 fidl::decode!(u32, D, &mut self.dropped, decoder, offset + 16, _depth)?;
201 Ok(())
202 }
203 }
204
205 impl OptionWatchEntry {
206 #[inline(always)]
207 fn max_ordinal_present(&self) -> u64 {
208 if let Some(_) = self.body {
209 return 4;
210 }
211 if let Some(_) = self.option_type {
212 return 3;
213 }
214 if let Some(_) = self.source_address {
215 return 2;
216 }
217 if let Some(_) = self.interface_id {
218 return 1;
219 }
220 0
221 }
222 }
223
224 impl fidl::encoding::ValueTypeMarker for OptionWatchEntry {
225 type Borrowed<'a> = &'a Self;
226 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
227 value
228 }
229 }
230
231 unsafe impl fidl::encoding::TypeMarker for OptionWatchEntry {
232 type Owned = Self;
233
234 #[inline(always)]
235 fn inline_align(_context: fidl::encoding::Context) -> usize {
236 8
237 }
238
239 #[inline(always)]
240 fn inline_size(_context: fidl::encoding::Context) -> usize {
241 16
242 }
243 }
244
245 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OptionWatchEntry, D>
246 for &OptionWatchEntry
247 {
248 unsafe fn encode(
249 self,
250 encoder: &mut fidl::encoding::Encoder<'_, D>,
251 offset: usize,
252 mut depth: fidl::encoding::Depth,
253 ) -> fidl::Result<()> {
254 encoder.debug_check_bounds::<OptionWatchEntry>(offset);
255 let max_ordinal: u64 = self.max_ordinal_present();
257 encoder.write_num(max_ordinal, offset);
258 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
259 if max_ordinal == 0 {
261 return Ok(());
262 }
263 depth.increment()?;
264 let envelope_size = 8;
265 let bytes_len = max_ordinal as usize * envelope_size;
266 #[allow(unused_variables)]
267 let offset = encoder.out_of_line_offset(bytes_len);
268 let mut _prev_end_offset: usize = 0;
269 if 1 > max_ordinal {
270 return Ok(());
271 }
272
273 let cur_offset: usize = (1 - 1) * envelope_size;
276
277 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
279
280 fidl::encoding::encode_in_envelope_optional::<u64, D>(
285 self.interface_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
286 encoder,
287 offset + cur_offset,
288 depth,
289 )?;
290
291 _prev_end_offset = cur_offset + envelope_size;
292 if 2 > max_ordinal {
293 return Ok(());
294 }
295
296 let cur_offset: usize = (2 - 1) * envelope_size;
299
300 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
302
303 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net::Ipv6Address, D>(
308 self.source_address.as_ref().map(
309 <fidl_fuchsia_net::Ipv6Address as fidl::encoding::ValueTypeMarker>::borrow,
310 ),
311 encoder,
312 offset + cur_offset,
313 depth,
314 )?;
315
316 _prev_end_offset = cur_offset + envelope_size;
317 if 3 > max_ordinal {
318 return Ok(());
319 }
320
321 let cur_offset: usize = (3 - 1) * envelope_size;
324
325 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
327
328 fidl::encoding::encode_in_envelope_optional::<u8, D>(
333 self.option_type.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
334 encoder,
335 offset + cur_offset,
336 depth,
337 )?;
338
339 _prev_end_offset = cur_offset + envelope_size;
340 if 4 > max_ordinal {
341 return Ok(());
342 }
343
344 let cur_offset: usize = (4 - 1) * envelope_size;
347
348 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
350
351 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 2038>, D>(
356 self.body.as_ref().map(
357 <fidl::encoding::Vector<u8, 2038> as fidl::encoding::ValueTypeMarker>::borrow,
358 ),
359 encoder,
360 offset + cur_offset,
361 depth,
362 )?;
363
364 _prev_end_offset = cur_offset + envelope_size;
365
366 Ok(())
367 }
368 }
369
370 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OptionWatchEntry {
371 #[inline(always)]
372 fn new_empty() -> Self {
373 Self::default()
374 }
375
376 unsafe fn decode(
377 &mut self,
378 decoder: &mut fidl::encoding::Decoder<'_, D>,
379 offset: usize,
380 mut depth: fidl::encoding::Depth,
381 ) -> fidl::Result<()> {
382 decoder.debug_check_bounds::<Self>(offset);
383 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
384 None => return Err(fidl::Error::NotNullable),
385 Some(len) => len,
386 };
387 if len == 0 {
389 return Ok(());
390 };
391 depth.increment()?;
392 let envelope_size = 8;
393 let bytes_len = len * envelope_size;
394 let offset = decoder.out_of_line_offset(bytes_len)?;
395 let mut _next_ordinal_to_read = 0;
397 let mut next_offset = offset;
398 let end_offset = offset + bytes_len;
399 _next_ordinal_to_read += 1;
400 if next_offset >= end_offset {
401 return Ok(());
402 }
403
404 while _next_ordinal_to_read < 1 {
406 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
407 _next_ordinal_to_read += 1;
408 next_offset += envelope_size;
409 }
410
411 let next_out_of_line = decoder.next_out_of_line();
412 let handles_before = decoder.remaining_handles();
413 if let Some((inlined, num_bytes, num_handles)) =
414 fidl::encoding::decode_envelope_header(decoder, next_offset)?
415 {
416 let member_inline_size =
417 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
418 if inlined != (member_inline_size <= 4) {
419 return Err(fidl::Error::InvalidInlineBitInEnvelope);
420 }
421 let inner_offset;
422 let mut inner_depth = depth.clone();
423 if inlined {
424 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
425 inner_offset = next_offset;
426 } else {
427 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
428 inner_depth.increment()?;
429 }
430 let val_ref = self.interface_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
431 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
432 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
433 {
434 return Err(fidl::Error::InvalidNumBytesInEnvelope);
435 }
436 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
437 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
438 }
439 }
440
441 next_offset += envelope_size;
442 _next_ordinal_to_read += 1;
443 if next_offset >= end_offset {
444 return Ok(());
445 }
446
447 while _next_ordinal_to_read < 2 {
449 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
450 _next_ordinal_to_read += 1;
451 next_offset += envelope_size;
452 }
453
454 let next_out_of_line = decoder.next_out_of_line();
455 let handles_before = decoder.remaining_handles();
456 if let Some((inlined, num_bytes, num_handles)) =
457 fidl::encoding::decode_envelope_header(decoder, next_offset)?
458 {
459 let member_inline_size =
460 <fidl_fuchsia_net::Ipv6Address as fidl::encoding::TypeMarker>::inline_size(
461 decoder.context,
462 );
463 if inlined != (member_inline_size <= 4) {
464 return Err(fidl::Error::InvalidInlineBitInEnvelope);
465 }
466 let inner_offset;
467 let mut inner_depth = depth.clone();
468 if inlined {
469 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
470 inner_offset = next_offset;
471 } else {
472 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
473 inner_depth.increment()?;
474 }
475 let val_ref = self
476 .source_address
477 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net::Ipv6Address, D));
478 fidl::decode!(
479 fidl_fuchsia_net::Ipv6Address,
480 D,
481 val_ref,
482 decoder,
483 inner_offset,
484 inner_depth
485 )?;
486 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
487 {
488 return Err(fidl::Error::InvalidNumBytesInEnvelope);
489 }
490 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
491 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
492 }
493 }
494
495 next_offset += envelope_size;
496 _next_ordinal_to_read += 1;
497 if next_offset >= end_offset {
498 return Ok(());
499 }
500
501 while _next_ordinal_to_read < 3 {
503 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
504 _next_ordinal_to_read += 1;
505 next_offset += envelope_size;
506 }
507
508 let next_out_of_line = decoder.next_out_of_line();
509 let handles_before = decoder.remaining_handles();
510 if let Some((inlined, num_bytes, num_handles)) =
511 fidl::encoding::decode_envelope_header(decoder, next_offset)?
512 {
513 let member_inline_size =
514 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
515 if inlined != (member_inline_size <= 4) {
516 return Err(fidl::Error::InvalidInlineBitInEnvelope);
517 }
518 let inner_offset;
519 let mut inner_depth = depth.clone();
520 if inlined {
521 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
522 inner_offset = next_offset;
523 } else {
524 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
525 inner_depth.increment()?;
526 }
527 let val_ref = self.option_type.get_or_insert_with(|| fidl::new_empty!(u8, D));
528 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
529 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
530 {
531 return Err(fidl::Error::InvalidNumBytesInEnvelope);
532 }
533 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
534 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
535 }
536 }
537
538 next_offset += envelope_size;
539 _next_ordinal_to_read += 1;
540 if next_offset >= end_offset {
541 return Ok(());
542 }
543
544 while _next_ordinal_to_read < 4 {
546 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
547 _next_ordinal_to_read += 1;
548 next_offset += envelope_size;
549 }
550
551 let next_out_of_line = decoder.next_out_of_line();
552 let handles_before = decoder.remaining_handles();
553 if let Some((inlined, num_bytes, num_handles)) =
554 fidl::encoding::decode_envelope_header(decoder, next_offset)?
555 {
556 let member_inline_size =
557 <fidl::encoding::Vector<u8, 2038> as fidl::encoding::TypeMarker>::inline_size(
558 decoder.context,
559 );
560 if inlined != (member_inline_size <= 4) {
561 return Err(fidl::Error::InvalidInlineBitInEnvelope);
562 }
563 let inner_offset;
564 let mut inner_depth = depth.clone();
565 if inlined {
566 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
567 inner_offset = next_offset;
568 } else {
569 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
570 inner_depth.increment()?;
571 }
572 let val_ref = self
573 .body
574 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 2038>, D));
575 fidl::decode!(fidl::encoding::Vector<u8, 2038>, D, val_ref, decoder, inner_offset, inner_depth)?;
576 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
577 {
578 return Err(fidl::Error::InvalidNumBytesInEnvelope);
579 }
580 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
581 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
582 }
583 }
584
585 next_offset += envelope_size;
586
587 while next_offset < end_offset {
589 _next_ordinal_to_read += 1;
590 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
591 next_offset += envelope_size;
592 }
593
594 Ok(())
595 }
596 }
597
598 impl RouterAdvertisementOptionWatcherParams {
599 #[inline(always)]
600 fn max_ordinal_present(&self) -> u64 {
601 if let Some(_) = self.interest_interface_id {
602 return 2;
603 }
604 if let Some(_) = self.interest_types {
605 return 1;
606 }
607 0
608 }
609 }
610
611 impl fidl::encoding::ValueTypeMarker for RouterAdvertisementOptionWatcherParams {
612 type Borrowed<'a> = &'a Self;
613 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
614 value
615 }
616 }
617
618 unsafe impl fidl::encoding::TypeMarker for RouterAdvertisementOptionWatcherParams {
619 type Owned = Self;
620
621 #[inline(always)]
622 fn inline_align(_context: fidl::encoding::Context) -> usize {
623 8
624 }
625
626 #[inline(always)]
627 fn inline_size(_context: fidl::encoding::Context) -> usize {
628 16
629 }
630 }
631
632 unsafe impl<D: fidl::encoding::ResourceDialect>
633 fidl::encoding::Encode<RouterAdvertisementOptionWatcherParams, D>
634 for &RouterAdvertisementOptionWatcherParams
635 {
636 unsafe fn encode(
637 self,
638 encoder: &mut fidl::encoding::Encoder<'_, D>,
639 offset: usize,
640 mut depth: fidl::encoding::Depth,
641 ) -> fidl::Result<()> {
642 encoder.debug_check_bounds::<RouterAdvertisementOptionWatcherParams>(offset);
643 let max_ordinal: u64 = self.max_ordinal_present();
645 encoder.write_num(max_ordinal, offset);
646 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
647 if max_ordinal == 0 {
649 return Ok(());
650 }
651 depth.increment()?;
652 let envelope_size = 8;
653 let bytes_len = max_ordinal as usize * envelope_size;
654 #[allow(unused_variables)]
655 let offset = encoder.out_of_line_offset(bytes_len);
656 let mut _prev_end_offset: usize = 0;
657 if 1 > max_ordinal {
658 return Ok(());
659 }
660
661 let cur_offset: usize = (1 - 1) * envelope_size;
664
665 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
667
668 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
673 self.interest_types.as_ref().map(
674 <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
675 ),
676 encoder,
677 offset + cur_offset,
678 depth,
679 )?;
680
681 _prev_end_offset = cur_offset + envelope_size;
682 if 2 > max_ordinal {
683 return Ok(());
684 }
685
686 let cur_offset: usize = (2 - 1) * envelope_size;
689
690 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
692
693 fidl::encoding::encode_in_envelope_optional::<u64, D>(
698 self.interest_interface_id
699 .as_ref()
700 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
701 encoder,
702 offset + cur_offset,
703 depth,
704 )?;
705
706 _prev_end_offset = cur_offset + envelope_size;
707
708 Ok(())
709 }
710 }
711
712 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
713 for RouterAdvertisementOptionWatcherParams
714 {
715 #[inline(always)]
716 fn new_empty() -> Self {
717 Self::default()
718 }
719
720 unsafe fn decode(
721 &mut self,
722 decoder: &mut fidl::encoding::Decoder<'_, D>,
723 offset: usize,
724 mut depth: fidl::encoding::Depth,
725 ) -> fidl::Result<()> {
726 decoder.debug_check_bounds::<Self>(offset);
727 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
728 None => return Err(fidl::Error::NotNullable),
729 Some(len) => len,
730 };
731 if len == 0 {
733 return Ok(());
734 };
735 depth.increment()?;
736 let envelope_size = 8;
737 let bytes_len = len * envelope_size;
738 let offset = decoder.out_of_line_offset(bytes_len)?;
739 let mut _next_ordinal_to_read = 0;
741 let mut next_offset = offset;
742 let end_offset = offset + bytes_len;
743 _next_ordinal_to_read += 1;
744 if next_offset >= end_offset {
745 return Ok(());
746 }
747
748 while _next_ordinal_to_read < 1 {
750 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
751 _next_ordinal_to_read += 1;
752 next_offset += envelope_size;
753 }
754
755 let next_out_of_line = decoder.next_out_of_line();
756 let handles_before = decoder.remaining_handles();
757 if let Some((inlined, num_bytes, num_handles)) =
758 fidl::encoding::decode_envelope_header(decoder, next_offset)?
759 {
760 let member_inline_size =
761 <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
762 decoder.context,
763 );
764 if inlined != (member_inline_size <= 4) {
765 return Err(fidl::Error::InvalidInlineBitInEnvelope);
766 }
767 let inner_offset;
768 let mut inner_depth = depth.clone();
769 if inlined {
770 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
771 inner_offset = next_offset;
772 } else {
773 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
774 inner_depth.increment()?;
775 }
776 let val_ref = self
777 .interest_types
778 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
779 fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
780 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
781 {
782 return Err(fidl::Error::InvalidNumBytesInEnvelope);
783 }
784 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
785 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
786 }
787 }
788
789 next_offset += envelope_size;
790 _next_ordinal_to_read += 1;
791 if next_offset >= end_offset {
792 return Ok(());
793 }
794
795 while _next_ordinal_to_read < 2 {
797 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
798 _next_ordinal_to_read += 1;
799 next_offset += envelope_size;
800 }
801
802 let next_out_of_line = decoder.next_out_of_line();
803 let handles_before = decoder.remaining_handles();
804 if let Some((inlined, num_bytes, num_handles)) =
805 fidl::encoding::decode_envelope_header(decoder, next_offset)?
806 {
807 let member_inline_size =
808 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
809 if inlined != (member_inline_size <= 4) {
810 return Err(fidl::Error::InvalidInlineBitInEnvelope);
811 }
812 let inner_offset;
813 let mut inner_depth = depth.clone();
814 if inlined {
815 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
816 inner_offset = next_offset;
817 } else {
818 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
819 inner_depth.increment()?;
820 }
821 let val_ref =
822 self.interest_interface_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
823 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
824 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
825 {
826 return Err(fidl::Error::InvalidNumBytesInEnvelope);
827 }
828 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
829 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
830 }
831 }
832
833 next_offset += envelope_size;
834
835 while next_offset < end_offset {
837 _next_ordinal_to_read += 1;
838 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
839 next_offset += envelope_size;
840 }
841
842 Ok(())
843 }
844 }
845}