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