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