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