fidl_fuchsia_lowpan_thread__common/
fidl_fuchsia_lowpan_thread__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/// Datatype for containing a Thread dataset in raw TLV form.
12/// Functionally equivalent to type [`otOperationalDatasetTlvs`][1].
13///
14/// The details of the Thread TLV format are documented in the
15/// [Thread Specification](https://www.threadgroup.org/ThreadSpec).
16///
17/// [1]: https://openthread.io/reference/struct/ot-operational-dataset-tlvs#structot_operational_dataset_tlvs
18pub type OperationalDatasetTlvs = Vec<u8>;
19
20pub const MAX_DATASET_TLV_LEN: u8 = 254;
21
22#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
23pub enum DetailedLoggingLevel {
24    LowpanLogUnspecified,
25    LowpanLogEmerg,
26    LowpanLogAlert,
27    LowpanLogCrit,
28    LowpanLogErr,
29    LowpanLogWarning,
30    LowpanLogNotice,
31    LowpanLogInfo,
32    LowpanLogDebug,
33    #[doc(hidden)]
34    __SourceBreaking {
35        unknown_ordinal: u32,
36    },
37}
38
39/// Pattern that matches an unknown `DetailedLoggingLevel` member.
40#[macro_export]
41macro_rules! DetailedLoggingLevelUnknown {
42    () => {
43        _
44    };
45}
46
47impl DetailedLoggingLevel {
48    #[inline]
49    pub fn from_primitive(prim: u32) -> Option<Self> {
50        match prim {
51            0 => Some(Self::LowpanLogUnspecified),
52            1 => Some(Self::LowpanLogEmerg),
53            2 => Some(Self::LowpanLogAlert),
54            3 => Some(Self::LowpanLogCrit),
55            4 => Some(Self::LowpanLogErr),
56            5 => Some(Self::LowpanLogWarning),
57            6 => Some(Self::LowpanLogNotice),
58            7 => Some(Self::LowpanLogInfo),
59            8 => Some(Self::LowpanLogDebug),
60            _ => None,
61        }
62    }
63
64    #[inline]
65    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
66        match prim {
67            0 => Self::LowpanLogUnspecified,
68            1 => Self::LowpanLogEmerg,
69            2 => Self::LowpanLogAlert,
70            3 => Self::LowpanLogCrit,
71            4 => Self::LowpanLogErr,
72            5 => Self::LowpanLogWarning,
73            6 => Self::LowpanLogNotice,
74            7 => Self::LowpanLogInfo,
75            8 => Self::LowpanLogDebug,
76            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
77        }
78    }
79
80    #[inline]
81    pub fn unknown() -> Self {
82        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
83    }
84
85    #[inline]
86    pub const fn into_primitive(self) -> u32 {
87        match self {
88            Self::LowpanLogUnspecified => 0,
89            Self::LowpanLogEmerg => 1,
90            Self::LowpanLogAlert => 2,
91            Self::LowpanLogCrit => 3,
92            Self::LowpanLogErr => 4,
93            Self::LowpanLogWarning => 5,
94            Self::LowpanLogNotice => 6,
95            Self::LowpanLogInfo => 7,
96            Self::LowpanLogDebug => 8,
97            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
98        }
99    }
100
101    #[inline]
102    pub fn is_unknown(&self) -> bool {
103        match self {
104            Self::__SourceBreaking { unknown_ordinal: _ } => true,
105            _ => false,
106        }
107    }
108}
109
110#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
111pub struct DatasetAttachAllNodesToRequest {
112    /// The Operational Dataset that contains parameter values of the
113    /// Thread network to attach to. It must be a full dataset.
114    pub dataset: Vec<u8>,
115}
116
117impl fidl::Persistable for DatasetAttachAllNodesToRequest {}
118
119#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
120#[repr(C)]
121pub struct DatasetAttachAllNodesToResponse {
122    /// The delay between when the method returns and when the dataset
123    /// takes effect, in milliseconds. If this value is 0, then the node is
124    /// attached to the given network when this method returns. If this
125    /// value is not 0, then the node is attached to its existing network
126    /// when this method returns, and will attach to the given network
127    /// after the delay. Negative values are prohibited and must be
128    /// considered a runtime error.
129    pub delay_ms: i64,
130}
131
132impl fidl::Persistable for DatasetAttachAllNodesToResponse {}
133
134#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
135pub struct DatasetGetActiveTlvsResponse {
136    pub dataset: Option<Vec<u8>>,
137}
138
139impl fidl::Persistable for DatasetGetActiveTlvsResponse {}
140
141#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
142pub struct DatasetSetActiveTlvsRequest {
143    pub dataset: Vec<u8>,
144}
145
146impl fidl::Persistable for DatasetSetActiveTlvsRequest {}
147
148#[derive(Clone, Debug, PartialEq)]
149pub struct FeatureGetFeatureConfigResponse {
150    pub config: FeatureConfig,
151}
152
153impl fidl::Persistable for FeatureGetFeatureConfigResponse {}
154
155#[derive(Clone, Debug, PartialEq)]
156pub struct FeatureUpdateFeatureConfigRequest {
157    pub config: FeatureConfig,
158}
159
160impl fidl::Persistable for FeatureUpdateFeatureConfigRequest {}
161
162#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
163pub struct MeshcopUpdateTxtEntriesRequest {
164    pub txt_entries: Vec<TxtEntries>,
165}
166
167impl fidl::Persistable for MeshcopUpdateTxtEntriesRequest {}
168
169#[derive(Clone, Debug, PartialEq)]
170pub struct ThreadCapabilitiesGetCapabilitiesResponse {
171    pub capabilities: Capabilities,
172}
173
174impl fidl::Persistable for ThreadCapabilitiesGetCapabilitiesResponse {}
175
176#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
177pub struct TxtEntries {
178    /// The key string for this TXT entry.
179    ///
180    /// Must not contain the character `=`.
181    /// Maximum theoretical length is 254 bytes.
182    pub key: String,
183    /// The binary value associated with this key.
184    ///
185    /// Maximum theoretical length is 253 bytes, which is two bytes less
186    /// than the TXT record maximum length to account for a single-byte
187    /// key and key/value separator byte.
188    pub value: Vec<u8>,
189}
190
191impl fidl::Persistable for TxtEntries {}
192
193/// Openthread capabilities.
194///
195/// Capabilities refers to features supported by openthread. For
196/// instance, nat64 refers to, if openthread has the required
197/// software support for nat64, which is determined by macros defined in openthread.
198/// It doesn't refer to if the feature is enabled or disabled.
199/// The table describes the capabilities of openthread that are supported/not-supported.
200/// For every new feature that's added, the table below should be updated.
201#[derive(Clone, Debug, Default, PartialEq)]
202pub struct Capabilities {
203    /// The fields cannot be absent. They are set to true or false.
204    /// Describes if nat64 is supported.
205    /// If nat64 is true, Openthread supports nat64, false otherwise.
206    pub nat64: Option<bool>,
207    /// Describes if dhcpv6 prefix delegation is supported.
208    /// If dhcpv6_pd is true, Openthread supports dhcpv6pd, false otherwise.
209    pub dhcpv6_pd: Option<bool>,
210    /// Describes if epskc is supported.
211    /// If epskc is true, Openthread supports epskc, false otherwise.
212    pub epskc: Option<bool>,
213    #[doc(hidden)]
214    pub __source_breaking: fidl::marker::SourceBreaking,
215}
216
217impl fidl::Persistable for Capabilities {}
218
219/// OpenThread feature configuration.
220///
221/// This table describes what OpenThread features are enabled or disabled
222/// for a given interface. See the [`Feature`] protocol for more information.
223#[derive(Clone, Debug, Default, PartialEq)]
224pub struct FeatureConfig {
225    /// Determines if TREL is enabled or disabled.
226    pub trel_enabled: Option<bool>,
227    /// Determines if NAT64 is enabled or disabled.
228    pub nat64_enabled: Option<bool>,
229    /// Determines if SRP replication is enabled or disabled.
230    pub srp_replication_enabled: Option<bool>,
231    /// Determines if detailed logging is enabled. If set to
232    /// false, default logging level set in config file should
233    /// be used in lowpan-ot-driver.
234    pub detailed_logging_enabled: Option<bool>,
235    /// Set target log level. The value will be used only if
236    /// `detailed_logging_enabled` is set to true.
237    pub detailed_logging_level: Option<DetailedLoggingLevel>,
238    /// Determines if DHCPv6-PD is enabled or disabled.
239    pub dhcpv6_pd_enabled: Option<bool>,
240    /// Determines if DNS upstream query is enabled or disabled.
241    pub dns_upstream_query_enabled: Option<bool>,
242    /// Determines if Link Metrics Manager is enabled or disabled.
243    pub link_metrics_manager_enabled: Option<bool>,
244    /// Determines if ePSKc is enabled or disabled.
245    pub epskc_enabled: Option<bool>,
246    #[doc(hidden)]
247    pub __source_breaking: fidl::marker::SourceBreaking,
248}
249
250impl fidl::Persistable for FeatureConfig {}
251
252mod internal {
253    use super::*;
254    unsafe impl fidl::encoding::TypeMarker for DetailedLoggingLevel {
255        type Owned = Self;
256
257        #[inline(always)]
258        fn inline_align(_context: fidl::encoding::Context) -> usize {
259            std::mem::align_of::<u32>()
260        }
261
262        #[inline(always)]
263        fn inline_size(_context: fidl::encoding::Context) -> usize {
264            std::mem::size_of::<u32>()
265        }
266
267        #[inline(always)]
268        fn encode_is_copy() -> bool {
269            false
270        }
271
272        #[inline(always)]
273        fn decode_is_copy() -> bool {
274            false
275        }
276    }
277
278    impl fidl::encoding::ValueTypeMarker for DetailedLoggingLevel {
279        type Borrowed<'a> = Self;
280        #[inline(always)]
281        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
282            *value
283        }
284    }
285
286    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
287        for DetailedLoggingLevel
288    {
289        #[inline]
290        unsafe fn encode(
291            self,
292            encoder: &mut fidl::encoding::Encoder<'_, D>,
293            offset: usize,
294            _depth: fidl::encoding::Depth,
295        ) -> fidl::Result<()> {
296            encoder.debug_check_bounds::<Self>(offset);
297            encoder.write_num(self.into_primitive(), offset);
298            Ok(())
299        }
300    }
301
302    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DetailedLoggingLevel {
303        #[inline(always)]
304        fn new_empty() -> Self {
305            Self::unknown()
306        }
307
308        #[inline]
309        unsafe fn decode(
310            &mut self,
311            decoder: &mut fidl::encoding::Decoder<'_, D>,
312            offset: usize,
313            _depth: fidl::encoding::Depth,
314        ) -> fidl::Result<()> {
315            decoder.debug_check_bounds::<Self>(offset);
316            let prim = decoder.read_num::<u32>(offset);
317
318            *self = Self::from_primitive_allow_unknown(prim);
319            Ok(())
320        }
321    }
322
323    impl fidl::encoding::ValueTypeMarker for DatasetAttachAllNodesToRequest {
324        type Borrowed<'a> = &'a Self;
325        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
326            value
327        }
328    }
329
330    unsafe impl fidl::encoding::TypeMarker for DatasetAttachAllNodesToRequest {
331        type Owned = Self;
332
333        #[inline(always)]
334        fn inline_align(_context: fidl::encoding::Context) -> usize {
335            8
336        }
337
338        #[inline(always)]
339        fn inline_size(_context: fidl::encoding::Context) -> usize {
340            16
341        }
342    }
343
344    unsafe impl<D: fidl::encoding::ResourceDialect>
345        fidl::encoding::Encode<DatasetAttachAllNodesToRequest, D>
346        for &DatasetAttachAllNodesToRequest
347    {
348        #[inline]
349        unsafe fn encode(
350            self,
351            encoder: &mut fidl::encoding::Encoder<'_, D>,
352            offset: usize,
353            _depth: fidl::encoding::Depth,
354        ) -> fidl::Result<()> {
355            encoder.debug_check_bounds::<DatasetAttachAllNodesToRequest>(offset);
356            // Delegate to tuple encoding.
357            fidl::encoding::Encode::<DatasetAttachAllNodesToRequest, D>::encode(
358                (<fidl::encoding::Vector<u8, 254> as fidl::encoding::ValueTypeMarker>::borrow(
359                    &self.dataset,
360                ),),
361                encoder,
362                offset,
363                _depth,
364            )
365        }
366    }
367    unsafe impl<
368            D: fidl::encoding::ResourceDialect,
369            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 254>, D>,
370        > fidl::encoding::Encode<DatasetAttachAllNodesToRequest, D> for (T0,)
371    {
372        #[inline]
373        unsafe fn encode(
374            self,
375            encoder: &mut fidl::encoding::Encoder<'_, D>,
376            offset: usize,
377            depth: fidl::encoding::Depth,
378        ) -> fidl::Result<()> {
379            encoder.debug_check_bounds::<DatasetAttachAllNodesToRequest>(offset);
380            // Zero out padding regions. There's no need to apply masks
381            // because the unmasked parts will be overwritten by fields.
382            // Write the fields.
383            self.0.encode(encoder, offset + 0, depth)?;
384            Ok(())
385        }
386    }
387
388    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
389        for DatasetAttachAllNodesToRequest
390    {
391        #[inline(always)]
392        fn new_empty() -> Self {
393            Self { dataset: fidl::new_empty!(fidl::encoding::Vector<u8, 254>, D) }
394        }
395
396        #[inline]
397        unsafe fn decode(
398            &mut self,
399            decoder: &mut fidl::encoding::Decoder<'_, D>,
400            offset: usize,
401            _depth: fidl::encoding::Depth,
402        ) -> fidl::Result<()> {
403            decoder.debug_check_bounds::<Self>(offset);
404            // Verify that padding bytes are zero.
405            fidl::decode!(fidl::encoding::Vector<u8, 254>, D, &mut self.dataset, decoder, offset + 0, _depth)?;
406            Ok(())
407        }
408    }
409
410    impl fidl::encoding::ValueTypeMarker for DatasetAttachAllNodesToResponse {
411        type Borrowed<'a> = &'a Self;
412        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
413            value
414        }
415    }
416
417    unsafe impl fidl::encoding::TypeMarker for DatasetAttachAllNodesToResponse {
418        type Owned = Self;
419
420        #[inline(always)]
421        fn inline_align(_context: fidl::encoding::Context) -> usize {
422            8
423        }
424
425        #[inline(always)]
426        fn inline_size(_context: fidl::encoding::Context) -> usize {
427            8
428        }
429        #[inline(always)]
430        fn encode_is_copy() -> bool {
431            true
432        }
433
434        #[inline(always)]
435        fn decode_is_copy() -> bool {
436            true
437        }
438    }
439
440    unsafe impl<D: fidl::encoding::ResourceDialect>
441        fidl::encoding::Encode<DatasetAttachAllNodesToResponse, D>
442        for &DatasetAttachAllNodesToResponse
443    {
444        #[inline]
445        unsafe fn encode(
446            self,
447            encoder: &mut fidl::encoding::Encoder<'_, D>,
448            offset: usize,
449            _depth: fidl::encoding::Depth,
450        ) -> fidl::Result<()> {
451            encoder.debug_check_bounds::<DatasetAttachAllNodesToResponse>(offset);
452            unsafe {
453                // Copy the object into the buffer.
454                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
455                (buf_ptr as *mut DatasetAttachAllNodesToResponse)
456                    .write_unaligned((self as *const DatasetAttachAllNodesToResponse).read());
457                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
458                // done second because the memcpy will write garbage to these bytes.
459            }
460            Ok(())
461        }
462    }
463    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
464        fidl::encoding::Encode<DatasetAttachAllNodesToResponse, D> for (T0,)
465    {
466        #[inline]
467        unsafe fn encode(
468            self,
469            encoder: &mut fidl::encoding::Encoder<'_, D>,
470            offset: usize,
471            depth: fidl::encoding::Depth,
472        ) -> fidl::Result<()> {
473            encoder.debug_check_bounds::<DatasetAttachAllNodesToResponse>(offset);
474            // Zero out padding regions. There's no need to apply masks
475            // because the unmasked parts will be overwritten by fields.
476            // Write the fields.
477            self.0.encode(encoder, offset + 0, depth)?;
478            Ok(())
479        }
480    }
481
482    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
483        for DatasetAttachAllNodesToResponse
484    {
485        #[inline(always)]
486        fn new_empty() -> Self {
487            Self { delay_ms: fidl::new_empty!(i64, D) }
488        }
489
490        #[inline]
491        unsafe fn decode(
492            &mut self,
493            decoder: &mut fidl::encoding::Decoder<'_, D>,
494            offset: usize,
495            _depth: fidl::encoding::Depth,
496        ) -> fidl::Result<()> {
497            decoder.debug_check_bounds::<Self>(offset);
498            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
499            // Verify that padding bytes are zero.
500            // Copy from the buffer into the object.
501            unsafe {
502                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
503            }
504            Ok(())
505        }
506    }
507
508    impl fidl::encoding::ValueTypeMarker for DatasetGetActiveTlvsResponse {
509        type Borrowed<'a> = &'a Self;
510        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
511            value
512        }
513    }
514
515    unsafe impl fidl::encoding::TypeMarker for DatasetGetActiveTlvsResponse {
516        type Owned = Self;
517
518        #[inline(always)]
519        fn inline_align(_context: fidl::encoding::Context) -> usize {
520            8
521        }
522
523        #[inline(always)]
524        fn inline_size(_context: fidl::encoding::Context) -> usize {
525            16
526        }
527    }
528
529    unsafe impl<D: fidl::encoding::ResourceDialect>
530        fidl::encoding::Encode<DatasetGetActiveTlvsResponse, D> for &DatasetGetActiveTlvsResponse
531    {
532        #[inline]
533        unsafe fn encode(
534            self,
535            encoder: &mut fidl::encoding::Encoder<'_, D>,
536            offset: usize,
537            _depth: fidl::encoding::Depth,
538        ) -> fidl::Result<()> {
539            encoder.debug_check_bounds::<DatasetGetActiveTlvsResponse>(offset);
540            // Delegate to tuple encoding.
541            fidl::encoding::Encode::<DatasetGetActiveTlvsResponse, D>::encode(
542                (
543                    <fidl::encoding::Optional<fidl::encoding::Vector<u8, 254>> as fidl::encoding::ValueTypeMarker>::borrow(&self.dataset),
544                ),
545                encoder, offset, _depth
546            )
547        }
548    }
549    unsafe impl<
550            D: fidl::encoding::ResourceDialect,
551            T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::Vector<u8, 254>>, D>,
552        > fidl::encoding::Encode<DatasetGetActiveTlvsResponse, D> for (T0,)
553    {
554        #[inline]
555        unsafe fn encode(
556            self,
557            encoder: &mut fidl::encoding::Encoder<'_, D>,
558            offset: usize,
559            depth: fidl::encoding::Depth,
560        ) -> fidl::Result<()> {
561            encoder.debug_check_bounds::<DatasetGetActiveTlvsResponse>(offset);
562            // Zero out padding regions. There's no need to apply masks
563            // because the unmasked parts will be overwritten by fields.
564            // Write the fields.
565            self.0.encode(encoder, offset + 0, depth)?;
566            Ok(())
567        }
568    }
569
570    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
571        for DatasetGetActiveTlvsResponse
572    {
573        #[inline(always)]
574        fn new_empty() -> Self {
575            Self {
576                dataset: fidl::new_empty!(
577                    fidl::encoding::Optional<fidl::encoding::Vector<u8, 254>>,
578                    D
579                ),
580            }
581        }
582
583        #[inline]
584        unsafe fn decode(
585            &mut self,
586            decoder: &mut fidl::encoding::Decoder<'_, D>,
587            offset: usize,
588            _depth: fidl::encoding::Depth,
589        ) -> fidl::Result<()> {
590            decoder.debug_check_bounds::<Self>(offset);
591            // Verify that padding bytes are zero.
592            fidl::decode!(
593                fidl::encoding::Optional<fidl::encoding::Vector<u8, 254>>,
594                D,
595                &mut self.dataset,
596                decoder,
597                offset + 0,
598                _depth
599            )?;
600            Ok(())
601        }
602    }
603
604    impl fidl::encoding::ValueTypeMarker for DatasetSetActiveTlvsRequest {
605        type Borrowed<'a> = &'a Self;
606        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
607            value
608        }
609    }
610
611    unsafe impl fidl::encoding::TypeMarker for DatasetSetActiveTlvsRequest {
612        type Owned = Self;
613
614        #[inline(always)]
615        fn inline_align(_context: fidl::encoding::Context) -> usize {
616            8
617        }
618
619        #[inline(always)]
620        fn inline_size(_context: fidl::encoding::Context) -> usize {
621            16
622        }
623    }
624
625    unsafe impl<D: fidl::encoding::ResourceDialect>
626        fidl::encoding::Encode<DatasetSetActiveTlvsRequest, D> for &DatasetSetActiveTlvsRequest
627    {
628        #[inline]
629        unsafe fn encode(
630            self,
631            encoder: &mut fidl::encoding::Encoder<'_, D>,
632            offset: usize,
633            _depth: fidl::encoding::Depth,
634        ) -> fidl::Result<()> {
635            encoder.debug_check_bounds::<DatasetSetActiveTlvsRequest>(offset);
636            // Delegate to tuple encoding.
637            fidl::encoding::Encode::<DatasetSetActiveTlvsRequest, D>::encode(
638                (<fidl::encoding::Vector<u8, 254> as fidl::encoding::ValueTypeMarker>::borrow(
639                    &self.dataset,
640                ),),
641                encoder,
642                offset,
643                _depth,
644            )
645        }
646    }
647    unsafe impl<
648            D: fidl::encoding::ResourceDialect,
649            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 254>, D>,
650        > fidl::encoding::Encode<DatasetSetActiveTlvsRequest, D> for (T0,)
651    {
652        #[inline]
653        unsafe fn encode(
654            self,
655            encoder: &mut fidl::encoding::Encoder<'_, D>,
656            offset: usize,
657            depth: fidl::encoding::Depth,
658        ) -> fidl::Result<()> {
659            encoder.debug_check_bounds::<DatasetSetActiveTlvsRequest>(offset);
660            // Zero out padding regions. There's no need to apply masks
661            // because the unmasked parts will be overwritten by fields.
662            // Write the fields.
663            self.0.encode(encoder, offset + 0, depth)?;
664            Ok(())
665        }
666    }
667
668    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
669        for DatasetSetActiveTlvsRequest
670    {
671        #[inline(always)]
672        fn new_empty() -> Self {
673            Self { dataset: fidl::new_empty!(fidl::encoding::Vector<u8, 254>, D) }
674        }
675
676        #[inline]
677        unsafe fn decode(
678            &mut self,
679            decoder: &mut fidl::encoding::Decoder<'_, D>,
680            offset: usize,
681            _depth: fidl::encoding::Depth,
682        ) -> fidl::Result<()> {
683            decoder.debug_check_bounds::<Self>(offset);
684            // Verify that padding bytes are zero.
685            fidl::decode!(fidl::encoding::Vector<u8, 254>, D, &mut self.dataset, decoder, offset + 0, _depth)?;
686            Ok(())
687        }
688    }
689
690    impl fidl::encoding::ValueTypeMarker for FeatureGetFeatureConfigResponse {
691        type Borrowed<'a> = &'a Self;
692        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
693            value
694        }
695    }
696
697    unsafe impl fidl::encoding::TypeMarker for FeatureGetFeatureConfigResponse {
698        type Owned = Self;
699
700        #[inline(always)]
701        fn inline_align(_context: fidl::encoding::Context) -> usize {
702            8
703        }
704
705        #[inline(always)]
706        fn inline_size(_context: fidl::encoding::Context) -> usize {
707            16
708        }
709    }
710
711    unsafe impl<D: fidl::encoding::ResourceDialect>
712        fidl::encoding::Encode<FeatureGetFeatureConfigResponse, D>
713        for &FeatureGetFeatureConfigResponse
714    {
715        #[inline]
716        unsafe fn encode(
717            self,
718            encoder: &mut fidl::encoding::Encoder<'_, D>,
719            offset: usize,
720            _depth: fidl::encoding::Depth,
721        ) -> fidl::Result<()> {
722            encoder.debug_check_bounds::<FeatureGetFeatureConfigResponse>(offset);
723            // Delegate to tuple encoding.
724            fidl::encoding::Encode::<FeatureGetFeatureConfigResponse, D>::encode(
725                (<FeatureConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),),
726                encoder,
727                offset,
728                _depth,
729            )
730        }
731    }
732    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<FeatureConfig, D>>
733        fidl::encoding::Encode<FeatureGetFeatureConfigResponse, D> for (T0,)
734    {
735        #[inline]
736        unsafe fn encode(
737            self,
738            encoder: &mut fidl::encoding::Encoder<'_, D>,
739            offset: usize,
740            depth: fidl::encoding::Depth,
741        ) -> fidl::Result<()> {
742            encoder.debug_check_bounds::<FeatureGetFeatureConfigResponse>(offset);
743            // Zero out padding regions. There's no need to apply masks
744            // because the unmasked parts will be overwritten by fields.
745            // Write the fields.
746            self.0.encode(encoder, offset + 0, depth)?;
747            Ok(())
748        }
749    }
750
751    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
752        for FeatureGetFeatureConfigResponse
753    {
754        #[inline(always)]
755        fn new_empty() -> Self {
756            Self { config: fidl::new_empty!(FeatureConfig, D) }
757        }
758
759        #[inline]
760        unsafe fn decode(
761            &mut self,
762            decoder: &mut fidl::encoding::Decoder<'_, D>,
763            offset: usize,
764            _depth: fidl::encoding::Depth,
765        ) -> fidl::Result<()> {
766            decoder.debug_check_bounds::<Self>(offset);
767            // Verify that padding bytes are zero.
768            fidl::decode!(FeatureConfig, D, &mut self.config, decoder, offset + 0, _depth)?;
769            Ok(())
770        }
771    }
772
773    impl fidl::encoding::ValueTypeMarker for FeatureUpdateFeatureConfigRequest {
774        type Borrowed<'a> = &'a Self;
775        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
776            value
777        }
778    }
779
780    unsafe impl fidl::encoding::TypeMarker for FeatureUpdateFeatureConfigRequest {
781        type Owned = Self;
782
783        #[inline(always)]
784        fn inline_align(_context: fidl::encoding::Context) -> usize {
785            8
786        }
787
788        #[inline(always)]
789        fn inline_size(_context: fidl::encoding::Context) -> usize {
790            16
791        }
792    }
793
794    unsafe impl<D: fidl::encoding::ResourceDialect>
795        fidl::encoding::Encode<FeatureUpdateFeatureConfigRequest, D>
796        for &FeatureUpdateFeatureConfigRequest
797    {
798        #[inline]
799        unsafe fn encode(
800            self,
801            encoder: &mut fidl::encoding::Encoder<'_, D>,
802            offset: usize,
803            _depth: fidl::encoding::Depth,
804        ) -> fidl::Result<()> {
805            encoder.debug_check_bounds::<FeatureUpdateFeatureConfigRequest>(offset);
806            // Delegate to tuple encoding.
807            fidl::encoding::Encode::<FeatureUpdateFeatureConfigRequest, D>::encode(
808                (<FeatureConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),),
809                encoder,
810                offset,
811                _depth,
812            )
813        }
814    }
815    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<FeatureConfig, D>>
816        fidl::encoding::Encode<FeatureUpdateFeatureConfigRequest, D> for (T0,)
817    {
818        #[inline]
819        unsafe fn encode(
820            self,
821            encoder: &mut fidl::encoding::Encoder<'_, D>,
822            offset: usize,
823            depth: fidl::encoding::Depth,
824        ) -> fidl::Result<()> {
825            encoder.debug_check_bounds::<FeatureUpdateFeatureConfigRequest>(offset);
826            // Zero out padding regions. There's no need to apply masks
827            // because the unmasked parts will be overwritten by fields.
828            // Write the fields.
829            self.0.encode(encoder, offset + 0, depth)?;
830            Ok(())
831        }
832    }
833
834    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
835        for FeatureUpdateFeatureConfigRequest
836    {
837        #[inline(always)]
838        fn new_empty() -> Self {
839            Self { config: fidl::new_empty!(FeatureConfig, D) }
840        }
841
842        #[inline]
843        unsafe fn decode(
844            &mut self,
845            decoder: &mut fidl::encoding::Decoder<'_, D>,
846            offset: usize,
847            _depth: fidl::encoding::Depth,
848        ) -> fidl::Result<()> {
849            decoder.debug_check_bounds::<Self>(offset);
850            // Verify that padding bytes are zero.
851            fidl::decode!(FeatureConfig, D, &mut self.config, decoder, offset + 0, _depth)?;
852            Ok(())
853        }
854    }
855
856    impl fidl::encoding::ValueTypeMarker for MeshcopUpdateTxtEntriesRequest {
857        type Borrowed<'a> = &'a Self;
858        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
859            value
860        }
861    }
862
863    unsafe impl fidl::encoding::TypeMarker for MeshcopUpdateTxtEntriesRequest {
864        type Owned = Self;
865
866        #[inline(always)]
867        fn inline_align(_context: fidl::encoding::Context) -> usize {
868            8
869        }
870
871        #[inline(always)]
872        fn inline_size(_context: fidl::encoding::Context) -> usize {
873            16
874        }
875    }
876
877    unsafe impl<D: fidl::encoding::ResourceDialect>
878        fidl::encoding::Encode<MeshcopUpdateTxtEntriesRequest, D>
879        for &MeshcopUpdateTxtEntriesRequest
880    {
881        #[inline]
882        unsafe fn encode(
883            self,
884            encoder: &mut fidl::encoding::Encoder<'_, D>,
885            offset: usize,
886            _depth: fidl::encoding::Depth,
887        ) -> fidl::Result<()> {
888            encoder.debug_check_bounds::<MeshcopUpdateTxtEntriesRequest>(offset);
889            // Delegate to tuple encoding.
890            fidl::encoding::Encode::<MeshcopUpdateTxtEntriesRequest, D>::encode(
891                (
892                    <fidl::encoding::Vector<TxtEntries, 32> as fidl::encoding::ValueTypeMarker>::borrow(&self.txt_entries),
893                ),
894                encoder, offset, _depth
895            )
896        }
897    }
898    unsafe impl<
899            D: fidl::encoding::ResourceDialect,
900            T0: fidl::encoding::Encode<fidl::encoding::Vector<TxtEntries, 32>, D>,
901        > fidl::encoding::Encode<MeshcopUpdateTxtEntriesRequest, D> for (T0,)
902    {
903        #[inline]
904        unsafe fn encode(
905            self,
906            encoder: &mut fidl::encoding::Encoder<'_, D>,
907            offset: usize,
908            depth: fidl::encoding::Depth,
909        ) -> fidl::Result<()> {
910            encoder.debug_check_bounds::<MeshcopUpdateTxtEntriesRequest>(offset);
911            // Zero out padding regions. There's no need to apply masks
912            // because the unmasked parts will be overwritten by fields.
913            // Write the fields.
914            self.0.encode(encoder, offset + 0, depth)?;
915            Ok(())
916        }
917    }
918
919    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
920        for MeshcopUpdateTxtEntriesRequest
921    {
922        #[inline(always)]
923        fn new_empty() -> Self {
924            Self { txt_entries: fidl::new_empty!(fidl::encoding::Vector<TxtEntries, 32>, D) }
925        }
926
927        #[inline]
928        unsafe fn decode(
929            &mut self,
930            decoder: &mut fidl::encoding::Decoder<'_, D>,
931            offset: usize,
932            _depth: fidl::encoding::Depth,
933        ) -> fidl::Result<()> {
934            decoder.debug_check_bounds::<Self>(offset);
935            // Verify that padding bytes are zero.
936            fidl::decode!(fidl::encoding::Vector<TxtEntries, 32>, D, &mut self.txt_entries, decoder, offset + 0, _depth)?;
937            Ok(())
938        }
939    }
940
941    impl fidl::encoding::ValueTypeMarker for ThreadCapabilitiesGetCapabilitiesResponse {
942        type Borrowed<'a> = &'a Self;
943        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
944            value
945        }
946    }
947
948    unsafe impl fidl::encoding::TypeMarker for ThreadCapabilitiesGetCapabilitiesResponse {
949        type Owned = Self;
950
951        #[inline(always)]
952        fn inline_align(_context: fidl::encoding::Context) -> usize {
953            8
954        }
955
956        #[inline(always)]
957        fn inline_size(_context: fidl::encoding::Context) -> usize {
958            16
959        }
960    }
961
962    unsafe impl<D: fidl::encoding::ResourceDialect>
963        fidl::encoding::Encode<ThreadCapabilitiesGetCapabilitiesResponse, D>
964        for &ThreadCapabilitiesGetCapabilitiesResponse
965    {
966        #[inline]
967        unsafe fn encode(
968            self,
969            encoder: &mut fidl::encoding::Encoder<'_, D>,
970            offset: usize,
971            _depth: fidl::encoding::Depth,
972        ) -> fidl::Result<()> {
973            encoder.debug_check_bounds::<ThreadCapabilitiesGetCapabilitiesResponse>(offset);
974            // Delegate to tuple encoding.
975            fidl::encoding::Encode::<ThreadCapabilitiesGetCapabilitiesResponse, D>::encode(
976                (<Capabilities as fidl::encoding::ValueTypeMarker>::borrow(&self.capabilities),),
977                encoder,
978                offset,
979                _depth,
980            )
981        }
982    }
983    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Capabilities, D>>
984        fidl::encoding::Encode<ThreadCapabilitiesGetCapabilitiesResponse, D> for (T0,)
985    {
986        #[inline]
987        unsafe fn encode(
988            self,
989            encoder: &mut fidl::encoding::Encoder<'_, D>,
990            offset: usize,
991            depth: fidl::encoding::Depth,
992        ) -> fidl::Result<()> {
993            encoder.debug_check_bounds::<ThreadCapabilitiesGetCapabilitiesResponse>(offset);
994            // Zero out padding regions. There's no need to apply masks
995            // because the unmasked parts will be overwritten by fields.
996            // Write the fields.
997            self.0.encode(encoder, offset + 0, depth)?;
998            Ok(())
999        }
1000    }
1001
1002    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1003        for ThreadCapabilitiesGetCapabilitiesResponse
1004    {
1005        #[inline(always)]
1006        fn new_empty() -> Self {
1007            Self { capabilities: fidl::new_empty!(Capabilities, D) }
1008        }
1009
1010        #[inline]
1011        unsafe fn decode(
1012            &mut self,
1013            decoder: &mut fidl::encoding::Decoder<'_, D>,
1014            offset: usize,
1015            _depth: fidl::encoding::Depth,
1016        ) -> fidl::Result<()> {
1017            decoder.debug_check_bounds::<Self>(offset);
1018            // Verify that padding bytes are zero.
1019            fidl::decode!(Capabilities, D, &mut self.capabilities, decoder, offset + 0, _depth)?;
1020            Ok(())
1021        }
1022    }
1023
1024    impl fidl::encoding::ValueTypeMarker for TxtEntries {
1025        type Borrowed<'a> = &'a Self;
1026        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1027            value
1028        }
1029    }
1030
1031    unsafe impl fidl::encoding::TypeMarker for TxtEntries {
1032        type Owned = Self;
1033
1034        #[inline(always)]
1035        fn inline_align(_context: fidl::encoding::Context) -> usize {
1036            8
1037        }
1038
1039        #[inline(always)]
1040        fn inline_size(_context: fidl::encoding::Context) -> usize {
1041            32
1042        }
1043    }
1044
1045    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TxtEntries, D>
1046        for &TxtEntries
1047    {
1048        #[inline]
1049        unsafe fn encode(
1050            self,
1051            encoder: &mut fidl::encoding::Encoder<'_, D>,
1052            offset: usize,
1053            _depth: fidl::encoding::Depth,
1054        ) -> fidl::Result<()> {
1055            encoder.debug_check_bounds::<TxtEntries>(offset);
1056            // Delegate to tuple encoding.
1057            fidl::encoding::Encode::<TxtEntries, D>::encode(
1058                (
1059                    <fidl::encoding::BoundedString<254> as fidl::encoding::ValueTypeMarker>::borrow(
1060                        &self.key,
1061                    ),
1062                    <fidl::encoding::Vector<u8, 253> as fidl::encoding::ValueTypeMarker>::borrow(
1063                        &self.value,
1064                    ),
1065                ),
1066                encoder,
1067                offset,
1068                _depth,
1069            )
1070        }
1071    }
1072    unsafe impl<
1073            D: fidl::encoding::ResourceDialect,
1074            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<254>, D>,
1075            T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 253>, D>,
1076        > fidl::encoding::Encode<TxtEntries, D> for (T0, T1)
1077    {
1078        #[inline]
1079        unsafe fn encode(
1080            self,
1081            encoder: &mut fidl::encoding::Encoder<'_, D>,
1082            offset: usize,
1083            depth: fidl::encoding::Depth,
1084        ) -> fidl::Result<()> {
1085            encoder.debug_check_bounds::<TxtEntries>(offset);
1086            // Zero out padding regions. There's no need to apply masks
1087            // because the unmasked parts will be overwritten by fields.
1088            // Write the fields.
1089            self.0.encode(encoder, offset + 0, depth)?;
1090            self.1.encode(encoder, offset + 16, depth)?;
1091            Ok(())
1092        }
1093    }
1094
1095    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TxtEntries {
1096        #[inline(always)]
1097        fn new_empty() -> Self {
1098            Self {
1099                key: fidl::new_empty!(fidl::encoding::BoundedString<254>, D),
1100                value: fidl::new_empty!(fidl::encoding::Vector<u8, 253>, D),
1101            }
1102        }
1103
1104        #[inline]
1105        unsafe fn decode(
1106            &mut self,
1107            decoder: &mut fidl::encoding::Decoder<'_, D>,
1108            offset: usize,
1109            _depth: fidl::encoding::Depth,
1110        ) -> fidl::Result<()> {
1111            decoder.debug_check_bounds::<Self>(offset);
1112            // Verify that padding bytes are zero.
1113            fidl::decode!(
1114                fidl::encoding::BoundedString<254>,
1115                D,
1116                &mut self.key,
1117                decoder,
1118                offset + 0,
1119                _depth
1120            )?;
1121            fidl::decode!(fidl::encoding::Vector<u8, 253>, D, &mut self.value, decoder, offset + 16, _depth)?;
1122            Ok(())
1123        }
1124    }
1125
1126    impl Capabilities {
1127        #[inline(always)]
1128        fn max_ordinal_present(&self) -> u64 {
1129            if let Some(_) = self.epskc {
1130                return 3;
1131            }
1132            if let Some(_) = self.dhcpv6_pd {
1133                return 2;
1134            }
1135            if let Some(_) = self.nat64 {
1136                return 1;
1137            }
1138            0
1139        }
1140    }
1141
1142    impl fidl::encoding::ValueTypeMarker for Capabilities {
1143        type Borrowed<'a> = &'a Self;
1144        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1145            value
1146        }
1147    }
1148
1149    unsafe impl fidl::encoding::TypeMarker for Capabilities {
1150        type Owned = Self;
1151
1152        #[inline(always)]
1153        fn inline_align(_context: fidl::encoding::Context) -> usize {
1154            8
1155        }
1156
1157        #[inline(always)]
1158        fn inline_size(_context: fidl::encoding::Context) -> usize {
1159            16
1160        }
1161    }
1162
1163    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Capabilities, D>
1164        for &Capabilities
1165    {
1166        unsafe fn encode(
1167            self,
1168            encoder: &mut fidl::encoding::Encoder<'_, D>,
1169            offset: usize,
1170            mut depth: fidl::encoding::Depth,
1171        ) -> fidl::Result<()> {
1172            encoder.debug_check_bounds::<Capabilities>(offset);
1173            // Vector header
1174            let max_ordinal: u64 = self.max_ordinal_present();
1175            encoder.write_num(max_ordinal, offset);
1176            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1177            // Calling encoder.out_of_line_offset(0) is not allowed.
1178            if max_ordinal == 0 {
1179                return Ok(());
1180            }
1181            depth.increment()?;
1182            let envelope_size = 8;
1183            let bytes_len = max_ordinal as usize * envelope_size;
1184            #[allow(unused_variables)]
1185            let offset = encoder.out_of_line_offset(bytes_len);
1186            let mut _prev_end_offset: usize = 0;
1187            if 1 > max_ordinal {
1188                return Ok(());
1189            }
1190
1191            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1192            // are envelope_size bytes.
1193            let cur_offset: usize = (1 - 1) * envelope_size;
1194
1195            // Zero reserved fields.
1196            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1197
1198            // Safety:
1199            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1200            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1201            //   envelope_size bytes, there is always sufficient room.
1202            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1203                self.nat64.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1204                encoder,
1205                offset + cur_offset,
1206                depth,
1207            )?;
1208
1209            _prev_end_offset = cur_offset + envelope_size;
1210            if 2 > max_ordinal {
1211                return Ok(());
1212            }
1213
1214            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1215            // are envelope_size bytes.
1216            let cur_offset: usize = (2 - 1) * envelope_size;
1217
1218            // Zero reserved fields.
1219            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1220
1221            // Safety:
1222            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1223            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1224            //   envelope_size bytes, there is always sufficient room.
1225            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1226                self.dhcpv6_pd.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1227                encoder,
1228                offset + cur_offset,
1229                depth,
1230            )?;
1231
1232            _prev_end_offset = cur_offset + envelope_size;
1233            if 3 > max_ordinal {
1234                return Ok(());
1235            }
1236
1237            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1238            // are envelope_size bytes.
1239            let cur_offset: usize = (3 - 1) * envelope_size;
1240
1241            // Zero reserved fields.
1242            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1243
1244            // Safety:
1245            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1246            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1247            //   envelope_size bytes, there is always sufficient room.
1248            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1249                self.epskc.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1250                encoder,
1251                offset + cur_offset,
1252                depth,
1253            )?;
1254
1255            _prev_end_offset = cur_offset + envelope_size;
1256
1257            Ok(())
1258        }
1259    }
1260
1261    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Capabilities {
1262        #[inline(always)]
1263        fn new_empty() -> Self {
1264            Self::default()
1265        }
1266
1267        unsafe fn decode(
1268            &mut self,
1269            decoder: &mut fidl::encoding::Decoder<'_, D>,
1270            offset: usize,
1271            mut depth: fidl::encoding::Depth,
1272        ) -> fidl::Result<()> {
1273            decoder.debug_check_bounds::<Self>(offset);
1274            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1275                None => return Err(fidl::Error::NotNullable),
1276                Some(len) => len,
1277            };
1278            // Calling decoder.out_of_line_offset(0) is not allowed.
1279            if len == 0 {
1280                return Ok(());
1281            };
1282            depth.increment()?;
1283            let envelope_size = 8;
1284            let bytes_len = len * envelope_size;
1285            let offset = decoder.out_of_line_offset(bytes_len)?;
1286            // Decode the envelope for each type.
1287            let mut _next_ordinal_to_read = 0;
1288            let mut next_offset = offset;
1289            let end_offset = offset + bytes_len;
1290            _next_ordinal_to_read += 1;
1291            if next_offset >= end_offset {
1292                return Ok(());
1293            }
1294
1295            // Decode unknown envelopes for gaps in ordinals.
1296            while _next_ordinal_to_read < 1 {
1297                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1298                _next_ordinal_to_read += 1;
1299                next_offset += envelope_size;
1300            }
1301
1302            let next_out_of_line = decoder.next_out_of_line();
1303            let handles_before = decoder.remaining_handles();
1304            if let Some((inlined, num_bytes, num_handles)) =
1305                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1306            {
1307                let member_inline_size =
1308                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1309                if inlined != (member_inline_size <= 4) {
1310                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1311                }
1312                let inner_offset;
1313                let mut inner_depth = depth.clone();
1314                if inlined {
1315                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1316                    inner_offset = next_offset;
1317                } else {
1318                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1319                    inner_depth.increment()?;
1320                }
1321                let val_ref = self.nat64.get_or_insert_with(|| fidl::new_empty!(bool, D));
1322                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1323                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1324                {
1325                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1326                }
1327                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1328                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1329                }
1330            }
1331
1332            next_offset += envelope_size;
1333            _next_ordinal_to_read += 1;
1334            if next_offset >= end_offset {
1335                return Ok(());
1336            }
1337
1338            // Decode unknown envelopes for gaps in ordinals.
1339            while _next_ordinal_to_read < 2 {
1340                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1341                _next_ordinal_to_read += 1;
1342                next_offset += envelope_size;
1343            }
1344
1345            let next_out_of_line = decoder.next_out_of_line();
1346            let handles_before = decoder.remaining_handles();
1347            if let Some((inlined, num_bytes, num_handles)) =
1348                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1349            {
1350                let member_inline_size =
1351                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1352                if inlined != (member_inline_size <= 4) {
1353                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1354                }
1355                let inner_offset;
1356                let mut inner_depth = depth.clone();
1357                if inlined {
1358                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1359                    inner_offset = next_offset;
1360                } else {
1361                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1362                    inner_depth.increment()?;
1363                }
1364                let val_ref = self.dhcpv6_pd.get_or_insert_with(|| fidl::new_empty!(bool, D));
1365                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1366                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1367                {
1368                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1369                }
1370                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1371                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1372                }
1373            }
1374
1375            next_offset += envelope_size;
1376            _next_ordinal_to_read += 1;
1377            if next_offset >= end_offset {
1378                return Ok(());
1379            }
1380
1381            // Decode unknown envelopes for gaps in ordinals.
1382            while _next_ordinal_to_read < 3 {
1383                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1384                _next_ordinal_to_read += 1;
1385                next_offset += envelope_size;
1386            }
1387
1388            let next_out_of_line = decoder.next_out_of_line();
1389            let handles_before = decoder.remaining_handles();
1390            if let Some((inlined, num_bytes, num_handles)) =
1391                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1392            {
1393                let member_inline_size =
1394                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1395                if inlined != (member_inline_size <= 4) {
1396                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1397                }
1398                let inner_offset;
1399                let mut inner_depth = depth.clone();
1400                if inlined {
1401                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1402                    inner_offset = next_offset;
1403                } else {
1404                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1405                    inner_depth.increment()?;
1406                }
1407                let val_ref = self.epskc.get_or_insert_with(|| fidl::new_empty!(bool, D));
1408                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1409                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1410                {
1411                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1412                }
1413                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1414                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1415                }
1416            }
1417
1418            next_offset += envelope_size;
1419
1420            // Decode the remaining unknown envelopes.
1421            while next_offset < end_offset {
1422                _next_ordinal_to_read += 1;
1423                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1424                next_offset += envelope_size;
1425            }
1426
1427            Ok(())
1428        }
1429    }
1430
1431    impl FeatureConfig {
1432        #[inline(always)]
1433        fn max_ordinal_present(&self) -> u64 {
1434            if let Some(_) = self.epskc_enabled {
1435                return 9;
1436            }
1437            if let Some(_) = self.link_metrics_manager_enabled {
1438                return 8;
1439            }
1440            if let Some(_) = self.dns_upstream_query_enabled {
1441                return 7;
1442            }
1443            if let Some(_) = self.dhcpv6_pd_enabled {
1444                return 6;
1445            }
1446            if let Some(_) = self.detailed_logging_level {
1447                return 5;
1448            }
1449            if let Some(_) = self.detailed_logging_enabled {
1450                return 4;
1451            }
1452            if let Some(_) = self.srp_replication_enabled {
1453                return 3;
1454            }
1455            if let Some(_) = self.nat64_enabled {
1456                return 2;
1457            }
1458            if let Some(_) = self.trel_enabled {
1459                return 1;
1460            }
1461            0
1462        }
1463    }
1464
1465    impl fidl::encoding::ValueTypeMarker for FeatureConfig {
1466        type Borrowed<'a> = &'a Self;
1467        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1468            value
1469        }
1470    }
1471
1472    unsafe impl fidl::encoding::TypeMarker for FeatureConfig {
1473        type Owned = Self;
1474
1475        #[inline(always)]
1476        fn inline_align(_context: fidl::encoding::Context) -> usize {
1477            8
1478        }
1479
1480        #[inline(always)]
1481        fn inline_size(_context: fidl::encoding::Context) -> usize {
1482            16
1483        }
1484    }
1485
1486    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FeatureConfig, D>
1487        for &FeatureConfig
1488    {
1489        unsafe fn encode(
1490            self,
1491            encoder: &mut fidl::encoding::Encoder<'_, D>,
1492            offset: usize,
1493            mut depth: fidl::encoding::Depth,
1494        ) -> fidl::Result<()> {
1495            encoder.debug_check_bounds::<FeatureConfig>(offset);
1496            // Vector header
1497            let max_ordinal: u64 = self.max_ordinal_present();
1498            encoder.write_num(max_ordinal, offset);
1499            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1500            // Calling encoder.out_of_line_offset(0) is not allowed.
1501            if max_ordinal == 0 {
1502                return Ok(());
1503            }
1504            depth.increment()?;
1505            let envelope_size = 8;
1506            let bytes_len = max_ordinal as usize * envelope_size;
1507            #[allow(unused_variables)]
1508            let offset = encoder.out_of_line_offset(bytes_len);
1509            let mut _prev_end_offset: usize = 0;
1510            if 1 > max_ordinal {
1511                return Ok(());
1512            }
1513
1514            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1515            // are envelope_size bytes.
1516            let cur_offset: usize = (1 - 1) * envelope_size;
1517
1518            // Zero reserved fields.
1519            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1520
1521            // Safety:
1522            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1523            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1524            //   envelope_size bytes, there is always sufficient room.
1525            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1526                self.trel_enabled.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1527                encoder,
1528                offset + cur_offset,
1529                depth,
1530            )?;
1531
1532            _prev_end_offset = cur_offset + envelope_size;
1533            if 2 > max_ordinal {
1534                return Ok(());
1535            }
1536
1537            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1538            // are envelope_size bytes.
1539            let cur_offset: usize = (2 - 1) * envelope_size;
1540
1541            // Zero reserved fields.
1542            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1543
1544            // Safety:
1545            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1546            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1547            //   envelope_size bytes, there is always sufficient room.
1548            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1549                self.nat64_enabled.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1550                encoder,
1551                offset + cur_offset,
1552                depth,
1553            )?;
1554
1555            _prev_end_offset = cur_offset + envelope_size;
1556            if 3 > max_ordinal {
1557                return Ok(());
1558            }
1559
1560            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1561            // are envelope_size bytes.
1562            let cur_offset: usize = (3 - 1) * envelope_size;
1563
1564            // Zero reserved fields.
1565            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1566
1567            // Safety:
1568            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1569            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1570            //   envelope_size bytes, there is always sufficient room.
1571            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1572                self.srp_replication_enabled
1573                    .as_ref()
1574                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1575                encoder,
1576                offset + cur_offset,
1577                depth,
1578            )?;
1579
1580            _prev_end_offset = cur_offset + envelope_size;
1581            if 4 > max_ordinal {
1582                return Ok(());
1583            }
1584
1585            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1586            // are envelope_size bytes.
1587            let cur_offset: usize = (4 - 1) * envelope_size;
1588
1589            // Zero reserved fields.
1590            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1591
1592            // Safety:
1593            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1594            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1595            //   envelope_size bytes, there is always sufficient room.
1596            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1597                self.detailed_logging_enabled
1598                    .as_ref()
1599                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1600                encoder,
1601                offset + cur_offset,
1602                depth,
1603            )?;
1604
1605            _prev_end_offset = cur_offset + envelope_size;
1606            if 5 > max_ordinal {
1607                return Ok(());
1608            }
1609
1610            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1611            // are envelope_size bytes.
1612            let cur_offset: usize = (5 - 1) * envelope_size;
1613
1614            // Zero reserved fields.
1615            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1616
1617            // Safety:
1618            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1619            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1620            //   envelope_size bytes, there is always sufficient room.
1621            fidl::encoding::encode_in_envelope_optional::<DetailedLoggingLevel, D>(
1622                self.detailed_logging_level
1623                    .as_ref()
1624                    .map(<DetailedLoggingLevel as fidl::encoding::ValueTypeMarker>::borrow),
1625                encoder,
1626                offset + cur_offset,
1627                depth,
1628            )?;
1629
1630            _prev_end_offset = cur_offset + envelope_size;
1631            if 6 > max_ordinal {
1632                return Ok(());
1633            }
1634
1635            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1636            // are envelope_size bytes.
1637            let cur_offset: usize = (6 - 1) * envelope_size;
1638
1639            // Zero reserved fields.
1640            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1641
1642            // Safety:
1643            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1644            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1645            //   envelope_size bytes, there is always sufficient room.
1646            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1647                self.dhcpv6_pd_enabled
1648                    .as_ref()
1649                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1650                encoder,
1651                offset + cur_offset,
1652                depth,
1653            )?;
1654
1655            _prev_end_offset = cur_offset + envelope_size;
1656            if 7 > max_ordinal {
1657                return Ok(());
1658            }
1659
1660            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1661            // are envelope_size bytes.
1662            let cur_offset: usize = (7 - 1) * envelope_size;
1663
1664            // Zero reserved fields.
1665            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1666
1667            // Safety:
1668            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1669            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1670            //   envelope_size bytes, there is always sufficient room.
1671            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1672                self.dns_upstream_query_enabled
1673                    .as_ref()
1674                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1675                encoder,
1676                offset + cur_offset,
1677                depth,
1678            )?;
1679
1680            _prev_end_offset = cur_offset + envelope_size;
1681            if 8 > max_ordinal {
1682                return Ok(());
1683            }
1684
1685            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1686            // are envelope_size bytes.
1687            let cur_offset: usize = (8 - 1) * envelope_size;
1688
1689            // Zero reserved fields.
1690            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1691
1692            // Safety:
1693            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1694            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1695            //   envelope_size bytes, there is always sufficient room.
1696            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1697                self.link_metrics_manager_enabled
1698                    .as_ref()
1699                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1700                encoder,
1701                offset + cur_offset,
1702                depth,
1703            )?;
1704
1705            _prev_end_offset = cur_offset + envelope_size;
1706            if 9 > max_ordinal {
1707                return Ok(());
1708            }
1709
1710            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
1711            // are envelope_size bytes.
1712            let cur_offset: usize = (9 - 1) * envelope_size;
1713
1714            // Zero reserved fields.
1715            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1716
1717            // Safety:
1718            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
1719            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
1720            //   envelope_size bytes, there is always sufficient room.
1721            fidl::encoding::encode_in_envelope_optional::<bool, D>(
1722                self.epskc_enabled.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
1723                encoder,
1724                offset + cur_offset,
1725                depth,
1726            )?;
1727
1728            _prev_end_offset = cur_offset + envelope_size;
1729
1730            Ok(())
1731        }
1732    }
1733
1734    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FeatureConfig {
1735        #[inline(always)]
1736        fn new_empty() -> Self {
1737            Self::default()
1738        }
1739
1740        unsafe fn decode(
1741            &mut self,
1742            decoder: &mut fidl::encoding::Decoder<'_, D>,
1743            offset: usize,
1744            mut depth: fidl::encoding::Depth,
1745        ) -> fidl::Result<()> {
1746            decoder.debug_check_bounds::<Self>(offset);
1747            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1748                None => return Err(fidl::Error::NotNullable),
1749                Some(len) => len,
1750            };
1751            // Calling decoder.out_of_line_offset(0) is not allowed.
1752            if len == 0 {
1753                return Ok(());
1754            };
1755            depth.increment()?;
1756            let envelope_size = 8;
1757            let bytes_len = len * envelope_size;
1758            let offset = decoder.out_of_line_offset(bytes_len)?;
1759            // Decode the envelope for each type.
1760            let mut _next_ordinal_to_read = 0;
1761            let mut next_offset = offset;
1762            let end_offset = offset + bytes_len;
1763            _next_ordinal_to_read += 1;
1764            if next_offset >= end_offset {
1765                return Ok(());
1766            }
1767
1768            // Decode unknown envelopes for gaps in ordinals.
1769            while _next_ordinal_to_read < 1 {
1770                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1771                _next_ordinal_to_read += 1;
1772                next_offset += envelope_size;
1773            }
1774
1775            let next_out_of_line = decoder.next_out_of_line();
1776            let handles_before = decoder.remaining_handles();
1777            if let Some((inlined, num_bytes, num_handles)) =
1778                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1779            {
1780                let member_inline_size =
1781                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1782                if inlined != (member_inline_size <= 4) {
1783                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1784                }
1785                let inner_offset;
1786                let mut inner_depth = depth.clone();
1787                if inlined {
1788                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1789                    inner_offset = next_offset;
1790                } else {
1791                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1792                    inner_depth.increment()?;
1793                }
1794                let val_ref = self.trel_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
1795                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1796                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1797                {
1798                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1799                }
1800                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1801                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1802                }
1803            }
1804
1805            next_offset += envelope_size;
1806            _next_ordinal_to_read += 1;
1807            if next_offset >= end_offset {
1808                return Ok(());
1809            }
1810
1811            // Decode unknown envelopes for gaps in ordinals.
1812            while _next_ordinal_to_read < 2 {
1813                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1814                _next_ordinal_to_read += 1;
1815                next_offset += envelope_size;
1816            }
1817
1818            let next_out_of_line = decoder.next_out_of_line();
1819            let handles_before = decoder.remaining_handles();
1820            if let Some((inlined, num_bytes, num_handles)) =
1821                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1822            {
1823                let member_inline_size =
1824                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1825                if inlined != (member_inline_size <= 4) {
1826                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1827                }
1828                let inner_offset;
1829                let mut inner_depth = depth.clone();
1830                if inlined {
1831                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1832                    inner_offset = next_offset;
1833                } else {
1834                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1835                    inner_depth.increment()?;
1836                }
1837                let val_ref = self.nat64_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
1838                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1839                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1840                {
1841                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1842                }
1843                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1844                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1845                }
1846            }
1847
1848            next_offset += envelope_size;
1849            _next_ordinal_to_read += 1;
1850            if next_offset >= end_offset {
1851                return Ok(());
1852            }
1853
1854            // Decode unknown envelopes for gaps in ordinals.
1855            while _next_ordinal_to_read < 3 {
1856                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1857                _next_ordinal_to_read += 1;
1858                next_offset += envelope_size;
1859            }
1860
1861            let next_out_of_line = decoder.next_out_of_line();
1862            let handles_before = decoder.remaining_handles();
1863            if let Some((inlined, num_bytes, num_handles)) =
1864                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1865            {
1866                let member_inline_size =
1867                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1868                if inlined != (member_inline_size <= 4) {
1869                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1870                }
1871                let inner_offset;
1872                let mut inner_depth = depth.clone();
1873                if inlined {
1874                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1875                    inner_offset = next_offset;
1876                } else {
1877                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1878                    inner_depth.increment()?;
1879                }
1880                let val_ref =
1881                    self.srp_replication_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
1882                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1883                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1884                {
1885                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1886                }
1887                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1888                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1889                }
1890            }
1891
1892            next_offset += envelope_size;
1893            _next_ordinal_to_read += 1;
1894            if next_offset >= end_offset {
1895                return Ok(());
1896            }
1897
1898            // Decode unknown envelopes for gaps in ordinals.
1899            while _next_ordinal_to_read < 4 {
1900                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1901                _next_ordinal_to_read += 1;
1902                next_offset += envelope_size;
1903            }
1904
1905            let next_out_of_line = decoder.next_out_of_line();
1906            let handles_before = decoder.remaining_handles();
1907            if let Some((inlined, num_bytes, num_handles)) =
1908                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1909            {
1910                let member_inline_size =
1911                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1912                if inlined != (member_inline_size <= 4) {
1913                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1914                }
1915                let inner_offset;
1916                let mut inner_depth = depth.clone();
1917                if inlined {
1918                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1919                    inner_offset = next_offset;
1920                } else {
1921                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1922                    inner_depth.increment()?;
1923                }
1924                let val_ref =
1925                    self.detailed_logging_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
1926                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
1927                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1928                {
1929                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1930                }
1931                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1932                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1933                }
1934            }
1935
1936            next_offset += envelope_size;
1937            _next_ordinal_to_read += 1;
1938            if next_offset >= end_offset {
1939                return Ok(());
1940            }
1941
1942            // Decode unknown envelopes for gaps in ordinals.
1943            while _next_ordinal_to_read < 5 {
1944                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1945                _next_ordinal_to_read += 1;
1946                next_offset += envelope_size;
1947            }
1948
1949            let next_out_of_line = decoder.next_out_of_line();
1950            let handles_before = decoder.remaining_handles();
1951            if let Some((inlined, num_bytes, num_handles)) =
1952                fidl::encoding::decode_envelope_header(decoder, next_offset)?
1953            {
1954                let member_inline_size =
1955                    <DetailedLoggingLevel as fidl::encoding::TypeMarker>::inline_size(
1956                        decoder.context,
1957                    );
1958                if inlined != (member_inline_size <= 4) {
1959                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
1960                }
1961                let inner_offset;
1962                let mut inner_depth = depth.clone();
1963                if inlined {
1964                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1965                    inner_offset = next_offset;
1966                } else {
1967                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1968                    inner_depth.increment()?;
1969                }
1970                let val_ref = self
1971                    .detailed_logging_level
1972                    .get_or_insert_with(|| fidl::new_empty!(DetailedLoggingLevel, D));
1973                fidl::decode!(
1974                    DetailedLoggingLevel,
1975                    D,
1976                    val_ref,
1977                    decoder,
1978                    inner_offset,
1979                    inner_depth
1980                )?;
1981                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1982                {
1983                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
1984                }
1985                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1986                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1987                }
1988            }
1989
1990            next_offset += envelope_size;
1991            _next_ordinal_to_read += 1;
1992            if next_offset >= end_offset {
1993                return Ok(());
1994            }
1995
1996            // Decode unknown envelopes for gaps in ordinals.
1997            while _next_ordinal_to_read < 6 {
1998                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1999                _next_ordinal_to_read += 1;
2000                next_offset += envelope_size;
2001            }
2002
2003            let next_out_of_line = decoder.next_out_of_line();
2004            let handles_before = decoder.remaining_handles();
2005            if let Some((inlined, num_bytes, num_handles)) =
2006                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2007            {
2008                let member_inline_size =
2009                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2010                if inlined != (member_inline_size <= 4) {
2011                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2012                }
2013                let inner_offset;
2014                let mut inner_depth = depth.clone();
2015                if inlined {
2016                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2017                    inner_offset = next_offset;
2018                } else {
2019                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2020                    inner_depth.increment()?;
2021                }
2022                let val_ref =
2023                    self.dhcpv6_pd_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
2024                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2025                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2026                {
2027                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2028                }
2029                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2030                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2031                }
2032            }
2033
2034            next_offset += envelope_size;
2035            _next_ordinal_to_read += 1;
2036            if next_offset >= end_offset {
2037                return Ok(());
2038            }
2039
2040            // Decode unknown envelopes for gaps in ordinals.
2041            while _next_ordinal_to_read < 7 {
2042                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2043                _next_ordinal_to_read += 1;
2044                next_offset += envelope_size;
2045            }
2046
2047            let next_out_of_line = decoder.next_out_of_line();
2048            let handles_before = decoder.remaining_handles();
2049            if let Some((inlined, num_bytes, num_handles)) =
2050                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2051            {
2052                let member_inline_size =
2053                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2054                if inlined != (member_inline_size <= 4) {
2055                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2056                }
2057                let inner_offset;
2058                let mut inner_depth = depth.clone();
2059                if inlined {
2060                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2061                    inner_offset = next_offset;
2062                } else {
2063                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2064                    inner_depth.increment()?;
2065                }
2066                let val_ref = self
2067                    .dns_upstream_query_enabled
2068                    .get_or_insert_with(|| fidl::new_empty!(bool, D));
2069                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2070                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2071                {
2072                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2073                }
2074                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2075                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2076                }
2077            }
2078
2079            next_offset += envelope_size;
2080            _next_ordinal_to_read += 1;
2081            if next_offset >= end_offset {
2082                return Ok(());
2083            }
2084
2085            // Decode unknown envelopes for gaps in ordinals.
2086            while _next_ordinal_to_read < 8 {
2087                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2088                _next_ordinal_to_read += 1;
2089                next_offset += envelope_size;
2090            }
2091
2092            let next_out_of_line = decoder.next_out_of_line();
2093            let handles_before = decoder.remaining_handles();
2094            if let Some((inlined, num_bytes, num_handles)) =
2095                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2096            {
2097                let member_inline_size =
2098                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2099                if inlined != (member_inline_size <= 4) {
2100                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2101                }
2102                let inner_offset;
2103                let mut inner_depth = depth.clone();
2104                if inlined {
2105                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2106                    inner_offset = next_offset;
2107                } else {
2108                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2109                    inner_depth.increment()?;
2110                }
2111                let val_ref = self
2112                    .link_metrics_manager_enabled
2113                    .get_or_insert_with(|| fidl::new_empty!(bool, D));
2114                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2115                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2116                {
2117                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2118                }
2119                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2120                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2121                }
2122            }
2123
2124            next_offset += envelope_size;
2125            _next_ordinal_to_read += 1;
2126            if next_offset >= end_offset {
2127                return Ok(());
2128            }
2129
2130            // Decode unknown envelopes for gaps in ordinals.
2131            while _next_ordinal_to_read < 9 {
2132                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2133                _next_ordinal_to_read += 1;
2134                next_offset += envelope_size;
2135            }
2136
2137            let next_out_of_line = decoder.next_out_of_line();
2138            let handles_before = decoder.remaining_handles();
2139            if let Some((inlined, num_bytes, num_handles)) =
2140                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2141            {
2142                let member_inline_size =
2143                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2144                if inlined != (member_inline_size <= 4) {
2145                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2146                }
2147                let inner_offset;
2148                let mut inner_depth = depth.clone();
2149                if inlined {
2150                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2151                    inner_offset = next_offset;
2152                } else {
2153                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2154                    inner_depth.increment()?;
2155                }
2156                let val_ref = self.epskc_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
2157                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
2158                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2159                {
2160                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2161                }
2162                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2163                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2164                }
2165            }
2166
2167            next_offset += envelope_size;
2168
2169            // Decode the remaining unknown envelopes.
2170            while next_offset < end_offset {
2171                _next_ordinal_to_read += 1;
2172                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2173                next_offset += envelope_size;
2174            }
2175
2176            Ok(())
2177        }
2178    }
2179}