Skip to main content

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