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