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