fidl_fuchsia_lowpan_test_common/
fidl_fuchsia_lowpan_test_common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11/// Maximum number of addresses that can be in the address filter list.
12pub const MAX_FILTERED: u16 = 100;
13
14pub const MAX_NEIGHBORS: u32 = 1024;
15
16/// Describes the address filtering mode of the interface.
17#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
18#[repr(i32)]
19pub enum MacAddressFilterMode {
20    /// Address filtering is disabled. All packets that are
21    /// received are processed normally.
22    Disabled = 0,
23    /// Only packets that have addresses matching an address
24    /// in the filter list will be allowed to be processed.
25    /// All other packets are dropped as if they were never
26    /// received.
27    ///
28    /// Additionally, if an RSSI value was associated
29    /// with an item, that value will be substituted for internal
30    /// routing considerations.
31    Allow = 1,
32    /// All packets from addresses in the filter list will be
33    /// dropped.
34    Deny = 2,
35}
36
37impl MacAddressFilterMode {
38    #[inline]
39    pub fn from_primitive(prim: i32) -> Option<Self> {
40        match prim {
41            0 => Some(Self::Disabled),
42            1 => Some(Self::Allow),
43            2 => Some(Self::Deny),
44            _ => None,
45        }
46    }
47
48    #[inline]
49    pub const fn into_primitive(self) -> i32 {
50        self as i32
51    }
52
53    #[deprecated = "Strict enums should not use `is_unknown`"]
54    #[inline]
55    pub fn is_unknown(&self) -> bool {
56        false
57    }
58}
59
60#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
61#[repr(C)]
62pub struct DeviceTestGetCurrentChannelResponse {
63    pub channel_index: u16,
64}
65
66impl fidl::Persistable for DeviceTestGetCurrentChannelResponse {}
67
68#[derive(Clone, Debug, PartialEq)]
69pub struct DeviceTestGetCurrentMacAddressResponse {
70    pub address: fidl_fuchsia_lowpan::MacAddress,
71}
72
73impl fidl::Persistable for DeviceTestGetCurrentMacAddressResponse {}
74
75#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
76#[repr(C)]
77pub struct DeviceTestGetCurrentRssiResponse {
78    pub rssi: i8,
79}
80
81impl fidl::Persistable for DeviceTestGetCurrentRssiResponse {}
82
83#[derive(Clone, Debug, PartialEq)]
84pub struct DeviceTestGetFactoryMacAddressResponse {
85    pub address: fidl_fuchsia_lowpan::MacAddress,
86}
87
88impl fidl::Persistable for DeviceTestGetFactoryMacAddressResponse {}
89
90#[derive(Clone, Debug, PartialEq)]
91pub struct DeviceTestGetMacAddressFilterSettingsResponse {
92    pub settings: MacAddressFilterSettings,
93}
94
95impl fidl::Persistable for DeviceTestGetMacAddressFilterSettingsResponse {}
96
97#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
98pub struct DeviceTestGetNcpVersionResponse {
99    pub version: String,
100}
101
102impl fidl::Persistable for DeviceTestGetNcpVersionResponse {}
103
104#[derive(Clone, Debug, PartialEq)]
105pub struct DeviceTestGetNeighborTableResponse {
106    pub neighbor_table: Vec<NeighborInfo>,
107}
108
109impl fidl::Persistable for DeviceTestGetNeighborTableResponse {}
110
111#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
112#[repr(C)]
113pub struct DeviceTestGetPartitionIdResponse {
114    pub pid: u32,
115}
116
117impl fidl::Persistable for DeviceTestGetPartitionIdResponse {}
118
119#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
120#[repr(C)]
121pub struct DeviceTestGetThreadRloc16Response {
122    pub rloc: u16,
123}
124
125impl fidl::Persistable for DeviceTestGetThreadRloc16Response {}
126
127#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
128#[repr(C)]
129pub struct DeviceTestGetThreadRouterIdResponse {
130    pub router_id: u8,
131}
132
133impl fidl::Persistable for DeviceTestGetThreadRouterIdResponse {}
134
135#[derive(Clone, Debug, PartialEq)]
136pub struct DeviceTestReplaceMacAddressFilterSettingsRequest {
137    pub settings: MacAddressFilterSettings,
138}
139
140impl fidl::Persistable for DeviceTestReplaceMacAddressFilterSettingsRequest {}
141
142/// An item in the MAC filter list.
143#[derive(Clone, Debug, Default, PartialEq)]
144pub struct MacAddressFilterItem {
145    /// The MAC address of the item. This field is required.
146    pub mac_address: Option<fidl_fuchsia_lowpan::MacAddress>,
147    /// Replacement RSSI value for packets received from this address.
148    ///
149    /// This field is ignored unless the mode is set to `MacAddressFilterMode::ALLOW`.
150    ///
151    /// This value is substituted for all received packets. This can affect
152    /// what the mesh topology ultimately looks like.
153    pub rssi: Option<i8>,
154    #[doc(hidden)]
155    pub __source_breaking: fidl::marker::SourceBreaking,
156}
157
158impl fidl::Persistable for MacAddressFilterItem {}
159
160#[derive(Clone, Debug, Default, PartialEq)]
161pub struct MacAddressFilterSettings {
162    /// Address filter mode.
163    ///
164    /// This field is required. If this field is absent when passed to
165    /// `ReplaceMacAddressFilterSettings`, the channel will be closed with
166    /// the epitaph `ZX_ERR_INVALID_ARGUMENT`.
167    pub mode: Option<MacAddressFilterMode>,
168    /// Addresses to be filtered.
169    ///
170    /// If this field is absent it is assumed to be empty.
171    pub items: Option<Vec<MacAddressFilterItem>>,
172    #[doc(hidden)]
173    pub __source_breaking: fidl::marker::SourceBreaking,
174}
175
176impl fidl::Persistable for MacAddressFilterSettings {}
177
178/// Neighbor Table Entry
179///
180/// All fields are optional except for `mac_address`.
181///
182/// See also:
183///   * https://openthread.io/reference/struct/ot-neighbor-info
184///   * https://openthread.io/reference/struct/ot-child-info
185///   * https://github.com/openthread/wpantund/blob/8db2a71c9597e08949dfc38d8c10f830e3de565c/third_party/openthread/src/ncp/spinel.h#L2356-L2373
186#[derive(Clone, Debug, Default, PartialEq)]
187pub struct NeighborInfo {
188    /// The MAC address of the neighbor.
189    ///
190    /// Note that this is the only field guaranteed to be present.
191    pub mac_address: Option<fidl_fuchsia_lowpan::MacAddress>,
192    /// 802.15.4 short address of neighbor.
193    ///
194    /// On Thread networks, this is also the RLOC16.
195    pub short_address: Option<u16>,
196    /// The age of this entry in the neighbor table.
197    ///
198    /// Describes when this neighbor was last seen.
199    /// Resolution is roughly +/- 1sec.
200    pub age: Option<i64>,
201    /// True if this neighbor is considered a child and is thus
202    /// entirely dependent on this device for routing.
203    ///
204    /// If absent, assumed to be false.
205    pub is_child: Option<bool>,
206    /// The number of link (non-management) frames received from this neighbor.
207    pub link_frame_count: Option<u32>,
208    /// The number of management (MLE, etc) frames received from this neighbor.
209    pub mgmt_frame_count: Option<u32>,
210    /// RSSI of the most recent packet received from the neighbor.
211    pub last_rssi_in: Option<i32>,
212    /// Average/typical RSSI of packets received from the neighbor.
213    pub avg_rssi_in: Option<i8>,
214    /// LQI of the most recent packet received from the neighbor.
215    ///
216    /// Value is between 1 and 255, with 1 being the worst possible
217    /// link quality (any worse and it would not have been decoded)
218    /// and 255 being perfect reception. All values in between
219    /// are a roughly linear (but not well defined) extrapolation
220    /// between these two extremes.
221    ///
222    /// Zero values must not be encoded, but if encountered should be
223    /// interpreted as if the LQI field were absent.
224    ///
225    /// In 802.15.4 networks, LQI is typically determined by the number of
226    /// "chip errors" when decoding the packets.
227    pub lqi_in: Option<u8>,
228    /// Thread Mode TLV. Only present on Thread networks.
229    ///
230    /// Defined by section 4.5.2 of the Thread 1.1.1 specification ("Mode TLV").
231    pub thread_mode: Option<u8>,
232    /// Frame error rate.
233    ///
234    /// `0xffff` indicates 100%, `0x0000` indicates 0%.
235    pub frame_error_rate: Option<u16>,
236    /// IPv6 message error rate.
237    ///
238    /// `0xffff` indicates 100%, `0x0000` indicates 0%.
239    pub ipv6_error_rate: Option<u16>,
240    /// True if the child is CSL synced.
241    ///
242    /// CSL is Coordinated Sampled Listening, a mechanism for sleepy devices
243    /// to perform indirect TX.
244    pub child_is_csl_synced: Option<bool>,
245    /// True if the child is restoring state.
246    pub child_is_state_restoring: Option<bool>,
247    /// Version of NetData that the neighbor has.
248    pub net_data_version: Option<u8>,
249    /// Number of messages queued for the neighbor.
250    pub queued_messages: Option<u16>,
251    /// MLE version for the neighbor.
252    pub thread_mle_version: Option<u8>,
253    #[doc(hidden)]
254    pub __source_breaking: fidl::marker::SourceBreaking,
255}
256
257impl fidl::Persistable for NeighborInfo {}
258
259mod internal {
260    use super::*;
261    unsafe impl fidl::encoding::TypeMarker for MacAddressFilterMode {
262        type Owned = Self;
263
264        #[inline(always)]
265        fn inline_align(_context: fidl::encoding::Context) -> usize {
266            std::mem::align_of::<i32>()
267        }
268
269        #[inline(always)]
270        fn inline_size(_context: fidl::encoding::Context) -> usize {
271            std::mem::size_of::<i32>()
272        }
273
274        #[inline(always)]
275        fn encode_is_copy() -> bool {
276            true
277        }
278
279        #[inline(always)]
280        fn decode_is_copy() -> bool {
281            false
282        }
283    }
284
285    impl fidl::encoding::ValueTypeMarker for MacAddressFilterMode {
286        type Borrowed<'a> = Self;
287        #[inline(always)]
288        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
289            *value
290        }
291    }
292
293    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
294        for MacAddressFilterMode
295    {
296        #[inline]
297        unsafe fn encode(
298            self,
299            encoder: &mut fidl::encoding::Encoder<'_, D>,
300            offset: usize,
301            _depth: fidl::encoding::Depth,
302        ) -> fidl::Result<()> {
303            encoder.debug_check_bounds::<Self>(offset);
304            encoder.write_num(self.into_primitive(), offset);
305            Ok(())
306        }
307    }
308
309    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MacAddressFilterMode {
310        #[inline(always)]
311        fn new_empty() -> Self {
312            Self::Disabled
313        }
314
315        #[inline]
316        unsafe fn decode(
317            &mut self,
318            decoder: &mut fidl::encoding::Decoder<'_, D>,
319            offset: usize,
320            _depth: fidl::encoding::Depth,
321        ) -> fidl::Result<()> {
322            decoder.debug_check_bounds::<Self>(offset);
323            let prim = decoder.read_num::<i32>(offset);
324
325            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
326            Ok(())
327        }
328    }
329
330    impl fidl::encoding::ValueTypeMarker for DeviceTestGetCurrentChannelResponse {
331        type Borrowed<'a> = &'a Self;
332        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
333            value
334        }
335    }
336
337    unsafe impl fidl::encoding::TypeMarker for DeviceTestGetCurrentChannelResponse {
338        type Owned = Self;
339
340        #[inline(always)]
341        fn inline_align(_context: fidl::encoding::Context) -> usize {
342            2
343        }
344
345        #[inline(always)]
346        fn inline_size(_context: fidl::encoding::Context) -> usize {
347            2
348        }
349        #[inline(always)]
350        fn encode_is_copy() -> bool {
351            true
352        }
353
354        #[inline(always)]
355        fn decode_is_copy() -> bool {
356            true
357        }
358    }
359
360    unsafe impl<D: fidl::encoding::ResourceDialect>
361        fidl::encoding::Encode<DeviceTestGetCurrentChannelResponse, D>
362        for &DeviceTestGetCurrentChannelResponse
363    {
364        #[inline]
365        unsafe fn encode(
366            self,
367            encoder: &mut fidl::encoding::Encoder<'_, D>,
368            offset: usize,
369            _depth: fidl::encoding::Depth,
370        ) -> fidl::Result<()> {
371            encoder.debug_check_bounds::<DeviceTestGetCurrentChannelResponse>(offset);
372            unsafe {
373                // Copy the object into the buffer.
374                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
375                (buf_ptr as *mut DeviceTestGetCurrentChannelResponse)
376                    .write_unaligned((self as *const DeviceTestGetCurrentChannelResponse).read());
377                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
378                // done second because the memcpy will write garbage to these bytes.
379            }
380            Ok(())
381        }
382    }
383    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
384        fidl::encoding::Encode<DeviceTestGetCurrentChannelResponse, D> for (T0,)
385    {
386        #[inline]
387        unsafe fn encode(
388            self,
389            encoder: &mut fidl::encoding::Encoder<'_, D>,
390            offset: usize,
391            depth: fidl::encoding::Depth,
392        ) -> fidl::Result<()> {
393            encoder.debug_check_bounds::<DeviceTestGetCurrentChannelResponse>(offset);
394            // Zero out padding regions. There's no need to apply masks
395            // because the unmasked parts will be overwritten by fields.
396            // Write the fields.
397            self.0.encode(encoder, offset + 0, depth)?;
398            Ok(())
399        }
400    }
401
402    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
403        for DeviceTestGetCurrentChannelResponse
404    {
405        #[inline(always)]
406        fn new_empty() -> Self {
407            Self { channel_index: fidl::new_empty!(u16, D) }
408        }
409
410        #[inline]
411        unsafe fn decode(
412            &mut self,
413            decoder: &mut fidl::encoding::Decoder<'_, D>,
414            offset: usize,
415            _depth: fidl::encoding::Depth,
416        ) -> fidl::Result<()> {
417            decoder.debug_check_bounds::<Self>(offset);
418            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
419            // Verify that padding bytes are zero.
420            // Copy from the buffer into the object.
421            unsafe {
422                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
423            }
424            Ok(())
425        }
426    }
427
428    impl fidl::encoding::ValueTypeMarker for DeviceTestGetCurrentMacAddressResponse {
429        type Borrowed<'a> = &'a Self;
430        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
431            value
432        }
433    }
434
435    unsafe impl fidl::encoding::TypeMarker for DeviceTestGetCurrentMacAddressResponse {
436        type Owned = Self;
437
438        #[inline(always)]
439        fn inline_align(_context: fidl::encoding::Context) -> usize {
440            1
441        }
442
443        #[inline(always)]
444        fn inline_size(_context: fidl::encoding::Context) -> usize {
445            8
446        }
447    }
448
449    unsafe impl<D: fidl::encoding::ResourceDialect>
450        fidl::encoding::Encode<DeviceTestGetCurrentMacAddressResponse, D>
451        for &DeviceTestGetCurrentMacAddressResponse
452    {
453        #[inline]
454        unsafe fn encode(
455            self,
456            encoder: &mut fidl::encoding::Encoder<'_, D>,
457            offset: usize,
458            _depth: fidl::encoding::Depth,
459        ) -> fidl::Result<()> {
460            encoder.debug_check_bounds::<DeviceTestGetCurrentMacAddressResponse>(offset);
461            // Delegate to tuple encoding.
462            fidl::encoding::Encode::<DeviceTestGetCurrentMacAddressResponse, D>::encode(
463                (<fidl_fuchsia_lowpan::MacAddress as fidl::encoding::ValueTypeMarker>::borrow(
464                    &self.address,
465                ),),
466                encoder,
467                offset,
468                _depth,
469            )
470        }
471    }
472    unsafe impl<
473            D: fidl::encoding::ResourceDialect,
474            T0: fidl::encoding::Encode<fidl_fuchsia_lowpan::MacAddress, D>,
475        > fidl::encoding::Encode<DeviceTestGetCurrentMacAddressResponse, D> for (T0,)
476    {
477        #[inline]
478        unsafe fn encode(
479            self,
480            encoder: &mut fidl::encoding::Encoder<'_, D>,
481            offset: usize,
482            depth: fidl::encoding::Depth,
483        ) -> fidl::Result<()> {
484            encoder.debug_check_bounds::<DeviceTestGetCurrentMacAddressResponse>(offset);
485            // Zero out padding regions. There's no need to apply masks
486            // because the unmasked parts will be overwritten by fields.
487            // Write the fields.
488            self.0.encode(encoder, offset + 0, depth)?;
489            Ok(())
490        }
491    }
492
493    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
494        for DeviceTestGetCurrentMacAddressResponse
495    {
496        #[inline(always)]
497        fn new_empty() -> Self {
498            Self { address: fidl::new_empty!(fidl_fuchsia_lowpan::MacAddress, D) }
499        }
500
501        #[inline]
502        unsafe fn decode(
503            &mut self,
504            decoder: &mut fidl::encoding::Decoder<'_, D>,
505            offset: usize,
506            _depth: fidl::encoding::Depth,
507        ) -> fidl::Result<()> {
508            decoder.debug_check_bounds::<Self>(offset);
509            // Verify that padding bytes are zero.
510            fidl::decode!(
511                fidl_fuchsia_lowpan::MacAddress,
512                D,
513                &mut self.address,
514                decoder,
515                offset + 0,
516                _depth
517            )?;
518            Ok(())
519        }
520    }
521
522    impl fidl::encoding::ValueTypeMarker for DeviceTestGetCurrentRssiResponse {
523        type Borrowed<'a> = &'a Self;
524        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
525            value
526        }
527    }
528
529    unsafe impl fidl::encoding::TypeMarker for DeviceTestGetCurrentRssiResponse {
530        type Owned = Self;
531
532        #[inline(always)]
533        fn inline_align(_context: fidl::encoding::Context) -> usize {
534            1
535        }
536
537        #[inline(always)]
538        fn inline_size(_context: fidl::encoding::Context) -> usize {
539            1
540        }
541        #[inline(always)]
542        fn encode_is_copy() -> bool {
543            true
544        }
545
546        #[inline(always)]
547        fn decode_is_copy() -> bool {
548            true
549        }
550    }
551
552    unsafe impl<D: fidl::encoding::ResourceDialect>
553        fidl::encoding::Encode<DeviceTestGetCurrentRssiResponse, D>
554        for &DeviceTestGetCurrentRssiResponse
555    {
556        #[inline]
557        unsafe fn encode(
558            self,
559            encoder: &mut fidl::encoding::Encoder<'_, D>,
560            offset: usize,
561            _depth: fidl::encoding::Depth,
562        ) -> fidl::Result<()> {
563            encoder.debug_check_bounds::<DeviceTestGetCurrentRssiResponse>(offset);
564            unsafe {
565                // Copy the object into the buffer.
566                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
567                (buf_ptr as *mut DeviceTestGetCurrentRssiResponse)
568                    .write_unaligned((self as *const DeviceTestGetCurrentRssiResponse).read());
569                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
570                // done second because the memcpy will write garbage to these bytes.
571            }
572            Ok(())
573        }
574    }
575    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i8, D>>
576        fidl::encoding::Encode<DeviceTestGetCurrentRssiResponse, D> for (T0,)
577    {
578        #[inline]
579        unsafe fn encode(
580            self,
581            encoder: &mut fidl::encoding::Encoder<'_, D>,
582            offset: usize,
583            depth: fidl::encoding::Depth,
584        ) -> fidl::Result<()> {
585            encoder.debug_check_bounds::<DeviceTestGetCurrentRssiResponse>(offset);
586            // Zero out padding regions. There's no need to apply masks
587            // because the unmasked parts will be overwritten by fields.
588            // Write the fields.
589            self.0.encode(encoder, offset + 0, depth)?;
590            Ok(())
591        }
592    }
593
594    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
595        for DeviceTestGetCurrentRssiResponse
596    {
597        #[inline(always)]
598        fn new_empty() -> Self {
599            Self { rssi: fidl::new_empty!(i8, D) }
600        }
601
602        #[inline]
603        unsafe fn decode(
604            &mut self,
605            decoder: &mut fidl::encoding::Decoder<'_, D>,
606            offset: usize,
607            _depth: fidl::encoding::Depth,
608        ) -> fidl::Result<()> {
609            decoder.debug_check_bounds::<Self>(offset);
610            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
611            // Verify that padding bytes are zero.
612            // Copy from the buffer into the object.
613            unsafe {
614                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
615            }
616            Ok(())
617        }
618    }
619
620    impl fidl::encoding::ValueTypeMarker for DeviceTestGetFactoryMacAddressResponse {
621        type Borrowed<'a> = &'a Self;
622        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
623            value
624        }
625    }
626
627    unsafe impl fidl::encoding::TypeMarker for DeviceTestGetFactoryMacAddressResponse {
628        type Owned = Self;
629
630        #[inline(always)]
631        fn inline_align(_context: fidl::encoding::Context) -> usize {
632            1
633        }
634
635        #[inline(always)]
636        fn inline_size(_context: fidl::encoding::Context) -> usize {
637            8
638        }
639    }
640
641    unsafe impl<D: fidl::encoding::ResourceDialect>
642        fidl::encoding::Encode<DeviceTestGetFactoryMacAddressResponse, D>
643        for &DeviceTestGetFactoryMacAddressResponse
644    {
645        #[inline]
646        unsafe fn encode(
647            self,
648            encoder: &mut fidl::encoding::Encoder<'_, D>,
649            offset: usize,
650            _depth: fidl::encoding::Depth,
651        ) -> fidl::Result<()> {
652            encoder.debug_check_bounds::<DeviceTestGetFactoryMacAddressResponse>(offset);
653            // Delegate to tuple encoding.
654            fidl::encoding::Encode::<DeviceTestGetFactoryMacAddressResponse, D>::encode(
655                (<fidl_fuchsia_lowpan::MacAddress as fidl::encoding::ValueTypeMarker>::borrow(
656                    &self.address,
657                ),),
658                encoder,
659                offset,
660                _depth,
661            )
662        }
663    }
664    unsafe impl<
665            D: fidl::encoding::ResourceDialect,
666            T0: fidl::encoding::Encode<fidl_fuchsia_lowpan::MacAddress, D>,
667        > fidl::encoding::Encode<DeviceTestGetFactoryMacAddressResponse, D> for (T0,)
668    {
669        #[inline]
670        unsafe fn encode(
671            self,
672            encoder: &mut fidl::encoding::Encoder<'_, D>,
673            offset: usize,
674            depth: fidl::encoding::Depth,
675        ) -> fidl::Result<()> {
676            encoder.debug_check_bounds::<DeviceTestGetFactoryMacAddressResponse>(offset);
677            // Zero out padding regions. There's no need to apply masks
678            // because the unmasked parts will be overwritten by fields.
679            // Write the fields.
680            self.0.encode(encoder, offset + 0, depth)?;
681            Ok(())
682        }
683    }
684
685    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
686        for DeviceTestGetFactoryMacAddressResponse
687    {
688        #[inline(always)]
689        fn new_empty() -> Self {
690            Self { address: fidl::new_empty!(fidl_fuchsia_lowpan::MacAddress, D) }
691        }
692
693        #[inline]
694        unsafe fn decode(
695            &mut self,
696            decoder: &mut fidl::encoding::Decoder<'_, D>,
697            offset: usize,
698            _depth: fidl::encoding::Depth,
699        ) -> fidl::Result<()> {
700            decoder.debug_check_bounds::<Self>(offset);
701            // Verify that padding bytes are zero.
702            fidl::decode!(
703                fidl_fuchsia_lowpan::MacAddress,
704                D,
705                &mut self.address,
706                decoder,
707                offset + 0,
708                _depth
709            )?;
710            Ok(())
711        }
712    }
713
714    impl fidl::encoding::ValueTypeMarker for DeviceTestGetMacAddressFilterSettingsResponse {
715        type Borrowed<'a> = &'a Self;
716        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
717            value
718        }
719    }
720
721    unsafe impl fidl::encoding::TypeMarker for DeviceTestGetMacAddressFilterSettingsResponse {
722        type Owned = Self;
723
724        #[inline(always)]
725        fn inline_align(_context: fidl::encoding::Context) -> usize {
726            8
727        }
728
729        #[inline(always)]
730        fn inline_size(_context: fidl::encoding::Context) -> usize {
731            16
732        }
733    }
734
735    unsafe impl<D: fidl::encoding::ResourceDialect>
736        fidl::encoding::Encode<DeviceTestGetMacAddressFilterSettingsResponse, D>
737        for &DeviceTestGetMacAddressFilterSettingsResponse
738    {
739        #[inline]
740        unsafe fn encode(
741            self,
742            encoder: &mut fidl::encoding::Encoder<'_, D>,
743            offset: usize,
744            _depth: fidl::encoding::Depth,
745        ) -> fidl::Result<()> {
746            encoder.debug_check_bounds::<DeviceTestGetMacAddressFilterSettingsResponse>(offset);
747            // Delegate to tuple encoding.
748            fidl::encoding::Encode::<DeviceTestGetMacAddressFilterSettingsResponse, D>::encode(
749                (<MacAddressFilterSettings as fidl::encoding::ValueTypeMarker>::borrow(
750                    &self.settings,
751                ),),
752                encoder,
753                offset,
754                _depth,
755            )
756        }
757    }
758    unsafe impl<
759            D: fidl::encoding::ResourceDialect,
760            T0: fidl::encoding::Encode<MacAddressFilterSettings, D>,
761        > fidl::encoding::Encode<DeviceTestGetMacAddressFilterSettingsResponse, D> for (T0,)
762    {
763        #[inline]
764        unsafe fn encode(
765            self,
766            encoder: &mut fidl::encoding::Encoder<'_, D>,
767            offset: usize,
768            depth: fidl::encoding::Depth,
769        ) -> fidl::Result<()> {
770            encoder.debug_check_bounds::<DeviceTestGetMacAddressFilterSettingsResponse>(offset);
771            // Zero out padding regions. There's no need to apply masks
772            // because the unmasked parts will be overwritten by fields.
773            // Write the fields.
774            self.0.encode(encoder, offset + 0, depth)?;
775            Ok(())
776        }
777    }
778
779    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
780        for DeviceTestGetMacAddressFilterSettingsResponse
781    {
782        #[inline(always)]
783        fn new_empty() -> Self {
784            Self { settings: fidl::new_empty!(MacAddressFilterSettings, D) }
785        }
786
787        #[inline]
788        unsafe fn decode(
789            &mut self,
790            decoder: &mut fidl::encoding::Decoder<'_, D>,
791            offset: usize,
792            _depth: fidl::encoding::Depth,
793        ) -> fidl::Result<()> {
794            decoder.debug_check_bounds::<Self>(offset);
795            // Verify that padding bytes are zero.
796            fidl::decode!(
797                MacAddressFilterSettings,
798                D,
799                &mut self.settings,
800                decoder,
801                offset + 0,
802                _depth
803            )?;
804            Ok(())
805        }
806    }
807
808    impl fidl::encoding::ValueTypeMarker for DeviceTestGetNcpVersionResponse {
809        type Borrowed<'a> = &'a Self;
810        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
811            value
812        }
813    }
814
815    unsafe impl fidl::encoding::TypeMarker for DeviceTestGetNcpVersionResponse {
816        type Owned = Self;
817
818        #[inline(always)]
819        fn inline_align(_context: fidl::encoding::Context) -> usize {
820            8
821        }
822
823        #[inline(always)]
824        fn inline_size(_context: fidl::encoding::Context) -> usize {
825            16
826        }
827    }
828
829    unsafe impl<D: fidl::encoding::ResourceDialect>
830        fidl::encoding::Encode<DeviceTestGetNcpVersionResponse, D>
831        for &DeviceTestGetNcpVersionResponse
832    {
833        #[inline]
834        unsafe fn encode(
835            self,
836            encoder: &mut fidl::encoding::Encoder<'_, D>,
837            offset: usize,
838            _depth: fidl::encoding::Depth,
839        ) -> fidl::Result<()> {
840            encoder.debug_check_bounds::<DeviceTestGetNcpVersionResponse>(offset);
841            // Delegate to tuple encoding.
842            fidl::encoding::Encode::<DeviceTestGetNcpVersionResponse, D>::encode(
843                (<fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
844                    &self.version,
845                ),),
846                encoder,
847                offset,
848                _depth,
849            )
850        }
851    }
852    unsafe impl<
853            D: fidl::encoding::ResourceDialect,
854            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
855        > fidl::encoding::Encode<DeviceTestGetNcpVersionResponse, D> for (T0,)
856    {
857        #[inline]
858        unsafe fn encode(
859            self,
860            encoder: &mut fidl::encoding::Encoder<'_, D>,
861            offset: usize,
862            depth: fidl::encoding::Depth,
863        ) -> fidl::Result<()> {
864            encoder.debug_check_bounds::<DeviceTestGetNcpVersionResponse>(offset);
865            // Zero out padding regions. There's no need to apply masks
866            // because the unmasked parts will be overwritten by fields.
867            // Write the fields.
868            self.0.encode(encoder, offset + 0, depth)?;
869            Ok(())
870        }
871    }
872
873    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
874        for DeviceTestGetNcpVersionResponse
875    {
876        #[inline(always)]
877        fn new_empty() -> Self {
878            Self { version: fidl::new_empty!(fidl::encoding::BoundedString<256>, D) }
879        }
880
881        #[inline]
882        unsafe fn decode(
883            &mut self,
884            decoder: &mut fidl::encoding::Decoder<'_, D>,
885            offset: usize,
886            _depth: fidl::encoding::Depth,
887        ) -> fidl::Result<()> {
888            decoder.debug_check_bounds::<Self>(offset);
889            // Verify that padding bytes are zero.
890            fidl::decode!(
891                fidl::encoding::BoundedString<256>,
892                D,
893                &mut self.version,
894                decoder,
895                offset + 0,
896                _depth
897            )?;
898            Ok(())
899        }
900    }
901
902    impl fidl::encoding::ValueTypeMarker for DeviceTestGetNeighborTableResponse {
903        type Borrowed<'a> = &'a Self;
904        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
905            value
906        }
907    }
908
909    unsafe impl fidl::encoding::TypeMarker for DeviceTestGetNeighborTableResponse {
910        type Owned = Self;
911
912        #[inline(always)]
913        fn inline_align(_context: fidl::encoding::Context) -> usize {
914            8
915        }
916
917        #[inline(always)]
918        fn inline_size(_context: fidl::encoding::Context) -> usize {
919            16
920        }
921    }
922
923    unsafe impl<D: fidl::encoding::ResourceDialect>
924        fidl::encoding::Encode<DeviceTestGetNeighborTableResponse, D>
925        for &DeviceTestGetNeighborTableResponse
926    {
927        #[inline]
928        unsafe fn encode(
929            self,
930            encoder: &mut fidl::encoding::Encoder<'_, D>,
931            offset: usize,
932            _depth: fidl::encoding::Depth,
933        ) -> fidl::Result<()> {
934            encoder.debug_check_bounds::<DeviceTestGetNeighborTableResponse>(offset);
935            // Delegate to tuple encoding.
936            fidl::encoding::Encode::<DeviceTestGetNeighborTableResponse, D>::encode(
937                (
938                    <fidl::encoding::Vector<NeighborInfo, 1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.neighbor_table),
939                ),
940                encoder, offset, _depth
941            )
942        }
943    }
944    unsafe impl<
945            D: fidl::encoding::ResourceDialect,
946            T0: fidl::encoding::Encode<fidl::encoding::Vector<NeighborInfo, 1024>, D>,
947        > fidl::encoding::Encode<DeviceTestGetNeighborTableResponse, D> for (T0,)
948    {
949        #[inline]
950        unsafe fn encode(
951            self,
952            encoder: &mut fidl::encoding::Encoder<'_, D>,
953            offset: usize,
954            depth: fidl::encoding::Depth,
955        ) -> fidl::Result<()> {
956            encoder.debug_check_bounds::<DeviceTestGetNeighborTableResponse>(offset);
957            // Zero out padding regions. There's no need to apply masks
958            // because the unmasked parts will be overwritten by fields.
959            // Write the fields.
960            self.0.encode(encoder, offset + 0, depth)?;
961            Ok(())
962        }
963    }
964
965    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
966        for DeviceTestGetNeighborTableResponse
967    {
968        #[inline(always)]
969        fn new_empty() -> Self {
970            Self { neighbor_table: fidl::new_empty!(fidl::encoding::Vector<NeighborInfo, 1024>, D) }
971        }
972
973        #[inline]
974        unsafe fn decode(
975            &mut self,
976            decoder: &mut fidl::encoding::Decoder<'_, D>,
977            offset: usize,
978            _depth: fidl::encoding::Depth,
979        ) -> fidl::Result<()> {
980            decoder.debug_check_bounds::<Self>(offset);
981            // Verify that padding bytes are zero.
982            fidl::decode!(fidl::encoding::Vector<NeighborInfo, 1024>, D, &mut self.neighbor_table, decoder, offset + 0, _depth)?;
983            Ok(())
984        }
985    }
986
987    impl fidl::encoding::ValueTypeMarker for DeviceTestGetPartitionIdResponse {
988        type Borrowed<'a> = &'a Self;
989        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
990            value
991        }
992    }
993
994    unsafe impl fidl::encoding::TypeMarker for DeviceTestGetPartitionIdResponse {
995        type Owned = Self;
996
997        #[inline(always)]
998        fn inline_align(_context: fidl::encoding::Context) -> usize {
999            4
1000        }
1001
1002        #[inline(always)]
1003        fn inline_size(_context: fidl::encoding::Context) -> usize {
1004            4
1005        }
1006        #[inline(always)]
1007        fn encode_is_copy() -> bool {
1008            true
1009        }
1010
1011        #[inline(always)]
1012        fn decode_is_copy() -> bool {
1013            true
1014        }
1015    }
1016
1017    unsafe impl<D: fidl::encoding::ResourceDialect>
1018        fidl::encoding::Encode<DeviceTestGetPartitionIdResponse, D>
1019        for &DeviceTestGetPartitionIdResponse
1020    {
1021        #[inline]
1022        unsafe fn encode(
1023            self,
1024            encoder: &mut fidl::encoding::Encoder<'_, D>,
1025            offset: usize,
1026            _depth: fidl::encoding::Depth,
1027        ) -> fidl::Result<()> {
1028            encoder.debug_check_bounds::<DeviceTestGetPartitionIdResponse>(offset);
1029            unsafe {
1030                // Copy the object into the buffer.
1031                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1032                (buf_ptr as *mut DeviceTestGetPartitionIdResponse)
1033                    .write_unaligned((self as *const DeviceTestGetPartitionIdResponse).read());
1034                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1035                // done second because the memcpy will write garbage to these bytes.
1036            }
1037            Ok(())
1038        }
1039    }
1040    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1041        fidl::encoding::Encode<DeviceTestGetPartitionIdResponse, D> for (T0,)
1042    {
1043        #[inline]
1044        unsafe fn encode(
1045            self,
1046            encoder: &mut fidl::encoding::Encoder<'_, D>,
1047            offset: usize,
1048            depth: fidl::encoding::Depth,
1049        ) -> fidl::Result<()> {
1050            encoder.debug_check_bounds::<DeviceTestGetPartitionIdResponse>(offset);
1051            // Zero out padding regions. There's no need to apply masks
1052            // because the unmasked parts will be overwritten by fields.
1053            // Write the fields.
1054            self.0.encode(encoder, offset + 0, depth)?;
1055            Ok(())
1056        }
1057    }
1058
1059    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1060        for DeviceTestGetPartitionIdResponse
1061    {
1062        #[inline(always)]
1063        fn new_empty() -> Self {
1064            Self { pid: fidl::new_empty!(u32, D) }
1065        }
1066
1067        #[inline]
1068        unsafe fn decode(
1069            &mut self,
1070            decoder: &mut fidl::encoding::Decoder<'_, D>,
1071            offset: usize,
1072            _depth: fidl::encoding::Depth,
1073        ) -> fidl::Result<()> {
1074            decoder.debug_check_bounds::<Self>(offset);
1075            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1076            // Verify that padding bytes are zero.
1077            // Copy from the buffer into the object.
1078            unsafe {
1079                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1080            }
1081            Ok(())
1082        }
1083    }
1084
1085    impl fidl::encoding::ValueTypeMarker for DeviceTestGetThreadRloc16Response {
1086        type Borrowed<'a> = &'a Self;
1087        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1088            value
1089        }
1090    }
1091
1092    unsafe impl fidl::encoding::TypeMarker for DeviceTestGetThreadRloc16Response {
1093        type Owned = Self;
1094
1095        #[inline(always)]
1096        fn inline_align(_context: fidl::encoding::Context) -> usize {
1097            2
1098        }
1099
1100        #[inline(always)]
1101        fn inline_size(_context: fidl::encoding::Context) -> usize {
1102            2
1103        }
1104        #[inline(always)]
1105        fn encode_is_copy() -> bool {
1106            true
1107        }
1108
1109        #[inline(always)]
1110        fn decode_is_copy() -> bool {
1111            true
1112        }
1113    }
1114
1115    unsafe impl<D: fidl::encoding::ResourceDialect>
1116        fidl::encoding::Encode<DeviceTestGetThreadRloc16Response, D>
1117        for &DeviceTestGetThreadRloc16Response
1118    {
1119        #[inline]
1120        unsafe fn encode(
1121            self,
1122            encoder: &mut fidl::encoding::Encoder<'_, D>,
1123            offset: usize,
1124            _depth: fidl::encoding::Depth,
1125        ) -> fidl::Result<()> {
1126            encoder.debug_check_bounds::<DeviceTestGetThreadRloc16Response>(offset);
1127            unsafe {
1128                // Copy the object into the buffer.
1129                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1130                (buf_ptr as *mut DeviceTestGetThreadRloc16Response)
1131                    .write_unaligned((self as *const DeviceTestGetThreadRloc16Response).read());
1132                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1133                // done second because the memcpy will write garbage to these bytes.
1134            }
1135            Ok(())
1136        }
1137    }
1138    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
1139        fidl::encoding::Encode<DeviceTestGetThreadRloc16Response, D> for (T0,)
1140    {
1141        #[inline]
1142        unsafe fn encode(
1143            self,
1144            encoder: &mut fidl::encoding::Encoder<'_, D>,
1145            offset: usize,
1146            depth: fidl::encoding::Depth,
1147        ) -> fidl::Result<()> {
1148            encoder.debug_check_bounds::<DeviceTestGetThreadRloc16Response>(offset);
1149            // Zero out padding regions. There's no need to apply masks
1150            // because the unmasked parts will be overwritten by fields.
1151            // Write the fields.
1152            self.0.encode(encoder, offset + 0, depth)?;
1153            Ok(())
1154        }
1155    }
1156
1157    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1158        for DeviceTestGetThreadRloc16Response
1159    {
1160        #[inline(always)]
1161        fn new_empty() -> Self {
1162            Self { rloc: fidl::new_empty!(u16, D) }
1163        }
1164
1165        #[inline]
1166        unsafe fn decode(
1167            &mut self,
1168            decoder: &mut fidl::encoding::Decoder<'_, D>,
1169            offset: usize,
1170            _depth: fidl::encoding::Depth,
1171        ) -> fidl::Result<()> {
1172            decoder.debug_check_bounds::<Self>(offset);
1173            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1174            // Verify that padding bytes are zero.
1175            // Copy from the buffer into the object.
1176            unsafe {
1177                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
1178            }
1179            Ok(())
1180        }
1181    }
1182
1183    impl fidl::encoding::ValueTypeMarker for DeviceTestGetThreadRouterIdResponse {
1184        type Borrowed<'a> = &'a Self;
1185        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1186            value
1187        }
1188    }
1189
1190    unsafe impl fidl::encoding::TypeMarker for DeviceTestGetThreadRouterIdResponse {
1191        type Owned = Self;
1192
1193        #[inline(always)]
1194        fn inline_align(_context: fidl::encoding::Context) -> usize {
1195            1
1196        }
1197
1198        #[inline(always)]
1199        fn inline_size(_context: fidl::encoding::Context) -> usize {
1200            1
1201        }
1202        #[inline(always)]
1203        fn encode_is_copy() -> bool {
1204            true
1205        }
1206
1207        #[inline(always)]
1208        fn decode_is_copy() -> bool {
1209            true
1210        }
1211    }
1212
1213    unsafe impl<D: fidl::encoding::ResourceDialect>
1214        fidl::encoding::Encode<DeviceTestGetThreadRouterIdResponse, D>
1215        for &DeviceTestGetThreadRouterIdResponse
1216    {
1217        #[inline]
1218        unsafe fn encode(
1219            self,
1220            encoder: &mut fidl::encoding::Encoder<'_, D>,
1221            offset: usize,
1222            _depth: fidl::encoding::Depth,
1223        ) -> fidl::Result<()> {
1224            encoder.debug_check_bounds::<DeviceTestGetThreadRouterIdResponse>(offset);
1225            unsafe {
1226                // Copy the object into the buffer.
1227                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1228                (buf_ptr as *mut DeviceTestGetThreadRouterIdResponse)
1229                    .write_unaligned((self as *const DeviceTestGetThreadRouterIdResponse).read());
1230                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1231                // done second because the memcpy will write garbage to these bytes.
1232            }
1233            Ok(())
1234        }
1235    }
1236    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
1237        fidl::encoding::Encode<DeviceTestGetThreadRouterIdResponse, D> for (T0,)
1238    {
1239        #[inline]
1240        unsafe fn encode(
1241            self,
1242            encoder: &mut fidl::encoding::Encoder<'_, D>,
1243            offset: usize,
1244            depth: fidl::encoding::Depth,
1245        ) -> fidl::Result<()> {
1246            encoder.debug_check_bounds::<DeviceTestGetThreadRouterIdResponse>(offset);
1247            // Zero out padding regions. There's no need to apply masks
1248            // because the unmasked parts will be overwritten by fields.
1249            // Write the fields.
1250            self.0.encode(encoder, offset + 0, depth)?;
1251            Ok(())
1252        }
1253    }
1254
1255    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1256        for DeviceTestGetThreadRouterIdResponse
1257    {
1258        #[inline(always)]
1259        fn new_empty() -> Self {
1260            Self { router_id: fidl::new_empty!(u8, D) }
1261        }
1262
1263        #[inline]
1264        unsafe fn decode(
1265            &mut self,
1266            decoder: &mut fidl::encoding::Decoder<'_, D>,
1267            offset: usize,
1268            _depth: fidl::encoding::Depth,
1269        ) -> fidl::Result<()> {
1270            decoder.debug_check_bounds::<Self>(offset);
1271            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1272            // Verify that padding bytes are zero.
1273            // Copy from the buffer into the object.
1274            unsafe {
1275                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
1276            }
1277            Ok(())
1278        }
1279    }
1280
1281    impl fidl::encoding::ValueTypeMarker for DeviceTestReplaceMacAddressFilterSettingsRequest {
1282        type Borrowed<'a> = &'a Self;
1283        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1284            value
1285        }
1286    }
1287
1288    unsafe impl fidl::encoding::TypeMarker for DeviceTestReplaceMacAddressFilterSettingsRequest {
1289        type Owned = Self;
1290
1291        #[inline(always)]
1292        fn inline_align(_context: fidl::encoding::Context) -> usize {
1293            8
1294        }
1295
1296        #[inline(always)]
1297        fn inline_size(_context: fidl::encoding::Context) -> usize {
1298            16
1299        }
1300    }
1301
1302    unsafe impl<D: fidl::encoding::ResourceDialect>
1303        fidl::encoding::Encode<DeviceTestReplaceMacAddressFilterSettingsRequest, D>
1304        for &DeviceTestReplaceMacAddressFilterSettingsRequest
1305    {
1306        #[inline]
1307        unsafe fn encode(
1308            self,
1309            encoder: &mut fidl::encoding::Encoder<'_, D>,
1310            offset: usize,
1311            _depth: fidl::encoding::Depth,
1312        ) -> fidl::Result<()> {
1313            encoder.debug_check_bounds::<DeviceTestReplaceMacAddressFilterSettingsRequest>(offset);
1314            // Delegate to tuple encoding.
1315            fidl::encoding::Encode::<DeviceTestReplaceMacAddressFilterSettingsRequest, D>::encode(
1316                (<MacAddressFilterSettings as fidl::encoding::ValueTypeMarker>::borrow(
1317                    &self.settings,
1318                ),),
1319                encoder,
1320                offset,
1321                _depth,
1322            )
1323        }
1324    }
1325    unsafe impl<
1326            D: fidl::encoding::ResourceDialect,
1327            T0: fidl::encoding::Encode<MacAddressFilterSettings, D>,
1328        > fidl::encoding::Encode<DeviceTestReplaceMacAddressFilterSettingsRequest, D> for (T0,)
1329    {
1330        #[inline]
1331        unsafe fn encode(
1332            self,
1333            encoder: &mut fidl::encoding::Encoder<'_, D>,
1334            offset: usize,
1335            depth: fidl::encoding::Depth,
1336        ) -> fidl::Result<()> {
1337            encoder.debug_check_bounds::<DeviceTestReplaceMacAddressFilterSettingsRequest>(offset);
1338            // Zero out padding regions. There's no need to apply masks
1339            // because the unmasked parts will be overwritten by fields.
1340            // Write the fields.
1341            self.0.encode(encoder, offset + 0, depth)?;
1342            Ok(())
1343        }
1344    }
1345
1346    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1347        for DeviceTestReplaceMacAddressFilterSettingsRequest
1348    {
1349        #[inline(always)]
1350        fn new_empty() -> Self {
1351            Self { settings: fidl::new_empty!(MacAddressFilterSettings, D) }
1352        }
1353
1354        #[inline]
1355        unsafe fn decode(
1356            &mut self,
1357            decoder: &mut fidl::encoding::Decoder<'_, D>,
1358            offset: usize,
1359            _depth: fidl::encoding::Depth,
1360        ) -> fidl::Result<()> {
1361            decoder.debug_check_bounds::<Self>(offset);
1362            // Verify that padding bytes are zero.
1363            fidl::decode!(
1364                MacAddressFilterSettings,
1365                D,
1366                &mut self.settings,
1367                decoder,
1368                offset + 0,
1369                _depth
1370            )?;
1371            Ok(())
1372        }
1373    }
1374
1375    impl MacAddressFilterItem {
1376        #[inline(always)]
1377        fn max_ordinal_present(&self) -> u64 {
1378            if let Some(_) = self.rssi {
1379                return 2;
1380            }
1381            if let Some(_) = self.mac_address {
1382                return 1;
1383            }
1384            0
1385        }
1386    }
1387
1388    impl fidl::encoding::ValueTypeMarker for MacAddressFilterItem {
1389        type Borrowed<'a> = &'a Self;
1390        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1391            value
1392        }
1393    }
1394
1395    unsafe impl fidl::encoding::TypeMarker for MacAddressFilterItem {
1396        type Owned = Self;
1397
1398        #[inline(always)]
1399        fn inline_align(_context: fidl::encoding::Context) -> usize {
1400            8
1401        }
1402
1403        #[inline(always)]
1404        fn inline_size(_context: fidl::encoding::Context) -> usize {
1405            16
1406        }
1407    }
1408
1409    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MacAddressFilterItem, D>
1410        for &MacAddressFilterItem
1411    {
1412        unsafe fn encode(
1413            self,
1414            encoder: &mut fidl::encoding::Encoder<'_, D>,
1415            offset: usize,
1416            mut depth: fidl::encoding::Depth,
1417        ) -> fidl::Result<()> {
1418            encoder.debug_check_bounds::<MacAddressFilterItem>(offset);
1419            // Vector header
1420            let max_ordinal: u64 = self.max_ordinal_present();
1421            encoder.write_num(max_ordinal, offset);
1422            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1423            // Calling encoder.out_of_line_offset(0) is not allowed.
1424            if max_ordinal == 0 {
1425                return Ok(());
1426            }
1427            depth.increment()?;
1428            let envelope_size = 8;
1429            let bytes_len = max_ordinal as usize * envelope_size;
1430            #[allow(unused_variables)]
1431            let offset = encoder.out_of_line_offset(bytes_len);
1432            let mut _prev_end_offset: usize = 0;
1433            if 1 > max_ordinal {
1434                return Ok(());
1435            }
1436
1437            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1438            // are envelope_size bytes.
1439            let cur_offset: usize = (1 - 1) * envelope_size;
1440
1441            // Zero reserved fields.
1442            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1443
1444            // Safety:
1445            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1446            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1447            //   envelope_size bytes, there is always sufficient room.
1448            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_lowpan::MacAddress, D>(
1449                self.mac_address.as_ref().map(
1450                    <fidl_fuchsia_lowpan::MacAddress as fidl::encoding::ValueTypeMarker>::borrow,
1451                ),
1452                encoder,
1453                offset + cur_offset,
1454                depth,
1455            )?;
1456
1457            _prev_end_offset = cur_offset + envelope_size;
1458            if 2 > max_ordinal {
1459                return Ok(());
1460            }
1461
1462            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1463            // are envelope_size bytes.
1464            let cur_offset: usize = (2 - 1) * envelope_size;
1465
1466            // Zero reserved fields.
1467            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1468
1469            // Safety:
1470            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1471            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1472            //   envelope_size bytes, there is always sufficient room.
1473            fidl::encoding::encode_in_envelope_optional::<i8, D>(
1474                self.rssi.as_ref().map(<i8 as fidl::encoding::ValueTypeMarker>::borrow),
1475                encoder,
1476                offset + cur_offset,
1477                depth,
1478            )?;
1479
1480            _prev_end_offset = cur_offset + envelope_size;
1481
1482            Ok(())
1483        }
1484    }
1485
1486    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MacAddressFilterItem {
1487        #[inline(always)]
1488        fn new_empty() -> Self {
1489            Self::default()
1490        }
1491
1492        unsafe fn decode(
1493            &mut self,
1494            decoder: &mut fidl::encoding::Decoder<'_, D>,
1495            offset: usize,
1496            mut depth: fidl::encoding::Depth,
1497        ) -> fidl::Result<()> {
1498            decoder.debug_check_bounds::<Self>(offset);
1499            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1500                None => return Err(fidl::Error::NotNullable),
1501                Some(len) => len,
1502            };
1503            // Calling decoder.out_of_line_offset(0) is not allowed.
1504            if len == 0 {
1505                return Ok(());
1506            };
1507            depth.increment()?;
1508            let envelope_size = 8;
1509            let bytes_len = len * envelope_size;
1510            let offset = decoder.out_of_line_offset(bytes_len)?;
1511            // Decode the envelope for each type.
1512            let mut _next_ordinal_to_read = 0;
1513            let mut next_offset = offset;
1514            let end_offset = offset + bytes_len;
1515            _next_ordinal_to_read += 1;
1516            if next_offset >= end_offset {
1517                return Ok(());
1518            }
1519
1520            // Decode unknown envelopes for gaps in ordinals.
1521            while _next_ordinal_to_read < 1 {
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 =
1533                    <fidl_fuchsia_lowpan::MacAddress as fidl::encoding::TypeMarker>::inline_size(
1534                        decoder.context,
1535                    );
1536                if inlined != (member_inline_size <= 4) {
1537                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1538                }
1539                let inner_offset;
1540                let mut inner_depth = depth.clone();
1541                if inlined {
1542                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1543                    inner_offset = next_offset;
1544                } else {
1545                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1546                    inner_depth.increment()?;
1547                }
1548                let val_ref = self
1549                    .mac_address
1550                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_lowpan::MacAddress, D));
1551                fidl::decode!(
1552                    fidl_fuchsia_lowpan::MacAddress,
1553                    D,
1554                    val_ref,
1555                    decoder,
1556                    inner_offset,
1557                    inner_depth
1558                )?;
1559                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1560                {
1561                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1562                }
1563                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1564                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1565                }
1566            }
1567
1568            next_offset += envelope_size;
1569            _next_ordinal_to_read += 1;
1570            if next_offset >= end_offset {
1571                return Ok(());
1572            }
1573
1574            // Decode unknown envelopes for gaps in ordinals.
1575            while _next_ordinal_to_read < 2 {
1576                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1577                _next_ordinal_to_read += 1;
1578                next_offset += envelope_size;
1579            }
1580
1581            let next_out_of_line = decoder.next_out_of_line();
1582            let handles_before = decoder.remaining_handles();
1583            if let Some((inlined, num_bytes, num_handles)) =
1584                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1585            {
1586                let member_inline_size =
1587                    <i8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1588                if inlined != (member_inline_size <= 4) {
1589                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1590                }
1591                let inner_offset;
1592                let mut inner_depth = depth.clone();
1593                if inlined {
1594                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1595                    inner_offset = next_offset;
1596                } else {
1597                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1598                    inner_depth.increment()?;
1599                }
1600                let val_ref = self.rssi.get_or_insert_with(|| fidl::new_empty!(i8, D));
1601                fidl::decode!(i8, D, val_ref, decoder, inner_offset, inner_depth)?;
1602                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1603                {
1604                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1605                }
1606                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1607                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1608                }
1609            }
1610
1611            next_offset += envelope_size;
1612
1613            // Decode the remaining unknown envelopes.
1614            while next_offset < end_offset {
1615                _next_ordinal_to_read += 1;
1616                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1617                next_offset += envelope_size;
1618            }
1619
1620            Ok(())
1621        }
1622    }
1623
1624    impl MacAddressFilterSettings {
1625        #[inline(always)]
1626        fn max_ordinal_present(&self) -> u64 {
1627            if let Some(_) = self.items {
1628                return 2;
1629            }
1630            if let Some(_) = self.mode {
1631                return 1;
1632            }
1633            0
1634        }
1635    }
1636
1637    impl fidl::encoding::ValueTypeMarker for MacAddressFilterSettings {
1638        type Borrowed<'a> = &'a Self;
1639        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1640            value
1641        }
1642    }
1643
1644    unsafe impl fidl::encoding::TypeMarker for MacAddressFilterSettings {
1645        type Owned = Self;
1646
1647        #[inline(always)]
1648        fn inline_align(_context: fidl::encoding::Context) -> usize {
1649            8
1650        }
1651
1652        #[inline(always)]
1653        fn inline_size(_context: fidl::encoding::Context) -> usize {
1654            16
1655        }
1656    }
1657
1658    unsafe impl<D: fidl::encoding::ResourceDialect>
1659        fidl::encoding::Encode<MacAddressFilterSettings, D> for &MacAddressFilterSettings
1660    {
1661        unsafe fn encode(
1662            self,
1663            encoder: &mut fidl::encoding::Encoder<'_, D>,
1664            offset: usize,
1665            mut depth: fidl::encoding::Depth,
1666        ) -> fidl::Result<()> {
1667            encoder.debug_check_bounds::<MacAddressFilterSettings>(offset);
1668            // Vector header
1669            let max_ordinal: u64 = self.max_ordinal_present();
1670            encoder.write_num(max_ordinal, offset);
1671            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1672            // Calling encoder.out_of_line_offset(0) is not allowed.
1673            if max_ordinal == 0 {
1674                return Ok(());
1675            }
1676            depth.increment()?;
1677            let envelope_size = 8;
1678            let bytes_len = max_ordinal as usize * envelope_size;
1679            #[allow(unused_variables)]
1680            let offset = encoder.out_of_line_offset(bytes_len);
1681            let mut _prev_end_offset: usize = 0;
1682            if 1 > max_ordinal {
1683                return Ok(());
1684            }
1685
1686            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1687            // are envelope_size bytes.
1688            let cur_offset: usize = (1 - 1) * envelope_size;
1689
1690            // Zero reserved fields.
1691            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1692
1693            // Safety:
1694            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1695            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1696            //   envelope_size bytes, there is always sufficient room.
1697            fidl::encoding::encode_in_envelope_optional::<MacAddressFilterMode, D>(
1698                self.mode
1699                    .as_ref()
1700                    .map(<MacAddressFilterMode as fidl::encoding::ValueTypeMarker>::borrow),
1701                encoder,
1702                offset + cur_offset,
1703                depth,
1704            )?;
1705
1706            _prev_end_offset = cur_offset + envelope_size;
1707            if 2 > max_ordinal {
1708                return Ok(());
1709            }
1710
1711            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1712            // are envelope_size bytes.
1713            let cur_offset: usize = (2 - 1) * envelope_size;
1714
1715            // Zero reserved fields.
1716            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1717
1718            // Safety:
1719            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1720            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1721            //   envelope_size bytes, there is always sufficient room.
1722            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<MacAddressFilterItem, 100>, D>(
1723            self.items.as_ref().map(<fidl::encoding::Vector<MacAddressFilterItem, 100> as fidl::encoding::ValueTypeMarker>::borrow),
1724            encoder, offset + cur_offset, depth
1725        )?;
1726
1727            _prev_end_offset = cur_offset + envelope_size;
1728
1729            Ok(())
1730        }
1731    }
1732
1733    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1734        for MacAddressFilterSettings
1735    {
1736        #[inline(always)]
1737        fn new_empty() -> Self {
1738            Self::default()
1739        }
1740
1741        unsafe fn decode(
1742            &mut self,
1743            decoder: &mut fidl::encoding::Decoder<'_, D>,
1744            offset: usize,
1745            mut depth: fidl::encoding::Depth,
1746        ) -> fidl::Result<()> {
1747            decoder.debug_check_bounds::<Self>(offset);
1748            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1749                None => return Err(fidl::Error::NotNullable),
1750                Some(len) => len,
1751            };
1752            // Calling decoder.out_of_line_offset(0) is not allowed.
1753            if len == 0 {
1754                return Ok(());
1755            };
1756            depth.increment()?;
1757            let envelope_size = 8;
1758            let bytes_len = len * envelope_size;
1759            let offset = decoder.out_of_line_offset(bytes_len)?;
1760            // Decode the envelope for each type.
1761            let mut _next_ordinal_to_read = 0;
1762            let mut next_offset = offset;
1763            let end_offset = offset + bytes_len;
1764            _next_ordinal_to_read += 1;
1765            if next_offset >= end_offset {
1766                return Ok(());
1767            }
1768
1769            // Decode unknown envelopes for gaps in ordinals.
1770            while _next_ordinal_to_read < 1 {
1771                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1772                _next_ordinal_to_read += 1;
1773                next_offset += envelope_size;
1774            }
1775
1776            let next_out_of_line = decoder.next_out_of_line();
1777            let handles_before = decoder.remaining_handles();
1778            if let Some((inlined, num_bytes, num_handles)) =
1779                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1780            {
1781                let member_inline_size =
1782                    <MacAddressFilterMode as fidl::encoding::TypeMarker>::inline_size(
1783                        decoder.context,
1784                    );
1785                if inlined != (member_inline_size <= 4) {
1786                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1787                }
1788                let inner_offset;
1789                let mut inner_depth = depth.clone();
1790                if inlined {
1791                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1792                    inner_offset = next_offset;
1793                } else {
1794                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1795                    inner_depth.increment()?;
1796                }
1797                let val_ref =
1798                    self.mode.get_or_insert_with(|| fidl::new_empty!(MacAddressFilterMode, D));
1799                fidl::decode!(
1800                    MacAddressFilterMode,
1801                    D,
1802                    val_ref,
1803                    decoder,
1804                    inner_offset,
1805                    inner_depth
1806                )?;
1807                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1808                {
1809                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1810                }
1811                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1812                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1813                }
1814            }
1815
1816            next_offset += envelope_size;
1817            _next_ordinal_to_read += 1;
1818            if next_offset >= end_offset {
1819                return Ok(());
1820            }
1821
1822            // Decode unknown envelopes for gaps in ordinals.
1823            while _next_ordinal_to_read < 2 {
1824                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1825                _next_ordinal_to_read += 1;
1826                next_offset += envelope_size;
1827            }
1828
1829            let next_out_of_line = decoder.next_out_of_line();
1830            let handles_before = decoder.remaining_handles();
1831            if let Some((inlined, num_bytes, num_handles)) =
1832                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1833            {
1834                let member_inline_size = <fidl::encoding::Vector<MacAddressFilterItem, 100> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1835                if inlined != (member_inline_size <= 4) {
1836                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1837                }
1838                let inner_offset;
1839                let mut inner_depth = depth.clone();
1840                if inlined {
1841                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1842                    inner_offset = next_offset;
1843                } else {
1844                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1845                    inner_depth.increment()?;
1846                }
1847                let val_ref = self.items.get_or_insert_with(
1848                    || fidl::new_empty!(fidl::encoding::Vector<MacAddressFilterItem, 100>, D),
1849                );
1850                fidl::decode!(fidl::encoding::Vector<MacAddressFilterItem, 100>, D, val_ref, decoder, inner_offset, inner_depth)?;
1851                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1852                {
1853                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1854                }
1855                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1856                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1857                }
1858            }
1859
1860            next_offset += envelope_size;
1861
1862            // Decode the remaining unknown envelopes.
1863            while next_offset < end_offset {
1864                _next_ordinal_to_read += 1;
1865                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1866                next_offset += envelope_size;
1867            }
1868
1869            Ok(())
1870        }
1871    }
1872
1873    impl NeighborInfo {
1874        #[inline(always)]
1875        fn max_ordinal_present(&self) -> u64 {
1876            if let Some(_) = self.thread_mle_version {
1877                return 17;
1878            }
1879            if let Some(_) = self.queued_messages {
1880                return 16;
1881            }
1882            if let Some(_) = self.net_data_version {
1883                return 15;
1884            }
1885            if let Some(_) = self.child_is_state_restoring {
1886                return 14;
1887            }
1888            if let Some(_) = self.child_is_csl_synced {
1889                return 13;
1890            }
1891            if let Some(_) = self.ipv6_error_rate {
1892                return 12;
1893            }
1894            if let Some(_) = self.frame_error_rate {
1895                return 11;
1896            }
1897            if let Some(_) = self.thread_mode {
1898                return 10;
1899            }
1900            if let Some(_) = self.lqi_in {
1901                return 9;
1902            }
1903            if let Some(_) = self.avg_rssi_in {
1904                return 8;
1905            }
1906            if let Some(_) = self.last_rssi_in {
1907                return 7;
1908            }
1909            if let Some(_) = self.mgmt_frame_count {
1910                return 6;
1911            }
1912            if let Some(_) = self.link_frame_count {
1913                return 5;
1914            }
1915            if let Some(_) = self.is_child {
1916                return 4;
1917            }
1918            if let Some(_) = self.age {
1919                return 3;
1920            }
1921            if let Some(_) = self.short_address {
1922                return 2;
1923            }
1924            if let Some(_) = self.mac_address {
1925                return 1;
1926            }
1927            0
1928        }
1929    }
1930
1931    impl fidl::encoding::ValueTypeMarker for NeighborInfo {
1932        type Borrowed<'a> = &'a Self;
1933        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1934            value
1935        }
1936    }
1937
1938    unsafe impl fidl::encoding::TypeMarker for NeighborInfo {
1939        type Owned = Self;
1940
1941        #[inline(always)]
1942        fn inline_align(_context: fidl::encoding::Context) -> usize {
1943            8
1944        }
1945
1946        #[inline(always)]
1947        fn inline_size(_context: fidl::encoding::Context) -> usize {
1948            16
1949        }
1950    }
1951
1952    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NeighborInfo, D>
1953        for &NeighborInfo
1954    {
1955        unsafe fn encode(
1956            self,
1957            encoder: &mut fidl::encoding::Encoder<'_, D>,
1958            offset: usize,
1959            mut depth: fidl::encoding::Depth,
1960        ) -> fidl::Result<()> {
1961            encoder.debug_check_bounds::<NeighborInfo>(offset);
1962            // Vector header
1963            let max_ordinal: u64 = self.max_ordinal_present();
1964            encoder.write_num(max_ordinal, offset);
1965            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1966            // Calling encoder.out_of_line_offset(0) is not allowed.
1967            if max_ordinal == 0 {
1968                return Ok(());
1969            }
1970            depth.increment()?;
1971            let envelope_size = 8;
1972            let bytes_len = max_ordinal as usize * envelope_size;
1973            #[allow(unused_variables)]
1974            let offset = encoder.out_of_line_offset(bytes_len);
1975            let mut _prev_end_offset: usize = 0;
1976            if 1 > max_ordinal {
1977                return Ok(());
1978            }
1979
1980            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1981            // are envelope_size bytes.
1982            let cur_offset: usize = (1 - 1) * envelope_size;
1983
1984            // Zero reserved fields.
1985            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1986
1987            // Safety:
1988            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1989            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1990            //   envelope_size bytes, there is always sufficient room.
1991            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_lowpan::MacAddress, D>(
1992                self.mac_address.as_ref().map(
1993                    <fidl_fuchsia_lowpan::MacAddress as fidl::encoding::ValueTypeMarker>::borrow,
1994                ),
1995                encoder,
1996                offset + cur_offset,
1997                depth,
1998            )?;
1999
2000            _prev_end_offset = cur_offset + envelope_size;
2001            if 2 > max_ordinal {
2002                return Ok(());
2003            }
2004
2005            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2006            // are envelope_size bytes.
2007            let cur_offset: usize = (2 - 1) * envelope_size;
2008
2009            // Zero reserved fields.
2010            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2011
2012            // Safety:
2013            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2014            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2015            //   envelope_size bytes, there is always sufficient room.
2016            fidl::encoding::encode_in_envelope_optional::<u16, D>(
2017                self.short_address.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
2018                encoder,
2019                offset + cur_offset,
2020                depth,
2021            )?;
2022
2023            _prev_end_offset = cur_offset + envelope_size;
2024            if 3 > max_ordinal {
2025                return Ok(());
2026            }
2027
2028            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2029            // are envelope_size bytes.
2030            let cur_offset: usize = (3 - 1) * envelope_size;
2031
2032            // Zero reserved fields.
2033            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2034
2035            // Safety:
2036            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2037            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2038            //   envelope_size bytes, there is always sufficient room.
2039            fidl::encoding::encode_in_envelope_optional::<i64, D>(
2040                self.age.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2041                encoder,
2042                offset + cur_offset,
2043                depth,
2044            )?;
2045
2046            _prev_end_offset = cur_offset + envelope_size;
2047            if 4 > max_ordinal {
2048                return Ok(());
2049            }
2050
2051            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2052            // are envelope_size bytes.
2053            let cur_offset: usize = (4 - 1) * envelope_size;
2054
2055            // Zero reserved fields.
2056            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2057
2058            // Safety:
2059            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2060            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2061            //   envelope_size bytes, there is always sufficient room.
2062            fidl::encoding::encode_in_envelope_optional::<bool, D>(
2063                self.is_child.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2064                encoder,
2065                offset + cur_offset,
2066                depth,
2067            )?;
2068
2069            _prev_end_offset = cur_offset + envelope_size;
2070            if 5 > max_ordinal {
2071                return Ok(());
2072            }
2073
2074            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2075            // are envelope_size bytes.
2076            let cur_offset: usize = (5 - 1) * envelope_size;
2077
2078            // Zero reserved fields.
2079            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2080
2081            // Safety:
2082            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2083            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2084            //   envelope_size bytes, there is always sufficient room.
2085            fidl::encoding::encode_in_envelope_optional::<u32, D>(
2086                self.link_frame_count
2087                    .as_ref()
2088                    .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
2089                encoder,
2090                offset + cur_offset,
2091                depth,
2092            )?;
2093
2094            _prev_end_offset = cur_offset + envelope_size;
2095            if 6 > max_ordinal {
2096                return Ok(());
2097            }
2098
2099            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2100            // are envelope_size bytes.
2101            let cur_offset: usize = (6 - 1) * envelope_size;
2102
2103            // Zero reserved fields.
2104            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2105
2106            // Safety:
2107            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2108            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2109            //   envelope_size bytes, there is always sufficient room.
2110            fidl::encoding::encode_in_envelope_optional::<u32, D>(
2111                self.mgmt_frame_count
2112                    .as_ref()
2113                    .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
2114                encoder,
2115                offset + cur_offset,
2116                depth,
2117            )?;
2118
2119            _prev_end_offset = cur_offset + envelope_size;
2120            if 7 > max_ordinal {
2121                return Ok(());
2122            }
2123
2124            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2125            // are envelope_size bytes.
2126            let cur_offset: usize = (7 - 1) * envelope_size;
2127
2128            // Zero reserved fields.
2129            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2130
2131            // Safety:
2132            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2133            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2134            //   envelope_size bytes, there is always sufficient room.
2135            fidl::encoding::encode_in_envelope_optional::<i32, D>(
2136                self.last_rssi_in.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
2137                encoder,
2138                offset + cur_offset,
2139                depth,
2140            )?;
2141
2142            _prev_end_offset = cur_offset + envelope_size;
2143            if 8 > max_ordinal {
2144                return Ok(());
2145            }
2146
2147            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2148            // are envelope_size bytes.
2149            let cur_offset: usize = (8 - 1) * envelope_size;
2150
2151            // Zero reserved fields.
2152            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2153
2154            // Safety:
2155            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2156            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2157            //   envelope_size bytes, there is always sufficient room.
2158            fidl::encoding::encode_in_envelope_optional::<i8, D>(
2159                self.avg_rssi_in.as_ref().map(<i8 as fidl::encoding::ValueTypeMarker>::borrow),
2160                encoder,
2161                offset + cur_offset,
2162                depth,
2163            )?;
2164
2165            _prev_end_offset = cur_offset + envelope_size;
2166            if 9 > max_ordinal {
2167                return Ok(());
2168            }
2169
2170            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2171            // are envelope_size bytes.
2172            let cur_offset: usize = (9 - 1) * envelope_size;
2173
2174            // Zero reserved fields.
2175            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2176
2177            // Safety:
2178            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2179            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2180            //   envelope_size bytes, there is always sufficient room.
2181            fidl::encoding::encode_in_envelope_optional::<u8, D>(
2182                self.lqi_in.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
2183                encoder,
2184                offset + cur_offset,
2185                depth,
2186            )?;
2187
2188            _prev_end_offset = cur_offset + envelope_size;
2189            if 10 > max_ordinal {
2190                return Ok(());
2191            }
2192
2193            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2194            // are envelope_size bytes.
2195            let cur_offset: usize = (10 - 1) * envelope_size;
2196
2197            // Zero reserved fields.
2198            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2199
2200            // Safety:
2201            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2202            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2203            //   envelope_size bytes, there is always sufficient room.
2204            fidl::encoding::encode_in_envelope_optional::<u8, D>(
2205                self.thread_mode.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
2206                encoder,
2207                offset + cur_offset,
2208                depth,
2209            )?;
2210
2211            _prev_end_offset = cur_offset + envelope_size;
2212            if 11 > max_ordinal {
2213                return Ok(());
2214            }
2215
2216            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2217            // are envelope_size bytes.
2218            let cur_offset: usize = (11 - 1) * envelope_size;
2219
2220            // Zero reserved fields.
2221            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2222
2223            // Safety:
2224            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2225            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2226            //   envelope_size bytes, there is always sufficient room.
2227            fidl::encoding::encode_in_envelope_optional::<u16, D>(
2228                self.frame_error_rate
2229                    .as_ref()
2230                    .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
2231                encoder,
2232                offset + cur_offset,
2233                depth,
2234            )?;
2235
2236            _prev_end_offset = cur_offset + envelope_size;
2237            if 12 > max_ordinal {
2238                return Ok(());
2239            }
2240
2241            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2242            // are envelope_size bytes.
2243            let cur_offset: usize = (12 - 1) * envelope_size;
2244
2245            // Zero reserved fields.
2246            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2247
2248            // Safety:
2249            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2250            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2251            //   envelope_size bytes, there is always sufficient room.
2252            fidl::encoding::encode_in_envelope_optional::<u16, D>(
2253                self.ipv6_error_rate.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
2254                encoder,
2255                offset + cur_offset,
2256                depth,
2257            )?;
2258
2259            _prev_end_offset = cur_offset + envelope_size;
2260            if 13 > max_ordinal {
2261                return Ok(());
2262            }
2263
2264            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2265            // are envelope_size bytes.
2266            let cur_offset: usize = (13 - 1) * envelope_size;
2267
2268            // Zero reserved fields.
2269            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2270
2271            // Safety:
2272            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2273            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2274            //   envelope_size bytes, there is always sufficient room.
2275            fidl::encoding::encode_in_envelope_optional::<bool, D>(
2276                self.child_is_csl_synced
2277                    .as_ref()
2278                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2279                encoder,
2280                offset + cur_offset,
2281                depth,
2282            )?;
2283
2284            _prev_end_offset = cur_offset + envelope_size;
2285            if 14 > max_ordinal {
2286                return Ok(());
2287            }
2288
2289            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2290            // are envelope_size bytes.
2291            let cur_offset: usize = (14 - 1) * envelope_size;
2292
2293            // Zero reserved fields.
2294            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2295
2296            // Safety:
2297            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2298            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2299            //   envelope_size bytes, there is always sufficient room.
2300            fidl::encoding::encode_in_envelope_optional::<bool, D>(
2301                self.child_is_state_restoring
2302                    .as_ref()
2303                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
2304                encoder,
2305                offset + cur_offset,
2306                depth,
2307            )?;
2308
2309            _prev_end_offset = cur_offset + envelope_size;
2310            if 15 > max_ordinal {
2311                return Ok(());
2312            }
2313
2314            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2315            // are envelope_size bytes.
2316            let cur_offset: usize = (15 - 1) * envelope_size;
2317
2318            // Zero reserved fields.
2319            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2320
2321            // Safety:
2322            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2323            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2324            //   envelope_size bytes, there is always sufficient room.
2325            fidl::encoding::encode_in_envelope_optional::<u8, D>(
2326                self.net_data_version.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
2327                encoder,
2328                offset + cur_offset,
2329                depth,
2330            )?;
2331
2332            _prev_end_offset = cur_offset + envelope_size;
2333            if 16 > max_ordinal {
2334                return Ok(());
2335            }
2336
2337            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2338            // are envelope_size bytes.
2339            let cur_offset: usize = (16 - 1) * envelope_size;
2340
2341            // Zero reserved fields.
2342            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2343
2344            // Safety:
2345            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2346            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2347            //   envelope_size bytes, there is always sufficient room.
2348            fidl::encoding::encode_in_envelope_optional::<u16, D>(
2349                self.queued_messages.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
2350                encoder,
2351                offset + cur_offset,
2352                depth,
2353            )?;
2354
2355            _prev_end_offset = cur_offset + envelope_size;
2356            if 17 > max_ordinal {
2357                return Ok(());
2358            }
2359
2360            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2361            // are envelope_size bytes.
2362            let cur_offset: usize = (17 - 1) * envelope_size;
2363
2364            // Zero reserved fields.
2365            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2366
2367            // Safety:
2368            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2369            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2370            //   envelope_size bytes, there is always sufficient room.
2371            fidl::encoding::encode_in_envelope_optional::<u8, D>(
2372                self.thread_mle_version
2373                    .as_ref()
2374                    .map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
2375                encoder,
2376                offset + cur_offset,
2377                depth,
2378            )?;
2379
2380            _prev_end_offset = cur_offset + envelope_size;
2381
2382            Ok(())
2383        }
2384    }
2385
2386    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NeighborInfo {
2387        #[inline(always)]
2388        fn new_empty() -> Self {
2389            Self::default()
2390        }
2391
2392        unsafe fn decode(
2393            &mut self,
2394            decoder: &mut fidl::encoding::Decoder<'_, D>,
2395            offset: usize,
2396            mut depth: fidl::encoding::Depth,
2397        ) -> fidl::Result<()> {
2398            decoder.debug_check_bounds::<Self>(offset);
2399            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2400                None => return Err(fidl::Error::NotNullable),
2401                Some(len) => len,
2402            };
2403            // Calling decoder.out_of_line_offset(0) is not allowed.
2404            if len == 0 {
2405                return Ok(());
2406            };
2407            depth.increment()?;
2408            let envelope_size = 8;
2409            let bytes_len = len * envelope_size;
2410            let offset = decoder.out_of_line_offset(bytes_len)?;
2411            // Decode the envelope for each type.
2412            let mut _next_ordinal_to_read = 0;
2413            let mut next_offset = offset;
2414            let end_offset = offset + bytes_len;
2415            _next_ordinal_to_read += 1;
2416            if next_offset >= end_offset {
2417                return Ok(());
2418            }
2419
2420            // Decode unknown envelopes for gaps in ordinals.
2421            while _next_ordinal_to_read < 1 {
2422                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2423                _next_ordinal_to_read += 1;
2424                next_offset += envelope_size;
2425            }
2426
2427            let next_out_of_line = decoder.next_out_of_line();
2428            let handles_before = decoder.remaining_handles();
2429            if let Some((inlined, num_bytes, num_handles)) =
2430                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2431            {
2432                let member_inline_size =
2433                    <fidl_fuchsia_lowpan::MacAddress as fidl::encoding::TypeMarker>::inline_size(
2434                        decoder.context,
2435                    );
2436                if inlined != (member_inline_size <= 4) {
2437                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2438                }
2439                let inner_offset;
2440                let mut inner_depth = depth.clone();
2441                if inlined {
2442                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2443                    inner_offset = next_offset;
2444                } else {
2445                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2446                    inner_depth.increment()?;
2447                }
2448                let val_ref = self
2449                    .mac_address
2450                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_lowpan::MacAddress, D));
2451                fidl::decode!(
2452                    fidl_fuchsia_lowpan::MacAddress,
2453                    D,
2454                    val_ref,
2455                    decoder,
2456                    inner_offset,
2457                    inner_depth
2458                )?;
2459                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2460                {
2461                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2462                }
2463                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2464                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2465                }
2466            }
2467
2468            next_offset += envelope_size;
2469            _next_ordinal_to_read += 1;
2470            if next_offset >= end_offset {
2471                return Ok(());
2472            }
2473
2474            // Decode unknown envelopes for gaps in ordinals.
2475            while _next_ordinal_to_read < 2 {
2476                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2477                _next_ordinal_to_read += 1;
2478                next_offset += envelope_size;
2479            }
2480
2481            let next_out_of_line = decoder.next_out_of_line();
2482            let handles_before = decoder.remaining_handles();
2483            if let Some((inlined, num_bytes, num_handles)) =
2484                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2485            {
2486                let member_inline_size =
2487                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2488                if inlined != (member_inline_size <= 4) {
2489                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2490                }
2491                let inner_offset;
2492                let mut inner_depth = depth.clone();
2493                if inlined {
2494                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2495                    inner_offset = next_offset;
2496                } else {
2497                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2498                    inner_depth.increment()?;
2499                }
2500                let val_ref = self.short_address.get_or_insert_with(|| fidl::new_empty!(u16, D));
2501                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
2502                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2503                {
2504                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2505                }
2506                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2507                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2508                }
2509            }
2510
2511            next_offset += envelope_size;
2512            _next_ordinal_to_read += 1;
2513            if next_offset >= end_offset {
2514                return Ok(());
2515            }
2516
2517            // Decode unknown envelopes for gaps in ordinals.
2518            while _next_ordinal_to_read < 3 {
2519                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2520                _next_ordinal_to_read += 1;
2521                next_offset += envelope_size;
2522            }
2523
2524            let next_out_of_line = decoder.next_out_of_line();
2525            let handles_before = decoder.remaining_handles();
2526            if let Some((inlined, num_bytes, num_handles)) =
2527                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2528            {
2529                let member_inline_size =
2530                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2531                if inlined != (member_inline_size <= 4) {
2532                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2533                }
2534                let inner_offset;
2535                let mut inner_depth = depth.clone();
2536                if inlined {
2537                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2538                    inner_offset = next_offset;
2539                } else {
2540                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2541                    inner_depth.increment()?;
2542                }
2543                let val_ref = self.age.get_or_insert_with(|| fidl::new_empty!(i64, D));
2544                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
2545                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2546                {
2547                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2548                }
2549                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2550                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2551                }
2552            }
2553
2554            next_offset += envelope_size;
2555            _next_ordinal_to_read += 1;
2556            if next_offset >= end_offset {
2557                return Ok(());
2558            }
2559
2560            // Decode unknown envelopes for gaps in ordinals.
2561            while _next_ordinal_to_read < 4 {
2562                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2563                _next_ordinal_to_read += 1;
2564                next_offset += envelope_size;
2565            }
2566
2567            let next_out_of_line = decoder.next_out_of_line();
2568            let handles_before = decoder.remaining_handles();
2569            if let Some((inlined, num_bytes, num_handles)) =
2570                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2571            {
2572                let member_inline_size =
2573                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2574                if inlined != (member_inline_size <= 4) {
2575                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2576                }
2577                let inner_offset;
2578                let mut inner_depth = depth.clone();
2579                if inlined {
2580                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2581                    inner_offset = next_offset;
2582                } else {
2583                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2584                    inner_depth.increment()?;
2585                }
2586                let val_ref = self.is_child.get_or_insert_with(|| fidl::new_empty!(bool, D));
2587                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2588                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2589                {
2590                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2591                }
2592                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2593                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2594                }
2595            }
2596
2597            next_offset += envelope_size;
2598            _next_ordinal_to_read += 1;
2599            if next_offset >= end_offset {
2600                return Ok(());
2601            }
2602
2603            // Decode unknown envelopes for gaps in ordinals.
2604            while _next_ordinal_to_read < 5 {
2605                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2606                _next_ordinal_to_read += 1;
2607                next_offset += envelope_size;
2608            }
2609
2610            let next_out_of_line = decoder.next_out_of_line();
2611            let handles_before = decoder.remaining_handles();
2612            if let Some((inlined, num_bytes, num_handles)) =
2613                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2614            {
2615                let member_inline_size =
2616                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2617                if inlined != (member_inline_size <= 4) {
2618                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2619                }
2620                let inner_offset;
2621                let mut inner_depth = depth.clone();
2622                if inlined {
2623                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2624                    inner_offset = next_offset;
2625                } else {
2626                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2627                    inner_depth.increment()?;
2628                }
2629                let val_ref = self.link_frame_count.get_or_insert_with(|| fidl::new_empty!(u32, D));
2630                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
2631                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2632                {
2633                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2634                }
2635                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2636                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2637                }
2638            }
2639
2640            next_offset += envelope_size;
2641            _next_ordinal_to_read += 1;
2642            if next_offset >= end_offset {
2643                return Ok(());
2644            }
2645
2646            // Decode unknown envelopes for gaps in ordinals.
2647            while _next_ordinal_to_read < 6 {
2648                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2649                _next_ordinal_to_read += 1;
2650                next_offset += envelope_size;
2651            }
2652
2653            let next_out_of_line = decoder.next_out_of_line();
2654            let handles_before = decoder.remaining_handles();
2655            if let Some((inlined, num_bytes, num_handles)) =
2656                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2657            {
2658                let member_inline_size =
2659                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2660                if inlined != (member_inline_size <= 4) {
2661                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2662                }
2663                let inner_offset;
2664                let mut inner_depth = depth.clone();
2665                if inlined {
2666                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2667                    inner_offset = next_offset;
2668                } else {
2669                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2670                    inner_depth.increment()?;
2671                }
2672                let val_ref = self.mgmt_frame_count.get_or_insert_with(|| fidl::new_empty!(u32, D));
2673                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
2674                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2675                {
2676                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2677                }
2678                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2679                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2680                }
2681            }
2682
2683            next_offset += envelope_size;
2684            _next_ordinal_to_read += 1;
2685            if next_offset >= end_offset {
2686                return Ok(());
2687            }
2688
2689            // Decode unknown envelopes for gaps in ordinals.
2690            while _next_ordinal_to_read < 7 {
2691                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2692                _next_ordinal_to_read += 1;
2693                next_offset += envelope_size;
2694            }
2695
2696            let next_out_of_line = decoder.next_out_of_line();
2697            let handles_before = decoder.remaining_handles();
2698            if let Some((inlined, num_bytes, num_handles)) =
2699                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2700            {
2701                let member_inline_size =
2702                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2703                if inlined != (member_inline_size <= 4) {
2704                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2705                }
2706                let inner_offset;
2707                let mut inner_depth = depth.clone();
2708                if inlined {
2709                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2710                    inner_offset = next_offset;
2711                } else {
2712                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2713                    inner_depth.increment()?;
2714                }
2715                let val_ref = self.last_rssi_in.get_or_insert_with(|| fidl::new_empty!(i32, D));
2716                fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
2717                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2718                {
2719                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2720                }
2721                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2722                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2723                }
2724            }
2725
2726            next_offset += envelope_size;
2727            _next_ordinal_to_read += 1;
2728            if next_offset >= end_offset {
2729                return Ok(());
2730            }
2731
2732            // Decode unknown envelopes for gaps in ordinals.
2733            while _next_ordinal_to_read < 8 {
2734                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2735                _next_ordinal_to_read += 1;
2736                next_offset += envelope_size;
2737            }
2738
2739            let next_out_of_line = decoder.next_out_of_line();
2740            let handles_before = decoder.remaining_handles();
2741            if let Some((inlined, num_bytes, num_handles)) =
2742                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2743            {
2744                let member_inline_size =
2745                    <i8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2746                if inlined != (member_inline_size <= 4) {
2747                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2748                }
2749                let inner_offset;
2750                let mut inner_depth = depth.clone();
2751                if inlined {
2752                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2753                    inner_offset = next_offset;
2754                } else {
2755                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2756                    inner_depth.increment()?;
2757                }
2758                let val_ref = self.avg_rssi_in.get_or_insert_with(|| fidl::new_empty!(i8, D));
2759                fidl::decode!(i8, D, val_ref, decoder, inner_offset, inner_depth)?;
2760                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2761                {
2762                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2763                }
2764                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2765                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2766                }
2767            }
2768
2769            next_offset += envelope_size;
2770            _next_ordinal_to_read += 1;
2771            if next_offset >= end_offset {
2772                return Ok(());
2773            }
2774
2775            // Decode unknown envelopes for gaps in ordinals.
2776            while _next_ordinal_to_read < 9 {
2777                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2778                _next_ordinal_to_read += 1;
2779                next_offset += envelope_size;
2780            }
2781
2782            let next_out_of_line = decoder.next_out_of_line();
2783            let handles_before = decoder.remaining_handles();
2784            if let Some((inlined, num_bytes, num_handles)) =
2785                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2786            {
2787                let member_inline_size =
2788                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2789                if inlined != (member_inline_size <= 4) {
2790                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2791                }
2792                let inner_offset;
2793                let mut inner_depth = depth.clone();
2794                if inlined {
2795                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2796                    inner_offset = next_offset;
2797                } else {
2798                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2799                    inner_depth.increment()?;
2800                }
2801                let val_ref = self.lqi_in.get_or_insert_with(|| fidl::new_empty!(u8, D));
2802                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
2803                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2804                {
2805                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2806                }
2807                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2808                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2809                }
2810            }
2811
2812            next_offset += envelope_size;
2813            _next_ordinal_to_read += 1;
2814            if next_offset >= end_offset {
2815                return Ok(());
2816            }
2817
2818            // Decode unknown envelopes for gaps in ordinals.
2819            while _next_ordinal_to_read < 10 {
2820                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2821                _next_ordinal_to_read += 1;
2822                next_offset += envelope_size;
2823            }
2824
2825            let next_out_of_line = decoder.next_out_of_line();
2826            let handles_before = decoder.remaining_handles();
2827            if let Some((inlined, num_bytes, num_handles)) =
2828                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2829            {
2830                let member_inline_size =
2831                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2832                if inlined != (member_inline_size <= 4) {
2833                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2834                }
2835                let inner_offset;
2836                let mut inner_depth = depth.clone();
2837                if inlined {
2838                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2839                    inner_offset = next_offset;
2840                } else {
2841                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2842                    inner_depth.increment()?;
2843                }
2844                let val_ref = self.thread_mode.get_or_insert_with(|| fidl::new_empty!(u8, D));
2845                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
2846                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2847                {
2848                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2849                }
2850                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2851                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2852                }
2853            }
2854
2855            next_offset += envelope_size;
2856            _next_ordinal_to_read += 1;
2857            if next_offset >= end_offset {
2858                return Ok(());
2859            }
2860
2861            // Decode unknown envelopes for gaps in ordinals.
2862            while _next_ordinal_to_read < 11 {
2863                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2864                _next_ordinal_to_read += 1;
2865                next_offset += envelope_size;
2866            }
2867
2868            let next_out_of_line = decoder.next_out_of_line();
2869            let handles_before = decoder.remaining_handles();
2870            if let Some((inlined, num_bytes, num_handles)) =
2871                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2872            {
2873                let member_inline_size =
2874                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2875                if inlined != (member_inline_size <= 4) {
2876                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2877                }
2878                let inner_offset;
2879                let mut inner_depth = depth.clone();
2880                if inlined {
2881                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2882                    inner_offset = next_offset;
2883                } else {
2884                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2885                    inner_depth.increment()?;
2886                }
2887                let val_ref = self.frame_error_rate.get_or_insert_with(|| fidl::new_empty!(u16, D));
2888                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
2889                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2890                {
2891                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2892                }
2893                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2894                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2895                }
2896            }
2897
2898            next_offset += envelope_size;
2899            _next_ordinal_to_read += 1;
2900            if next_offset >= end_offset {
2901                return Ok(());
2902            }
2903
2904            // Decode unknown envelopes for gaps in ordinals.
2905            while _next_ordinal_to_read < 12 {
2906                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2907                _next_ordinal_to_read += 1;
2908                next_offset += envelope_size;
2909            }
2910
2911            let next_out_of_line = decoder.next_out_of_line();
2912            let handles_before = decoder.remaining_handles();
2913            if let Some((inlined, num_bytes, num_handles)) =
2914                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2915            {
2916                let member_inline_size =
2917                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2918                if inlined != (member_inline_size <= 4) {
2919                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2920                }
2921                let inner_offset;
2922                let mut inner_depth = depth.clone();
2923                if inlined {
2924                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2925                    inner_offset = next_offset;
2926                } else {
2927                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2928                    inner_depth.increment()?;
2929                }
2930                let val_ref = self.ipv6_error_rate.get_or_insert_with(|| fidl::new_empty!(u16, D));
2931                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
2932                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2933                {
2934                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2935                }
2936                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2937                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2938                }
2939            }
2940
2941            next_offset += envelope_size;
2942            _next_ordinal_to_read += 1;
2943            if next_offset >= end_offset {
2944                return Ok(());
2945            }
2946
2947            // Decode unknown envelopes for gaps in ordinals.
2948            while _next_ordinal_to_read < 13 {
2949                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2950                _next_ordinal_to_read += 1;
2951                next_offset += envelope_size;
2952            }
2953
2954            let next_out_of_line = decoder.next_out_of_line();
2955            let handles_before = decoder.remaining_handles();
2956            if let Some((inlined, num_bytes, num_handles)) =
2957                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2958            {
2959                let member_inline_size =
2960                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2961                if inlined != (member_inline_size <= 4) {
2962                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2963                }
2964                let inner_offset;
2965                let mut inner_depth = depth.clone();
2966                if inlined {
2967                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2968                    inner_offset = next_offset;
2969                } else {
2970                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2971                    inner_depth.increment()?;
2972                }
2973                let val_ref =
2974                    self.child_is_csl_synced.get_or_insert_with(|| fidl::new_empty!(bool, D));
2975                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2976                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2977                {
2978                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2979                }
2980                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2981                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2982                }
2983            }
2984
2985            next_offset += envelope_size;
2986            _next_ordinal_to_read += 1;
2987            if next_offset >= end_offset {
2988                return Ok(());
2989            }
2990
2991            // Decode unknown envelopes for gaps in ordinals.
2992            while _next_ordinal_to_read < 14 {
2993                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2994                _next_ordinal_to_read += 1;
2995                next_offset += envelope_size;
2996            }
2997
2998            let next_out_of_line = decoder.next_out_of_line();
2999            let handles_before = decoder.remaining_handles();
3000            if let Some((inlined, num_bytes, num_handles)) =
3001                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3002            {
3003                let member_inline_size =
3004                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3005                if inlined != (member_inline_size <= 4) {
3006                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3007                }
3008                let inner_offset;
3009                let mut inner_depth = depth.clone();
3010                if inlined {
3011                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3012                    inner_offset = next_offset;
3013                } else {
3014                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3015                    inner_depth.increment()?;
3016                }
3017                let val_ref =
3018                    self.child_is_state_restoring.get_or_insert_with(|| fidl::new_empty!(bool, D));
3019                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3020                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3021                {
3022                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3023                }
3024                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3025                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3026                }
3027            }
3028
3029            next_offset += envelope_size;
3030            _next_ordinal_to_read += 1;
3031            if next_offset >= end_offset {
3032                return Ok(());
3033            }
3034
3035            // Decode unknown envelopes for gaps in ordinals.
3036            while _next_ordinal_to_read < 15 {
3037                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3038                _next_ordinal_to_read += 1;
3039                next_offset += envelope_size;
3040            }
3041
3042            let next_out_of_line = decoder.next_out_of_line();
3043            let handles_before = decoder.remaining_handles();
3044            if let Some((inlined, num_bytes, num_handles)) =
3045                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3046            {
3047                let member_inline_size =
3048                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3049                if inlined != (member_inline_size <= 4) {
3050                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3051                }
3052                let inner_offset;
3053                let mut inner_depth = depth.clone();
3054                if inlined {
3055                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3056                    inner_offset = next_offset;
3057                } else {
3058                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3059                    inner_depth.increment()?;
3060                }
3061                let val_ref = self.net_data_version.get_or_insert_with(|| fidl::new_empty!(u8, D));
3062                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
3063                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3064                {
3065                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3066                }
3067                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3068                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3069                }
3070            }
3071
3072            next_offset += envelope_size;
3073            _next_ordinal_to_read += 1;
3074            if next_offset >= end_offset {
3075                return Ok(());
3076            }
3077
3078            // Decode unknown envelopes for gaps in ordinals.
3079            while _next_ordinal_to_read < 16 {
3080                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3081                _next_ordinal_to_read += 1;
3082                next_offset += envelope_size;
3083            }
3084
3085            let next_out_of_line = decoder.next_out_of_line();
3086            let handles_before = decoder.remaining_handles();
3087            if let Some((inlined, num_bytes, num_handles)) =
3088                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3089            {
3090                let member_inline_size =
3091                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3092                if inlined != (member_inline_size <= 4) {
3093                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3094                }
3095                let inner_offset;
3096                let mut inner_depth = depth.clone();
3097                if inlined {
3098                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3099                    inner_offset = next_offset;
3100                } else {
3101                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3102                    inner_depth.increment()?;
3103                }
3104                let val_ref = self.queued_messages.get_or_insert_with(|| fidl::new_empty!(u16, D));
3105                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
3106                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3107                {
3108                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3109                }
3110                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3111                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3112                }
3113            }
3114
3115            next_offset += envelope_size;
3116            _next_ordinal_to_read += 1;
3117            if next_offset >= end_offset {
3118                return Ok(());
3119            }
3120
3121            // Decode unknown envelopes for gaps in ordinals.
3122            while _next_ordinal_to_read < 17 {
3123                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3124                _next_ordinal_to_read += 1;
3125                next_offset += envelope_size;
3126            }
3127
3128            let next_out_of_line = decoder.next_out_of_line();
3129            let handles_before = decoder.remaining_handles();
3130            if let Some((inlined, num_bytes, num_handles)) =
3131                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3132            {
3133                let member_inline_size =
3134                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3135                if inlined != (member_inline_size <= 4) {
3136                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3137                }
3138                let inner_offset;
3139                let mut inner_depth = depth.clone();
3140                if inlined {
3141                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3142                    inner_offset = next_offset;
3143                } else {
3144                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3145                    inner_depth.increment()?;
3146                }
3147                let val_ref =
3148                    self.thread_mle_version.get_or_insert_with(|| fidl::new_empty!(u8, D));
3149                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
3150                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3151                {
3152                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3153                }
3154                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3155                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3156                }
3157            }
3158
3159            next_offset += envelope_size;
3160
3161            // Decode the remaining unknown envelopes.
3162            while next_offset < end_offset {
3163                _next_ordinal_to_read += 1;
3164                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3165                next_offset += envelope_size;
3166            }
3167
3168            Ok(())
3169        }
3170    }
3171}