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