fidl_fuchsia_net_routes__common/
fidl_fuchsia_net_routes__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11/// The index of a rule within a provided rule set.
12///
13/// Rules within the same `RuleSet` are oredered based on the index. Rule at
14/// index 0 is evaluated first among the entire set.
15pub type RuleIndex = u32;
16
17/// The priority of the rule set, all rule sets are linearized based on this.
18///
19/// Rules of a `RuleSet` with a smaller [`RuleSetPriority`] are executed before
20/// rules of a `RuleSet` with a larger [`RuleSetPriority`]. That is, `RuleSet`
21/// with priority 0 has the top priority.
22pub type RuleSetPriority = u32;
23
24/// The ID of a route table.
25///
26/// `TableId`s are globally unique non-reusable identifiers for a route table.
27pub type TableId = u32;
28
29/// The name of a route table.
30pub type TableName = String;
31
32/// A reserved rule set priority for the netstack.
33///
34/// This is used by the network stack for installing default rules.
35pub const DEFAULT_RULE_SET_PRIORITY: u32 = 4294967295;
36
37/// The maximum number of events that can be returned by one call to `Watch()`.
38pub const MAX_EVENTS: u16 = 512;
39
40/// Maximum length of a table name.
41pub const MAX_TABLE_NAME_LEN: u64 = 255;
42
43#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
44pub enum ResolveError {
45    AddressUnreachable,
46    #[doc(hidden)]
47    __SourceBreaking {
48        unknown_ordinal: u32,
49    },
50}
51
52/// Pattern that matches an unknown `ResolveError` member.
53#[macro_export]
54macro_rules! ResolveErrorUnknown {
55    () => {
56        _
57    };
58}
59
60impl ResolveError {
61    #[inline]
62    pub fn from_primitive(prim: u32) -> Option<Self> {
63        match prim {
64            1 => Some(Self::AddressUnreachable),
65            _ => None,
66        }
67    }
68
69    #[inline]
70    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
71        match prim {
72            1 => Self::AddressUnreachable,
73            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
74        }
75    }
76
77    #[inline]
78    pub fn unknown() -> Self {
79        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
80    }
81
82    #[inline]
83    pub const fn into_primitive(self) -> u32 {
84        match self {
85            Self::AddressUnreachable => 1,
86            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
87        }
88    }
89
90    #[inline]
91    pub fn is_unknown(&self) -> bool {
92        match self {
93            Self::__SourceBreaking { unknown_ordinal: _ } => true,
94            _ => false,
95        }
96    }
97}
98
99#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
100#[repr(u32)]
101pub enum StateGetRouteTableNameError {
102    NoTable = 1,
103}
104
105impl StateGetRouteTableNameError {
106    #[inline]
107    pub fn from_primitive(prim: u32) -> Option<Self> {
108        match prim {
109            1 => Some(Self::NoTable),
110            _ => None,
111        }
112    }
113
114    #[inline]
115    pub const fn into_primitive(self) -> u32 {
116        self as u32
117    }
118}
119
120#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
121pub struct All;
122
123impl fidl::Persistable for All {}
124
125#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
126#[repr(C)]
127pub struct Between {
128    /// start of the range, inclusive.
129    pub start: u32,
130    /// end of the range, inclusive.
131    pub end: u32,
132}
133
134impl fidl::Persistable for Between {}
135
136/// A placeholder for empty values.
137#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
138pub struct Empty;
139
140impl fidl::Persistable for Empty {}
141
142/// An installed IPv4 routing rule.
143#[derive(Clone, Debug, PartialEq)]
144pub struct InstalledRuleV4 {
145    /// Rule sets are ordered by the rule set priority, rule sets are disjoint
146    /// and don’t have interleaving rules among them.
147    pub rule_set_priority: u32,
148    /// Rules within a rule set are locally ordered, together with the rule set
149    /// priority, this defines a global order for all installed rules.
150    pub rule_index: u32,
151    /// The matcher part of the rule, the rule is a no-op if the matcher does
152    /// not match the packet.
153    pub matcher: RuleMatcherV4,
154    /// The action part of the rule that describes what to do if the matcher
155    /// matches the packet.
156    pub action: RuleAction,
157}
158
159impl fidl::Persistable for InstalledRuleV4 {}
160
161/// An installed IPv6 routing rule.
162#[derive(Clone, Debug, PartialEq)]
163pub struct InstalledRuleV6 {
164    /// Rule sets are ordered by the rule set priority, rule sets are disjoint
165    /// and don’t have interleaving rules among them.
166    pub rule_set_priority: u32,
167    /// Rules within a rule set are locally ordered, together with the rule set
168    /// priority, this defines a global order for all installed rules.
169    pub rule_index: u32,
170    /// The matcher part of the rule, the rule is a no-op if the matcher does
171    /// not match the packet.
172    pub matcher: RuleMatcherV6,
173    /// The action part of the rule that describes what to do if the matcher
174    /// matches the packet.
175    pub action: RuleAction,
176}
177
178impl fidl::Persistable for InstalledRuleV6 {}
179
180#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
181pub struct Main;
182
183impl fidl::Persistable for Main {}
184
185#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
186#[repr(C)]
187pub struct Marked {
188    /// Mask to apply before comparing to the range in `between`.
189    pub mask: u32,
190    /// The mark is between the given range.
191    pub between: Between,
192}
193
194impl fidl::Persistable for Marked {}
195
196#[derive(Clone, Debug, PartialEq)]
197pub struct RouteTargetV4 {
198    /// The interface ID of the target's outbound interface.
199    pub outbound_interface: u64,
200    /// The optional next-hop of the target. If provided, the address
201    /// must be a unicast address.
202    pub next_hop: Option<Box<fidl_fuchsia_net__common::Ipv4Address>>,
203}
204
205impl fidl::Persistable for RouteTargetV4 {}
206
207#[derive(Clone, Debug, PartialEq)]
208pub struct RouteTargetV6 {
209    /// The interface ID of the target's outbound interface.
210    pub outbound_interface: u64,
211    /// The optional next-hop of the target. If provided, the address
212    /// must be a unicast address.
213    pub next_hop: Option<Box<fidl_fuchsia_net__common::Ipv6Address>>,
214}
215
216impl fidl::Persistable for RouteTargetV6 {}
217
218/// A `RouteV4` specifies an IPv4 network route.
219#[derive(Clone, Debug, PartialEq)]
220pub struct RouteV4 {
221    /// The destination subnet of the route. When making a routing decision
222    /// for a given packet the route whose destination forms the longest
223    /// matching prefix will be selected, with ties being broken by the route's
224    /// metric.
225    pub destination: fidl_fuchsia_net__common::Ipv4AddressWithPrefix,
226    /// Packets matching this route will have the specified action applied to
227    /// them.
228    pub action: RouteActionV4,
229    /// The additional properties of the IPv4 route.
230    pub properties: RoutePropertiesV4,
231}
232
233impl fidl::Persistable for RouteV4 {}
234
235/// A `RouteV6` specifies an IPv6 network route.
236#[derive(Clone, Debug, PartialEq)]
237pub struct RouteV6 {
238    /// The destination subnet of the route. When making a routing decision
239    /// for a given packet the route whose destination forms the longest
240    /// matching prefix will be selected, with ties being broken by the route's
241    /// metric.
242    pub destination: fidl_fuchsia_net__common::Ipv6AddressWithPrefix,
243    /// Packets matching this route will have the specified action applied to
244    /// them.
245    pub action: RouteActionV6,
246    /// The additional properties of the IPv6 route.
247    pub properties: RoutePropertiesV6,
248}
249
250impl fidl::Persistable for RouteV6 {}
251
252#[derive(Clone, Debug, PartialEq)]
253pub struct RuleWatcherV4WatchResponse {
254    pub events: Vec<RuleEventV4>,
255}
256
257impl fidl::Persistable for RuleWatcherV4WatchResponse {}
258
259#[derive(Clone, Debug, PartialEq)]
260pub struct RuleWatcherV6WatchResponse {
261    pub events: Vec<RuleEventV6>,
262}
263
264impl fidl::Persistable for RuleWatcherV6WatchResponse {}
265
266#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
267#[repr(C)]
268pub struct StateGetRouteTableNameRequest {
269    pub table_id: u32,
270}
271
272impl fidl::Persistable for StateGetRouteTableNameRequest {}
273
274#[derive(Clone, Debug, PartialEq)]
275pub struct StateResolve2Request {
276    pub destination: fidl_fuchsia_net__common::IpAddress,
277    pub options: ResolveOptions,
278}
279
280impl fidl::Persistable for StateResolve2Request {}
281
282#[derive(Clone, Debug, PartialEq)]
283pub struct StateResolveRequest {
284    pub destination: fidl_fuchsia_net__common::IpAddress,
285}
286
287impl fidl::Persistable for StateResolveRequest {}
288
289#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
290pub struct StateGetRouteTableNameResponse {
291    pub table_name: String,
292}
293
294impl fidl::Persistable for StateGetRouteTableNameResponse {}
295
296#[derive(Clone, Debug, PartialEq)]
297pub struct StateResolve2Response {
298    /// A resolved route.
299    ///
300    /// Contains the information for the "next-hop" or immediate-destination
301    /// that is the result of a route resolution. A resolved route is only
302    /// meaningful in the context of a requested destination.
303    pub result: ResolveResult,
304}
305
306impl fidl::Persistable for StateResolve2Response {}
307
308#[derive(Clone, Debug, PartialEq)]
309pub struct StateResolveResponse {
310    /// A resolved route.
311    ///
312    /// Contains the information for the "next-hop" or immediate-destination
313    /// that is the result of a route resolution. A resolved route is only
314    /// meaningful in the context of a requested destination.
315    pub result: Resolved,
316}
317
318impl fidl::Persistable for StateResolveResponse {}
319
320#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
321pub struct Unbound;
322
323impl fidl::Persistable for Unbound {}
324
325#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
326pub struct Unmarked;
327
328impl fidl::Persistable for Unmarked {}
329
330#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
331pub struct Unreachable;
332
333impl fidl::Persistable for Unreachable {}
334
335#[derive(Clone, Debug, PartialEq)]
336pub struct WatcherV4WatchResponse {
337    pub events: Vec<EventV4>,
338}
339
340impl fidl::Persistable for WatcherV4WatchResponse {}
341
342#[derive(Clone, Debug, PartialEq)]
343pub struct WatcherV6WatchResponse {
344    pub events: Vec<EventV6>,
345}
346
347impl fidl::Persistable for WatcherV6WatchResponse {}
348
349/// The common matcher that can be matched to both IPv4 and IPv6 packets.
350///
351/// A matcher matches a packet if all of the present fields match the
352/// corresponding properties.
353#[derive(Clone, Debug, Default, PartialEq)]
354pub struct BaseMatcher {
355    /// Matches the packet iff the packet was locally generated.
356    pub locally_generated: Option<bool>,
357    /// Matches the packet iff the packet is sent with `SO_BINDTODEVICE`.
358    pub bound_device: Option<InterfaceMatcher>,
359    /// Matches the MARK_1 domain.
360    pub mark_1: Option<MarkMatcher>,
361    /// Matches for the MARK_2 domain.
362    pub mark_2: Option<MarkMatcher>,
363    #[doc(hidden)]
364    pub __source_breaking: fidl::marker::SourceBreaking,
365}
366
367impl fidl::Persistable for BaseMatcher {}
368
369/// Collection of addresses and identifiers describing a network destination.
370///
371/// A `Destination` is the "next-hop" for a routed packet.
372#[derive(Clone, Debug, Default, PartialEq)]
373pub struct Destination {
374    /// The IP address of the destination.
375    pub address: Option<fidl_fuchsia_net__common::IpAddress>,
376    /// The MAC address of the destination. Only set if the destination is on a
377    /// link that requires a MAC address.
378    pub mac: Option<fidl_fuchsia_net__common::MacAddress>,
379    /// The interface identifier over which the destination can be reached.
380    pub interface_id: Option<u64>,
381    /// The preferred local IP address used to communicate with the destination.
382    pub source_address: Option<fidl_fuchsia_net__common::IpAddress>,
383    #[doc(hidden)]
384    pub __source_breaking: fidl::marker::SourceBreaking,
385}
386
387impl fidl::Persistable for Destination {}
388
389/// The effective properties of a route installed in the system.
390#[derive(Clone, Debug, Default, PartialEq)]
391pub struct EffectiveRouteProperties {
392    /// The route's effective metric, dependent on the value of the route's
393    /// [`SpecifiedRouteProperties`]. If the `specified_metric` is
394    /// `explicit_metric`, this value will be identical to the provided value;
395    /// if the `specified_metric` is `inherited_from_interface` this value will
396    /// be the interface's routing metric.
397    pub metric: Option<u32>,
398    #[doc(hidden)]
399    pub __source_breaking: fidl::marker::SourceBreaking,
400}
401
402impl fidl::Persistable for EffectiveRouteProperties {}
403
404/// An `InstalledRouteV4` specifies an IPv4 network route that is installed in
405/// the system's routing table.
406#[derive(Clone, Debug, Default, PartialEq)]
407pub struct InstalledRouteV4 {
408    /// The route.
409    pub route: Option<RouteV4>,
410    /// The route's effective properties.
411    pub effective_properties: Option<EffectiveRouteProperties>,
412    /// The ID of the table to which this route belongs.
413    pub table_id: Option<u32>,
414    #[doc(hidden)]
415    pub __source_breaking: fidl::marker::SourceBreaking,
416}
417
418impl fidl::Persistable for InstalledRouteV4 {}
419
420/// An `InstalledRouteV6` specifies an IPv6 network route that is installed in
421/// the system's routing table.
422#[derive(Clone, Debug, Default, PartialEq)]
423pub struct InstalledRouteV6 {
424    /// The route.
425    pub route: Option<RouteV6>,
426    /// The route's effective properties.
427    pub effective_properties: Option<EffectiveRouteProperties>,
428    /// The ID of the table to which this route belongs.
429    pub table_id: Option<u32>,
430    #[doc(hidden)]
431    pub __source_breaking: fidl::marker::SourceBreaking,
432}
433
434impl fidl::Persistable for InstalledRouteV6 {}
435
436#[derive(Clone, Debug, Default, PartialEq)]
437pub struct ResolveOptions {
438    /// The marks used for the route resolution.
439    ///
440    /// For mark domains that are not present, the route resolution will
441    /// happen with no marks for the domain. This field is also optional.
442    /// If absent, all mark domains are considered to be unmarked for the
443    /// route resolution.
444    pub marks: Option<fidl_fuchsia_net__common::Marks>,
445    #[doc(hidden)]
446    pub __source_breaking: fidl::marker::SourceBreaking,
447}
448
449impl fidl::Persistable for ResolveOptions {}
450
451#[derive(Clone, Debug, Default, PartialEq)]
452pub struct RoutePropertiesV4 {
453    /// The route's specified properties.
454    pub specified_properties: Option<SpecifiedRouteProperties>,
455    #[doc(hidden)]
456    pub __source_breaking: fidl::marker::SourceBreaking,
457}
458
459impl fidl::Persistable for RoutePropertiesV4 {}
460
461#[derive(Clone, Debug, Default, PartialEq)]
462pub struct RoutePropertiesV6 {
463    /// The route's specified properties.
464    pub specified_properties: Option<SpecifiedRouteProperties>,
465    #[doc(hidden)]
466    pub __source_breaking: fidl::marker::SourceBreaking,
467}
468
469impl fidl::Persistable for RoutePropertiesV6 {}
470
471/// The matcher part of the rule that is used to match packets.
472///
473/// A matcher matches a packet if all of the present fields match the
474/// corresponding properties.
475#[derive(Clone, Debug, Default, PartialEq)]
476pub struct RuleMatcherV4 {
477    /// Matches whether the source address of the packet is from the subnet.
478    pub from: Option<fidl_fuchsia_net__common::Ipv4AddressWithPrefix>,
479    /// The rest of the matcher that is common between IP versions.
480    ///
481    /// Interpreted as an empty table if absent.
482    pub base: Option<BaseMatcher>,
483    #[doc(hidden)]
484    pub __source_breaking: fidl::marker::SourceBreaking,
485}
486
487impl fidl::Persistable for RuleMatcherV4 {}
488
489/// The matcher part of the rule that is used to match packets.
490///
491/// A matcher matches a packet if all of the present fields match the
492/// corresponding properties.
493#[derive(Clone, Debug, Default, PartialEq)]
494pub struct RuleMatcherV6 {
495    /// Matches whether the source address of the packet is from the subnet.
496    pub from: Option<fidl_fuchsia_net__common::Ipv6AddressWithPrefix>,
497    /// The rest of the matcher that is common between IP versions.
498    ///
499    /// Interpreted as an empty table if absent.
500    pub base: Option<BaseMatcher>,
501    #[doc(hidden)]
502    pub __source_breaking: fidl::marker::SourceBreaking,
503}
504
505impl fidl::Persistable for RuleMatcherV6 {}
506
507#[derive(Clone, Debug, Default, PartialEq)]
508pub struct RuleWatcherOptionsV4 {
509    #[doc(hidden)]
510    pub __source_breaking: fidl::marker::SourceBreaking,
511}
512
513impl fidl::Persistable for RuleWatcherOptionsV4 {}
514
515#[derive(Clone, Debug, Default, PartialEq)]
516pub struct RuleWatcherOptionsV6 {
517    #[doc(hidden)]
518    pub __source_breaking: fidl::marker::SourceBreaking,
519}
520
521impl fidl::Persistable for RuleWatcherOptionsV6 {}
522
523/// The properties of the route that were explicitly specified at the time the
524/// route was created.
525#[derive(Clone, Debug, Default, PartialEq)]
526pub struct SpecifiedRouteProperties {
527    /// The route's effective metric will be determined by whichever value is
528    /// specified below.
529    pub metric: Option<SpecifiedMetric>,
530    #[doc(hidden)]
531    pub __source_breaking: fidl::marker::SourceBreaking,
532}
533
534impl fidl::Persistable for SpecifiedRouteProperties {}
535
536#[derive(Clone, Debug, Default, PartialEq)]
537pub struct WatcherOptionsV4 {
538    /// Filter events on tables matching `table_interest`.
539    ///
540    /// Interpreted as `all` if absent. The server does not validate if
541    /// `TableInterest` contains valid table IDs.
542    pub table_interest: Option<TableInterest>,
543    #[doc(hidden)]
544    pub __source_breaking: fidl::marker::SourceBreaking,
545}
546
547impl fidl::Persistable for WatcherOptionsV4 {}
548
549#[derive(Clone, Debug, Default, PartialEq)]
550pub struct WatcherOptionsV6 {
551    /// Filter events on tables matching `table_interest`.
552    ///
553    /// Interpreted as `all` if absent. The server does not validate if
554    /// `TableInterest` contains valid table IDs.
555    pub table_interest: Option<TableInterest>,
556    #[doc(hidden)]
557    pub __source_breaking: fidl::marker::SourceBreaking,
558}
559
560impl fidl::Persistable for WatcherOptionsV6 {}
561
562#[derive(Clone, Debug)]
563pub enum EventV4 {
564    /// A route that already existed when watching started.
565    Existing(InstalledRouteV4),
566    /// Sentinel value indicating no more `existing` events will be
567    /// received.
568    Idle(Empty),
569    /// A route that was added while watching.
570    Added(InstalledRouteV4),
571    /// A route that was removed while watching.
572    Removed(InstalledRouteV4),
573    #[doc(hidden)]
574    __SourceBreaking { unknown_ordinal: u64 },
575}
576
577/// Pattern that matches an unknown `EventV4` member.
578#[macro_export]
579macro_rules! EventV4Unknown {
580    () => {
581        _
582    };
583}
584
585// Custom PartialEq so that unknown variants are not equal to themselves.
586impl PartialEq for EventV4 {
587    fn eq(&self, other: &Self) -> bool {
588        match (self, other) {
589            (Self::Existing(x), Self::Existing(y)) => *x == *y,
590            (Self::Idle(x), Self::Idle(y)) => *x == *y,
591            (Self::Added(x), Self::Added(y)) => *x == *y,
592            (Self::Removed(x), Self::Removed(y)) => *x == *y,
593            _ => false,
594        }
595    }
596}
597
598impl EventV4 {
599    #[inline]
600    pub fn ordinal(&self) -> u64 {
601        match *self {
602            Self::Existing(_) => 1,
603            Self::Idle(_) => 2,
604            Self::Added(_) => 3,
605            Self::Removed(_) => 4,
606            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
607        }
608    }
609
610    #[inline]
611    pub fn unknown_variant_for_testing() -> Self {
612        Self::__SourceBreaking { unknown_ordinal: 0 }
613    }
614
615    #[inline]
616    pub fn is_unknown(&self) -> bool {
617        match self {
618            Self::__SourceBreaking { .. } => true,
619            _ => false,
620        }
621    }
622}
623
624impl fidl::Persistable for EventV4 {}
625
626#[derive(Clone, Debug)]
627pub enum EventV6 {
628    /// A route that already existed when watching started.
629    Existing(InstalledRouteV6),
630    /// Sentinel value indicating no more `existing` events will be
631    /// received.
632    Idle(Empty),
633    /// A route that was added while watching.
634    Added(InstalledRouteV6),
635    /// A route that was removed while watching.
636    Removed(InstalledRouteV6),
637    #[doc(hidden)]
638    __SourceBreaking { unknown_ordinal: u64 },
639}
640
641/// Pattern that matches an unknown `EventV6` member.
642#[macro_export]
643macro_rules! EventV6Unknown {
644    () => {
645        _
646    };
647}
648
649// Custom PartialEq so that unknown variants are not equal to themselves.
650impl PartialEq for EventV6 {
651    fn eq(&self, other: &Self) -> bool {
652        match (self, other) {
653            (Self::Existing(x), Self::Existing(y)) => *x == *y,
654            (Self::Idle(x), Self::Idle(y)) => *x == *y,
655            (Self::Added(x), Self::Added(y)) => *x == *y,
656            (Self::Removed(x), Self::Removed(y)) => *x == *y,
657            _ => false,
658        }
659    }
660}
661
662impl EventV6 {
663    #[inline]
664    pub fn ordinal(&self) -> u64 {
665        match *self {
666            Self::Existing(_) => 1,
667            Self::Idle(_) => 2,
668            Self::Added(_) => 3,
669            Self::Removed(_) => 4,
670            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
671        }
672    }
673
674    #[inline]
675    pub fn unknown_variant_for_testing() -> Self {
676        Self::__SourceBreaking { unknown_ordinal: 0 }
677    }
678
679    #[inline]
680    pub fn is_unknown(&self) -> bool {
681        match self {
682            Self::__SourceBreaking { .. } => true,
683            _ => false,
684        }
685    }
686}
687
688impl fidl::Persistable for EventV6 {}
689
690/// Matches on the originating interface of the outgoing packet.
691#[derive(Clone, Debug)]
692pub enum InterfaceMatcher {
693    /// Matches the device iff the names match.
694    ///
695    /// The name is not a pattern or regex, it needs to be an exact match for
696    /// the rule to be chosen.
697    DeviceName(String),
698    /// Matches iff the outgoing traffic is not bound to a device.
699    Unbound(Unbound),
700    #[doc(hidden)]
701    __SourceBreaking { unknown_ordinal: u64 },
702}
703
704/// Pattern that matches an unknown `InterfaceMatcher` member.
705#[macro_export]
706macro_rules! InterfaceMatcherUnknown {
707    () => {
708        _
709    };
710}
711
712// Custom PartialEq so that unknown variants are not equal to themselves.
713impl PartialEq for InterfaceMatcher {
714    fn eq(&self, other: &Self) -> bool {
715        match (self, other) {
716            (Self::DeviceName(x), Self::DeviceName(y)) => *x == *y,
717            (Self::Unbound(x), Self::Unbound(y)) => *x == *y,
718            _ => false,
719        }
720    }
721}
722
723impl InterfaceMatcher {
724    #[inline]
725    pub fn ordinal(&self) -> u64 {
726        match *self {
727            Self::DeviceName(_) => 1,
728            Self::Unbound(_) => 2,
729            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
730        }
731    }
732
733    #[inline]
734    pub fn unknown_variant_for_testing() -> Self {
735        Self::__SourceBreaking { unknown_ordinal: 0 }
736    }
737
738    #[inline]
739    pub fn is_unknown(&self) -> bool {
740        match self {
741            Self::__SourceBreaking { .. } => true,
742            _ => false,
743        }
744    }
745}
746
747impl fidl::Persistable for InterfaceMatcher {}
748
749/// Matches the mark value of a packet.
750#[derive(Clone, Debug)]
751pub enum MarkMatcher {
752    /// This mark domain does not have a mark.
753    Unmarked(Unmarked),
754    Marked(Marked),
755    #[doc(hidden)]
756    __SourceBreaking {
757        unknown_ordinal: u64,
758    },
759}
760
761/// Pattern that matches an unknown `MarkMatcher` member.
762#[macro_export]
763macro_rules! MarkMatcherUnknown {
764    () => {
765        _
766    };
767}
768
769// Custom PartialEq so that unknown variants are not equal to themselves.
770impl PartialEq for MarkMatcher {
771    fn eq(&self, other: &Self) -> bool {
772        match (self, other) {
773            (Self::Unmarked(x), Self::Unmarked(y)) => *x == *y,
774            (Self::Marked(x), Self::Marked(y)) => *x == *y,
775            _ => false,
776        }
777    }
778}
779
780impl MarkMatcher {
781    #[inline]
782    pub fn ordinal(&self) -> u64 {
783        match *self {
784            Self::Unmarked(_) => 1,
785            Self::Marked(_) => 2,
786            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
787        }
788    }
789
790    #[inline]
791    pub fn unknown_variant_for_testing() -> Self {
792        Self::__SourceBreaking { unknown_ordinal: 0 }
793    }
794
795    #[inline]
796    pub fn is_unknown(&self) -> bool {
797        match self {
798            Self::__SourceBreaking { .. } => true,
799            _ => false,
800        }
801    }
802}
803
804impl fidl::Persistable for MarkMatcher {}
805
806#[derive(Clone, Debug)]
807pub enum ResolveResult {
808    /// The requested destination is directly reachable.
809    Direct(Destination),
810    /// The requested destination is reachable through a gateway, thus
811    /// the next hop is the gateway.
812    Gateway(Destination),
813    #[doc(hidden)]
814    __SourceBreaking { unknown_ordinal: u64 },
815}
816
817/// Pattern that matches an unknown `ResolveResult` member.
818#[macro_export]
819macro_rules! ResolveResultUnknown {
820    () => {
821        _
822    };
823}
824
825// Custom PartialEq so that unknown variants are not equal to themselves.
826impl PartialEq for ResolveResult {
827    fn eq(&self, other: &Self) -> bool {
828        match (self, other) {
829            (Self::Direct(x), Self::Direct(y)) => *x == *y,
830            (Self::Gateway(x), Self::Gateway(y)) => *x == *y,
831            _ => false,
832        }
833    }
834}
835
836impl ResolveResult {
837    #[inline]
838    pub fn ordinal(&self) -> u64 {
839        match *self {
840            Self::Direct(_) => 1,
841            Self::Gateway(_) => 2,
842            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
843        }
844    }
845
846    #[inline]
847    pub fn unknown_variant_for_testing() -> Self {
848        Self::__SourceBreaking { unknown_ordinal: 0 }
849    }
850
851    #[inline]
852    pub fn is_unknown(&self) -> bool {
853        match self {
854            Self::__SourceBreaking { .. } => true,
855            _ => false,
856        }
857    }
858}
859
860impl fidl::Persistable for ResolveResult {}
861
862#[derive(Clone, Debug, PartialEq)]
863pub enum Resolved {
864    /// The requested destination is directly reachable.
865    Direct(Destination),
866    /// The requested destination is reachable through a gateway, thus
867    /// the next hop is the gateway.
868    Gateway(Destination),
869}
870
871impl Resolved {
872    #[inline]
873    pub fn ordinal(&self) -> u64 {
874        match *self {
875            Self::Direct(_) => 1,
876            Self::Gateway(_) => 2,
877        }
878    }
879}
880
881impl fidl::Persistable for Resolved {}
882
883#[derive(Clone, Debug)]
884pub enum RouteActionV4 {
885    /// Forward the packet to the specified target.
886    Forward(RouteTargetV4),
887    #[doc(hidden)]
888    __SourceBreaking { unknown_ordinal: u64 },
889}
890
891/// Pattern that matches an unknown `RouteActionV4` member.
892#[macro_export]
893macro_rules! RouteActionV4Unknown {
894    () => {
895        _
896    };
897}
898
899// Custom PartialEq so that unknown variants are not equal to themselves.
900impl PartialEq for RouteActionV4 {
901    fn eq(&self, other: &Self) -> bool {
902        match (self, other) {
903            (Self::Forward(x), Self::Forward(y)) => *x == *y,
904            _ => false,
905        }
906    }
907}
908
909impl RouteActionV4 {
910    #[inline]
911    pub fn ordinal(&self) -> u64 {
912        match *self {
913            Self::Forward(_) => 1,
914            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
915        }
916    }
917
918    #[inline]
919    pub fn unknown_variant_for_testing() -> Self {
920        Self::__SourceBreaking { unknown_ordinal: 0 }
921    }
922
923    #[inline]
924    pub fn is_unknown(&self) -> bool {
925        match self {
926            Self::__SourceBreaking { .. } => true,
927            _ => false,
928        }
929    }
930}
931
932impl fidl::Persistable for RouteActionV4 {}
933
934#[derive(Clone, Debug)]
935pub enum RouteActionV6 {
936    /// Forward the packet to the specified target.
937    Forward(RouteTargetV6),
938    #[doc(hidden)]
939    __SourceBreaking { unknown_ordinal: u64 },
940}
941
942/// Pattern that matches an unknown `RouteActionV6` member.
943#[macro_export]
944macro_rules! RouteActionV6Unknown {
945    () => {
946        _
947    };
948}
949
950// Custom PartialEq so that unknown variants are not equal to themselves.
951impl PartialEq for RouteActionV6 {
952    fn eq(&self, other: &Self) -> bool {
953        match (self, other) {
954            (Self::Forward(x), Self::Forward(y)) => *x == *y,
955            _ => false,
956        }
957    }
958}
959
960impl RouteActionV6 {
961    #[inline]
962    pub fn ordinal(&self) -> u64 {
963        match *self {
964            Self::Forward(_) => 1,
965            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
966        }
967    }
968
969    #[inline]
970    pub fn unknown_variant_for_testing() -> Self {
971        Self::__SourceBreaking { unknown_ordinal: 0 }
972    }
973
974    #[inline]
975    pub fn is_unknown(&self) -> bool {
976        match self {
977            Self::__SourceBreaking { .. } => true,
978            _ => false,
979        }
980    }
981}
982
983impl fidl::Persistable for RouteActionV6 {}
984
985/// Actions of a rule if the matcher matches.
986#[derive(Clone, Debug)]
987pub enum RuleAction {
988    /// Look for a route in the indicated route table. If there is no matching
989    /// route in the target table, the lookup will continue to consider the
990    /// next rule.
991    Lookup(u32),
992    /// Return network is unreachable. This is contrary to if a `lookup` table
993    /// is empty or no matching routes, this decision is terminal and stops
994    /// the lookup process from continuing.
995    Unreachable(Unreachable),
996    #[doc(hidden)]
997    __SourceBreaking { unknown_ordinal: u64 },
998}
999
1000/// Pattern that matches an unknown `RuleAction` member.
1001#[macro_export]
1002macro_rules! RuleActionUnknown {
1003    () => {
1004        _
1005    };
1006}
1007
1008// Custom PartialEq so that unknown variants are not equal to themselves.
1009impl PartialEq for RuleAction {
1010    fn eq(&self, other: &Self) -> bool {
1011        match (self, other) {
1012            (Self::Lookup(x), Self::Lookup(y)) => *x == *y,
1013            (Self::Unreachable(x), Self::Unreachable(y)) => *x == *y,
1014            _ => false,
1015        }
1016    }
1017}
1018
1019impl RuleAction {
1020    #[inline]
1021    pub fn ordinal(&self) -> u64 {
1022        match *self {
1023            Self::Lookup(_) => 1,
1024            Self::Unreachable(_) => 2,
1025            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
1026        }
1027    }
1028
1029    #[inline]
1030    pub fn unknown_variant_for_testing() -> Self {
1031        Self::__SourceBreaking { unknown_ordinal: 0 }
1032    }
1033
1034    #[inline]
1035    pub fn is_unknown(&self) -> bool {
1036        match self {
1037            Self::__SourceBreaking { .. } => true,
1038            _ => false,
1039        }
1040    }
1041}
1042
1043impl fidl::Persistable for RuleAction {}
1044
1045#[derive(Clone, Debug)]
1046pub enum RuleEventV4 {
1047    /// A rule that already existed when watching started.
1048    Existing(InstalledRuleV4),
1049    /// Sentinel value indicating no more `existing` events will be
1050    /// received.
1051    Idle(Empty),
1052    /// A rule that was added while watching.
1053    Added(InstalledRuleV4),
1054    /// A rule that was removed while watching.
1055    Removed(InstalledRuleV4),
1056    #[doc(hidden)]
1057    __SourceBreaking { unknown_ordinal: u64 },
1058}
1059
1060/// Pattern that matches an unknown `RuleEventV4` member.
1061#[macro_export]
1062macro_rules! RuleEventV4Unknown {
1063    () => {
1064        _
1065    };
1066}
1067
1068// Custom PartialEq so that unknown variants are not equal to themselves.
1069impl PartialEq for RuleEventV4 {
1070    fn eq(&self, other: &Self) -> bool {
1071        match (self, other) {
1072            (Self::Existing(x), Self::Existing(y)) => *x == *y,
1073            (Self::Idle(x), Self::Idle(y)) => *x == *y,
1074            (Self::Added(x), Self::Added(y)) => *x == *y,
1075            (Self::Removed(x), Self::Removed(y)) => *x == *y,
1076            _ => false,
1077        }
1078    }
1079}
1080
1081impl RuleEventV4 {
1082    #[inline]
1083    pub fn ordinal(&self) -> u64 {
1084        match *self {
1085            Self::Existing(_) => 1,
1086            Self::Idle(_) => 2,
1087            Self::Added(_) => 3,
1088            Self::Removed(_) => 4,
1089            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
1090        }
1091    }
1092
1093    #[inline]
1094    pub fn unknown_variant_for_testing() -> Self {
1095        Self::__SourceBreaking { unknown_ordinal: 0 }
1096    }
1097
1098    #[inline]
1099    pub fn is_unknown(&self) -> bool {
1100        match self {
1101            Self::__SourceBreaking { .. } => true,
1102            _ => false,
1103        }
1104    }
1105}
1106
1107impl fidl::Persistable for RuleEventV4 {}
1108
1109#[derive(Clone, Debug)]
1110pub enum RuleEventV6 {
1111    /// A rule that already existed when watching started.
1112    Existing(InstalledRuleV6),
1113    /// Sentinel value indicating no more `existing` events will be
1114    /// received.
1115    Idle(Empty),
1116    /// A rule that was added while watching.
1117    Added(InstalledRuleV6),
1118    /// A rule that was removed while watching.
1119    Removed(InstalledRuleV6),
1120    #[doc(hidden)]
1121    __SourceBreaking { unknown_ordinal: u64 },
1122}
1123
1124/// Pattern that matches an unknown `RuleEventV6` member.
1125#[macro_export]
1126macro_rules! RuleEventV6Unknown {
1127    () => {
1128        _
1129    };
1130}
1131
1132// Custom PartialEq so that unknown variants are not equal to themselves.
1133impl PartialEq for RuleEventV6 {
1134    fn eq(&self, other: &Self) -> bool {
1135        match (self, other) {
1136            (Self::Existing(x), Self::Existing(y)) => *x == *y,
1137            (Self::Idle(x), Self::Idle(y)) => *x == *y,
1138            (Self::Added(x), Self::Added(y)) => *x == *y,
1139            (Self::Removed(x), Self::Removed(y)) => *x == *y,
1140            _ => false,
1141        }
1142    }
1143}
1144
1145impl RuleEventV6 {
1146    #[inline]
1147    pub fn ordinal(&self) -> u64 {
1148        match *self {
1149            Self::Existing(_) => 1,
1150            Self::Idle(_) => 2,
1151            Self::Added(_) => 3,
1152            Self::Removed(_) => 6,
1153            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
1154        }
1155    }
1156
1157    #[inline]
1158    pub fn unknown_variant_for_testing() -> Self {
1159        Self::__SourceBreaking { unknown_ordinal: 0 }
1160    }
1161
1162    #[inline]
1163    pub fn is_unknown(&self) -> bool {
1164        match self {
1165            Self::__SourceBreaking { .. } => true,
1166            _ => false,
1167        }
1168    }
1169}
1170
1171impl fidl::Persistable for RuleEventV6 {}
1172
1173#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1174pub enum SpecifiedMetric {
1175    /// The route's metric will be this explicitly specified value.
1176    ExplicitMetric(u32),
1177    /// The route's metric is inherited from its outbound interface, and
1178    /// will track this value as it changes throughout the route's lifetime.
1179    /// Clients may prefer this approach if they wish to offload the
1180    /// responsibility of "which route is best" to the system.
1181    InheritedFromInterface(Empty),
1182}
1183
1184impl SpecifiedMetric {
1185    #[inline]
1186    pub fn ordinal(&self) -> u64 {
1187        match *self {
1188            Self::ExplicitMetric(_) => 1,
1189            Self::InheritedFromInterface(_) => 2,
1190        }
1191    }
1192}
1193
1194impl fidl::Persistable for SpecifiedMetric {}
1195
1196/// Specifies which table(s) the watcher is interested in.
1197#[derive(Clone, Debug)]
1198pub enum TableInterest {
1199    /// Only watch for events on the specified table.
1200    Only(u32),
1201    /// Watches on the main table without knowing the table ID.
1202    Main(Main),
1203    /// Watches for all routing tables.
1204    All(All),
1205    #[doc(hidden)]
1206    __SourceBreaking { unknown_ordinal: u64 },
1207}
1208
1209/// Pattern that matches an unknown `TableInterest` member.
1210#[macro_export]
1211macro_rules! TableInterestUnknown {
1212    () => {
1213        _
1214    };
1215}
1216
1217// Custom PartialEq so that unknown variants are not equal to themselves.
1218impl PartialEq for TableInterest {
1219    fn eq(&self, other: &Self) -> bool {
1220        match (self, other) {
1221            (Self::Only(x), Self::Only(y)) => *x == *y,
1222            (Self::Main(x), Self::Main(y)) => *x == *y,
1223            (Self::All(x), Self::All(y)) => *x == *y,
1224            _ => false,
1225        }
1226    }
1227}
1228
1229impl TableInterest {
1230    #[inline]
1231    pub fn ordinal(&self) -> u64 {
1232        match *self {
1233            Self::Only(_) => 1,
1234            Self::Main(_) => 2,
1235            Self::All(_) => 3,
1236            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
1237        }
1238    }
1239
1240    #[inline]
1241    pub fn unknown_variant_for_testing() -> Self {
1242        Self::__SourceBreaking { unknown_ordinal: 0 }
1243    }
1244
1245    #[inline]
1246    pub fn is_unknown(&self) -> bool {
1247        match self {
1248            Self::__SourceBreaking { .. } => true,
1249            _ => false,
1250        }
1251    }
1252}
1253
1254impl fidl::Persistable for TableInterest {}
1255
1256mod internal {
1257    use super::*;
1258    unsafe impl fidl::encoding::TypeMarker for ResolveError {
1259        type Owned = Self;
1260
1261        #[inline(always)]
1262        fn inline_align(_context: fidl::encoding::Context) -> usize {
1263            std::mem::align_of::<u32>()
1264        }
1265
1266        #[inline(always)]
1267        fn inline_size(_context: fidl::encoding::Context) -> usize {
1268            std::mem::size_of::<u32>()
1269        }
1270
1271        #[inline(always)]
1272        fn encode_is_copy() -> bool {
1273            false
1274        }
1275
1276        #[inline(always)]
1277        fn decode_is_copy() -> bool {
1278            false
1279        }
1280    }
1281
1282    impl fidl::encoding::ValueTypeMarker for ResolveError {
1283        type Borrowed<'a> = Self;
1284        #[inline(always)]
1285        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1286            *value
1287        }
1288    }
1289
1290    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ResolveError {
1291        #[inline]
1292        unsafe fn encode(
1293            self,
1294            encoder: &mut fidl::encoding::Encoder<'_, D>,
1295            offset: usize,
1296            _depth: fidl::encoding::Depth,
1297        ) -> fidl::Result<()> {
1298            encoder.debug_check_bounds::<Self>(offset);
1299            encoder.write_num(self.into_primitive(), offset);
1300            Ok(())
1301        }
1302    }
1303
1304    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolveError {
1305        #[inline(always)]
1306        fn new_empty() -> Self {
1307            Self::unknown()
1308        }
1309
1310        #[inline]
1311        unsafe fn decode(
1312            &mut self,
1313            decoder: &mut fidl::encoding::Decoder<'_, D>,
1314            offset: usize,
1315            _depth: fidl::encoding::Depth,
1316        ) -> fidl::Result<()> {
1317            decoder.debug_check_bounds::<Self>(offset);
1318            let prim = decoder.read_num::<u32>(offset);
1319
1320            *self = Self::from_primitive_allow_unknown(prim);
1321            Ok(())
1322        }
1323    }
1324    unsafe impl fidl::encoding::TypeMarker for StateGetRouteTableNameError {
1325        type Owned = Self;
1326
1327        #[inline(always)]
1328        fn inline_align(_context: fidl::encoding::Context) -> usize {
1329            std::mem::align_of::<u32>()
1330        }
1331
1332        #[inline(always)]
1333        fn inline_size(_context: fidl::encoding::Context) -> usize {
1334            std::mem::size_of::<u32>()
1335        }
1336
1337        #[inline(always)]
1338        fn encode_is_copy() -> bool {
1339            true
1340        }
1341
1342        #[inline(always)]
1343        fn decode_is_copy() -> bool {
1344            false
1345        }
1346    }
1347
1348    impl fidl::encoding::ValueTypeMarker for StateGetRouteTableNameError {
1349        type Borrowed<'a> = Self;
1350        #[inline(always)]
1351        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1352            *value
1353        }
1354    }
1355
1356    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1357        for StateGetRouteTableNameError
1358    {
1359        #[inline]
1360        unsafe fn encode(
1361            self,
1362            encoder: &mut fidl::encoding::Encoder<'_, D>,
1363            offset: usize,
1364            _depth: fidl::encoding::Depth,
1365        ) -> fidl::Result<()> {
1366            encoder.debug_check_bounds::<Self>(offset);
1367            encoder.write_num(self.into_primitive(), offset);
1368            Ok(())
1369        }
1370    }
1371
1372    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1373        for StateGetRouteTableNameError
1374    {
1375        #[inline(always)]
1376        fn new_empty() -> Self {
1377            Self::NoTable
1378        }
1379
1380        #[inline]
1381        unsafe fn decode(
1382            &mut self,
1383            decoder: &mut fidl::encoding::Decoder<'_, D>,
1384            offset: usize,
1385            _depth: fidl::encoding::Depth,
1386        ) -> fidl::Result<()> {
1387            decoder.debug_check_bounds::<Self>(offset);
1388            let prim = decoder.read_num::<u32>(offset);
1389
1390            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1391            Ok(())
1392        }
1393    }
1394
1395    impl fidl::encoding::ValueTypeMarker for All {
1396        type Borrowed<'a> = &'a Self;
1397        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1398            value
1399        }
1400    }
1401
1402    unsafe impl fidl::encoding::TypeMarker for All {
1403        type Owned = Self;
1404
1405        #[inline(always)]
1406        fn inline_align(_context: fidl::encoding::Context) -> usize {
1407            1
1408        }
1409
1410        #[inline(always)]
1411        fn inline_size(_context: fidl::encoding::Context) -> usize {
1412            1
1413        }
1414    }
1415
1416    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<All, D> for &All {
1417        #[inline]
1418        unsafe fn encode(
1419            self,
1420            encoder: &mut fidl::encoding::Encoder<'_, D>,
1421            offset: usize,
1422            _depth: fidl::encoding::Depth,
1423        ) -> fidl::Result<()> {
1424            encoder.debug_check_bounds::<All>(offset);
1425            encoder.write_num(0u8, offset);
1426            Ok(())
1427        }
1428    }
1429
1430    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for All {
1431        #[inline(always)]
1432        fn new_empty() -> Self {
1433            Self
1434        }
1435
1436        #[inline]
1437        unsafe fn decode(
1438            &mut self,
1439            decoder: &mut fidl::encoding::Decoder<'_, D>,
1440            offset: usize,
1441            _depth: fidl::encoding::Depth,
1442        ) -> fidl::Result<()> {
1443            decoder.debug_check_bounds::<Self>(offset);
1444            match decoder.read_num::<u8>(offset) {
1445                0 => Ok(()),
1446                _ => Err(fidl::Error::Invalid),
1447            }
1448        }
1449    }
1450
1451    impl fidl::encoding::ValueTypeMarker for Between {
1452        type Borrowed<'a> = &'a Self;
1453        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1454            value
1455        }
1456    }
1457
1458    unsafe impl fidl::encoding::TypeMarker for Between {
1459        type Owned = Self;
1460
1461        #[inline(always)]
1462        fn inline_align(_context: fidl::encoding::Context) -> usize {
1463            4
1464        }
1465
1466        #[inline(always)]
1467        fn inline_size(_context: fidl::encoding::Context) -> usize {
1468            8
1469        }
1470        #[inline(always)]
1471        fn encode_is_copy() -> bool {
1472            true
1473        }
1474
1475        #[inline(always)]
1476        fn decode_is_copy() -> bool {
1477            true
1478        }
1479    }
1480
1481    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Between, D> for &Between {
1482        #[inline]
1483        unsafe fn encode(
1484            self,
1485            encoder: &mut fidl::encoding::Encoder<'_, D>,
1486            offset: usize,
1487            _depth: fidl::encoding::Depth,
1488        ) -> fidl::Result<()> {
1489            encoder.debug_check_bounds::<Between>(offset);
1490            unsafe {
1491                // Copy the object into the buffer.
1492                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1493                (buf_ptr as *mut Between).write_unaligned((self as *const Between).read());
1494                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1495                // done second because the memcpy will write garbage to these bytes.
1496            }
1497            Ok(())
1498        }
1499    }
1500    unsafe impl<
1501            D: fidl::encoding::ResourceDialect,
1502            T0: fidl::encoding::Encode<u32, D>,
1503            T1: fidl::encoding::Encode<u32, D>,
1504        > fidl::encoding::Encode<Between, D> for (T0, T1)
1505    {
1506        #[inline]
1507        unsafe fn encode(
1508            self,
1509            encoder: &mut fidl::encoding::Encoder<'_, D>,
1510            offset: usize,
1511            depth: fidl::encoding::Depth,
1512        ) -> fidl::Result<()> {
1513            encoder.debug_check_bounds::<Between>(offset);
1514            // Zero out padding regions. There's no need to apply masks
1515            // because the unmasked parts will be overwritten by fields.
1516            // Write the fields.
1517            self.0.encode(encoder, offset + 0, depth)?;
1518            self.1.encode(encoder, offset + 4, depth)?;
1519            Ok(())
1520        }
1521    }
1522
1523    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Between {
1524        #[inline(always)]
1525        fn new_empty() -> Self {
1526            Self { start: fidl::new_empty!(u32, D), end: fidl::new_empty!(u32, D) }
1527        }
1528
1529        #[inline]
1530        unsafe fn decode(
1531            &mut self,
1532            decoder: &mut fidl::encoding::Decoder<'_, D>,
1533            offset: usize,
1534            _depth: fidl::encoding::Depth,
1535        ) -> fidl::Result<()> {
1536            decoder.debug_check_bounds::<Self>(offset);
1537            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1538            // Verify that padding bytes are zero.
1539            // Copy from the buffer into the object.
1540            unsafe {
1541                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1542            }
1543            Ok(())
1544        }
1545    }
1546
1547    impl fidl::encoding::ValueTypeMarker for Empty {
1548        type Borrowed<'a> = &'a Self;
1549        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1550            value
1551        }
1552    }
1553
1554    unsafe impl fidl::encoding::TypeMarker for Empty {
1555        type Owned = Self;
1556
1557        #[inline(always)]
1558        fn inline_align(_context: fidl::encoding::Context) -> usize {
1559            1
1560        }
1561
1562        #[inline(always)]
1563        fn inline_size(_context: fidl::encoding::Context) -> usize {
1564            1
1565        }
1566    }
1567
1568    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
1569        #[inline]
1570        unsafe fn encode(
1571            self,
1572            encoder: &mut fidl::encoding::Encoder<'_, D>,
1573            offset: usize,
1574            _depth: fidl::encoding::Depth,
1575        ) -> fidl::Result<()> {
1576            encoder.debug_check_bounds::<Empty>(offset);
1577            encoder.write_num(0u8, offset);
1578            Ok(())
1579        }
1580    }
1581
1582    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
1583        #[inline(always)]
1584        fn new_empty() -> Self {
1585            Self
1586        }
1587
1588        #[inline]
1589        unsafe fn decode(
1590            &mut self,
1591            decoder: &mut fidl::encoding::Decoder<'_, D>,
1592            offset: usize,
1593            _depth: fidl::encoding::Depth,
1594        ) -> fidl::Result<()> {
1595            decoder.debug_check_bounds::<Self>(offset);
1596            match decoder.read_num::<u8>(offset) {
1597                0 => Ok(()),
1598                _ => Err(fidl::Error::Invalid),
1599            }
1600        }
1601    }
1602
1603    impl fidl::encoding::ValueTypeMarker for InstalledRuleV4 {
1604        type Borrowed<'a> = &'a Self;
1605        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1606            value
1607        }
1608    }
1609
1610    unsafe impl fidl::encoding::TypeMarker for InstalledRuleV4 {
1611        type Owned = Self;
1612
1613        #[inline(always)]
1614        fn inline_align(_context: fidl::encoding::Context) -> usize {
1615            8
1616        }
1617
1618        #[inline(always)]
1619        fn inline_size(_context: fidl::encoding::Context) -> usize {
1620            40
1621        }
1622    }
1623
1624    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InstalledRuleV4, D>
1625        for &InstalledRuleV4
1626    {
1627        #[inline]
1628        unsafe fn encode(
1629            self,
1630            encoder: &mut fidl::encoding::Encoder<'_, D>,
1631            offset: usize,
1632            _depth: fidl::encoding::Depth,
1633        ) -> fidl::Result<()> {
1634            encoder.debug_check_bounds::<InstalledRuleV4>(offset);
1635            // Delegate to tuple encoding.
1636            fidl::encoding::Encode::<InstalledRuleV4, D>::encode(
1637                (
1638                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.rule_set_priority),
1639                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.rule_index),
1640                    <RuleMatcherV4 as fidl::encoding::ValueTypeMarker>::borrow(&self.matcher),
1641                    <RuleAction as fidl::encoding::ValueTypeMarker>::borrow(&self.action),
1642                ),
1643                encoder,
1644                offset,
1645                _depth,
1646            )
1647        }
1648    }
1649    unsafe impl<
1650            D: fidl::encoding::ResourceDialect,
1651            T0: fidl::encoding::Encode<u32, D>,
1652            T1: fidl::encoding::Encode<u32, D>,
1653            T2: fidl::encoding::Encode<RuleMatcherV4, D>,
1654            T3: fidl::encoding::Encode<RuleAction, D>,
1655        > fidl::encoding::Encode<InstalledRuleV4, D> for (T0, T1, T2, T3)
1656    {
1657        #[inline]
1658        unsafe fn encode(
1659            self,
1660            encoder: &mut fidl::encoding::Encoder<'_, D>,
1661            offset: usize,
1662            depth: fidl::encoding::Depth,
1663        ) -> fidl::Result<()> {
1664            encoder.debug_check_bounds::<InstalledRuleV4>(offset);
1665            // Zero out padding regions. There's no need to apply masks
1666            // because the unmasked parts will be overwritten by fields.
1667            // Write the fields.
1668            self.0.encode(encoder, offset + 0, depth)?;
1669            self.1.encode(encoder, offset + 4, depth)?;
1670            self.2.encode(encoder, offset + 8, depth)?;
1671            self.3.encode(encoder, offset + 24, depth)?;
1672            Ok(())
1673        }
1674    }
1675
1676    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InstalledRuleV4 {
1677        #[inline(always)]
1678        fn new_empty() -> Self {
1679            Self {
1680                rule_set_priority: fidl::new_empty!(u32, D),
1681                rule_index: fidl::new_empty!(u32, D),
1682                matcher: fidl::new_empty!(RuleMatcherV4, D),
1683                action: fidl::new_empty!(RuleAction, D),
1684            }
1685        }
1686
1687        #[inline]
1688        unsafe fn decode(
1689            &mut self,
1690            decoder: &mut fidl::encoding::Decoder<'_, D>,
1691            offset: usize,
1692            _depth: fidl::encoding::Depth,
1693        ) -> fidl::Result<()> {
1694            decoder.debug_check_bounds::<Self>(offset);
1695            // Verify that padding bytes are zero.
1696            fidl::decode!(u32, D, &mut self.rule_set_priority, decoder, offset + 0, _depth)?;
1697            fidl::decode!(u32, D, &mut self.rule_index, decoder, offset + 4, _depth)?;
1698            fidl::decode!(RuleMatcherV4, D, &mut self.matcher, decoder, offset + 8, _depth)?;
1699            fidl::decode!(RuleAction, D, &mut self.action, decoder, offset + 24, _depth)?;
1700            Ok(())
1701        }
1702    }
1703
1704    impl fidl::encoding::ValueTypeMarker for InstalledRuleV6 {
1705        type Borrowed<'a> = &'a Self;
1706        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1707            value
1708        }
1709    }
1710
1711    unsafe impl fidl::encoding::TypeMarker for InstalledRuleV6 {
1712        type Owned = Self;
1713
1714        #[inline(always)]
1715        fn inline_align(_context: fidl::encoding::Context) -> usize {
1716            8
1717        }
1718
1719        #[inline(always)]
1720        fn inline_size(_context: fidl::encoding::Context) -> usize {
1721            40
1722        }
1723    }
1724
1725    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InstalledRuleV6, D>
1726        for &InstalledRuleV6
1727    {
1728        #[inline]
1729        unsafe fn encode(
1730            self,
1731            encoder: &mut fidl::encoding::Encoder<'_, D>,
1732            offset: usize,
1733            _depth: fidl::encoding::Depth,
1734        ) -> fidl::Result<()> {
1735            encoder.debug_check_bounds::<InstalledRuleV6>(offset);
1736            // Delegate to tuple encoding.
1737            fidl::encoding::Encode::<InstalledRuleV6, D>::encode(
1738                (
1739                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.rule_set_priority),
1740                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.rule_index),
1741                    <RuleMatcherV6 as fidl::encoding::ValueTypeMarker>::borrow(&self.matcher),
1742                    <RuleAction as fidl::encoding::ValueTypeMarker>::borrow(&self.action),
1743                ),
1744                encoder,
1745                offset,
1746                _depth,
1747            )
1748        }
1749    }
1750    unsafe impl<
1751            D: fidl::encoding::ResourceDialect,
1752            T0: fidl::encoding::Encode<u32, D>,
1753            T1: fidl::encoding::Encode<u32, D>,
1754            T2: fidl::encoding::Encode<RuleMatcherV6, D>,
1755            T3: fidl::encoding::Encode<RuleAction, D>,
1756        > fidl::encoding::Encode<InstalledRuleV6, D> for (T0, T1, T2, T3)
1757    {
1758        #[inline]
1759        unsafe fn encode(
1760            self,
1761            encoder: &mut fidl::encoding::Encoder<'_, D>,
1762            offset: usize,
1763            depth: fidl::encoding::Depth,
1764        ) -> fidl::Result<()> {
1765            encoder.debug_check_bounds::<InstalledRuleV6>(offset);
1766            // Zero out padding regions. There's no need to apply masks
1767            // because the unmasked parts will be overwritten by fields.
1768            // Write the fields.
1769            self.0.encode(encoder, offset + 0, depth)?;
1770            self.1.encode(encoder, offset + 4, depth)?;
1771            self.2.encode(encoder, offset + 8, depth)?;
1772            self.3.encode(encoder, offset + 24, depth)?;
1773            Ok(())
1774        }
1775    }
1776
1777    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InstalledRuleV6 {
1778        #[inline(always)]
1779        fn new_empty() -> Self {
1780            Self {
1781                rule_set_priority: fidl::new_empty!(u32, D),
1782                rule_index: fidl::new_empty!(u32, D),
1783                matcher: fidl::new_empty!(RuleMatcherV6, D),
1784                action: fidl::new_empty!(RuleAction, D),
1785            }
1786        }
1787
1788        #[inline]
1789        unsafe fn decode(
1790            &mut self,
1791            decoder: &mut fidl::encoding::Decoder<'_, D>,
1792            offset: usize,
1793            _depth: fidl::encoding::Depth,
1794        ) -> fidl::Result<()> {
1795            decoder.debug_check_bounds::<Self>(offset);
1796            // Verify that padding bytes are zero.
1797            fidl::decode!(u32, D, &mut self.rule_set_priority, decoder, offset + 0, _depth)?;
1798            fidl::decode!(u32, D, &mut self.rule_index, decoder, offset + 4, _depth)?;
1799            fidl::decode!(RuleMatcherV6, D, &mut self.matcher, decoder, offset + 8, _depth)?;
1800            fidl::decode!(RuleAction, D, &mut self.action, decoder, offset + 24, _depth)?;
1801            Ok(())
1802        }
1803    }
1804
1805    impl fidl::encoding::ValueTypeMarker for Main {
1806        type Borrowed<'a> = &'a Self;
1807        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1808            value
1809        }
1810    }
1811
1812    unsafe impl fidl::encoding::TypeMarker for Main {
1813        type Owned = Self;
1814
1815        #[inline(always)]
1816        fn inline_align(_context: fidl::encoding::Context) -> usize {
1817            1
1818        }
1819
1820        #[inline(always)]
1821        fn inline_size(_context: fidl::encoding::Context) -> usize {
1822            1
1823        }
1824    }
1825
1826    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Main, D> for &Main {
1827        #[inline]
1828        unsafe fn encode(
1829            self,
1830            encoder: &mut fidl::encoding::Encoder<'_, D>,
1831            offset: usize,
1832            _depth: fidl::encoding::Depth,
1833        ) -> fidl::Result<()> {
1834            encoder.debug_check_bounds::<Main>(offset);
1835            encoder.write_num(0u8, offset);
1836            Ok(())
1837        }
1838    }
1839
1840    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Main {
1841        #[inline(always)]
1842        fn new_empty() -> Self {
1843            Self
1844        }
1845
1846        #[inline]
1847        unsafe fn decode(
1848            &mut self,
1849            decoder: &mut fidl::encoding::Decoder<'_, D>,
1850            offset: usize,
1851            _depth: fidl::encoding::Depth,
1852        ) -> fidl::Result<()> {
1853            decoder.debug_check_bounds::<Self>(offset);
1854            match decoder.read_num::<u8>(offset) {
1855                0 => Ok(()),
1856                _ => Err(fidl::Error::Invalid),
1857            }
1858        }
1859    }
1860
1861    impl fidl::encoding::ValueTypeMarker for Marked {
1862        type Borrowed<'a> = &'a Self;
1863        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1864            value
1865        }
1866    }
1867
1868    unsafe impl fidl::encoding::TypeMarker for Marked {
1869        type Owned = Self;
1870
1871        #[inline(always)]
1872        fn inline_align(_context: fidl::encoding::Context) -> usize {
1873            4
1874        }
1875
1876        #[inline(always)]
1877        fn inline_size(_context: fidl::encoding::Context) -> usize {
1878            12
1879        }
1880        #[inline(always)]
1881        fn encode_is_copy() -> bool {
1882            true
1883        }
1884
1885        #[inline(always)]
1886        fn decode_is_copy() -> bool {
1887            true
1888        }
1889    }
1890
1891    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Marked, D> for &Marked {
1892        #[inline]
1893        unsafe fn encode(
1894            self,
1895            encoder: &mut fidl::encoding::Encoder<'_, D>,
1896            offset: usize,
1897            _depth: fidl::encoding::Depth,
1898        ) -> fidl::Result<()> {
1899            encoder.debug_check_bounds::<Marked>(offset);
1900            unsafe {
1901                // Copy the object into the buffer.
1902                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1903                (buf_ptr as *mut Marked).write_unaligned((self as *const Marked).read());
1904                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1905                // done second because the memcpy will write garbage to these bytes.
1906            }
1907            Ok(())
1908        }
1909    }
1910    unsafe impl<
1911            D: fidl::encoding::ResourceDialect,
1912            T0: fidl::encoding::Encode<u32, D>,
1913            T1: fidl::encoding::Encode<Between, D>,
1914        > fidl::encoding::Encode<Marked, D> for (T0, T1)
1915    {
1916        #[inline]
1917        unsafe fn encode(
1918            self,
1919            encoder: &mut fidl::encoding::Encoder<'_, D>,
1920            offset: usize,
1921            depth: fidl::encoding::Depth,
1922        ) -> fidl::Result<()> {
1923            encoder.debug_check_bounds::<Marked>(offset);
1924            // Zero out padding regions. There's no need to apply masks
1925            // because the unmasked parts will be overwritten by fields.
1926            // Write the fields.
1927            self.0.encode(encoder, offset + 0, depth)?;
1928            self.1.encode(encoder, offset + 4, depth)?;
1929            Ok(())
1930        }
1931    }
1932
1933    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Marked {
1934        #[inline(always)]
1935        fn new_empty() -> Self {
1936            Self { mask: fidl::new_empty!(u32, D), between: fidl::new_empty!(Between, D) }
1937        }
1938
1939        #[inline]
1940        unsafe fn decode(
1941            &mut self,
1942            decoder: &mut fidl::encoding::Decoder<'_, D>,
1943            offset: usize,
1944            _depth: fidl::encoding::Depth,
1945        ) -> fidl::Result<()> {
1946            decoder.debug_check_bounds::<Self>(offset);
1947            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1948            // Verify that padding bytes are zero.
1949            // Copy from the buffer into the object.
1950            unsafe {
1951                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
1952            }
1953            Ok(())
1954        }
1955    }
1956
1957    impl fidl::encoding::ValueTypeMarker for RouteTargetV4 {
1958        type Borrowed<'a> = &'a Self;
1959        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1960            value
1961        }
1962    }
1963
1964    unsafe impl fidl::encoding::TypeMarker for RouteTargetV4 {
1965        type Owned = Self;
1966
1967        #[inline(always)]
1968        fn inline_align(_context: fidl::encoding::Context) -> usize {
1969            8
1970        }
1971
1972        #[inline(always)]
1973        fn inline_size(_context: fidl::encoding::Context) -> usize {
1974            16
1975        }
1976    }
1977
1978    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RouteTargetV4, D>
1979        for &RouteTargetV4
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::<RouteTargetV4>(offset);
1989            // Delegate to tuple encoding.
1990            fidl::encoding::Encode::<RouteTargetV4, D>::encode(
1991                (
1992                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.outbound_interface),
1993                    <fidl::encoding::Boxed<fidl_fuchsia_net__common::Ipv4Address> as fidl::encoding::ValueTypeMarker>::borrow(&self.next_hop),
1994                ),
1995                encoder, offset, _depth
1996            )
1997        }
1998    }
1999    unsafe impl<
2000            D: fidl::encoding::ResourceDialect,
2001            T0: fidl::encoding::Encode<u64, D>,
2002            T1: fidl::encoding::Encode<fidl::encoding::Boxed<fidl_fuchsia_net__common::Ipv4Address>, D>,
2003        > fidl::encoding::Encode<RouteTargetV4, D> for (T0, T1)
2004    {
2005        #[inline]
2006        unsafe fn encode(
2007            self,
2008            encoder: &mut fidl::encoding::Encoder<'_, D>,
2009            offset: usize,
2010            depth: fidl::encoding::Depth,
2011        ) -> fidl::Result<()> {
2012            encoder.debug_check_bounds::<RouteTargetV4>(offset);
2013            // Zero out padding regions. There's no need to apply masks
2014            // because the unmasked parts will be overwritten by fields.
2015            // Write the fields.
2016            self.0.encode(encoder, offset + 0, depth)?;
2017            self.1.encode(encoder, offset + 8, depth)?;
2018            Ok(())
2019        }
2020    }
2021
2022    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteTargetV4 {
2023        #[inline(always)]
2024        fn new_empty() -> Self {
2025            Self {
2026                outbound_interface: fidl::new_empty!(u64, D),
2027                next_hop: fidl::new_empty!(
2028                    fidl::encoding::Boxed<fidl_fuchsia_net__common::Ipv4Address>,
2029                    D
2030                ),
2031            }
2032        }
2033
2034        #[inline]
2035        unsafe fn decode(
2036            &mut self,
2037            decoder: &mut fidl::encoding::Decoder<'_, D>,
2038            offset: usize,
2039            _depth: fidl::encoding::Depth,
2040        ) -> fidl::Result<()> {
2041            decoder.debug_check_bounds::<Self>(offset);
2042            // Verify that padding bytes are zero.
2043            fidl::decode!(u64, D, &mut self.outbound_interface, decoder, offset + 0, _depth)?;
2044            fidl::decode!(
2045                fidl::encoding::Boxed<fidl_fuchsia_net__common::Ipv4Address>,
2046                D,
2047                &mut self.next_hop,
2048                decoder,
2049                offset + 8,
2050                _depth
2051            )?;
2052            Ok(())
2053        }
2054    }
2055
2056    impl fidl::encoding::ValueTypeMarker for RouteTargetV6 {
2057        type Borrowed<'a> = &'a Self;
2058        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2059            value
2060        }
2061    }
2062
2063    unsafe impl fidl::encoding::TypeMarker for RouteTargetV6 {
2064        type Owned = Self;
2065
2066        #[inline(always)]
2067        fn inline_align(_context: fidl::encoding::Context) -> usize {
2068            8
2069        }
2070
2071        #[inline(always)]
2072        fn inline_size(_context: fidl::encoding::Context) -> usize {
2073            16
2074        }
2075    }
2076
2077    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RouteTargetV6, D>
2078        for &RouteTargetV6
2079    {
2080        #[inline]
2081        unsafe fn encode(
2082            self,
2083            encoder: &mut fidl::encoding::Encoder<'_, D>,
2084            offset: usize,
2085            _depth: fidl::encoding::Depth,
2086        ) -> fidl::Result<()> {
2087            encoder.debug_check_bounds::<RouteTargetV6>(offset);
2088            // Delegate to tuple encoding.
2089            fidl::encoding::Encode::<RouteTargetV6, D>::encode(
2090                (
2091                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.outbound_interface),
2092                    <fidl::encoding::Boxed<fidl_fuchsia_net__common::Ipv6Address> as fidl::encoding::ValueTypeMarker>::borrow(&self.next_hop),
2093                ),
2094                encoder, offset, _depth
2095            )
2096        }
2097    }
2098    unsafe impl<
2099            D: fidl::encoding::ResourceDialect,
2100            T0: fidl::encoding::Encode<u64, D>,
2101            T1: fidl::encoding::Encode<fidl::encoding::Boxed<fidl_fuchsia_net__common::Ipv6Address>, D>,
2102        > fidl::encoding::Encode<RouteTargetV6, D> for (T0, T1)
2103    {
2104        #[inline]
2105        unsafe fn encode(
2106            self,
2107            encoder: &mut fidl::encoding::Encoder<'_, D>,
2108            offset: usize,
2109            depth: fidl::encoding::Depth,
2110        ) -> fidl::Result<()> {
2111            encoder.debug_check_bounds::<RouteTargetV6>(offset);
2112            // Zero out padding regions. There's no need to apply masks
2113            // because the unmasked parts will be overwritten by fields.
2114            // Write the fields.
2115            self.0.encode(encoder, offset + 0, depth)?;
2116            self.1.encode(encoder, offset + 8, depth)?;
2117            Ok(())
2118        }
2119    }
2120
2121    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteTargetV6 {
2122        #[inline(always)]
2123        fn new_empty() -> Self {
2124            Self {
2125                outbound_interface: fidl::new_empty!(u64, D),
2126                next_hop: fidl::new_empty!(
2127                    fidl::encoding::Boxed<fidl_fuchsia_net__common::Ipv6Address>,
2128                    D
2129                ),
2130            }
2131        }
2132
2133        #[inline]
2134        unsafe fn decode(
2135            &mut self,
2136            decoder: &mut fidl::encoding::Decoder<'_, D>,
2137            offset: usize,
2138            _depth: fidl::encoding::Depth,
2139        ) -> fidl::Result<()> {
2140            decoder.debug_check_bounds::<Self>(offset);
2141            // Verify that padding bytes are zero.
2142            fidl::decode!(u64, D, &mut self.outbound_interface, decoder, offset + 0, _depth)?;
2143            fidl::decode!(
2144                fidl::encoding::Boxed<fidl_fuchsia_net__common::Ipv6Address>,
2145                D,
2146                &mut self.next_hop,
2147                decoder,
2148                offset + 8,
2149                _depth
2150            )?;
2151            Ok(())
2152        }
2153    }
2154
2155    impl fidl::encoding::ValueTypeMarker for RouteV4 {
2156        type Borrowed<'a> = &'a Self;
2157        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2158            value
2159        }
2160    }
2161
2162    unsafe impl fidl::encoding::TypeMarker for RouteV4 {
2163        type Owned = Self;
2164
2165        #[inline(always)]
2166        fn inline_align(_context: fidl::encoding::Context) -> usize {
2167            8
2168        }
2169
2170        #[inline(always)]
2171        fn inline_size(_context: fidl::encoding::Context) -> usize {
2172            40
2173        }
2174    }
2175
2176    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RouteV4, D> for &RouteV4 {
2177        #[inline]
2178        unsafe fn encode(
2179            self,
2180            encoder: &mut fidl::encoding::Encoder<'_, D>,
2181            offset: usize,
2182            _depth: fidl::encoding::Depth,
2183        ) -> fidl::Result<()> {
2184            encoder.debug_check_bounds::<RouteV4>(offset);
2185            // Delegate to tuple encoding.
2186            fidl::encoding::Encode::<RouteV4, D>::encode(
2187                (
2188                    <fidl_fuchsia_net__common::Ipv4AddressWithPrefix as fidl::encoding::ValueTypeMarker>::borrow(&self.destination),
2189                    <RouteActionV4 as fidl::encoding::ValueTypeMarker>::borrow(&self.action),
2190                    <RoutePropertiesV4 as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
2191                ),
2192                encoder, offset, _depth
2193            )
2194        }
2195    }
2196    unsafe impl<
2197            D: fidl::encoding::ResourceDialect,
2198            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv4AddressWithPrefix, D>,
2199            T1: fidl::encoding::Encode<RouteActionV4, D>,
2200            T2: fidl::encoding::Encode<RoutePropertiesV4, D>,
2201        > fidl::encoding::Encode<RouteV4, D> for (T0, T1, T2)
2202    {
2203        #[inline]
2204        unsafe fn encode(
2205            self,
2206            encoder: &mut fidl::encoding::Encoder<'_, D>,
2207            offset: usize,
2208            depth: fidl::encoding::Depth,
2209        ) -> fidl::Result<()> {
2210            encoder.debug_check_bounds::<RouteV4>(offset);
2211            // Zero out padding regions. There's no need to apply masks
2212            // because the unmasked parts will be overwritten by fields.
2213            unsafe {
2214                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2215                (ptr as *mut u64).write_unaligned(0);
2216            }
2217            // Write the fields.
2218            self.0.encode(encoder, offset + 0, depth)?;
2219            self.1.encode(encoder, offset + 8, depth)?;
2220            self.2.encode(encoder, offset + 24, depth)?;
2221            Ok(())
2222        }
2223    }
2224
2225    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteV4 {
2226        #[inline(always)]
2227        fn new_empty() -> Self {
2228            Self {
2229                destination: fidl::new_empty!(fidl_fuchsia_net__common::Ipv4AddressWithPrefix, D),
2230                action: fidl::new_empty!(RouteActionV4, D),
2231                properties: fidl::new_empty!(RoutePropertiesV4, D),
2232            }
2233        }
2234
2235        #[inline]
2236        unsafe fn decode(
2237            &mut self,
2238            decoder: &mut fidl::encoding::Decoder<'_, D>,
2239            offset: usize,
2240            _depth: fidl::encoding::Depth,
2241        ) -> fidl::Result<()> {
2242            decoder.debug_check_bounds::<Self>(offset);
2243            // Verify that padding bytes are zero.
2244            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2245            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2246            let mask = 0xffffff0000000000u64;
2247            let maskedval = padval & mask;
2248            if maskedval != 0 {
2249                return Err(fidl::Error::NonZeroPadding {
2250                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2251                });
2252            }
2253            fidl::decode!(
2254                fidl_fuchsia_net__common::Ipv4AddressWithPrefix,
2255                D,
2256                &mut self.destination,
2257                decoder,
2258                offset + 0,
2259                _depth
2260            )?;
2261            fidl::decode!(RouteActionV4, D, &mut self.action, decoder, offset + 8, _depth)?;
2262            fidl::decode!(
2263                RoutePropertiesV4,
2264                D,
2265                &mut self.properties,
2266                decoder,
2267                offset + 24,
2268                _depth
2269            )?;
2270            Ok(())
2271        }
2272    }
2273
2274    impl fidl::encoding::ValueTypeMarker for RouteV6 {
2275        type Borrowed<'a> = &'a Self;
2276        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2277            value
2278        }
2279    }
2280
2281    unsafe impl fidl::encoding::TypeMarker for RouteV6 {
2282        type Owned = Self;
2283
2284        #[inline(always)]
2285        fn inline_align(_context: fidl::encoding::Context) -> usize {
2286            8
2287        }
2288
2289        #[inline(always)]
2290        fn inline_size(_context: fidl::encoding::Context) -> usize {
2291            56
2292        }
2293    }
2294
2295    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RouteV6, D> for &RouteV6 {
2296        #[inline]
2297        unsafe fn encode(
2298            self,
2299            encoder: &mut fidl::encoding::Encoder<'_, D>,
2300            offset: usize,
2301            _depth: fidl::encoding::Depth,
2302        ) -> fidl::Result<()> {
2303            encoder.debug_check_bounds::<RouteV6>(offset);
2304            // Delegate to tuple encoding.
2305            fidl::encoding::Encode::<RouteV6, D>::encode(
2306                (
2307                    <fidl_fuchsia_net__common::Ipv6AddressWithPrefix as fidl::encoding::ValueTypeMarker>::borrow(&self.destination),
2308                    <RouteActionV6 as fidl::encoding::ValueTypeMarker>::borrow(&self.action),
2309                    <RoutePropertiesV6 as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
2310                ),
2311                encoder, offset, _depth
2312            )
2313        }
2314    }
2315    unsafe impl<
2316            D: fidl::encoding::ResourceDialect,
2317            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::Ipv6AddressWithPrefix, D>,
2318            T1: fidl::encoding::Encode<RouteActionV6, D>,
2319            T2: fidl::encoding::Encode<RoutePropertiesV6, D>,
2320        > fidl::encoding::Encode<RouteV6, D> for (T0, T1, T2)
2321    {
2322        #[inline]
2323        unsafe fn encode(
2324            self,
2325            encoder: &mut fidl::encoding::Encoder<'_, D>,
2326            offset: usize,
2327            depth: fidl::encoding::Depth,
2328        ) -> fidl::Result<()> {
2329            encoder.debug_check_bounds::<RouteV6>(offset);
2330            // Zero out padding regions. There's no need to apply masks
2331            // because the unmasked parts will be overwritten by fields.
2332            unsafe {
2333                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
2334                (ptr as *mut u64).write_unaligned(0);
2335            }
2336            // Write the fields.
2337            self.0.encode(encoder, offset + 0, depth)?;
2338            self.1.encode(encoder, offset + 24, depth)?;
2339            self.2.encode(encoder, offset + 40, depth)?;
2340            Ok(())
2341        }
2342    }
2343
2344    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteV6 {
2345        #[inline(always)]
2346        fn new_empty() -> Self {
2347            Self {
2348                destination: fidl::new_empty!(fidl_fuchsia_net__common::Ipv6AddressWithPrefix, D),
2349                action: fidl::new_empty!(RouteActionV6, D),
2350                properties: fidl::new_empty!(RoutePropertiesV6, D),
2351            }
2352        }
2353
2354        #[inline]
2355        unsafe fn decode(
2356            &mut self,
2357            decoder: &mut fidl::encoding::Decoder<'_, D>,
2358            offset: usize,
2359            _depth: fidl::encoding::Depth,
2360        ) -> fidl::Result<()> {
2361            decoder.debug_check_bounds::<Self>(offset);
2362            // Verify that padding bytes are zero.
2363            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
2364            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2365            let mask = 0xffffffffffffff00u64;
2366            let maskedval = padval & mask;
2367            if maskedval != 0 {
2368                return Err(fidl::Error::NonZeroPadding {
2369                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
2370                });
2371            }
2372            fidl::decode!(
2373                fidl_fuchsia_net__common::Ipv6AddressWithPrefix,
2374                D,
2375                &mut self.destination,
2376                decoder,
2377                offset + 0,
2378                _depth
2379            )?;
2380            fidl::decode!(RouteActionV6, D, &mut self.action, decoder, offset + 24, _depth)?;
2381            fidl::decode!(
2382                RoutePropertiesV6,
2383                D,
2384                &mut self.properties,
2385                decoder,
2386                offset + 40,
2387                _depth
2388            )?;
2389            Ok(())
2390        }
2391    }
2392
2393    impl fidl::encoding::ValueTypeMarker for RuleWatcherV4WatchResponse {
2394        type Borrowed<'a> = &'a Self;
2395        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2396            value
2397        }
2398    }
2399
2400    unsafe impl fidl::encoding::TypeMarker for RuleWatcherV4WatchResponse {
2401        type Owned = Self;
2402
2403        #[inline(always)]
2404        fn inline_align(_context: fidl::encoding::Context) -> usize {
2405            8
2406        }
2407
2408        #[inline(always)]
2409        fn inline_size(_context: fidl::encoding::Context) -> usize {
2410            16
2411        }
2412    }
2413
2414    unsafe impl<D: fidl::encoding::ResourceDialect>
2415        fidl::encoding::Encode<RuleWatcherV4WatchResponse, D> for &RuleWatcherV4WatchResponse
2416    {
2417        #[inline]
2418        unsafe fn encode(
2419            self,
2420            encoder: &mut fidl::encoding::Encoder<'_, D>,
2421            offset: usize,
2422            _depth: fidl::encoding::Depth,
2423        ) -> fidl::Result<()> {
2424            encoder.debug_check_bounds::<RuleWatcherV4WatchResponse>(offset);
2425            // Delegate to tuple encoding.
2426            fidl::encoding::Encode::<RuleWatcherV4WatchResponse, D>::encode(
2427                (
2428                    <fidl::encoding::Vector<RuleEventV4, 512> as fidl::encoding::ValueTypeMarker>::borrow(&self.events),
2429                ),
2430                encoder, offset, _depth
2431            )
2432        }
2433    }
2434    unsafe impl<
2435            D: fidl::encoding::ResourceDialect,
2436            T0: fidl::encoding::Encode<fidl::encoding::Vector<RuleEventV4, 512>, D>,
2437        > fidl::encoding::Encode<RuleWatcherV4WatchResponse, D> for (T0,)
2438    {
2439        #[inline]
2440        unsafe fn encode(
2441            self,
2442            encoder: &mut fidl::encoding::Encoder<'_, D>,
2443            offset: usize,
2444            depth: fidl::encoding::Depth,
2445        ) -> fidl::Result<()> {
2446            encoder.debug_check_bounds::<RuleWatcherV4WatchResponse>(offset);
2447            // Zero out padding regions. There's no need to apply masks
2448            // because the unmasked parts will be overwritten by fields.
2449            // Write the fields.
2450            self.0.encode(encoder, offset + 0, depth)?;
2451            Ok(())
2452        }
2453    }
2454
2455    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2456        for RuleWatcherV4WatchResponse
2457    {
2458        #[inline(always)]
2459        fn new_empty() -> Self {
2460            Self { events: fidl::new_empty!(fidl::encoding::Vector<RuleEventV4, 512>, D) }
2461        }
2462
2463        #[inline]
2464        unsafe fn decode(
2465            &mut self,
2466            decoder: &mut fidl::encoding::Decoder<'_, D>,
2467            offset: usize,
2468            _depth: fidl::encoding::Depth,
2469        ) -> fidl::Result<()> {
2470            decoder.debug_check_bounds::<Self>(offset);
2471            // Verify that padding bytes are zero.
2472            fidl::decode!(fidl::encoding::Vector<RuleEventV4, 512>, D, &mut self.events, decoder, offset + 0, _depth)?;
2473            Ok(())
2474        }
2475    }
2476
2477    impl fidl::encoding::ValueTypeMarker for RuleWatcherV6WatchResponse {
2478        type Borrowed<'a> = &'a Self;
2479        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2480            value
2481        }
2482    }
2483
2484    unsafe impl fidl::encoding::TypeMarker for RuleWatcherV6WatchResponse {
2485        type Owned = Self;
2486
2487        #[inline(always)]
2488        fn inline_align(_context: fidl::encoding::Context) -> usize {
2489            8
2490        }
2491
2492        #[inline(always)]
2493        fn inline_size(_context: fidl::encoding::Context) -> usize {
2494            16
2495        }
2496    }
2497
2498    unsafe impl<D: fidl::encoding::ResourceDialect>
2499        fidl::encoding::Encode<RuleWatcherV6WatchResponse, D> for &RuleWatcherV6WatchResponse
2500    {
2501        #[inline]
2502        unsafe fn encode(
2503            self,
2504            encoder: &mut fidl::encoding::Encoder<'_, D>,
2505            offset: usize,
2506            _depth: fidl::encoding::Depth,
2507        ) -> fidl::Result<()> {
2508            encoder.debug_check_bounds::<RuleWatcherV6WatchResponse>(offset);
2509            // Delegate to tuple encoding.
2510            fidl::encoding::Encode::<RuleWatcherV6WatchResponse, D>::encode(
2511                (
2512                    <fidl::encoding::Vector<RuleEventV6, 512> as fidl::encoding::ValueTypeMarker>::borrow(&self.events),
2513                ),
2514                encoder, offset, _depth
2515            )
2516        }
2517    }
2518    unsafe impl<
2519            D: fidl::encoding::ResourceDialect,
2520            T0: fidl::encoding::Encode<fidl::encoding::Vector<RuleEventV6, 512>, D>,
2521        > fidl::encoding::Encode<RuleWatcherV6WatchResponse, D> for (T0,)
2522    {
2523        #[inline]
2524        unsafe fn encode(
2525            self,
2526            encoder: &mut fidl::encoding::Encoder<'_, D>,
2527            offset: usize,
2528            depth: fidl::encoding::Depth,
2529        ) -> fidl::Result<()> {
2530            encoder.debug_check_bounds::<RuleWatcherV6WatchResponse>(offset);
2531            // Zero out padding regions. There's no need to apply masks
2532            // because the unmasked parts will be overwritten by fields.
2533            // Write the fields.
2534            self.0.encode(encoder, offset + 0, depth)?;
2535            Ok(())
2536        }
2537    }
2538
2539    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2540        for RuleWatcherV6WatchResponse
2541    {
2542        #[inline(always)]
2543        fn new_empty() -> Self {
2544            Self { events: fidl::new_empty!(fidl::encoding::Vector<RuleEventV6, 512>, D) }
2545        }
2546
2547        #[inline]
2548        unsafe fn decode(
2549            &mut self,
2550            decoder: &mut fidl::encoding::Decoder<'_, D>,
2551            offset: usize,
2552            _depth: fidl::encoding::Depth,
2553        ) -> fidl::Result<()> {
2554            decoder.debug_check_bounds::<Self>(offset);
2555            // Verify that padding bytes are zero.
2556            fidl::decode!(fidl::encoding::Vector<RuleEventV6, 512>, D, &mut self.events, decoder, offset + 0, _depth)?;
2557            Ok(())
2558        }
2559    }
2560
2561    impl fidl::encoding::ValueTypeMarker for StateGetRouteTableNameRequest {
2562        type Borrowed<'a> = &'a Self;
2563        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2564            value
2565        }
2566    }
2567
2568    unsafe impl fidl::encoding::TypeMarker for StateGetRouteTableNameRequest {
2569        type Owned = Self;
2570
2571        #[inline(always)]
2572        fn inline_align(_context: fidl::encoding::Context) -> usize {
2573            4
2574        }
2575
2576        #[inline(always)]
2577        fn inline_size(_context: fidl::encoding::Context) -> usize {
2578            4
2579        }
2580        #[inline(always)]
2581        fn encode_is_copy() -> bool {
2582            true
2583        }
2584
2585        #[inline(always)]
2586        fn decode_is_copy() -> bool {
2587            true
2588        }
2589    }
2590
2591    unsafe impl<D: fidl::encoding::ResourceDialect>
2592        fidl::encoding::Encode<StateGetRouteTableNameRequest, D>
2593        for &StateGetRouteTableNameRequest
2594    {
2595        #[inline]
2596        unsafe fn encode(
2597            self,
2598            encoder: &mut fidl::encoding::Encoder<'_, D>,
2599            offset: usize,
2600            _depth: fidl::encoding::Depth,
2601        ) -> fidl::Result<()> {
2602            encoder.debug_check_bounds::<StateGetRouteTableNameRequest>(offset);
2603            unsafe {
2604                // Copy the object into the buffer.
2605                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2606                (buf_ptr as *mut StateGetRouteTableNameRequest)
2607                    .write_unaligned((self as *const StateGetRouteTableNameRequest).read());
2608                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2609                // done second because the memcpy will write garbage to these bytes.
2610            }
2611            Ok(())
2612        }
2613    }
2614    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
2615        fidl::encoding::Encode<StateGetRouteTableNameRequest, D> for (T0,)
2616    {
2617        #[inline]
2618        unsafe fn encode(
2619            self,
2620            encoder: &mut fidl::encoding::Encoder<'_, D>,
2621            offset: usize,
2622            depth: fidl::encoding::Depth,
2623        ) -> fidl::Result<()> {
2624            encoder.debug_check_bounds::<StateGetRouteTableNameRequest>(offset);
2625            // Zero out padding regions. There's no need to apply masks
2626            // because the unmasked parts will be overwritten by fields.
2627            // Write the fields.
2628            self.0.encode(encoder, offset + 0, depth)?;
2629            Ok(())
2630        }
2631    }
2632
2633    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2634        for StateGetRouteTableNameRequest
2635    {
2636        #[inline(always)]
2637        fn new_empty() -> Self {
2638            Self { table_id: fidl::new_empty!(u32, D) }
2639        }
2640
2641        #[inline]
2642        unsafe fn decode(
2643            &mut self,
2644            decoder: &mut fidl::encoding::Decoder<'_, D>,
2645            offset: usize,
2646            _depth: fidl::encoding::Depth,
2647        ) -> fidl::Result<()> {
2648            decoder.debug_check_bounds::<Self>(offset);
2649            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2650            // Verify that padding bytes are zero.
2651            // Copy from the buffer into the object.
2652            unsafe {
2653                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2654            }
2655            Ok(())
2656        }
2657    }
2658
2659    impl fidl::encoding::ValueTypeMarker for StateResolve2Request {
2660        type Borrowed<'a> = &'a Self;
2661        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2662            value
2663        }
2664    }
2665
2666    unsafe impl fidl::encoding::TypeMarker for StateResolve2Request {
2667        type Owned = Self;
2668
2669        #[inline(always)]
2670        fn inline_align(_context: fidl::encoding::Context) -> usize {
2671            8
2672        }
2673
2674        #[inline(always)]
2675        fn inline_size(_context: fidl::encoding::Context) -> usize {
2676            32
2677        }
2678    }
2679
2680    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StateResolve2Request, D>
2681        for &StateResolve2Request
2682    {
2683        #[inline]
2684        unsafe fn encode(
2685            self,
2686            encoder: &mut fidl::encoding::Encoder<'_, D>,
2687            offset: usize,
2688            _depth: fidl::encoding::Depth,
2689        ) -> fidl::Result<()> {
2690            encoder.debug_check_bounds::<StateResolve2Request>(offset);
2691            // Delegate to tuple encoding.
2692            fidl::encoding::Encode::<StateResolve2Request, D>::encode(
2693                (
2694                    <fidl_fuchsia_net__common::IpAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.destination),
2695                    <ResolveOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
2696                ),
2697                encoder, offset, _depth
2698            )
2699        }
2700    }
2701    unsafe impl<
2702            D: fidl::encoding::ResourceDialect,
2703            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::IpAddress, D>,
2704            T1: fidl::encoding::Encode<ResolveOptions, D>,
2705        > fidl::encoding::Encode<StateResolve2Request, D> for (T0, T1)
2706    {
2707        #[inline]
2708        unsafe fn encode(
2709            self,
2710            encoder: &mut fidl::encoding::Encoder<'_, D>,
2711            offset: usize,
2712            depth: fidl::encoding::Depth,
2713        ) -> fidl::Result<()> {
2714            encoder.debug_check_bounds::<StateResolve2Request>(offset);
2715            // Zero out padding regions. There's no need to apply masks
2716            // because the unmasked parts will be overwritten by fields.
2717            // Write the fields.
2718            self.0.encode(encoder, offset + 0, depth)?;
2719            self.1.encode(encoder, offset + 16, depth)?;
2720            Ok(())
2721        }
2722    }
2723
2724    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StateResolve2Request {
2725        #[inline(always)]
2726        fn new_empty() -> Self {
2727            Self {
2728                destination: fidl::new_empty!(fidl_fuchsia_net__common::IpAddress, D),
2729                options: fidl::new_empty!(ResolveOptions, D),
2730            }
2731        }
2732
2733        #[inline]
2734        unsafe fn decode(
2735            &mut self,
2736            decoder: &mut fidl::encoding::Decoder<'_, D>,
2737            offset: usize,
2738            _depth: fidl::encoding::Depth,
2739        ) -> fidl::Result<()> {
2740            decoder.debug_check_bounds::<Self>(offset);
2741            // Verify that padding bytes are zero.
2742            fidl::decode!(
2743                fidl_fuchsia_net__common::IpAddress,
2744                D,
2745                &mut self.destination,
2746                decoder,
2747                offset + 0,
2748                _depth
2749            )?;
2750            fidl::decode!(ResolveOptions, D, &mut self.options, decoder, offset + 16, _depth)?;
2751            Ok(())
2752        }
2753    }
2754
2755    impl fidl::encoding::ValueTypeMarker for StateResolveRequest {
2756        type Borrowed<'a> = &'a Self;
2757        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2758            value
2759        }
2760    }
2761
2762    unsafe impl fidl::encoding::TypeMarker for StateResolveRequest {
2763        type Owned = Self;
2764
2765        #[inline(always)]
2766        fn inline_align(_context: fidl::encoding::Context) -> usize {
2767            8
2768        }
2769
2770        #[inline(always)]
2771        fn inline_size(_context: fidl::encoding::Context) -> usize {
2772            16
2773        }
2774    }
2775
2776    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StateResolveRequest, D>
2777        for &StateResolveRequest
2778    {
2779        #[inline]
2780        unsafe fn encode(
2781            self,
2782            encoder: &mut fidl::encoding::Encoder<'_, D>,
2783            offset: usize,
2784            _depth: fidl::encoding::Depth,
2785        ) -> fidl::Result<()> {
2786            encoder.debug_check_bounds::<StateResolveRequest>(offset);
2787            // Delegate to tuple encoding.
2788            fidl::encoding::Encode::<StateResolveRequest, D>::encode(
2789                (<fidl_fuchsia_net__common::IpAddress as fidl::encoding::ValueTypeMarker>::borrow(
2790                    &self.destination,
2791                ),),
2792                encoder,
2793                offset,
2794                _depth,
2795            )
2796        }
2797    }
2798    unsafe impl<
2799            D: fidl::encoding::ResourceDialect,
2800            T0: fidl::encoding::Encode<fidl_fuchsia_net__common::IpAddress, D>,
2801        > fidl::encoding::Encode<StateResolveRequest, D> for (T0,)
2802    {
2803        #[inline]
2804        unsafe fn encode(
2805            self,
2806            encoder: &mut fidl::encoding::Encoder<'_, D>,
2807            offset: usize,
2808            depth: fidl::encoding::Depth,
2809        ) -> fidl::Result<()> {
2810            encoder.debug_check_bounds::<StateResolveRequest>(offset);
2811            // Zero out padding regions. There's no need to apply masks
2812            // because the unmasked parts will be overwritten by fields.
2813            // Write the fields.
2814            self.0.encode(encoder, offset + 0, depth)?;
2815            Ok(())
2816        }
2817    }
2818
2819    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StateResolveRequest {
2820        #[inline(always)]
2821        fn new_empty() -> Self {
2822            Self { destination: fidl::new_empty!(fidl_fuchsia_net__common::IpAddress, D) }
2823        }
2824
2825        #[inline]
2826        unsafe fn decode(
2827            &mut self,
2828            decoder: &mut fidl::encoding::Decoder<'_, D>,
2829            offset: usize,
2830            _depth: fidl::encoding::Depth,
2831        ) -> fidl::Result<()> {
2832            decoder.debug_check_bounds::<Self>(offset);
2833            // Verify that padding bytes are zero.
2834            fidl::decode!(
2835                fidl_fuchsia_net__common::IpAddress,
2836                D,
2837                &mut self.destination,
2838                decoder,
2839                offset + 0,
2840                _depth
2841            )?;
2842            Ok(())
2843        }
2844    }
2845
2846    impl fidl::encoding::ValueTypeMarker for StateGetRouteTableNameResponse {
2847        type Borrowed<'a> = &'a Self;
2848        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2849            value
2850        }
2851    }
2852
2853    unsafe impl fidl::encoding::TypeMarker for StateGetRouteTableNameResponse {
2854        type Owned = Self;
2855
2856        #[inline(always)]
2857        fn inline_align(_context: fidl::encoding::Context) -> usize {
2858            8
2859        }
2860
2861        #[inline(always)]
2862        fn inline_size(_context: fidl::encoding::Context) -> usize {
2863            16
2864        }
2865    }
2866
2867    unsafe impl<D: fidl::encoding::ResourceDialect>
2868        fidl::encoding::Encode<StateGetRouteTableNameResponse, D>
2869        for &StateGetRouteTableNameResponse
2870    {
2871        #[inline]
2872        unsafe fn encode(
2873            self,
2874            encoder: &mut fidl::encoding::Encoder<'_, D>,
2875            offset: usize,
2876            _depth: fidl::encoding::Depth,
2877        ) -> fidl::Result<()> {
2878            encoder.debug_check_bounds::<StateGetRouteTableNameResponse>(offset);
2879            // Delegate to tuple encoding.
2880            fidl::encoding::Encode::<StateGetRouteTableNameResponse, D>::encode(
2881                (<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
2882                    &self.table_name,
2883                ),),
2884                encoder,
2885                offset,
2886                _depth,
2887            )
2888        }
2889    }
2890    unsafe impl<
2891            D: fidl::encoding::ResourceDialect,
2892            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
2893        > fidl::encoding::Encode<StateGetRouteTableNameResponse, D> for (T0,)
2894    {
2895        #[inline]
2896        unsafe fn encode(
2897            self,
2898            encoder: &mut fidl::encoding::Encoder<'_, D>,
2899            offset: usize,
2900            depth: fidl::encoding::Depth,
2901        ) -> fidl::Result<()> {
2902            encoder.debug_check_bounds::<StateGetRouteTableNameResponse>(offset);
2903            // Zero out padding regions. There's no need to apply masks
2904            // because the unmasked parts will be overwritten by fields.
2905            // Write the fields.
2906            self.0.encode(encoder, offset + 0, depth)?;
2907            Ok(())
2908        }
2909    }
2910
2911    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2912        for StateGetRouteTableNameResponse
2913    {
2914        #[inline(always)]
2915        fn new_empty() -> Self {
2916            Self { table_name: fidl::new_empty!(fidl::encoding::BoundedString<255>, D) }
2917        }
2918
2919        #[inline]
2920        unsafe fn decode(
2921            &mut self,
2922            decoder: &mut fidl::encoding::Decoder<'_, D>,
2923            offset: usize,
2924            _depth: fidl::encoding::Depth,
2925        ) -> fidl::Result<()> {
2926            decoder.debug_check_bounds::<Self>(offset);
2927            // Verify that padding bytes are zero.
2928            fidl::decode!(
2929                fidl::encoding::BoundedString<255>,
2930                D,
2931                &mut self.table_name,
2932                decoder,
2933                offset + 0,
2934                _depth
2935            )?;
2936            Ok(())
2937        }
2938    }
2939
2940    impl fidl::encoding::ValueTypeMarker for StateResolve2Response {
2941        type Borrowed<'a> = &'a Self;
2942        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2943            value
2944        }
2945    }
2946
2947    unsafe impl fidl::encoding::TypeMarker for StateResolve2Response {
2948        type Owned = Self;
2949
2950        #[inline(always)]
2951        fn inline_align(_context: fidl::encoding::Context) -> usize {
2952            8
2953        }
2954
2955        #[inline(always)]
2956        fn inline_size(_context: fidl::encoding::Context) -> usize {
2957            16
2958        }
2959    }
2960
2961    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StateResolve2Response, D>
2962        for &StateResolve2Response
2963    {
2964        #[inline]
2965        unsafe fn encode(
2966            self,
2967            encoder: &mut fidl::encoding::Encoder<'_, D>,
2968            offset: usize,
2969            _depth: fidl::encoding::Depth,
2970        ) -> fidl::Result<()> {
2971            encoder.debug_check_bounds::<StateResolve2Response>(offset);
2972            // Delegate to tuple encoding.
2973            fidl::encoding::Encode::<StateResolve2Response, D>::encode(
2974                (<ResolveResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
2975                encoder,
2976                offset,
2977                _depth,
2978            )
2979        }
2980    }
2981    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ResolveResult, D>>
2982        fidl::encoding::Encode<StateResolve2Response, D> for (T0,)
2983    {
2984        #[inline]
2985        unsafe fn encode(
2986            self,
2987            encoder: &mut fidl::encoding::Encoder<'_, D>,
2988            offset: usize,
2989            depth: fidl::encoding::Depth,
2990        ) -> fidl::Result<()> {
2991            encoder.debug_check_bounds::<StateResolve2Response>(offset);
2992            // Zero out padding regions. There's no need to apply masks
2993            // because the unmasked parts will be overwritten by fields.
2994            // Write the fields.
2995            self.0.encode(encoder, offset + 0, depth)?;
2996            Ok(())
2997        }
2998    }
2999
3000    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StateResolve2Response {
3001        #[inline(always)]
3002        fn new_empty() -> Self {
3003            Self { result: fidl::new_empty!(ResolveResult, D) }
3004        }
3005
3006        #[inline]
3007        unsafe fn decode(
3008            &mut self,
3009            decoder: &mut fidl::encoding::Decoder<'_, D>,
3010            offset: usize,
3011            _depth: fidl::encoding::Depth,
3012        ) -> fidl::Result<()> {
3013            decoder.debug_check_bounds::<Self>(offset);
3014            // Verify that padding bytes are zero.
3015            fidl::decode!(ResolveResult, D, &mut self.result, decoder, offset + 0, _depth)?;
3016            Ok(())
3017        }
3018    }
3019
3020    impl fidl::encoding::ValueTypeMarker for StateResolveResponse {
3021        type Borrowed<'a> = &'a Self;
3022        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3023            value
3024        }
3025    }
3026
3027    unsafe impl fidl::encoding::TypeMarker for StateResolveResponse {
3028        type Owned = Self;
3029
3030        #[inline(always)]
3031        fn inline_align(_context: fidl::encoding::Context) -> usize {
3032            8
3033        }
3034
3035        #[inline(always)]
3036        fn inline_size(_context: fidl::encoding::Context) -> usize {
3037            16
3038        }
3039    }
3040
3041    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StateResolveResponse, D>
3042        for &StateResolveResponse
3043    {
3044        #[inline]
3045        unsafe fn encode(
3046            self,
3047            encoder: &mut fidl::encoding::Encoder<'_, D>,
3048            offset: usize,
3049            _depth: fidl::encoding::Depth,
3050        ) -> fidl::Result<()> {
3051            encoder.debug_check_bounds::<StateResolveResponse>(offset);
3052            // Delegate to tuple encoding.
3053            fidl::encoding::Encode::<StateResolveResponse, D>::encode(
3054                (<Resolved as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
3055                encoder,
3056                offset,
3057                _depth,
3058            )
3059        }
3060    }
3061    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Resolved, D>>
3062        fidl::encoding::Encode<StateResolveResponse, D> for (T0,)
3063    {
3064        #[inline]
3065        unsafe fn encode(
3066            self,
3067            encoder: &mut fidl::encoding::Encoder<'_, D>,
3068            offset: usize,
3069            depth: fidl::encoding::Depth,
3070        ) -> fidl::Result<()> {
3071            encoder.debug_check_bounds::<StateResolveResponse>(offset);
3072            // Zero out padding regions. There's no need to apply masks
3073            // because the unmasked parts will be overwritten by fields.
3074            // Write the fields.
3075            self.0.encode(encoder, offset + 0, depth)?;
3076            Ok(())
3077        }
3078    }
3079
3080    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StateResolveResponse {
3081        #[inline(always)]
3082        fn new_empty() -> Self {
3083            Self { result: fidl::new_empty!(Resolved, D) }
3084        }
3085
3086        #[inline]
3087        unsafe fn decode(
3088            &mut self,
3089            decoder: &mut fidl::encoding::Decoder<'_, D>,
3090            offset: usize,
3091            _depth: fidl::encoding::Depth,
3092        ) -> fidl::Result<()> {
3093            decoder.debug_check_bounds::<Self>(offset);
3094            // Verify that padding bytes are zero.
3095            fidl::decode!(Resolved, D, &mut self.result, decoder, offset + 0, _depth)?;
3096            Ok(())
3097        }
3098    }
3099
3100    impl fidl::encoding::ValueTypeMarker for Unbound {
3101        type Borrowed<'a> = &'a Self;
3102        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3103            value
3104        }
3105    }
3106
3107    unsafe impl fidl::encoding::TypeMarker for Unbound {
3108        type Owned = Self;
3109
3110        #[inline(always)]
3111        fn inline_align(_context: fidl::encoding::Context) -> usize {
3112            1
3113        }
3114
3115        #[inline(always)]
3116        fn inline_size(_context: fidl::encoding::Context) -> usize {
3117            1
3118        }
3119    }
3120
3121    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Unbound, D> for &Unbound {
3122        #[inline]
3123        unsafe fn encode(
3124            self,
3125            encoder: &mut fidl::encoding::Encoder<'_, D>,
3126            offset: usize,
3127            _depth: fidl::encoding::Depth,
3128        ) -> fidl::Result<()> {
3129            encoder.debug_check_bounds::<Unbound>(offset);
3130            encoder.write_num(0u8, offset);
3131            Ok(())
3132        }
3133    }
3134
3135    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Unbound {
3136        #[inline(always)]
3137        fn new_empty() -> Self {
3138            Self
3139        }
3140
3141        #[inline]
3142        unsafe fn decode(
3143            &mut self,
3144            decoder: &mut fidl::encoding::Decoder<'_, D>,
3145            offset: usize,
3146            _depth: fidl::encoding::Depth,
3147        ) -> fidl::Result<()> {
3148            decoder.debug_check_bounds::<Self>(offset);
3149            match decoder.read_num::<u8>(offset) {
3150                0 => Ok(()),
3151                _ => Err(fidl::Error::Invalid),
3152            }
3153        }
3154    }
3155
3156    impl fidl::encoding::ValueTypeMarker for Unmarked {
3157        type Borrowed<'a> = &'a Self;
3158        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3159            value
3160        }
3161    }
3162
3163    unsafe impl fidl::encoding::TypeMarker for Unmarked {
3164        type Owned = Self;
3165
3166        #[inline(always)]
3167        fn inline_align(_context: fidl::encoding::Context) -> usize {
3168            1
3169        }
3170
3171        #[inline(always)]
3172        fn inline_size(_context: fidl::encoding::Context) -> usize {
3173            1
3174        }
3175    }
3176
3177    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Unmarked, D> for &Unmarked {
3178        #[inline]
3179        unsafe fn encode(
3180            self,
3181            encoder: &mut fidl::encoding::Encoder<'_, D>,
3182            offset: usize,
3183            _depth: fidl::encoding::Depth,
3184        ) -> fidl::Result<()> {
3185            encoder.debug_check_bounds::<Unmarked>(offset);
3186            encoder.write_num(0u8, offset);
3187            Ok(())
3188        }
3189    }
3190
3191    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Unmarked {
3192        #[inline(always)]
3193        fn new_empty() -> Self {
3194            Self
3195        }
3196
3197        #[inline]
3198        unsafe fn decode(
3199            &mut self,
3200            decoder: &mut fidl::encoding::Decoder<'_, D>,
3201            offset: usize,
3202            _depth: fidl::encoding::Depth,
3203        ) -> fidl::Result<()> {
3204            decoder.debug_check_bounds::<Self>(offset);
3205            match decoder.read_num::<u8>(offset) {
3206                0 => Ok(()),
3207                _ => Err(fidl::Error::Invalid),
3208            }
3209        }
3210    }
3211
3212    impl fidl::encoding::ValueTypeMarker for Unreachable {
3213        type Borrowed<'a> = &'a Self;
3214        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3215            value
3216        }
3217    }
3218
3219    unsafe impl fidl::encoding::TypeMarker for Unreachable {
3220        type Owned = Self;
3221
3222        #[inline(always)]
3223        fn inline_align(_context: fidl::encoding::Context) -> usize {
3224            1
3225        }
3226
3227        #[inline(always)]
3228        fn inline_size(_context: fidl::encoding::Context) -> usize {
3229            1
3230        }
3231    }
3232
3233    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Unreachable, D>
3234        for &Unreachable
3235    {
3236        #[inline]
3237        unsafe fn encode(
3238            self,
3239            encoder: &mut fidl::encoding::Encoder<'_, D>,
3240            offset: usize,
3241            _depth: fidl::encoding::Depth,
3242        ) -> fidl::Result<()> {
3243            encoder.debug_check_bounds::<Unreachable>(offset);
3244            encoder.write_num(0u8, offset);
3245            Ok(())
3246        }
3247    }
3248
3249    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Unreachable {
3250        #[inline(always)]
3251        fn new_empty() -> Self {
3252            Self
3253        }
3254
3255        #[inline]
3256        unsafe fn decode(
3257            &mut self,
3258            decoder: &mut fidl::encoding::Decoder<'_, D>,
3259            offset: usize,
3260            _depth: fidl::encoding::Depth,
3261        ) -> fidl::Result<()> {
3262            decoder.debug_check_bounds::<Self>(offset);
3263            match decoder.read_num::<u8>(offset) {
3264                0 => Ok(()),
3265                _ => Err(fidl::Error::Invalid),
3266            }
3267        }
3268    }
3269
3270    impl fidl::encoding::ValueTypeMarker for WatcherV4WatchResponse {
3271        type Borrowed<'a> = &'a Self;
3272        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3273            value
3274        }
3275    }
3276
3277    unsafe impl fidl::encoding::TypeMarker for WatcherV4WatchResponse {
3278        type Owned = Self;
3279
3280        #[inline(always)]
3281        fn inline_align(_context: fidl::encoding::Context) -> usize {
3282            8
3283        }
3284
3285        #[inline(always)]
3286        fn inline_size(_context: fidl::encoding::Context) -> usize {
3287            16
3288        }
3289    }
3290
3291    unsafe impl<D: fidl::encoding::ResourceDialect>
3292        fidl::encoding::Encode<WatcherV4WatchResponse, D> for &WatcherV4WatchResponse
3293    {
3294        #[inline]
3295        unsafe fn encode(
3296            self,
3297            encoder: &mut fidl::encoding::Encoder<'_, D>,
3298            offset: usize,
3299            _depth: fidl::encoding::Depth,
3300        ) -> fidl::Result<()> {
3301            encoder.debug_check_bounds::<WatcherV4WatchResponse>(offset);
3302            // Delegate to tuple encoding.
3303            fidl::encoding::Encode::<WatcherV4WatchResponse, D>::encode(
3304                (
3305                    <fidl::encoding::Vector<EventV4, 512> as fidl::encoding::ValueTypeMarker>::borrow(&self.events),
3306                ),
3307                encoder, offset, _depth
3308            )
3309        }
3310    }
3311    unsafe impl<
3312            D: fidl::encoding::ResourceDialect,
3313            T0: fidl::encoding::Encode<fidl::encoding::Vector<EventV4, 512>, D>,
3314        > fidl::encoding::Encode<WatcherV4WatchResponse, D> for (T0,)
3315    {
3316        #[inline]
3317        unsafe fn encode(
3318            self,
3319            encoder: &mut fidl::encoding::Encoder<'_, D>,
3320            offset: usize,
3321            depth: fidl::encoding::Depth,
3322        ) -> fidl::Result<()> {
3323            encoder.debug_check_bounds::<WatcherV4WatchResponse>(offset);
3324            // Zero out padding regions. There's no need to apply masks
3325            // because the unmasked parts will be overwritten by fields.
3326            // Write the fields.
3327            self.0.encode(encoder, offset + 0, depth)?;
3328            Ok(())
3329        }
3330    }
3331
3332    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3333        for WatcherV4WatchResponse
3334    {
3335        #[inline(always)]
3336        fn new_empty() -> Self {
3337            Self { events: fidl::new_empty!(fidl::encoding::Vector<EventV4, 512>, D) }
3338        }
3339
3340        #[inline]
3341        unsafe fn decode(
3342            &mut self,
3343            decoder: &mut fidl::encoding::Decoder<'_, D>,
3344            offset: usize,
3345            _depth: fidl::encoding::Depth,
3346        ) -> fidl::Result<()> {
3347            decoder.debug_check_bounds::<Self>(offset);
3348            // Verify that padding bytes are zero.
3349            fidl::decode!(fidl::encoding::Vector<EventV4, 512>, D, &mut self.events, decoder, offset + 0, _depth)?;
3350            Ok(())
3351        }
3352    }
3353
3354    impl fidl::encoding::ValueTypeMarker for WatcherV6WatchResponse {
3355        type Borrowed<'a> = &'a Self;
3356        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3357            value
3358        }
3359    }
3360
3361    unsafe impl fidl::encoding::TypeMarker for WatcherV6WatchResponse {
3362        type Owned = Self;
3363
3364        #[inline(always)]
3365        fn inline_align(_context: fidl::encoding::Context) -> usize {
3366            8
3367        }
3368
3369        #[inline(always)]
3370        fn inline_size(_context: fidl::encoding::Context) -> usize {
3371            16
3372        }
3373    }
3374
3375    unsafe impl<D: fidl::encoding::ResourceDialect>
3376        fidl::encoding::Encode<WatcherV6WatchResponse, D> for &WatcherV6WatchResponse
3377    {
3378        #[inline]
3379        unsafe fn encode(
3380            self,
3381            encoder: &mut fidl::encoding::Encoder<'_, D>,
3382            offset: usize,
3383            _depth: fidl::encoding::Depth,
3384        ) -> fidl::Result<()> {
3385            encoder.debug_check_bounds::<WatcherV6WatchResponse>(offset);
3386            // Delegate to tuple encoding.
3387            fidl::encoding::Encode::<WatcherV6WatchResponse, D>::encode(
3388                (
3389                    <fidl::encoding::Vector<EventV6, 512> as fidl::encoding::ValueTypeMarker>::borrow(&self.events),
3390                ),
3391                encoder, offset, _depth
3392            )
3393        }
3394    }
3395    unsafe impl<
3396            D: fidl::encoding::ResourceDialect,
3397            T0: fidl::encoding::Encode<fidl::encoding::Vector<EventV6, 512>, D>,
3398        > fidl::encoding::Encode<WatcherV6WatchResponse, D> for (T0,)
3399    {
3400        #[inline]
3401        unsafe fn encode(
3402            self,
3403            encoder: &mut fidl::encoding::Encoder<'_, D>,
3404            offset: usize,
3405            depth: fidl::encoding::Depth,
3406        ) -> fidl::Result<()> {
3407            encoder.debug_check_bounds::<WatcherV6WatchResponse>(offset);
3408            // Zero out padding regions. There's no need to apply masks
3409            // because the unmasked parts will be overwritten by fields.
3410            // Write the fields.
3411            self.0.encode(encoder, offset + 0, depth)?;
3412            Ok(())
3413        }
3414    }
3415
3416    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3417        for WatcherV6WatchResponse
3418    {
3419        #[inline(always)]
3420        fn new_empty() -> Self {
3421            Self { events: fidl::new_empty!(fidl::encoding::Vector<EventV6, 512>, D) }
3422        }
3423
3424        #[inline]
3425        unsafe fn decode(
3426            &mut self,
3427            decoder: &mut fidl::encoding::Decoder<'_, D>,
3428            offset: usize,
3429            _depth: fidl::encoding::Depth,
3430        ) -> fidl::Result<()> {
3431            decoder.debug_check_bounds::<Self>(offset);
3432            // Verify that padding bytes are zero.
3433            fidl::decode!(fidl::encoding::Vector<EventV6, 512>, D, &mut self.events, decoder, offset + 0, _depth)?;
3434            Ok(())
3435        }
3436    }
3437
3438    impl BaseMatcher {
3439        #[inline(always)]
3440        fn max_ordinal_present(&self) -> u64 {
3441            if let Some(_) = self.mark_2 {
3442                return 4;
3443            }
3444            if let Some(_) = self.mark_1 {
3445                return 3;
3446            }
3447            if let Some(_) = self.bound_device {
3448                return 2;
3449            }
3450            if let Some(_) = self.locally_generated {
3451                return 1;
3452            }
3453            0
3454        }
3455    }
3456
3457    impl fidl::encoding::ValueTypeMarker for BaseMatcher {
3458        type Borrowed<'a> = &'a Self;
3459        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3460            value
3461        }
3462    }
3463
3464    unsafe impl fidl::encoding::TypeMarker for BaseMatcher {
3465        type Owned = Self;
3466
3467        #[inline(always)]
3468        fn inline_align(_context: fidl::encoding::Context) -> usize {
3469            8
3470        }
3471
3472        #[inline(always)]
3473        fn inline_size(_context: fidl::encoding::Context) -> usize {
3474            16
3475        }
3476    }
3477
3478    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BaseMatcher, D>
3479        for &BaseMatcher
3480    {
3481        unsafe fn encode(
3482            self,
3483            encoder: &mut fidl::encoding::Encoder<'_, D>,
3484            offset: usize,
3485            mut depth: fidl::encoding::Depth,
3486        ) -> fidl::Result<()> {
3487            encoder.debug_check_bounds::<BaseMatcher>(offset);
3488            // Vector header
3489            let max_ordinal: u64 = self.max_ordinal_present();
3490            encoder.write_num(max_ordinal, offset);
3491            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3492            // Calling encoder.out_of_line_offset(0) is not allowed.
3493            if max_ordinal == 0 {
3494                return Ok(());
3495            }
3496            depth.increment()?;
3497            let envelope_size = 8;
3498            let bytes_len = max_ordinal as usize * envelope_size;
3499            #[allow(unused_variables)]
3500            let offset = encoder.out_of_line_offset(bytes_len);
3501            let mut _prev_end_offset: usize = 0;
3502            if 1 > max_ordinal {
3503                return Ok(());
3504            }
3505
3506            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3507            // are envelope_size bytes.
3508            let cur_offset: usize = (1 - 1) * envelope_size;
3509
3510            // Zero reserved fields.
3511            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3512
3513            // Safety:
3514            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3515            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3516            //   envelope_size bytes, there is always sufficient room.
3517            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3518                self.locally_generated
3519                    .as_ref()
3520                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3521                encoder,
3522                offset + cur_offset,
3523                depth,
3524            )?;
3525
3526            _prev_end_offset = cur_offset + envelope_size;
3527            if 2 > max_ordinal {
3528                return Ok(());
3529            }
3530
3531            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3532            // are envelope_size bytes.
3533            let cur_offset: usize = (2 - 1) * envelope_size;
3534
3535            // Zero reserved fields.
3536            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3537
3538            // Safety:
3539            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3540            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3541            //   envelope_size bytes, there is always sufficient room.
3542            fidl::encoding::encode_in_envelope_optional::<InterfaceMatcher, D>(
3543                self.bound_device
3544                    .as_ref()
3545                    .map(<InterfaceMatcher as fidl::encoding::ValueTypeMarker>::borrow),
3546                encoder,
3547                offset + cur_offset,
3548                depth,
3549            )?;
3550
3551            _prev_end_offset = cur_offset + envelope_size;
3552            if 3 > max_ordinal {
3553                return Ok(());
3554            }
3555
3556            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3557            // are envelope_size bytes.
3558            let cur_offset: usize = (3 - 1) * envelope_size;
3559
3560            // Zero reserved fields.
3561            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3562
3563            // Safety:
3564            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3565            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3566            //   envelope_size bytes, there is always sufficient room.
3567            fidl::encoding::encode_in_envelope_optional::<MarkMatcher, D>(
3568                self.mark_1.as_ref().map(<MarkMatcher as fidl::encoding::ValueTypeMarker>::borrow),
3569                encoder,
3570                offset + cur_offset,
3571                depth,
3572            )?;
3573
3574            _prev_end_offset = cur_offset + envelope_size;
3575            if 4 > max_ordinal {
3576                return Ok(());
3577            }
3578
3579            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3580            // are envelope_size bytes.
3581            let cur_offset: usize = (4 - 1) * envelope_size;
3582
3583            // Zero reserved fields.
3584            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3585
3586            // Safety:
3587            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3588            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3589            //   envelope_size bytes, there is always sufficient room.
3590            fidl::encoding::encode_in_envelope_optional::<MarkMatcher, D>(
3591                self.mark_2.as_ref().map(<MarkMatcher as fidl::encoding::ValueTypeMarker>::borrow),
3592                encoder,
3593                offset + cur_offset,
3594                depth,
3595            )?;
3596
3597            _prev_end_offset = cur_offset + envelope_size;
3598
3599            Ok(())
3600        }
3601    }
3602
3603    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BaseMatcher {
3604        #[inline(always)]
3605        fn new_empty() -> Self {
3606            Self::default()
3607        }
3608
3609        unsafe fn decode(
3610            &mut self,
3611            decoder: &mut fidl::encoding::Decoder<'_, D>,
3612            offset: usize,
3613            mut depth: fidl::encoding::Depth,
3614        ) -> fidl::Result<()> {
3615            decoder.debug_check_bounds::<Self>(offset);
3616            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3617                None => return Err(fidl::Error::NotNullable),
3618                Some(len) => len,
3619            };
3620            // Calling decoder.out_of_line_offset(0) is not allowed.
3621            if len == 0 {
3622                return Ok(());
3623            };
3624            depth.increment()?;
3625            let envelope_size = 8;
3626            let bytes_len = len * envelope_size;
3627            let offset = decoder.out_of_line_offset(bytes_len)?;
3628            // Decode the envelope for each type.
3629            let mut _next_ordinal_to_read = 0;
3630            let mut next_offset = offset;
3631            let end_offset = offset + bytes_len;
3632            _next_ordinal_to_read += 1;
3633            if next_offset >= end_offset {
3634                return Ok(());
3635            }
3636
3637            // Decode unknown envelopes for gaps in ordinals.
3638            while _next_ordinal_to_read < 1 {
3639                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3640                _next_ordinal_to_read += 1;
3641                next_offset += envelope_size;
3642            }
3643
3644            let next_out_of_line = decoder.next_out_of_line();
3645            let handles_before = decoder.remaining_handles();
3646            if let Some((inlined, num_bytes, num_handles)) =
3647                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3648            {
3649                let member_inline_size =
3650                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3651                if inlined != (member_inline_size <= 4) {
3652                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3653                }
3654                let inner_offset;
3655                let mut inner_depth = depth.clone();
3656                if inlined {
3657                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3658                    inner_offset = next_offset;
3659                } else {
3660                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3661                    inner_depth.increment()?;
3662                }
3663                let val_ref =
3664                    self.locally_generated.get_or_insert_with(|| fidl::new_empty!(bool, D));
3665                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3666                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3667                {
3668                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3669                }
3670                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3671                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3672                }
3673            }
3674
3675            next_offset += envelope_size;
3676            _next_ordinal_to_read += 1;
3677            if next_offset >= end_offset {
3678                return Ok(());
3679            }
3680
3681            // Decode unknown envelopes for gaps in ordinals.
3682            while _next_ordinal_to_read < 2 {
3683                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3684                _next_ordinal_to_read += 1;
3685                next_offset += envelope_size;
3686            }
3687
3688            let next_out_of_line = decoder.next_out_of_line();
3689            let handles_before = decoder.remaining_handles();
3690            if let Some((inlined, num_bytes, num_handles)) =
3691                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3692            {
3693                let member_inline_size =
3694                    <InterfaceMatcher as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3695                if inlined != (member_inline_size <= 4) {
3696                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3697                }
3698                let inner_offset;
3699                let mut inner_depth = depth.clone();
3700                if inlined {
3701                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3702                    inner_offset = next_offset;
3703                } else {
3704                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3705                    inner_depth.increment()?;
3706                }
3707                let val_ref =
3708                    self.bound_device.get_or_insert_with(|| fidl::new_empty!(InterfaceMatcher, D));
3709                fidl::decode!(InterfaceMatcher, D, val_ref, decoder, inner_offset, inner_depth)?;
3710                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3711                {
3712                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3713                }
3714                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3715                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3716                }
3717            }
3718
3719            next_offset += envelope_size;
3720            _next_ordinal_to_read += 1;
3721            if next_offset >= end_offset {
3722                return Ok(());
3723            }
3724
3725            // Decode unknown envelopes for gaps in ordinals.
3726            while _next_ordinal_to_read < 3 {
3727                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3728                _next_ordinal_to_read += 1;
3729                next_offset += envelope_size;
3730            }
3731
3732            let next_out_of_line = decoder.next_out_of_line();
3733            let handles_before = decoder.remaining_handles();
3734            if let Some((inlined, num_bytes, num_handles)) =
3735                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3736            {
3737                let member_inline_size =
3738                    <MarkMatcher as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3739                if inlined != (member_inline_size <= 4) {
3740                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3741                }
3742                let inner_offset;
3743                let mut inner_depth = depth.clone();
3744                if inlined {
3745                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3746                    inner_offset = next_offset;
3747                } else {
3748                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3749                    inner_depth.increment()?;
3750                }
3751                let val_ref = self.mark_1.get_or_insert_with(|| fidl::new_empty!(MarkMatcher, D));
3752                fidl::decode!(MarkMatcher, D, val_ref, decoder, inner_offset, inner_depth)?;
3753                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3754                {
3755                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3756                }
3757                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3758                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3759                }
3760            }
3761
3762            next_offset += envelope_size;
3763            _next_ordinal_to_read += 1;
3764            if next_offset >= end_offset {
3765                return Ok(());
3766            }
3767
3768            // Decode unknown envelopes for gaps in ordinals.
3769            while _next_ordinal_to_read < 4 {
3770                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3771                _next_ordinal_to_read += 1;
3772                next_offset += envelope_size;
3773            }
3774
3775            let next_out_of_line = decoder.next_out_of_line();
3776            let handles_before = decoder.remaining_handles();
3777            if let Some((inlined, num_bytes, num_handles)) =
3778                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3779            {
3780                let member_inline_size =
3781                    <MarkMatcher as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3782                if inlined != (member_inline_size <= 4) {
3783                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3784                }
3785                let inner_offset;
3786                let mut inner_depth = depth.clone();
3787                if inlined {
3788                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3789                    inner_offset = next_offset;
3790                } else {
3791                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3792                    inner_depth.increment()?;
3793                }
3794                let val_ref = self.mark_2.get_or_insert_with(|| fidl::new_empty!(MarkMatcher, D));
3795                fidl::decode!(MarkMatcher, D, val_ref, decoder, inner_offset, inner_depth)?;
3796                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3797                {
3798                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3799                }
3800                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3801                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3802                }
3803            }
3804
3805            next_offset += envelope_size;
3806
3807            // Decode the remaining unknown envelopes.
3808            while next_offset < end_offset {
3809                _next_ordinal_to_read += 1;
3810                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3811                next_offset += envelope_size;
3812            }
3813
3814            Ok(())
3815        }
3816    }
3817
3818    impl Destination {
3819        #[inline(always)]
3820        fn max_ordinal_present(&self) -> u64 {
3821            if let Some(_) = self.source_address {
3822                return 4;
3823            }
3824            if let Some(_) = self.interface_id {
3825                return 3;
3826            }
3827            if let Some(_) = self.mac {
3828                return 2;
3829            }
3830            if let Some(_) = self.address {
3831                return 1;
3832            }
3833            0
3834        }
3835    }
3836
3837    impl fidl::encoding::ValueTypeMarker for Destination {
3838        type Borrowed<'a> = &'a Self;
3839        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3840            value
3841        }
3842    }
3843
3844    unsafe impl fidl::encoding::TypeMarker for Destination {
3845        type Owned = Self;
3846
3847        #[inline(always)]
3848        fn inline_align(_context: fidl::encoding::Context) -> usize {
3849            8
3850        }
3851
3852        #[inline(always)]
3853        fn inline_size(_context: fidl::encoding::Context) -> usize {
3854            16
3855        }
3856    }
3857
3858    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Destination, D>
3859        for &Destination
3860    {
3861        unsafe fn encode(
3862            self,
3863            encoder: &mut fidl::encoding::Encoder<'_, D>,
3864            offset: usize,
3865            mut depth: fidl::encoding::Depth,
3866        ) -> fidl::Result<()> {
3867            encoder.debug_check_bounds::<Destination>(offset);
3868            // Vector header
3869            let max_ordinal: u64 = self.max_ordinal_present();
3870            encoder.write_num(max_ordinal, offset);
3871            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3872            // Calling encoder.out_of_line_offset(0) is not allowed.
3873            if max_ordinal == 0 {
3874                return Ok(());
3875            }
3876            depth.increment()?;
3877            let envelope_size = 8;
3878            let bytes_len = max_ordinal as usize * envelope_size;
3879            #[allow(unused_variables)]
3880            let offset = encoder.out_of_line_offset(bytes_len);
3881            let mut _prev_end_offset: usize = 0;
3882            if 1 > max_ordinal {
3883                return Ok(());
3884            }
3885
3886            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3887            // are envelope_size bytes.
3888            let cur_offset: usize = (1 - 1) * envelope_size;
3889
3890            // Zero reserved fields.
3891            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3892
3893            // Safety:
3894            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3895            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3896            //   envelope_size bytes, there is always sufficient room.
3897            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::IpAddress, D>(
3898            self.address.as_ref().map(<fidl_fuchsia_net__common::IpAddress as fidl::encoding::ValueTypeMarker>::borrow),
3899            encoder, offset + cur_offset, depth
3900        )?;
3901
3902            _prev_end_offset = cur_offset + envelope_size;
3903            if 2 > max_ordinal {
3904                return Ok(());
3905            }
3906
3907            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3908            // are envelope_size bytes.
3909            let cur_offset: usize = (2 - 1) * envelope_size;
3910
3911            // Zero reserved fields.
3912            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3913
3914            // Safety:
3915            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3916            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3917            //   envelope_size bytes, there is always sufficient room.
3918            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::MacAddress, D>(
3919            self.mac.as_ref().map(<fidl_fuchsia_net__common::MacAddress as fidl::encoding::ValueTypeMarker>::borrow),
3920            encoder, offset + cur_offset, depth
3921        )?;
3922
3923            _prev_end_offset = cur_offset + envelope_size;
3924            if 3 > max_ordinal {
3925                return Ok(());
3926            }
3927
3928            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3929            // are envelope_size bytes.
3930            let cur_offset: usize = (3 - 1) * envelope_size;
3931
3932            // Zero reserved fields.
3933            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3934
3935            // Safety:
3936            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3937            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3938            //   envelope_size bytes, there is always sufficient room.
3939            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3940                self.interface_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3941                encoder,
3942                offset + cur_offset,
3943                depth,
3944            )?;
3945
3946            _prev_end_offset = cur_offset + envelope_size;
3947            if 4 > max_ordinal {
3948                return Ok(());
3949            }
3950
3951            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3952            // are envelope_size bytes.
3953            let cur_offset: usize = (4 - 1) * envelope_size;
3954
3955            // Zero reserved fields.
3956            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3957
3958            // Safety:
3959            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3960            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3961            //   envelope_size bytes, there is always sufficient room.
3962            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::IpAddress, D>(
3963            self.source_address.as_ref().map(<fidl_fuchsia_net__common::IpAddress as fidl::encoding::ValueTypeMarker>::borrow),
3964            encoder, offset + cur_offset, depth
3965        )?;
3966
3967            _prev_end_offset = cur_offset + envelope_size;
3968
3969            Ok(())
3970        }
3971    }
3972
3973    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Destination {
3974        #[inline(always)]
3975        fn new_empty() -> Self {
3976            Self::default()
3977        }
3978
3979        unsafe fn decode(
3980            &mut self,
3981            decoder: &mut fidl::encoding::Decoder<'_, D>,
3982            offset: usize,
3983            mut depth: fidl::encoding::Depth,
3984        ) -> fidl::Result<()> {
3985            decoder.debug_check_bounds::<Self>(offset);
3986            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3987                None => return Err(fidl::Error::NotNullable),
3988                Some(len) => len,
3989            };
3990            // Calling decoder.out_of_line_offset(0) is not allowed.
3991            if len == 0 {
3992                return Ok(());
3993            };
3994            depth.increment()?;
3995            let envelope_size = 8;
3996            let bytes_len = len * envelope_size;
3997            let offset = decoder.out_of_line_offset(bytes_len)?;
3998            // Decode the envelope for each type.
3999            let mut _next_ordinal_to_read = 0;
4000            let mut next_offset = offset;
4001            let end_offset = offset + bytes_len;
4002            _next_ordinal_to_read += 1;
4003            if next_offset >= end_offset {
4004                return Ok(());
4005            }
4006
4007            // Decode unknown envelopes for gaps in ordinals.
4008            while _next_ordinal_to_read < 1 {
4009                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4010                _next_ordinal_to_read += 1;
4011                next_offset += envelope_size;
4012            }
4013
4014            let next_out_of_line = decoder.next_out_of_line();
4015            let handles_before = decoder.remaining_handles();
4016            if let Some((inlined, num_bytes, num_handles)) =
4017                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4018            {
4019                let member_inline_size = <fidl_fuchsia_net__common::IpAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4020                if inlined != (member_inline_size <= 4) {
4021                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4022                }
4023                let inner_offset;
4024                let mut inner_depth = depth.clone();
4025                if inlined {
4026                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4027                    inner_offset = next_offset;
4028                } else {
4029                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4030                    inner_depth.increment()?;
4031                }
4032                let val_ref = self.address.get_or_insert_with(|| {
4033                    fidl::new_empty!(fidl_fuchsia_net__common::IpAddress, D)
4034                });
4035                fidl::decode!(
4036                    fidl_fuchsia_net__common::IpAddress,
4037                    D,
4038                    val_ref,
4039                    decoder,
4040                    inner_offset,
4041                    inner_depth
4042                )?;
4043                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4044                {
4045                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4046                }
4047                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4048                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4049                }
4050            }
4051
4052            next_offset += envelope_size;
4053            _next_ordinal_to_read += 1;
4054            if next_offset >= end_offset {
4055                return Ok(());
4056            }
4057
4058            // Decode unknown envelopes for gaps in ordinals.
4059            while _next_ordinal_to_read < 2 {
4060                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4061                _next_ordinal_to_read += 1;
4062                next_offset += envelope_size;
4063            }
4064
4065            let next_out_of_line = decoder.next_out_of_line();
4066            let handles_before = decoder.remaining_handles();
4067            if let Some((inlined, num_bytes, num_handles)) =
4068                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4069            {
4070                let member_inline_size = <fidl_fuchsia_net__common::MacAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4071                if inlined != (member_inline_size <= 4) {
4072                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4073                }
4074                let inner_offset;
4075                let mut inner_depth = depth.clone();
4076                if inlined {
4077                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4078                    inner_offset = next_offset;
4079                } else {
4080                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4081                    inner_depth.increment()?;
4082                }
4083                let val_ref = self.mac.get_or_insert_with(|| {
4084                    fidl::new_empty!(fidl_fuchsia_net__common::MacAddress, D)
4085                });
4086                fidl::decode!(
4087                    fidl_fuchsia_net__common::MacAddress,
4088                    D,
4089                    val_ref,
4090                    decoder,
4091                    inner_offset,
4092                    inner_depth
4093                )?;
4094                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4095                {
4096                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4097                }
4098                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4099                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4100                }
4101            }
4102
4103            next_offset += envelope_size;
4104            _next_ordinal_to_read += 1;
4105            if next_offset >= end_offset {
4106                return Ok(());
4107            }
4108
4109            // Decode unknown envelopes for gaps in ordinals.
4110            while _next_ordinal_to_read < 3 {
4111                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4112                _next_ordinal_to_read += 1;
4113                next_offset += envelope_size;
4114            }
4115
4116            let next_out_of_line = decoder.next_out_of_line();
4117            let handles_before = decoder.remaining_handles();
4118            if let Some((inlined, num_bytes, num_handles)) =
4119                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4120            {
4121                let member_inline_size =
4122                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4123                if inlined != (member_inline_size <= 4) {
4124                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4125                }
4126                let inner_offset;
4127                let mut inner_depth = depth.clone();
4128                if inlined {
4129                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4130                    inner_offset = next_offset;
4131                } else {
4132                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4133                    inner_depth.increment()?;
4134                }
4135                let val_ref = self.interface_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
4136                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4137                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4138                {
4139                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4140                }
4141                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4142                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4143                }
4144            }
4145
4146            next_offset += envelope_size;
4147            _next_ordinal_to_read += 1;
4148            if next_offset >= end_offset {
4149                return Ok(());
4150            }
4151
4152            // Decode unknown envelopes for gaps in ordinals.
4153            while _next_ordinal_to_read < 4 {
4154                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4155                _next_ordinal_to_read += 1;
4156                next_offset += envelope_size;
4157            }
4158
4159            let next_out_of_line = decoder.next_out_of_line();
4160            let handles_before = decoder.remaining_handles();
4161            if let Some((inlined, num_bytes, num_handles)) =
4162                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4163            {
4164                let member_inline_size = <fidl_fuchsia_net__common::IpAddress as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4165                if inlined != (member_inline_size <= 4) {
4166                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4167                }
4168                let inner_offset;
4169                let mut inner_depth = depth.clone();
4170                if inlined {
4171                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4172                    inner_offset = next_offset;
4173                } else {
4174                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4175                    inner_depth.increment()?;
4176                }
4177                let val_ref = self.source_address.get_or_insert_with(|| {
4178                    fidl::new_empty!(fidl_fuchsia_net__common::IpAddress, D)
4179                });
4180                fidl::decode!(
4181                    fidl_fuchsia_net__common::IpAddress,
4182                    D,
4183                    val_ref,
4184                    decoder,
4185                    inner_offset,
4186                    inner_depth
4187                )?;
4188                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4189                {
4190                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4191                }
4192                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4193                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4194                }
4195            }
4196
4197            next_offset += envelope_size;
4198
4199            // Decode the remaining unknown envelopes.
4200            while next_offset < end_offset {
4201                _next_ordinal_to_read += 1;
4202                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4203                next_offset += envelope_size;
4204            }
4205
4206            Ok(())
4207        }
4208    }
4209
4210    impl EffectiveRouteProperties {
4211        #[inline(always)]
4212        fn max_ordinal_present(&self) -> u64 {
4213            if let Some(_) = self.metric {
4214                return 1;
4215            }
4216            0
4217        }
4218    }
4219
4220    impl fidl::encoding::ValueTypeMarker for EffectiveRouteProperties {
4221        type Borrowed<'a> = &'a Self;
4222        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4223            value
4224        }
4225    }
4226
4227    unsafe impl fidl::encoding::TypeMarker for EffectiveRouteProperties {
4228        type Owned = Self;
4229
4230        #[inline(always)]
4231        fn inline_align(_context: fidl::encoding::Context) -> usize {
4232            8
4233        }
4234
4235        #[inline(always)]
4236        fn inline_size(_context: fidl::encoding::Context) -> usize {
4237            16
4238        }
4239    }
4240
4241    unsafe impl<D: fidl::encoding::ResourceDialect>
4242        fidl::encoding::Encode<EffectiveRouteProperties, D> for &EffectiveRouteProperties
4243    {
4244        unsafe fn encode(
4245            self,
4246            encoder: &mut fidl::encoding::Encoder<'_, D>,
4247            offset: usize,
4248            mut depth: fidl::encoding::Depth,
4249        ) -> fidl::Result<()> {
4250            encoder.debug_check_bounds::<EffectiveRouteProperties>(offset);
4251            // Vector header
4252            let max_ordinal: u64 = self.max_ordinal_present();
4253            encoder.write_num(max_ordinal, offset);
4254            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4255            // Calling encoder.out_of_line_offset(0) is not allowed.
4256            if max_ordinal == 0 {
4257                return Ok(());
4258            }
4259            depth.increment()?;
4260            let envelope_size = 8;
4261            let bytes_len = max_ordinal as usize * envelope_size;
4262            #[allow(unused_variables)]
4263            let offset = encoder.out_of_line_offset(bytes_len);
4264            let mut _prev_end_offset: usize = 0;
4265            if 1 > max_ordinal {
4266                return Ok(());
4267            }
4268
4269            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4270            // are envelope_size bytes.
4271            let cur_offset: usize = (1 - 1) * envelope_size;
4272
4273            // Zero reserved fields.
4274            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4275
4276            // Safety:
4277            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4278            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4279            //   envelope_size bytes, there is always sufficient room.
4280            fidl::encoding::encode_in_envelope_optional::<u32, D>(
4281                self.metric.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4282                encoder,
4283                offset + cur_offset,
4284                depth,
4285            )?;
4286
4287            _prev_end_offset = cur_offset + envelope_size;
4288
4289            Ok(())
4290        }
4291    }
4292
4293    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4294        for EffectiveRouteProperties
4295    {
4296        #[inline(always)]
4297        fn new_empty() -> Self {
4298            Self::default()
4299        }
4300
4301        unsafe fn decode(
4302            &mut self,
4303            decoder: &mut fidl::encoding::Decoder<'_, D>,
4304            offset: usize,
4305            mut depth: fidl::encoding::Depth,
4306        ) -> fidl::Result<()> {
4307            decoder.debug_check_bounds::<Self>(offset);
4308            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4309                None => return Err(fidl::Error::NotNullable),
4310                Some(len) => len,
4311            };
4312            // Calling decoder.out_of_line_offset(0) is not allowed.
4313            if len == 0 {
4314                return Ok(());
4315            };
4316            depth.increment()?;
4317            let envelope_size = 8;
4318            let bytes_len = len * envelope_size;
4319            let offset = decoder.out_of_line_offset(bytes_len)?;
4320            // Decode the envelope for each type.
4321            let mut _next_ordinal_to_read = 0;
4322            let mut next_offset = offset;
4323            let end_offset = offset + bytes_len;
4324            _next_ordinal_to_read += 1;
4325            if next_offset >= end_offset {
4326                return Ok(());
4327            }
4328
4329            // Decode unknown envelopes for gaps in ordinals.
4330            while _next_ordinal_to_read < 1 {
4331                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4332                _next_ordinal_to_read += 1;
4333                next_offset += envelope_size;
4334            }
4335
4336            let next_out_of_line = decoder.next_out_of_line();
4337            let handles_before = decoder.remaining_handles();
4338            if let Some((inlined, num_bytes, num_handles)) =
4339                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4340            {
4341                let member_inline_size =
4342                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4343                if inlined != (member_inline_size <= 4) {
4344                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4345                }
4346                let inner_offset;
4347                let mut inner_depth = depth.clone();
4348                if inlined {
4349                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4350                    inner_offset = next_offset;
4351                } else {
4352                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4353                    inner_depth.increment()?;
4354                }
4355                let val_ref = self.metric.get_or_insert_with(|| fidl::new_empty!(u32, D));
4356                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
4357                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4358                {
4359                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4360                }
4361                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4362                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4363                }
4364            }
4365
4366            next_offset += envelope_size;
4367
4368            // Decode the remaining unknown envelopes.
4369            while next_offset < end_offset {
4370                _next_ordinal_to_read += 1;
4371                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4372                next_offset += envelope_size;
4373            }
4374
4375            Ok(())
4376        }
4377    }
4378
4379    impl InstalledRouteV4 {
4380        #[inline(always)]
4381        fn max_ordinal_present(&self) -> u64 {
4382            if let Some(_) = self.table_id {
4383                return 3;
4384            }
4385            if let Some(_) = self.effective_properties {
4386                return 2;
4387            }
4388            if let Some(_) = self.route {
4389                return 1;
4390            }
4391            0
4392        }
4393    }
4394
4395    impl fidl::encoding::ValueTypeMarker for InstalledRouteV4 {
4396        type Borrowed<'a> = &'a Self;
4397        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4398            value
4399        }
4400    }
4401
4402    unsafe impl fidl::encoding::TypeMarker for InstalledRouteV4 {
4403        type Owned = Self;
4404
4405        #[inline(always)]
4406        fn inline_align(_context: fidl::encoding::Context) -> usize {
4407            8
4408        }
4409
4410        #[inline(always)]
4411        fn inline_size(_context: fidl::encoding::Context) -> usize {
4412            16
4413        }
4414    }
4415
4416    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InstalledRouteV4, D>
4417        for &InstalledRouteV4
4418    {
4419        unsafe fn encode(
4420            self,
4421            encoder: &mut fidl::encoding::Encoder<'_, D>,
4422            offset: usize,
4423            mut depth: fidl::encoding::Depth,
4424        ) -> fidl::Result<()> {
4425            encoder.debug_check_bounds::<InstalledRouteV4>(offset);
4426            // Vector header
4427            let max_ordinal: u64 = self.max_ordinal_present();
4428            encoder.write_num(max_ordinal, offset);
4429            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4430            // Calling encoder.out_of_line_offset(0) is not allowed.
4431            if max_ordinal == 0 {
4432                return Ok(());
4433            }
4434            depth.increment()?;
4435            let envelope_size = 8;
4436            let bytes_len = max_ordinal as usize * envelope_size;
4437            #[allow(unused_variables)]
4438            let offset = encoder.out_of_line_offset(bytes_len);
4439            let mut _prev_end_offset: usize = 0;
4440            if 1 > max_ordinal {
4441                return Ok(());
4442            }
4443
4444            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4445            // are envelope_size bytes.
4446            let cur_offset: usize = (1 - 1) * envelope_size;
4447
4448            // Zero reserved fields.
4449            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4450
4451            // Safety:
4452            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4453            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4454            //   envelope_size bytes, there is always sufficient room.
4455            fidl::encoding::encode_in_envelope_optional::<RouteV4, D>(
4456                self.route.as_ref().map(<RouteV4 as fidl::encoding::ValueTypeMarker>::borrow),
4457                encoder,
4458                offset + cur_offset,
4459                depth,
4460            )?;
4461
4462            _prev_end_offset = cur_offset + envelope_size;
4463            if 2 > max_ordinal {
4464                return Ok(());
4465            }
4466
4467            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4468            // are envelope_size bytes.
4469            let cur_offset: usize = (2 - 1) * envelope_size;
4470
4471            // Zero reserved fields.
4472            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4473
4474            // Safety:
4475            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4476            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4477            //   envelope_size bytes, there is always sufficient room.
4478            fidl::encoding::encode_in_envelope_optional::<EffectiveRouteProperties, D>(
4479                self.effective_properties
4480                    .as_ref()
4481                    .map(<EffectiveRouteProperties as fidl::encoding::ValueTypeMarker>::borrow),
4482                encoder,
4483                offset + cur_offset,
4484                depth,
4485            )?;
4486
4487            _prev_end_offset = cur_offset + envelope_size;
4488            if 3 > max_ordinal {
4489                return Ok(());
4490            }
4491
4492            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4493            // are envelope_size bytes.
4494            let cur_offset: usize = (3 - 1) * envelope_size;
4495
4496            // Zero reserved fields.
4497            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4498
4499            // Safety:
4500            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4501            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4502            //   envelope_size bytes, there is always sufficient room.
4503            fidl::encoding::encode_in_envelope_optional::<u32, D>(
4504                self.table_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4505                encoder,
4506                offset + cur_offset,
4507                depth,
4508            )?;
4509
4510            _prev_end_offset = cur_offset + envelope_size;
4511
4512            Ok(())
4513        }
4514    }
4515
4516    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InstalledRouteV4 {
4517        #[inline(always)]
4518        fn new_empty() -> Self {
4519            Self::default()
4520        }
4521
4522        unsafe fn decode(
4523            &mut self,
4524            decoder: &mut fidl::encoding::Decoder<'_, D>,
4525            offset: usize,
4526            mut depth: fidl::encoding::Depth,
4527        ) -> fidl::Result<()> {
4528            decoder.debug_check_bounds::<Self>(offset);
4529            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4530                None => return Err(fidl::Error::NotNullable),
4531                Some(len) => len,
4532            };
4533            // Calling decoder.out_of_line_offset(0) is not allowed.
4534            if len == 0 {
4535                return Ok(());
4536            };
4537            depth.increment()?;
4538            let envelope_size = 8;
4539            let bytes_len = len * envelope_size;
4540            let offset = decoder.out_of_line_offset(bytes_len)?;
4541            // Decode the envelope for each type.
4542            let mut _next_ordinal_to_read = 0;
4543            let mut next_offset = offset;
4544            let end_offset = offset + bytes_len;
4545            _next_ordinal_to_read += 1;
4546            if next_offset >= end_offset {
4547                return Ok(());
4548            }
4549
4550            // Decode unknown envelopes for gaps in ordinals.
4551            while _next_ordinal_to_read < 1 {
4552                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4553                _next_ordinal_to_read += 1;
4554                next_offset += envelope_size;
4555            }
4556
4557            let next_out_of_line = decoder.next_out_of_line();
4558            let handles_before = decoder.remaining_handles();
4559            if let Some((inlined, num_bytes, num_handles)) =
4560                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4561            {
4562                let member_inline_size =
4563                    <RouteV4 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4564                if inlined != (member_inline_size <= 4) {
4565                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4566                }
4567                let inner_offset;
4568                let mut inner_depth = depth.clone();
4569                if inlined {
4570                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4571                    inner_offset = next_offset;
4572                } else {
4573                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4574                    inner_depth.increment()?;
4575                }
4576                let val_ref = self.route.get_or_insert_with(|| fidl::new_empty!(RouteV4, D));
4577                fidl::decode!(RouteV4, D, val_ref, decoder, inner_offset, inner_depth)?;
4578                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4579                {
4580                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4581                }
4582                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4583                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4584                }
4585            }
4586
4587            next_offset += envelope_size;
4588            _next_ordinal_to_read += 1;
4589            if next_offset >= end_offset {
4590                return Ok(());
4591            }
4592
4593            // Decode unknown envelopes for gaps in ordinals.
4594            while _next_ordinal_to_read < 2 {
4595                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4596                _next_ordinal_to_read += 1;
4597                next_offset += envelope_size;
4598            }
4599
4600            let next_out_of_line = decoder.next_out_of_line();
4601            let handles_before = decoder.remaining_handles();
4602            if let Some((inlined, num_bytes, num_handles)) =
4603                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4604            {
4605                let member_inline_size =
4606                    <EffectiveRouteProperties as fidl::encoding::TypeMarker>::inline_size(
4607                        decoder.context,
4608                    );
4609                if inlined != (member_inline_size <= 4) {
4610                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4611                }
4612                let inner_offset;
4613                let mut inner_depth = depth.clone();
4614                if inlined {
4615                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4616                    inner_offset = next_offset;
4617                } else {
4618                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4619                    inner_depth.increment()?;
4620                }
4621                let val_ref = self
4622                    .effective_properties
4623                    .get_or_insert_with(|| fidl::new_empty!(EffectiveRouteProperties, D));
4624                fidl::decode!(
4625                    EffectiveRouteProperties,
4626                    D,
4627                    val_ref,
4628                    decoder,
4629                    inner_offset,
4630                    inner_depth
4631                )?;
4632                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4633                {
4634                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4635                }
4636                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4637                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4638                }
4639            }
4640
4641            next_offset += envelope_size;
4642            _next_ordinal_to_read += 1;
4643            if next_offset >= end_offset {
4644                return Ok(());
4645            }
4646
4647            // Decode unknown envelopes for gaps in ordinals.
4648            while _next_ordinal_to_read < 3 {
4649                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4650                _next_ordinal_to_read += 1;
4651                next_offset += envelope_size;
4652            }
4653
4654            let next_out_of_line = decoder.next_out_of_line();
4655            let handles_before = decoder.remaining_handles();
4656            if let Some((inlined, num_bytes, num_handles)) =
4657                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4658            {
4659                let member_inline_size =
4660                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4661                if inlined != (member_inline_size <= 4) {
4662                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4663                }
4664                let inner_offset;
4665                let mut inner_depth = depth.clone();
4666                if inlined {
4667                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4668                    inner_offset = next_offset;
4669                } else {
4670                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4671                    inner_depth.increment()?;
4672                }
4673                let val_ref = self.table_id.get_or_insert_with(|| fidl::new_empty!(u32, D));
4674                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
4675                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4676                {
4677                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4678                }
4679                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4680                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4681                }
4682            }
4683
4684            next_offset += envelope_size;
4685
4686            // Decode the remaining unknown envelopes.
4687            while next_offset < end_offset {
4688                _next_ordinal_to_read += 1;
4689                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4690                next_offset += envelope_size;
4691            }
4692
4693            Ok(())
4694        }
4695    }
4696
4697    impl InstalledRouteV6 {
4698        #[inline(always)]
4699        fn max_ordinal_present(&self) -> u64 {
4700            if let Some(_) = self.table_id {
4701                return 3;
4702            }
4703            if let Some(_) = self.effective_properties {
4704                return 2;
4705            }
4706            if let Some(_) = self.route {
4707                return 1;
4708            }
4709            0
4710        }
4711    }
4712
4713    impl fidl::encoding::ValueTypeMarker for InstalledRouteV6 {
4714        type Borrowed<'a> = &'a Self;
4715        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4716            value
4717        }
4718    }
4719
4720    unsafe impl fidl::encoding::TypeMarker for InstalledRouteV6 {
4721        type Owned = Self;
4722
4723        #[inline(always)]
4724        fn inline_align(_context: fidl::encoding::Context) -> usize {
4725            8
4726        }
4727
4728        #[inline(always)]
4729        fn inline_size(_context: fidl::encoding::Context) -> usize {
4730            16
4731        }
4732    }
4733
4734    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InstalledRouteV6, D>
4735        for &InstalledRouteV6
4736    {
4737        unsafe fn encode(
4738            self,
4739            encoder: &mut fidl::encoding::Encoder<'_, D>,
4740            offset: usize,
4741            mut depth: fidl::encoding::Depth,
4742        ) -> fidl::Result<()> {
4743            encoder.debug_check_bounds::<InstalledRouteV6>(offset);
4744            // Vector header
4745            let max_ordinal: u64 = self.max_ordinal_present();
4746            encoder.write_num(max_ordinal, offset);
4747            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4748            // Calling encoder.out_of_line_offset(0) is not allowed.
4749            if max_ordinal == 0 {
4750                return Ok(());
4751            }
4752            depth.increment()?;
4753            let envelope_size = 8;
4754            let bytes_len = max_ordinal as usize * envelope_size;
4755            #[allow(unused_variables)]
4756            let offset = encoder.out_of_line_offset(bytes_len);
4757            let mut _prev_end_offset: usize = 0;
4758            if 1 > max_ordinal {
4759                return Ok(());
4760            }
4761
4762            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4763            // are envelope_size bytes.
4764            let cur_offset: usize = (1 - 1) * envelope_size;
4765
4766            // Zero reserved fields.
4767            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4768
4769            // Safety:
4770            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4771            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4772            //   envelope_size bytes, there is always sufficient room.
4773            fidl::encoding::encode_in_envelope_optional::<RouteV6, D>(
4774                self.route.as_ref().map(<RouteV6 as fidl::encoding::ValueTypeMarker>::borrow),
4775                encoder,
4776                offset + cur_offset,
4777                depth,
4778            )?;
4779
4780            _prev_end_offset = cur_offset + envelope_size;
4781            if 2 > max_ordinal {
4782                return Ok(());
4783            }
4784
4785            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4786            // are envelope_size bytes.
4787            let cur_offset: usize = (2 - 1) * envelope_size;
4788
4789            // Zero reserved fields.
4790            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4791
4792            // Safety:
4793            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4794            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4795            //   envelope_size bytes, there is always sufficient room.
4796            fidl::encoding::encode_in_envelope_optional::<EffectiveRouteProperties, D>(
4797                self.effective_properties
4798                    .as_ref()
4799                    .map(<EffectiveRouteProperties as fidl::encoding::ValueTypeMarker>::borrow),
4800                encoder,
4801                offset + cur_offset,
4802                depth,
4803            )?;
4804
4805            _prev_end_offset = cur_offset + envelope_size;
4806            if 3 > max_ordinal {
4807                return Ok(());
4808            }
4809
4810            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4811            // are envelope_size bytes.
4812            let cur_offset: usize = (3 - 1) * envelope_size;
4813
4814            // Zero reserved fields.
4815            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4816
4817            // Safety:
4818            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4819            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4820            //   envelope_size bytes, there is always sufficient room.
4821            fidl::encoding::encode_in_envelope_optional::<u32, D>(
4822                self.table_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4823                encoder,
4824                offset + cur_offset,
4825                depth,
4826            )?;
4827
4828            _prev_end_offset = cur_offset + envelope_size;
4829
4830            Ok(())
4831        }
4832    }
4833
4834    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InstalledRouteV6 {
4835        #[inline(always)]
4836        fn new_empty() -> Self {
4837            Self::default()
4838        }
4839
4840        unsafe fn decode(
4841            &mut self,
4842            decoder: &mut fidl::encoding::Decoder<'_, D>,
4843            offset: usize,
4844            mut depth: fidl::encoding::Depth,
4845        ) -> fidl::Result<()> {
4846            decoder.debug_check_bounds::<Self>(offset);
4847            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4848                None => return Err(fidl::Error::NotNullable),
4849                Some(len) => len,
4850            };
4851            // Calling decoder.out_of_line_offset(0) is not allowed.
4852            if len == 0 {
4853                return Ok(());
4854            };
4855            depth.increment()?;
4856            let envelope_size = 8;
4857            let bytes_len = len * envelope_size;
4858            let offset = decoder.out_of_line_offset(bytes_len)?;
4859            // Decode the envelope for each type.
4860            let mut _next_ordinal_to_read = 0;
4861            let mut next_offset = offset;
4862            let end_offset = offset + bytes_len;
4863            _next_ordinal_to_read += 1;
4864            if next_offset >= end_offset {
4865                return Ok(());
4866            }
4867
4868            // Decode unknown envelopes for gaps in ordinals.
4869            while _next_ordinal_to_read < 1 {
4870                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4871                _next_ordinal_to_read += 1;
4872                next_offset += envelope_size;
4873            }
4874
4875            let next_out_of_line = decoder.next_out_of_line();
4876            let handles_before = decoder.remaining_handles();
4877            if let Some((inlined, num_bytes, num_handles)) =
4878                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4879            {
4880                let member_inline_size =
4881                    <RouteV6 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4882                if inlined != (member_inline_size <= 4) {
4883                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4884                }
4885                let inner_offset;
4886                let mut inner_depth = depth.clone();
4887                if inlined {
4888                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4889                    inner_offset = next_offset;
4890                } else {
4891                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4892                    inner_depth.increment()?;
4893                }
4894                let val_ref = self.route.get_or_insert_with(|| fidl::new_empty!(RouteV6, D));
4895                fidl::decode!(RouteV6, D, val_ref, decoder, inner_offset, inner_depth)?;
4896                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4897                {
4898                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4899                }
4900                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4901                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4902                }
4903            }
4904
4905            next_offset += envelope_size;
4906            _next_ordinal_to_read += 1;
4907            if next_offset >= end_offset {
4908                return Ok(());
4909            }
4910
4911            // Decode unknown envelopes for gaps in ordinals.
4912            while _next_ordinal_to_read < 2 {
4913                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4914                _next_ordinal_to_read += 1;
4915                next_offset += envelope_size;
4916            }
4917
4918            let next_out_of_line = decoder.next_out_of_line();
4919            let handles_before = decoder.remaining_handles();
4920            if let Some((inlined, num_bytes, num_handles)) =
4921                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4922            {
4923                let member_inline_size =
4924                    <EffectiveRouteProperties as fidl::encoding::TypeMarker>::inline_size(
4925                        decoder.context,
4926                    );
4927                if inlined != (member_inline_size <= 4) {
4928                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4929                }
4930                let inner_offset;
4931                let mut inner_depth = depth.clone();
4932                if inlined {
4933                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4934                    inner_offset = next_offset;
4935                } else {
4936                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4937                    inner_depth.increment()?;
4938                }
4939                let val_ref = self
4940                    .effective_properties
4941                    .get_or_insert_with(|| fidl::new_empty!(EffectiveRouteProperties, D));
4942                fidl::decode!(
4943                    EffectiveRouteProperties,
4944                    D,
4945                    val_ref,
4946                    decoder,
4947                    inner_offset,
4948                    inner_depth
4949                )?;
4950                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4951                {
4952                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4953                }
4954                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4955                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4956                }
4957            }
4958
4959            next_offset += envelope_size;
4960            _next_ordinal_to_read += 1;
4961            if next_offset >= end_offset {
4962                return Ok(());
4963            }
4964
4965            // Decode unknown envelopes for gaps in ordinals.
4966            while _next_ordinal_to_read < 3 {
4967                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4968                _next_ordinal_to_read += 1;
4969                next_offset += envelope_size;
4970            }
4971
4972            let next_out_of_line = decoder.next_out_of_line();
4973            let handles_before = decoder.remaining_handles();
4974            if let Some((inlined, num_bytes, num_handles)) =
4975                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4976            {
4977                let member_inline_size =
4978                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4979                if inlined != (member_inline_size <= 4) {
4980                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4981                }
4982                let inner_offset;
4983                let mut inner_depth = depth.clone();
4984                if inlined {
4985                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4986                    inner_offset = next_offset;
4987                } else {
4988                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4989                    inner_depth.increment()?;
4990                }
4991                let val_ref = self.table_id.get_or_insert_with(|| fidl::new_empty!(u32, D));
4992                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
4993                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4994                {
4995                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4996                }
4997                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4998                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4999                }
5000            }
5001
5002            next_offset += envelope_size;
5003
5004            // Decode the remaining unknown envelopes.
5005            while next_offset < end_offset {
5006                _next_ordinal_to_read += 1;
5007                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5008                next_offset += envelope_size;
5009            }
5010
5011            Ok(())
5012        }
5013    }
5014
5015    impl ResolveOptions {
5016        #[inline(always)]
5017        fn max_ordinal_present(&self) -> u64 {
5018            if let Some(_) = self.marks {
5019                return 1;
5020            }
5021            0
5022        }
5023    }
5024
5025    impl fidl::encoding::ValueTypeMarker for ResolveOptions {
5026        type Borrowed<'a> = &'a Self;
5027        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5028            value
5029        }
5030    }
5031
5032    unsafe impl fidl::encoding::TypeMarker for ResolveOptions {
5033        type Owned = Self;
5034
5035        #[inline(always)]
5036        fn inline_align(_context: fidl::encoding::Context) -> usize {
5037            8
5038        }
5039
5040        #[inline(always)]
5041        fn inline_size(_context: fidl::encoding::Context) -> usize {
5042            16
5043        }
5044    }
5045
5046    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResolveOptions, D>
5047        for &ResolveOptions
5048    {
5049        unsafe fn encode(
5050            self,
5051            encoder: &mut fidl::encoding::Encoder<'_, D>,
5052            offset: usize,
5053            mut depth: fidl::encoding::Depth,
5054        ) -> fidl::Result<()> {
5055            encoder.debug_check_bounds::<ResolveOptions>(offset);
5056            // Vector header
5057            let max_ordinal: u64 = self.max_ordinal_present();
5058            encoder.write_num(max_ordinal, offset);
5059            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5060            // Calling encoder.out_of_line_offset(0) is not allowed.
5061            if max_ordinal == 0 {
5062                return Ok(());
5063            }
5064            depth.increment()?;
5065            let envelope_size = 8;
5066            let bytes_len = max_ordinal as usize * envelope_size;
5067            #[allow(unused_variables)]
5068            let offset = encoder.out_of_line_offset(bytes_len);
5069            let mut _prev_end_offset: usize = 0;
5070            if 1 > max_ordinal {
5071                return Ok(());
5072            }
5073
5074            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5075            // are envelope_size bytes.
5076            let cur_offset: usize = (1 - 1) * envelope_size;
5077
5078            // Zero reserved fields.
5079            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5080
5081            // Safety:
5082            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5083            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5084            //   envelope_size bytes, there is always sufficient room.
5085            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::Marks, D>(
5086                self.marks.as_ref().map(
5087                    <fidl_fuchsia_net__common::Marks as fidl::encoding::ValueTypeMarker>::borrow,
5088                ),
5089                encoder,
5090                offset + cur_offset,
5091                depth,
5092            )?;
5093
5094            _prev_end_offset = cur_offset + envelope_size;
5095
5096            Ok(())
5097        }
5098    }
5099
5100    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolveOptions {
5101        #[inline(always)]
5102        fn new_empty() -> Self {
5103            Self::default()
5104        }
5105
5106        unsafe fn decode(
5107            &mut self,
5108            decoder: &mut fidl::encoding::Decoder<'_, D>,
5109            offset: usize,
5110            mut depth: fidl::encoding::Depth,
5111        ) -> fidl::Result<()> {
5112            decoder.debug_check_bounds::<Self>(offset);
5113            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5114                None => return Err(fidl::Error::NotNullable),
5115                Some(len) => len,
5116            };
5117            // Calling decoder.out_of_line_offset(0) is not allowed.
5118            if len == 0 {
5119                return Ok(());
5120            };
5121            depth.increment()?;
5122            let envelope_size = 8;
5123            let bytes_len = len * envelope_size;
5124            let offset = decoder.out_of_line_offset(bytes_len)?;
5125            // Decode the envelope for each type.
5126            let mut _next_ordinal_to_read = 0;
5127            let mut next_offset = offset;
5128            let end_offset = offset + bytes_len;
5129            _next_ordinal_to_read += 1;
5130            if next_offset >= end_offset {
5131                return Ok(());
5132            }
5133
5134            // Decode unknown envelopes for gaps in ordinals.
5135            while _next_ordinal_to_read < 1 {
5136                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5137                _next_ordinal_to_read += 1;
5138                next_offset += envelope_size;
5139            }
5140
5141            let next_out_of_line = decoder.next_out_of_line();
5142            let handles_before = decoder.remaining_handles();
5143            if let Some((inlined, num_bytes, num_handles)) =
5144                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5145            {
5146                let member_inline_size =
5147                    <fidl_fuchsia_net__common::Marks as fidl::encoding::TypeMarker>::inline_size(
5148                        decoder.context,
5149                    );
5150                if inlined != (member_inline_size <= 4) {
5151                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5152                }
5153                let inner_offset;
5154                let mut inner_depth = depth.clone();
5155                if inlined {
5156                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5157                    inner_offset = next_offset;
5158                } else {
5159                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5160                    inner_depth.increment()?;
5161                }
5162                let val_ref = self
5163                    .marks
5164                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net__common::Marks, D));
5165                fidl::decode!(
5166                    fidl_fuchsia_net__common::Marks,
5167                    D,
5168                    val_ref,
5169                    decoder,
5170                    inner_offset,
5171                    inner_depth
5172                )?;
5173                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5174                {
5175                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5176                }
5177                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5178                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5179                }
5180            }
5181
5182            next_offset += envelope_size;
5183
5184            // Decode the remaining unknown envelopes.
5185            while next_offset < end_offset {
5186                _next_ordinal_to_read += 1;
5187                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5188                next_offset += envelope_size;
5189            }
5190
5191            Ok(())
5192        }
5193    }
5194
5195    impl RoutePropertiesV4 {
5196        #[inline(always)]
5197        fn max_ordinal_present(&self) -> u64 {
5198            if let Some(_) = self.specified_properties {
5199                return 1;
5200            }
5201            0
5202        }
5203    }
5204
5205    impl fidl::encoding::ValueTypeMarker for RoutePropertiesV4 {
5206        type Borrowed<'a> = &'a Self;
5207        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5208            value
5209        }
5210    }
5211
5212    unsafe impl fidl::encoding::TypeMarker for RoutePropertiesV4 {
5213        type Owned = Self;
5214
5215        #[inline(always)]
5216        fn inline_align(_context: fidl::encoding::Context) -> usize {
5217            8
5218        }
5219
5220        #[inline(always)]
5221        fn inline_size(_context: fidl::encoding::Context) -> usize {
5222            16
5223        }
5224    }
5225
5226    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RoutePropertiesV4, D>
5227        for &RoutePropertiesV4
5228    {
5229        unsafe fn encode(
5230            self,
5231            encoder: &mut fidl::encoding::Encoder<'_, D>,
5232            offset: usize,
5233            mut depth: fidl::encoding::Depth,
5234        ) -> fidl::Result<()> {
5235            encoder.debug_check_bounds::<RoutePropertiesV4>(offset);
5236            // Vector header
5237            let max_ordinal: u64 = self.max_ordinal_present();
5238            encoder.write_num(max_ordinal, offset);
5239            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5240            // Calling encoder.out_of_line_offset(0) is not allowed.
5241            if max_ordinal == 0 {
5242                return Ok(());
5243            }
5244            depth.increment()?;
5245            let envelope_size = 8;
5246            let bytes_len = max_ordinal as usize * envelope_size;
5247            #[allow(unused_variables)]
5248            let offset = encoder.out_of_line_offset(bytes_len);
5249            let mut _prev_end_offset: usize = 0;
5250            if 1 > max_ordinal {
5251                return Ok(());
5252            }
5253
5254            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5255            // are envelope_size bytes.
5256            let cur_offset: usize = (1 - 1) * envelope_size;
5257
5258            // Zero reserved fields.
5259            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5260
5261            // Safety:
5262            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5263            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5264            //   envelope_size bytes, there is always sufficient room.
5265            fidl::encoding::encode_in_envelope_optional::<SpecifiedRouteProperties, D>(
5266                self.specified_properties
5267                    .as_ref()
5268                    .map(<SpecifiedRouteProperties as fidl::encoding::ValueTypeMarker>::borrow),
5269                encoder,
5270                offset + cur_offset,
5271                depth,
5272            )?;
5273
5274            _prev_end_offset = cur_offset + envelope_size;
5275
5276            Ok(())
5277        }
5278    }
5279
5280    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RoutePropertiesV4 {
5281        #[inline(always)]
5282        fn new_empty() -> Self {
5283            Self::default()
5284        }
5285
5286        unsafe fn decode(
5287            &mut self,
5288            decoder: &mut fidl::encoding::Decoder<'_, D>,
5289            offset: usize,
5290            mut depth: fidl::encoding::Depth,
5291        ) -> fidl::Result<()> {
5292            decoder.debug_check_bounds::<Self>(offset);
5293            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5294                None => return Err(fidl::Error::NotNullable),
5295                Some(len) => len,
5296            };
5297            // Calling decoder.out_of_line_offset(0) is not allowed.
5298            if len == 0 {
5299                return Ok(());
5300            };
5301            depth.increment()?;
5302            let envelope_size = 8;
5303            let bytes_len = len * envelope_size;
5304            let offset = decoder.out_of_line_offset(bytes_len)?;
5305            // Decode the envelope for each type.
5306            let mut _next_ordinal_to_read = 0;
5307            let mut next_offset = offset;
5308            let end_offset = offset + bytes_len;
5309            _next_ordinal_to_read += 1;
5310            if next_offset >= end_offset {
5311                return Ok(());
5312            }
5313
5314            // Decode unknown envelopes for gaps in ordinals.
5315            while _next_ordinal_to_read < 1 {
5316                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5317                _next_ordinal_to_read += 1;
5318                next_offset += envelope_size;
5319            }
5320
5321            let next_out_of_line = decoder.next_out_of_line();
5322            let handles_before = decoder.remaining_handles();
5323            if let Some((inlined, num_bytes, num_handles)) =
5324                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5325            {
5326                let member_inline_size =
5327                    <SpecifiedRouteProperties as fidl::encoding::TypeMarker>::inline_size(
5328                        decoder.context,
5329                    );
5330                if inlined != (member_inline_size <= 4) {
5331                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5332                }
5333                let inner_offset;
5334                let mut inner_depth = depth.clone();
5335                if inlined {
5336                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5337                    inner_offset = next_offset;
5338                } else {
5339                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5340                    inner_depth.increment()?;
5341                }
5342                let val_ref = self
5343                    .specified_properties
5344                    .get_or_insert_with(|| fidl::new_empty!(SpecifiedRouteProperties, D));
5345                fidl::decode!(
5346                    SpecifiedRouteProperties,
5347                    D,
5348                    val_ref,
5349                    decoder,
5350                    inner_offset,
5351                    inner_depth
5352                )?;
5353                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5354                {
5355                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5356                }
5357                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5358                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5359                }
5360            }
5361
5362            next_offset += envelope_size;
5363
5364            // Decode the remaining unknown envelopes.
5365            while next_offset < end_offset {
5366                _next_ordinal_to_read += 1;
5367                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5368                next_offset += envelope_size;
5369            }
5370
5371            Ok(())
5372        }
5373    }
5374
5375    impl RoutePropertiesV6 {
5376        #[inline(always)]
5377        fn max_ordinal_present(&self) -> u64 {
5378            if let Some(_) = self.specified_properties {
5379                return 1;
5380            }
5381            0
5382        }
5383    }
5384
5385    impl fidl::encoding::ValueTypeMarker for RoutePropertiesV6 {
5386        type Borrowed<'a> = &'a Self;
5387        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5388            value
5389        }
5390    }
5391
5392    unsafe impl fidl::encoding::TypeMarker for RoutePropertiesV6 {
5393        type Owned = Self;
5394
5395        #[inline(always)]
5396        fn inline_align(_context: fidl::encoding::Context) -> usize {
5397            8
5398        }
5399
5400        #[inline(always)]
5401        fn inline_size(_context: fidl::encoding::Context) -> usize {
5402            16
5403        }
5404    }
5405
5406    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RoutePropertiesV6, D>
5407        for &RoutePropertiesV6
5408    {
5409        unsafe fn encode(
5410            self,
5411            encoder: &mut fidl::encoding::Encoder<'_, D>,
5412            offset: usize,
5413            mut depth: fidl::encoding::Depth,
5414        ) -> fidl::Result<()> {
5415            encoder.debug_check_bounds::<RoutePropertiesV6>(offset);
5416            // Vector header
5417            let max_ordinal: u64 = self.max_ordinal_present();
5418            encoder.write_num(max_ordinal, offset);
5419            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5420            // Calling encoder.out_of_line_offset(0) is not allowed.
5421            if max_ordinal == 0 {
5422                return Ok(());
5423            }
5424            depth.increment()?;
5425            let envelope_size = 8;
5426            let bytes_len = max_ordinal as usize * envelope_size;
5427            #[allow(unused_variables)]
5428            let offset = encoder.out_of_line_offset(bytes_len);
5429            let mut _prev_end_offset: usize = 0;
5430            if 1 > max_ordinal {
5431                return Ok(());
5432            }
5433
5434            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5435            // are envelope_size bytes.
5436            let cur_offset: usize = (1 - 1) * envelope_size;
5437
5438            // Zero reserved fields.
5439            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5440
5441            // Safety:
5442            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5443            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5444            //   envelope_size bytes, there is always sufficient room.
5445            fidl::encoding::encode_in_envelope_optional::<SpecifiedRouteProperties, D>(
5446                self.specified_properties
5447                    .as_ref()
5448                    .map(<SpecifiedRouteProperties as fidl::encoding::ValueTypeMarker>::borrow),
5449                encoder,
5450                offset + cur_offset,
5451                depth,
5452            )?;
5453
5454            _prev_end_offset = cur_offset + envelope_size;
5455
5456            Ok(())
5457        }
5458    }
5459
5460    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RoutePropertiesV6 {
5461        #[inline(always)]
5462        fn new_empty() -> Self {
5463            Self::default()
5464        }
5465
5466        unsafe fn decode(
5467            &mut self,
5468            decoder: &mut fidl::encoding::Decoder<'_, D>,
5469            offset: usize,
5470            mut depth: fidl::encoding::Depth,
5471        ) -> fidl::Result<()> {
5472            decoder.debug_check_bounds::<Self>(offset);
5473            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5474                None => return Err(fidl::Error::NotNullable),
5475                Some(len) => len,
5476            };
5477            // Calling decoder.out_of_line_offset(0) is not allowed.
5478            if len == 0 {
5479                return Ok(());
5480            };
5481            depth.increment()?;
5482            let envelope_size = 8;
5483            let bytes_len = len * envelope_size;
5484            let offset = decoder.out_of_line_offset(bytes_len)?;
5485            // Decode the envelope for each type.
5486            let mut _next_ordinal_to_read = 0;
5487            let mut next_offset = offset;
5488            let end_offset = offset + bytes_len;
5489            _next_ordinal_to_read += 1;
5490            if next_offset >= end_offset {
5491                return Ok(());
5492            }
5493
5494            // Decode unknown envelopes for gaps in ordinals.
5495            while _next_ordinal_to_read < 1 {
5496                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5497                _next_ordinal_to_read += 1;
5498                next_offset += envelope_size;
5499            }
5500
5501            let next_out_of_line = decoder.next_out_of_line();
5502            let handles_before = decoder.remaining_handles();
5503            if let Some((inlined, num_bytes, num_handles)) =
5504                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5505            {
5506                let member_inline_size =
5507                    <SpecifiedRouteProperties as fidl::encoding::TypeMarker>::inline_size(
5508                        decoder.context,
5509                    );
5510                if inlined != (member_inline_size <= 4) {
5511                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5512                }
5513                let inner_offset;
5514                let mut inner_depth = depth.clone();
5515                if inlined {
5516                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5517                    inner_offset = next_offset;
5518                } else {
5519                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5520                    inner_depth.increment()?;
5521                }
5522                let val_ref = self
5523                    .specified_properties
5524                    .get_or_insert_with(|| fidl::new_empty!(SpecifiedRouteProperties, D));
5525                fidl::decode!(
5526                    SpecifiedRouteProperties,
5527                    D,
5528                    val_ref,
5529                    decoder,
5530                    inner_offset,
5531                    inner_depth
5532                )?;
5533                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5534                {
5535                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5536                }
5537                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5538                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5539                }
5540            }
5541
5542            next_offset += envelope_size;
5543
5544            // Decode the remaining unknown envelopes.
5545            while next_offset < end_offset {
5546                _next_ordinal_to_read += 1;
5547                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5548                next_offset += envelope_size;
5549            }
5550
5551            Ok(())
5552        }
5553    }
5554
5555    impl RuleMatcherV4 {
5556        #[inline(always)]
5557        fn max_ordinal_present(&self) -> u64 {
5558            if let Some(_) = self.base {
5559                return 2;
5560            }
5561            if let Some(_) = self.from {
5562                return 1;
5563            }
5564            0
5565        }
5566    }
5567
5568    impl fidl::encoding::ValueTypeMarker for RuleMatcherV4 {
5569        type Borrowed<'a> = &'a Self;
5570        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5571            value
5572        }
5573    }
5574
5575    unsafe impl fidl::encoding::TypeMarker for RuleMatcherV4 {
5576        type Owned = Self;
5577
5578        #[inline(always)]
5579        fn inline_align(_context: fidl::encoding::Context) -> usize {
5580            8
5581        }
5582
5583        #[inline(always)]
5584        fn inline_size(_context: fidl::encoding::Context) -> usize {
5585            16
5586        }
5587    }
5588
5589    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RuleMatcherV4, D>
5590        for &RuleMatcherV4
5591    {
5592        unsafe fn encode(
5593            self,
5594            encoder: &mut fidl::encoding::Encoder<'_, D>,
5595            offset: usize,
5596            mut depth: fidl::encoding::Depth,
5597        ) -> fidl::Result<()> {
5598            encoder.debug_check_bounds::<RuleMatcherV4>(offset);
5599            // Vector header
5600            let max_ordinal: u64 = self.max_ordinal_present();
5601            encoder.write_num(max_ordinal, offset);
5602            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5603            // Calling encoder.out_of_line_offset(0) is not allowed.
5604            if max_ordinal == 0 {
5605                return Ok(());
5606            }
5607            depth.increment()?;
5608            let envelope_size = 8;
5609            let bytes_len = max_ordinal as usize * envelope_size;
5610            #[allow(unused_variables)]
5611            let offset = encoder.out_of_line_offset(bytes_len);
5612            let mut _prev_end_offset: usize = 0;
5613            if 1 > max_ordinal {
5614                return Ok(());
5615            }
5616
5617            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5618            // are envelope_size bytes.
5619            let cur_offset: usize = (1 - 1) * envelope_size;
5620
5621            // Zero reserved fields.
5622            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5623
5624            // Safety:
5625            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5626            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5627            //   envelope_size bytes, there is always sufficient room.
5628            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::Ipv4AddressWithPrefix, D>(
5629            self.from.as_ref().map(<fidl_fuchsia_net__common::Ipv4AddressWithPrefix as fidl::encoding::ValueTypeMarker>::borrow),
5630            encoder, offset + cur_offset, depth
5631        )?;
5632
5633            _prev_end_offset = cur_offset + envelope_size;
5634            if 2 > max_ordinal {
5635                return Ok(());
5636            }
5637
5638            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5639            // are envelope_size bytes.
5640            let cur_offset: usize = (2 - 1) * envelope_size;
5641
5642            // Zero reserved fields.
5643            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5644
5645            // Safety:
5646            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5647            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5648            //   envelope_size bytes, there is always sufficient room.
5649            fidl::encoding::encode_in_envelope_optional::<BaseMatcher, D>(
5650                self.base.as_ref().map(<BaseMatcher as fidl::encoding::ValueTypeMarker>::borrow),
5651                encoder,
5652                offset + cur_offset,
5653                depth,
5654            )?;
5655
5656            _prev_end_offset = cur_offset + envelope_size;
5657
5658            Ok(())
5659        }
5660    }
5661
5662    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RuleMatcherV4 {
5663        #[inline(always)]
5664        fn new_empty() -> Self {
5665            Self::default()
5666        }
5667
5668        unsafe fn decode(
5669            &mut self,
5670            decoder: &mut fidl::encoding::Decoder<'_, D>,
5671            offset: usize,
5672            mut depth: fidl::encoding::Depth,
5673        ) -> fidl::Result<()> {
5674            decoder.debug_check_bounds::<Self>(offset);
5675            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5676                None => return Err(fidl::Error::NotNullable),
5677                Some(len) => len,
5678            };
5679            // Calling decoder.out_of_line_offset(0) is not allowed.
5680            if len == 0 {
5681                return Ok(());
5682            };
5683            depth.increment()?;
5684            let envelope_size = 8;
5685            let bytes_len = len * envelope_size;
5686            let offset = decoder.out_of_line_offset(bytes_len)?;
5687            // Decode the envelope for each type.
5688            let mut _next_ordinal_to_read = 0;
5689            let mut next_offset = offset;
5690            let end_offset = offset + bytes_len;
5691            _next_ordinal_to_read += 1;
5692            if next_offset >= end_offset {
5693                return Ok(());
5694            }
5695
5696            // Decode unknown envelopes for gaps in ordinals.
5697            while _next_ordinal_to_read < 1 {
5698                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5699                _next_ordinal_to_read += 1;
5700                next_offset += envelope_size;
5701            }
5702
5703            let next_out_of_line = decoder.next_out_of_line();
5704            let handles_before = decoder.remaining_handles();
5705            if let Some((inlined, num_bytes, num_handles)) =
5706                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5707            {
5708                let member_inline_size = <fidl_fuchsia_net__common::Ipv4AddressWithPrefix as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5709                if inlined != (member_inline_size <= 4) {
5710                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5711                }
5712                let inner_offset;
5713                let mut inner_depth = depth.clone();
5714                if inlined {
5715                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5716                    inner_offset = next_offset;
5717                } else {
5718                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5719                    inner_depth.increment()?;
5720                }
5721                let val_ref = self.from.get_or_insert_with(|| {
5722                    fidl::new_empty!(fidl_fuchsia_net__common::Ipv4AddressWithPrefix, D)
5723                });
5724                fidl::decode!(
5725                    fidl_fuchsia_net__common::Ipv4AddressWithPrefix,
5726                    D,
5727                    val_ref,
5728                    decoder,
5729                    inner_offset,
5730                    inner_depth
5731                )?;
5732                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5733                {
5734                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5735                }
5736                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5737                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5738                }
5739            }
5740
5741            next_offset += envelope_size;
5742            _next_ordinal_to_read += 1;
5743            if next_offset >= end_offset {
5744                return Ok(());
5745            }
5746
5747            // Decode unknown envelopes for gaps in ordinals.
5748            while _next_ordinal_to_read < 2 {
5749                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5750                _next_ordinal_to_read += 1;
5751                next_offset += envelope_size;
5752            }
5753
5754            let next_out_of_line = decoder.next_out_of_line();
5755            let handles_before = decoder.remaining_handles();
5756            if let Some((inlined, num_bytes, num_handles)) =
5757                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5758            {
5759                let member_inline_size =
5760                    <BaseMatcher as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5761                if inlined != (member_inline_size <= 4) {
5762                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5763                }
5764                let inner_offset;
5765                let mut inner_depth = depth.clone();
5766                if inlined {
5767                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5768                    inner_offset = next_offset;
5769                } else {
5770                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5771                    inner_depth.increment()?;
5772                }
5773                let val_ref = self.base.get_or_insert_with(|| fidl::new_empty!(BaseMatcher, D));
5774                fidl::decode!(BaseMatcher, D, val_ref, decoder, inner_offset, inner_depth)?;
5775                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5776                {
5777                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5778                }
5779                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5780                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5781                }
5782            }
5783
5784            next_offset += envelope_size;
5785
5786            // Decode the remaining unknown envelopes.
5787            while next_offset < end_offset {
5788                _next_ordinal_to_read += 1;
5789                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5790                next_offset += envelope_size;
5791            }
5792
5793            Ok(())
5794        }
5795    }
5796
5797    impl RuleMatcherV6 {
5798        #[inline(always)]
5799        fn max_ordinal_present(&self) -> u64 {
5800            if let Some(_) = self.base {
5801                return 2;
5802            }
5803            if let Some(_) = self.from {
5804                return 1;
5805            }
5806            0
5807        }
5808    }
5809
5810    impl fidl::encoding::ValueTypeMarker for RuleMatcherV6 {
5811        type Borrowed<'a> = &'a Self;
5812        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5813            value
5814        }
5815    }
5816
5817    unsafe impl fidl::encoding::TypeMarker for RuleMatcherV6 {
5818        type Owned = Self;
5819
5820        #[inline(always)]
5821        fn inline_align(_context: fidl::encoding::Context) -> usize {
5822            8
5823        }
5824
5825        #[inline(always)]
5826        fn inline_size(_context: fidl::encoding::Context) -> usize {
5827            16
5828        }
5829    }
5830
5831    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RuleMatcherV6, D>
5832        for &RuleMatcherV6
5833    {
5834        unsafe fn encode(
5835            self,
5836            encoder: &mut fidl::encoding::Encoder<'_, D>,
5837            offset: usize,
5838            mut depth: fidl::encoding::Depth,
5839        ) -> fidl::Result<()> {
5840            encoder.debug_check_bounds::<RuleMatcherV6>(offset);
5841            // Vector header
5842            let max_ordinal: u64 = self.max_ordinal_present();
5843            encoder.write_num(max_ordinal, offset);
5844            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5845            // Calling encoder.out_of_line_offset(0) is not allowed.
5846            if max_ordinal == 0 {
5847                return Ok(());
5848            }
5849            depth.increment()?;
5850            let envelope_size = 8;
5851            let bytes_len = max_ordinal as usize * envelope_size;
5852            #[allow(unused_variables)]
5853            let offset = encoder.out_of_line_offset(bytes_len);
5854            let mut _prev_end_offset: usize = 0;
5855            if 1 > max_ordinal {
5856                return Ok(());
5857            }
5858
5859            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5860            // are envelope_size bytes.
5861            let cur_offset: usize = (1 - 1) * envelope_size;
5862
5863            // Zero reserved fields.
5864            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5865
5866            // Safety:
5867            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5868            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5869            //   envelope_size bytes, there is always sufficient room.
5870            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net__common::Ipv6AddressWithPrefix, D>(
5871            self.from.as_ref().map(<fidl_fuchsia_net__common::Ipv6AddressWithPrefix as fidl::encoding::ValueTypeMarker>::borrow),
5872            encoder, offset + cur_offset, depth
5873        )?;
5874
5875            _prev_end_offset = cur_offset + envelope_size;
5876            if 2 > max_ordinal {
5877                return Ok(());
5878            }
5879
5880            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5881            // are envelope_size bytes.
5882            let cur_offset: usize = (2 - 1) * envelope_size;
5883
5884            // Zero reserved fields.
5885            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5886
5887            // Safety:
5888            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5889            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5890            //   envelope_size bytes, there is always sufficient room.
5891            fidl::encoding::encode_in_envelope_optional::<BaseMatcher, D>(
5892                self.base.as_ref().map(<BaseMatcher as fidl::encoding::ValueTypeMarker>::borrow),
5893                encoder,
5894                offset + cur_offset,
5895                depth,
5896            )?;
5897
5898            _prev_end_offset = cur_offset + envelope_size;
5899
5900            Ok(())
5901        }
5902    }
5903
5904    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RuleMatcherV6 {
5905        #[inline(always)]
5906        fn new_empty() -> Self {
5907            Self::default()
5908        }
5909
5910        unsafe fn decode(
5911            &mut self,
5912            decoder: &mut fidl::encoding::Decoder<'_, D>,
5913            offset: usize,
5914            mut depth: fidl::encoding::Depth,
5915        ) -> fidl::Result<()> {
5916            decoder.debug_check_bounds::<Self>(offset);
5917            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5918                None => return Err(fidl::Error::NotNullable),
5919                Some(len) => len,
5920            };
5921            // Calling decoder.out_of_line_offset(0) is not allowed.
5922            if len == 0 {
5923                return Ok(());
5924            };
5925            depth.increment()?;
5926            let envelope_size = 8;
5927            let bytes_len = len * envelope_size;
5928            let offset = decoder.out_of_line_offset(bytes_len)?;
5929            // Decode the envelope for each type.
5930            let mut _next_ordinal_to_read = 0;
5931            let mut next_offset = offset;
5932            let end_offset = offset + bytes_len;
5933            _next_ordinal_to_read += 1;
5934            if next_offset >= end_offset {
5935                return Ok(());
5936            }
5937
5938            // Decode unknown envelopes for gaps in ordinals.
5939            while _next_ordinal_to_read < 1 {
5940                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5941                _next_ordinal_to_read += 1;
5942                next_offset += envelope_size;
5943            }
5944
5945            let next_out_of_line = decoder.next_out_of_line();
5946            let handles_before = decoder.remaining_handles();
5947            if let Some((inlined, num_bytes, num_handles)) =
5948                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5949            {
5950                let member_inline_size = <fidl_fuchsia_net__common::Ipv6AddressWithPrefix as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5951                if inlined != (member_inline_size <= 4) {
5952                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5953                }
5954                let inner_offset;
5955                let mut inner_depth = depth.clone();
5956                if inlined {
5957                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5958                    inner_offset = next_offset;
5959                } else {
5960                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5961                    inner_depth.increment()?;
5962                }
5963                let val_ref = self.from.get_or_insert_with(|| {
5964                    fidl::new_empty!(fidl_fuchsia_net__common::Ipv6AddressWithPrefix, D)
5965                });
5966                fidl::decode!(
5967                    fidl_fuchsia_net__common::Ipv6AddressWithPrefix,
5968                    D,
5969                    val_ref,
5970                    decoder,
5971                    inner_offset,
5972                    inner_depth
5973                )?;
5974                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5975                {
5976                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5977                }
5978                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5979                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5980                }
5981            }
5982
5983            next_offset += envelope_size;
5984            _next_ordinal_to_read += 1;
5985            if next_offset >= end_offset {
5986                return Ok(());
5987            }
5988
5989            // Decode unknown envelopes for gaps in ordinals.
5990            while _next_ordinal_to_read < 2 {
5991                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5992                _next_ordinal_to_read += 1;
5993                next_offset += envelope_size;
5994            }
5995
5996            let next_out_of_line = decoder.next_out_of_line();
5997            let handles_before = decoder.remaining_handles();
5998            if let Some((inlined, num_bytes, num_handles)) =
5999                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6000            {
6001                let member_inline_size =
6002                    <BaseMatcher as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6003                if inlined != (member_inline_size <= 4) {
6004                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6005                }
6006                let inner_offset;
6007                let mut inner_depth = depth.clone();
6008                if inlined {
6009                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6010                    inner_offset = next_offset;
6011                } else {
6012                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6013                    inner_depth.increment()?;
6014                }
6015                let val_ref = self.base.get_or_insert_with(|| fidl::new_empty!(BaseMatcher, D));
6016                fidl::decode!(BaseMatcher, D, val_ref, decoder, inner_offset, inner_depth)?;
6017                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6018                {
6019                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6020                }
6021                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6022                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6023                }
6024            }
6025
6026            next_offset += envelope_size;
6027
6028            // Decode the remaining unknown envelopes.
6029            while next_offset < end_offset {
6030                _next_ordinal_to_read += 1;
6031                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6032                next_offset += envelope_size;
6033            }
6034
6035            Ok(())
6036        }
6037    }
6038
6039    impl RuleWatcherOptionsV4 {
6040        #[inline(always)]
6041        fn max_ordinal_present(&self) -> u64 {
6042            0
6043        }
6044    }
6045
6046    impl fidl::encoding::ValueTypeMarker for RuleWatcherOptionsV4 {
6047        type Borrowed<'a> = &'a Self;
6048        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6049            value
6050        }
6051    }
6052
6053    unsafe impl fidl::encoding::TypeMarker for RuleWatcherOptionsV4 {
6054        type Owned = Self;
6055
6056        #[inline(always)]
6057        fn inline_align(_context: fidl::encoding::Context) -> usize {
6058            8
6059        }
6060
6061        #[inline(always)]
6062        fn inline_size(_context: fidl::encoding::Context) -> usize {
6063            16
6064        }
6065    }
6066
6067    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RuleWatcherOptionsV4, D>
6068        for &RuleWatcherOptionsV4
6069    {
6070        unsafe fn encode(
6071            self,
6072            encoder: &mut fidl::encoding::Encoder<'_, D>,
6073            offset: usize,
6074            mut depth: fidl::encoding::Depth,
6075        ) -> fidl::Result<()> {
6076            encoder.debug_check_bounds::<RuleWatcherOptionsV4>(offset);
6077            // Vector header
6078            let max_ordinal: u64 = self.max_ordinal_present();
6079            encoder.write_num(max_ordinal, offset);
6080            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6081            // Calling encoder.out_of_line_offset(0) is not allowed.
6082            if max_ordinal == 0 {
6083                return Ok(());
6084            }
6085            depth.increment()?;
6086            let envelope_size = 8;
6087            let bytes_len = max_ordinal as usize * envelope_size;
6088            #[allow(unused_variables)]
6089            let offset = encoder.out_of_line_offset(bytes_len);
6090            let mut _prev_end_offset: usize = 0;
6091
6092            Ok(())
6093        }
6094    }
6095
6096    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RuleWatcherOptionsV4 {
6097        #[inline(always)]
6098        fn new_empty() -> Self {
6099            Self::default()
6100        }
6101
6102        unsafe fn decode(
6103            &mut self,
6104            decoder: &mut fidl::encoding::Decoder<'_, D>,
6105            offset: usize,
6106            mut depth: fidl::encoding::Depth,
6107        ) -> fidl::Result<()> {
6108            decoder.debug_check_bounds::<Self>(offset);
6109            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6110                None => return Err(fidl::Error::NotNullable),
6111                Some(len) => len,
6112            };
6113            // Calling decoder.out_of_line_offset(0) is not allowed.
6114            if len == 0 {
6115                return Ok(());
6116            };
6117            depth.increment()?;
6118            let envelope_size = 8;
6119            let bytes_len = len * envelope_size;
6120            let offset = decoder.out_of_line_offset(bytes_len)?;
6121            // Decode the envelope for each type.
6122            let mut _next_ordinal_to_read = 0;
6123            let mut next_offset = offset;
6124            let end_offset = offset + bytes_len;
6125
6126            // Decode the remaining unknown envelopes.
6127            while next_offset < end_offset {
6128                _next_ordinal_to_read += 1;
6129                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6130                next_offset += envelope_size;
6131            }
6132
6133            Ok(())
6134        }
6135    }
6136
6137    impl RuleWatcherOptionsV6 {
6138        #[inline(always)]
6139        fn max_ordinal_present(&self) -> u64 {
6140            0
6141        }
6142    }
6143
6144    impl fidl::encoding::ValueTypeMarker for RuleWatcherOptionsV6 {
6145        type Borrowed<'a> = &'a Self;
6146        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6147            value
6148        }
6149    }
6150
6151    unsafe impl fidl::encoding::TypeMarker for RuleWatcherOptionsV6 {
6152        type Owned = Self;
6153
6154        #[inline(always)]
6155        fn inline_align(_context: fidl::encoding::Context) -> usize {
6156            8
6157        }
6158
6159        #[inline(always)]
6160        fn inline_size(_context: fidl::encoding::Context) -> usize {
6161            16
6162        }
6163    }
6164
6165    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RuleWatcherOptionsV6, D>
6166        for &RuleWatcherOptionsV6
6167    {
6168        unsafe fn encode(
6169            self,
6170            encoder: &mut fidl::encoding::Encoder<'_, D>,
6171            offset: usize,
6172            mut depth: fidl::encoding::Depth,
6173        ) -> fidl::Result<()> {
6174            encoder.debug_check_bounds::<RuleWatcherOptionsV6>(offset);
6175            // Vector header
6176            let max_ordinal: u64 = self.max_ordinal_present();
6177            encoder.write_num(max_ordinal, offset);
6178            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6179            // Calling encoder.out_of_line_offset(0) is not allowed.
6180            if max_ordinal == 0 {
6181                return Ok(());
6182            }
6183            depth.increment()?;
6184            let envelope_size = 8;
6185            let bytes_len = max_ordinal as usize * envelope_size;
6186            #[allow(unused_variables)]
6187            let offset = encoder.out_of_line_offset(bytes_len);
6188            let mut _prev_end_offset: usize = 0;
6189
6190            Ok(())
6191        }
6192    }
6193
6194    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RuleWatcherOptionsV6 {
6195        #[inline(always)]
6196        fn new_empty() -> Self {
6197            Self::default()
6198        }
6199
6200        unsafe fn decode(
6201            &mut self,
6202            decoder: &mut fidl::encoding::Decoder<'_, D>,
6203            offset: usize,
6204            mut depth: fidl::encoding::Depth,
6205        ) -> fidl::Result<()> {
6206            decoder.debug_check_bounds::<Self>(offset);
6207            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6208                None => return Err(fidl::Error::NotNullable),
6209                Some(len) => len,
6210            };
6211            // Calling decoder.out_of_line_offset(0) is not allowed.
6212            if len == 0 {
6213                return Ok(());
6214            };
6215            depth.increment()?;
6216            let envelope_size = 8;
6217            let bytes_len = len * envelope_size;
6218            let offset = decoder.out_of_line_offset(bytes_len)?;
6219            // Decode the envelope for each type.
6220            let mut _next_ordinal_to_read = 0;
6221            let mut next_offset = offset;
6222            let end_offset = offset + bytes_len;
6223
6224            // Decode the remaining unknown envelopes.
6225            while next_offset < end_offset {
6226                _next_ordinal_to_read += 1;
6227                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6228                next_offset += envelope_size;
6229            }
6230
6231            Ok(())
6232        }
6233    }
6234
6235    impl SpecifiedRouteProperties {
6236        #[inline(always)]
6237        fn max_ordinal_present(&self) -> u64 {
6238            if let Some(_) = self.metric {
6239                return 1;
6240            }
6241            0
6242        }
6243    }
6244
6245    impl fidl::encoding::ValueTypeMarker for SpecifiedRouteProperties {
6246        type Borrowed<'a> = &'a Self;
6247        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6248            value
6249        }
6250    }
6251
6252    unsafe impl fidl::encoding::TypeMarker for SpecifiedRouteProperties {
6253        type Owned = Self;
6254
6255        #[inline(always)]
6256        fn inline_align(_context: fidl::encoding::Context) -> usize {
6257            8
6258        }
6259
6260        #[inline(always)]
6261        fn inline_size(_context: fidl::encoding::Context) -> usize {
6262            16
6263        }
6264    }
6265
6266    unsafe impl<D: fidl::encoding::ResourceDialect>
6267        fidl::encoding::Encode<SpecifiedRouteProperties, D> for &SpecifiedRouteProperties
6268    {
6269        unsafe fn encode(
6270            self,
6271            encoder: &mut fidl::encoding::Encoder<'_, D>,
6272            offset: usize,
6273            mut depth: fidl::encoding::Depth,
6274        ) -> fidl::Result<()> {
6275            encoder.debug_check_bounds::<SpecifiedRouteProperties>(offset);
6276            // Vector header
6277            let max_ordinal: u64 = self.max_ordinal_present();
6278            encoder.write_num(max_ordinal, offset);
6279            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6280            // Calling encoder.out_of_line_offset(0) is not allowed.
6281            if max_ordinal == 0 {
6282                return Ok(());
6283            }
6284            depth.increment()?;
6285            let envelope_size = 8;
6286            let bytes_len = max_ordinal as usize * envelope_size;
6287            #[allow(unused_variables)]
6288            let offset = encoder.out_of_line_offset(bytes_len);
6289            let mut _prev_end_offset: usize = 0;
6290            if 1 > max_ordinal {
6291                return Ok(());
6292            }
6293
6294            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6295            // are envelope_size bytes.
6296            let cur_offset: usize = (1 - 1) * envelope_size;
6297
6298            // Zero reserved fields.
6299            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6300
6301            // Safety:
6302            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6303            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6304            //   envelope_size bytes, there is always sufficient room.
6305            fidl::encoding::encode_in_envelope_optional::<SpecifiedMetric, D>(
6306                self.metric
6307                    .as_ref()
6308                    .map(<SpecifiedMetric as fidl::encoding::ValueTypeMarker>::borrow),
6309                encoder,
6310                offset + cur_offset,
6311                depth,
6312            )?;
6313
6314            _prev_end_offset = cur_offset + envelope_size;
6315
6316            Ok(())
6317        }
6318    }
6319
6320    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6321        for SpecifiedRouteProperties
6322    {
6323        #[inline(always)]
6324        fn new_empty() -> Self {
6325            Self::default()
6326        }
6327
6328        unsafe fn decode(
6329            &mut self,
6330            decoder: &mut fidl::encoding::Decoder<'_, D>,
6331            offset: usize,
6332            mut depth: fidl::encoding::Depth,
6333        ) -> fidl::Result<()> {
6334            decoder.debug_check_bounds::<Self>(offset);
6335            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6336                None => return Err(fidl::Error::NotNullable),
6337                Some(len) => len,
6338            };
6339            // Calling decoder.out_of_line_offset(0) is not allowed.
6340            if len == 0 {
6341                return Ok(());
6342            };
6343            depth.increment()?;
6344            let envelope_size = 8;
6345            let bytes_len = len * envelope_size;
6346            let offset = decoder.out_of_line_offset(bytes_len)?;
6347            // Decode the envelope for each type.
6348            let mut _next_ordinal_to_read = 0;
6349            let mut next_offset = offset;
6350            let end_offset = offset + bytes_len;
6351            _next_ordinal_to_read += 1;
6352            if next_offset >= end_offset {
6353                return Ok(());
6354            }
6355
6356            // Decode unknown envelopes for gaps in ordinals.
6357            while _next_ordinal_to_read < 1 {
6358                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6359                _next_ordinal_to_read += 1;
6360                next_offset += envelope_size;
6361            }
6362
6363            let next_out_of_line = decoder.next_out_of_line();
6364            let handles_before = decoder.remaining_handles();
6365            if let Some((inlined, num_bytes, num_handles)) =
6366                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6367            {
6368                let member_inline_size =
6369                    <SpecifiedMetric as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6370                if inlined != (member_inline_size <= 4) {
6371                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6372                }
6373                let inner_offset;
6374                let mut inner_depth = depth.clone();
6375                if inlined {
6376                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6377                    inner_offset = next_offset;
6378                } else {
6379                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6380                    inner_depth.increment()?;
6381                }
6382                let val_ref =
6383                    self.metric.get_or_insert_with(|| fidl::new_empty!(SpecifiedMetric, D));
6384                fidl::decode!(SpecifiedMetric, D, val_ref, decoder, inner_offset, inner_depth)?;
6385                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6386                {
6387                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6388                }
6389                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6390                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6391                }
6392            }
6393
6394            next_offset += envelope_size;
6395
6396            // Decode the remaining unknown envelopes.
6397            while next_offset < end_offset {
6398                _next_ordinal_to_read += 1;
6399                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6400                next_offset += envelope_size;
6401            }
6402
6403            Ok(())
6404        }
6405    }
6406
6407    impl WatcherOptionsV4 {
6408        #[inline(always)]
6409        fn max_ordinal_present(&self) -> u64 {
6410            if let Some(_) = self.table_interest {
6411                return 1;
6412            }
6413            0
6414        }
6415    }
6416
6417    impl fidl::encoding::ValueTypeMarker for WatcherOptionsV4 {
6418        type Borrowed<'a> = &'a Self;
6419        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6420            value
6421        }
6422    }
6423
6424    unsafe impl fidl::encoding::TypeMarker for WatcherOptionsV4 {
6425        type Owned = Self;
6426
6427        #[inline(always)]
6428        fn inline_align(_context: fidl::encoding::Context) -> usize {
6429            8
6430        }
6431
6432        #[inline(always)]
6433        fn inline_size(_context: fidl::encoding::Context) -> usize {
6434            16
6435        }
6436    }
6437
6438    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WatcherOptionsV4, D>
6439        for &WatcherOptionsV4
6440    {
6441        unsafe fn encode(
6442            self,
6443            encoder: &mut fidl::encoding::Encoder<'_, D>,
6444            offset: usize,
6445            mut depth: fidl::encoding::Depth,
6446        ) -> fidl::Result<()> {
6447            encoder.debug_check_bounds::<WatcherOptionsV4>(offset);
6448            // Vector header
6449            let max_ordinal: u64 = self.max_ordinal_present();
6450            encoder.write_num(max_ordinal, offset);
6451            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6452            // Calling encoder.out_of_line_offset(0) is not allowed.
6453            if max_ordinal == 0 {
6454                return Ok(());
6455            }
6456            depth.increment()?;
6457            let envelope_size = 8;
6458            let bytes_len = max_ordinal as usize * envelope_size;
6459            #[allow(unused_variables)]
6460            let offset = encoder.out_of_line_offset(bytes_len);
6461            let mut _prev_end_offset: usize = 0;
6462            if 1 > max_ordinal {
6463                return Ok(());
6464            }
6465
6466            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6467            // are envelope_size bytes.
6468            let cur_offset: usize = (1 - 1) * envelope_size;
6469
6470            // Zero reserved fields.
6471            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6472
6473            // Safety:
6474            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6475            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6476            //   envelope_size bytes, there is always sufficient room.
6477            fidl::encoding::encode_in_envelope_optional::<TableInterest, D>(
6478                self.table_interest
6479                    .as_ref()
6480                    .map(<TableInterest as fidl::encoding::ValueTypeMarker>::borrow),
6481                encoder,
6482                offset + cur_offset,
6483                depth,
6484            )?;
6485
6486            _prev_end_offset = cur_offset + envelope_size;
6487
6488            Ok(())
6489        }
6490    }
6491
6492    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WatcherOptionsV4 {
6493        #[inline(always)]
6494        fn new_empty() -> Self {
6495            Self::default()
6496        }
6497
6498        unsafe fn decode(
6499            &mut self,
6500            decoder: &mut fidl::encoding::Decoder<'_, D>,
6501            offset: usize,
6502            mut depth: fidl::encoding::Depth,
6503        ) -> fidl::Result<()> {
6504            decoder.debug_check_bounds::<Self>(offset);
6505            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6506                None => return Err(fidl::Error::NotNullable),
6507                Some(len) => len,
6508            };
6509            // Calling decoder.out_of_line_offset(0) is not allowed.
6510            if len == 0 {
6511                return Ok(());
6512            };
6513            depth.increment()?;
6514            let envelope_size = 8;
6515            let bytes_len = len * envelope_size;
6516            let offset = decoder.out_of_line_offset(bytes_len)?;
6517            // Decode the envelope for each type.
6518            let mut _next_ordinal_to_read = 0;
6519            let mut next_offset = offset;
6520            let end_offset = offset + bytes_len;
6521            _next_ordinal_to_read += 1;
6522            if next_offset >= end_offset {
6523                return Ok(());
6524            }
6525
6526            // Decode unknown envelopes for gaps in ordinals.
6527            while _next_ordinal_to_read < 1 {
6528                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6529                _next_ordinal_to_read += 1;
6530                next_offset += envelope_size;
6531            }
6532
6533            let next_out_of_line = decoder.next_out_of_line();
6534            let handles_before = decoder.remaining_handles();
6535            if let Some((inlined, num_bytes, num_handles)) =
6536                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6537            {
6538                let member_inline_size =
6539                    <TableInterest as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6540                if inlined != (member_inline_size <= 4) {
6541                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6542                }
6543                let inner_offset;
6544                let mut inner_depth = depth.clone();
6545                if inlined {
6546                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6547                    inner_offset = next_offset;
6548                } else {
6549                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6550                    inner_depth.increment()?;
6551                }
6552                let val_ref =
6553                    self.table_interest.get_or_insert_with(|| fidl::new_empty!(TableInterest, D));
6554                fidl::decode!(TableInterest, D, val_ref, decoder, inner_offset, inner_depth)?;
6555                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6556                {
6557                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6558                }
6559                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6560                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6561                }
6562            }
6563
6564            next_offset += envelope_size;
6565
6566            // Decode the remaining unknown envelopes.
6567            while next_offset < end_offset {
6568                _next_ordinal_to_read += 1;
6569                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6570                next_offset += envelope_size;
6571            }
6572
6573            Ok(())
6574        }
6575    }
6576
6577    impl WatcherOptionsV6 {
6578        #[inline(always)]
6579        fn max_ordinal_present(&self) -> u64 {
6580            if let Some(_) = self.table_interest {
6581                return 1;
6582            }
6583            0
6584        }
6585    }
6586
6587    impl fidl::encoding::ValueTypeMarker for WatcherOptionsV6 {
6588        type Borrowed<'a> = &'a Self;
6589        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6590            value
6591        }
6592    }
6593
6594    unsafe impl fidl::encoding::TypeMarker for WatcherOptionsV6 {
6595        type Owned = Self;
6596
6597        #[inline(always)]
6598        fn inline_align(_context: fidl::encoding::Context) -> usize {
6599            8
6600        }
6601
6602        #[inline(always)]
6603        fn inline_size(_context: fidl::encoding::Context) -> usize {
6604            16
6605        }
6606    }
6607
6608    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WatcherOptionsV6, D>
6609        for &WatcherOptionsV6
6610    {
6611        unsafe fn encode(
6612            self,
6613            encoder: &mut fidl::encoding::Encoder<'_, D>,
6614            offset: usize,
6615            mut depth: fidl::encoding::Depth,
6616        ) -> fidl::Result<()> {
6617            encoder.debug_check_bounds::<WatcherOptionsV6>(offset);
6618            // Vector header
6619            let max_ordinal: u64 = self.max_ordinal_present();
6620            encoder.write_num(max_ordinal, offset);
6621            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6622            // Calling encoder.out_of_line_offset(0) is not allowed.
6623            if max_ordinal == 0 {
6624                return Ok(());
6625            }
6626            depth.increment()?;
6627            let envelope_size = 8;
6628            let bytes_len = max_ordinal as usize * envelope_size;
6629            #[allow(unused_variables)]
6630            let offset = encoder.out_of_line_offset(bytes_len);
6631            let mut _prev_end_offset: usize = 0;
6632            if 1 > max_ordinal {
6633                return Ok(());
6634            }
6635
6636            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6637            // are envelope_size bytes.
6638            let cur_offset: usize = (1 - 1) * envelope_size;
6639
6640            // Zero reserved fields.
6641            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6642
6643            // Safety:
6644            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6645            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6646            //   envelope_size bytes, there is always sufficient room.
6647            fidl::encoding::encode_in_envelope_optional::<TableInterest, D>(
6648                self.table_interest
6649                    .as_ref()
6650                    .map(<TableInterest as fidl::encoding::ValueTypeMarker>::borrow),
6651                encoder,
6652                offset + cur_offset,
6653                depth,
6654            )?;
6655
6656            _prev_end_offset = cur_offset + envelope_size;
6657
6658            Ok(())
6659        }
6660    }
6661
6662    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WatcherOptionsV6 {
6663        #[inline(always)]
6664        fn new_empty() -> Self {
6665            Self::default()
6666        }
6667
6668        unsafe fn decode(
6669            &mut self,
6670            decoder: &mut fidl::encoding::Decoder<'_, D>,
6671            offset: usize,
6672            mut depth: fidl::encoding::Depth,
6673        ) -> fidl::Result<()> {
6674            decoder.debug_check_bounds::<Self>(offset);
6675            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6676                None => return Err(fidl::Error::NotNullable),
6677                Some(len) => len,
6678            };
6679            // Calling decoder.out_of_line_offset(0) is not allowed.
6680            if len == 0 {
6681                return Ok(());
6682            };
6683            depth.increment()?;
6684            let envelope_size = 8;
6685            let bytes_len = len * envelope_size;
6686            let offset = decoder.out_of_line_offset(bytes_len)?;
6687            // Decode the envelope for each type.
6688            let mut _next_ordinal_to_read = 0;
6689            let mut next_offset = offset;
6690            let end_offset = offset + bytes_len;
6691            _next_ordinal_to_read += 1;
6692            if next_offset >= end_offset {
6693                return Ok(());
6694            }
6695
6696            // Decode unknown envelopes for gaps in ordinals.
6697            while _next_ordinal_to_read < 1 {
6698                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6699                _next_ordinal_to_read += 1;
6700                next_offset += envelope_size;
6701            }
6702
6703            let next_out_of_line = decoder.next_out_of_line();
6704            let handles_before = decoder.remaining_handles();
6705            if let Some((inlined, num_bytes, num_handles)) =
6706                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6707            {
6708                let member_inline_size =
6709                    <TableInterest as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6710                if inlined != (member_inline_size <= 4) {
6711                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6712                }
6713                let inner_offset;
6714                let mut inner_depth = depth.clone();
6715                if inlined {
6716                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6717                    inner_offset = next_offset;
6718                } else {
6719                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6720                    inner_depth.increment()?;
6721                }
6722                let val_ref =
6723                    self.table_interest.get_or_insert_with(|| fidl::new_empty!(TableInterest, D));
6724                fidl::decode!(TableInterest, D, val_ref, decoder, inner_offset, inner_depth)?;
6725                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6726                {
6727                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6728                }
6729                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6730                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6731                }
6732            }
6733
6734            next_offset += envelope_size;
6735
6736            // Decode the remaining unknown envelopes.
6737            while next_offset < end_offset {
6738                _next_ordinal_to_read += 1;
6739                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6740                next_offset += envelope_size;
6741            }
6742
6743            Ok(())
6744        }
6745    }
6746
6747    impl fidl::encoding::ValueTypeMarker for EventV4 {
6748        type Borrowed<'a> = &'a Self;
6749        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6750            value
6751        }
6752    }
6753
6754    unsafe impl fidl::encoding::TypeMarker for EventV4 {
6755        type Owned = Self;
6756
6757        #[inline(always)]
6758        fn inline_align(_context: fidl::encoding::Context) -> usize {
6759            8
6760        }
6761
6762        #[inline(always)]
6763        fn inline_size(_context: fidl::encoding::Context) -> usize {
6764            16
6765        }
6766    }
6767
6768    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EventV4, D> for &EventV4 {
6769        #[inline]
6770        unsafe fn encode(
6771            self,
6772            encoder: &mut fidl::encoding::Encoder<'_, D>,
6773            offset: usize,
6774            _depth: fidl::encoding::Depth,
6775        ) -> fidl::Result<()> {
6776            encoder.debug_check_bounds::<EventV4>(offset);
6777            encoder.write_num::<u64>(self.ordinal(), offset);
6778            match self {
6779                EventV4::Existing(ref val) => {
6780                    fidl::encoding::encode_in_envelope::<InstalledRouteV4, D>(
6781                        <InstalledRouteV4 as fidl::encoding::ValueTypeMarker>::borrow(val),
6782                        encoder,
6783                        offset + 8,
6784                        _depth,
6785                    )
6786                }
6787                EventV4::Idle(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
6788                    <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
6789                    encoder,
6790                    offset + 8,
6791                    _depth,
6792                ),
6793                EventV4::Added(ref val) => {
6794                    fidl::encoding::encode_in_envelope::<InstalledRouteV4, D>(
6795                        <InstalledRouteV4 as fidl::encoding::ValueTypeMarker>::borrow(val),
6796                        encoder,
6797                        offset + 8,
6798                        _depth,
6799                    )
6800                }
6801                EventV4::Removed(ref val) => {
6802                    fidl::encoding::encode_in_envelope::<InstalledRouteV4, D>(
6803                        <InstalledRouteV4 as fidl::encoding::ValueTypeMarker>::borrow(val),
6804                        encoder,
6805                        offset + 8,
6806                        _depth,
6807                    )
6808                }
6809                EventV4::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
6810            }
6811        }
6812    }
6813
6814    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EventV4 {
6815        #[inline(always)]
6816        fn new_empty() -> Self {
6817            Self::__SourceBreaking { unknown_ordinal: 0 }
6818        }
6819
6820        #[inline]
6821        unsafe fn decode(
6822            &mut self,
6823            decoder: &mut fidl::encoding::Decoder<'_, D>,
6824            offset: usize,
6825            mut depth: fidl::encoding::Depth,
6826        ) -> fidl::Result<()> {
6827            decoder.debug_check_bounds::<Self>(offset);
6828            #[allow(unused_variables)]
6829            let next_out_of_line = decoder.next_out_of_line();
6830            let handles_before = decoder.remaining_handles();
6831            let (ordinal, inlined, num_bytes, num_handles) =
6832                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
6833
6834            let member_inline_size = match ordinal {
6835                1 => <InstalledRouteV4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6836                2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6837                3 => <InstalledRouteV4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6838                4 => <InstalledRouteV4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6839                0 => return Err(fidl::Error::UnknownUnionTag),
6840                _ => num_bytes as usize,
6841            };
6842
6843            if inlined != (member_inline_size <= 4) {
6844                return Err(fidl::Error::InvalidInlineBitInEnvelope);
6845            }
6846            let _inner_offset;
6847            if inlined {
6848                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
6849                _inner_offset = offset + 8;
6850            } else {
6851                depth.increment()?;
6852                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6853            }
6854            match ordinal {
6855                1 => {
6856                    #[allow(irrefutable_let_patterns)]
6857                    if let EventV4::Existing(_) = self {
6858                        // Do nothing, read the value into the object
6859                    } else {
6860                        // Initialize `self` to the right variant
6861                        *self = EventV4::Existing(fidl::new_empty!(InstalledRouteV4, D));
6862                    }
6863                    #[allow(irrefutable_let_patterns)]
6864                    if let EventV4::Existing(ref mut val) = self {
6865                        fidl::decode!(InstalledRouteV4, D, val, decoder, _inner_offset, depth)?;
6866                    } else {
6867                        unreachable!()
6868                    }
6869                }
6870                2 => {
6871                    #[allow(irrefutable_let_patterns)]
6872                    if let EventV4::Idle(_) = self {
6873                        // Do nothing, read the value into the object
6874                    } else {
6875                        // Initialize `self` to the right variant
6876                        *self = EventV4::Idle(fidl::new_empty!(Empty, D));
6877                    }
6878                    #[allow(irrefutable_let_patterns)]
6879                    if let EventV4::Idle(ref mut val) = self {
6880                        fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
6881                    } else {
6882                        unreachable!()
6883                    }
6884                }
6885                3 => {
6886                    #[allow(irrefutable_let_patterns)]
6887                    if let EventV4::Added(_) = self {
6888                        // Do nothing, read the value into the object
6889                    } else {
6890                        // Initialize `self` to the right variant
6891                        *self = EventV4::Added(fidl::new_empty!(InstalledRouteV4, D));
6892                    }
6893                    #[allow(irrefutable_let_patterns)]
6894                    if let EventV4::Added(ref mut val) = self {
6895                        fidl::decode!(InstalledRouteV4, D, val, decoder, _inner_offset, depth)?;
6896                    } else {
6897                        unreachable!()
6898                    }
6899                }
6900                4 => {
6901                    #[allow(irrefutable_let_patterns)]
6902                    if let EventV4::Removed(_) = self {
6903                        // Do nothing, read the value into the object
6904                    } else {
6905                        // Initialize `self` to the right variant
6906                        *self = EventV4::Removed(fidl::new_empty!(InstalledRouteV4, D));
6907                    }
6908                    #[allow(irrefutable_let_patterns)]
6909                    if let EventV4::Removed(ref mut val) = self {
6910                        fidl::decode!(InstalledRouteV4, D, val, decoder, _inner_offset, depth)?;
6911                    } else {
6912                        unreachable!()
6913                    }
6914                }
6915                #[allow(deprecated)]
6916                ordinal => {
6917                    for _ in 0..num_handles {
6918                        decoder.drop_next_handle()?;
6919                    }
6920                    *self = EventV4::__SourceBreaking { unknown_ordinal: ordinal };
6921                }
6922            }
6923            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
6924                return Err(fidl::Error::InvalidNumBytesInEnvelope);
6925            }
6926            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6927                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6928            }
6929            Ok(())
6930        }
6931    }
6932
6933    impl fidl::encoding::ValueTypeMarker for EventV6 {
6934        type Borrowed<'a> = &'a Self;
6935        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6936            value
6937        }
6938    }
6939
6940    unsafe impl fidl::encoding::TypeMarker for EventV6 {
6941        type Owned = Self;
6942
6943        #[inline(always)]
6944        fn inline_align(_context: fidl::encoding::Context) -> usize {
6945            8
6946        }
6947
6948        #[inline(always)]
6949        fn inline_size(_context: fidl::encoding::Context) -> usize {
6950            16
6951        }
6952    }
6953
6954    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EventV6, D> for &EventV6 {
6955        #[inline]
6956        unsafe fn encode(
6957            self,
6958            encoder: &mut fidl::encoding::Encoder<'_, D>,
6959            offset: usize,
6960            _depth: fidl::encoding::Depth,
6961        ) -> fidl::Result<()> {
6962            encoder.debug_check_bounds::<EventV6>(offset);
6963            encoder.write_num::<u64>(self.ordinal(), offset);
6964            match self {
6965                EventV6::Existing(ref val) => {
6966                    fidl::encoding::encode_in_envelope::<InstalledRouteV6, D>(
6967                        <InstalledRouteV6 as fidl::encoding::ValueTypeMarker>::borrow(val),
6968                        encoder,
6969                        offset + 8,
6970                        _depth,
6971                    )
6972                }
6973                EventV6::Idle(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
6974                    <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
6975                    encoder,
6976                    offset + 8,
6977                    _depth,
6978                ),
6979                EventV6::Added(ref val) => {
6980                    fidl::encoding::encode_in_envelope::<InstalledRouteV6, D>(
6981                        <InstalledRouteV6 as fidl::encoding::ValueTypeMarker>::borrow(val),
6982                        encoder,
6983                        offset + 8,
6984                        _depth,
6985                    )
6986                }
6987                EventV6::Removed(ref val) => {
6988                    fidl::encoding::encode_in_envelope::<InstalledRouteV6, D>(
6989                        <InstalledRouteV6 as fidl::encoding::ValueTypeMarker>::borrow(val),
6990                        encoder,
6991                        offset + 8,
6992                        _depth,
6993                    )
6994                }
6995                EventV6::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
6996            }
6997        }
6998    }
6999
7000    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EventV6 {
7001        #[inline(always)]
7002        fn new_empty() -> Self {
7003            Self::__SourceBreaking { unknown_ordinal: 0 }
7004        }
7005
7006        #[inline]
7007        unsafe fn decode(
7008            &mut self,
7009            decoder: &mut fidl::encoding::Decoder<'_, D>,
7010            offset: usize,
7011            mut depth: fidl::encoding::Depth,
7012        ) -> fidl::Result<()> {
7013            decoder.debug_check_bounds::<Self>(offset);
7014            #[allow(unused_variables)]
7015            let next_out_of_line = decoder.next_out_of_line();
7016            let handles_before = decoder.remaining_handles();
7017            let (ordinal, inlined, num_bytes, num_handles) =
7018                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
7019
7020            let member_inline_size = match ordinal {
7021                1 => <InstalledRouteV6 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7022                2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7023                3 => <InstalledRouteV6 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7024                4 => <InstalledRouteV6 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7025                0 => return Err(fidl::Error::UnknownUnionTag),
7026                _ => num_bytes as usize,
7027            };
7028
7029            if inlined != (member_inline_size <= 4) {
7030                return Err(fidl::Error::InvalidInlineBitInEnvelope);
7031            }
7032            let _inner_offset;
7033            if inlined {
7034                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
7035                _inner_offset = offset + 8;
7036            } else {
7037                depth.increment()?;
7038                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7039            }
7040            match ordinal {
7041                1 => {
7042                    #[allow(irrefutable_let_patterns)]
7043                    if let EventV6::Existing(_) = self {
7044                        // Do nothing, read the value into the object
7045                    } else {
7046                        // Initialize `self` to the right variant
7047                        *self = EventV6::Existing(fidl::new_empty!(InstalledRouteV6, D));
7048                    }
7049                    #[allow(irrefutable_let_patterns)]
7050                    if let EventV6::Existing(ref mut val) = self {
7051                        fidl::decode!(InstalledRouteV6, D, val, decoder, _inner_offset, depth)?;
7052                    } else {
7053                        unreachable!()
7054                    }
7055                }
7056                2 => {
7057                    #[allow(irrefutable_let_patterns)]
7058                    if let EventV6::Idle(_) = self {
7059                        // Do nothing, read the value into the object
7060                    } else {
7061                        // Initialize `self` to the right variant
7062                        *self = EventV6::Idle(fidl::new_empty!(Empty, D));
7063                    }
7064                    #[allow(irrefutable_let_patterns)]
7065                    if let EventV6::Idle(ref mut val) = self {
7066                        fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
7067                    } else {
7068                        unreachable!()
7069                    }
7070                }
7071                3 => {
7072                    #[allow(irrefutable_let_patterns)]
7073                    if let EventV6::Added(_) = self {
7074                        // Do nothing, read the value into the object
7075                    } else {
7076                        // Initialize `self` to the right variant
7077                        *self = EventV6::Added(fidl::new_empty!(InstalledRouteV6, D));
7078                    }
7079                    #[allow(irrefutable_let_patterns)]
7080                    if let EventV6::Added(ref mut val) = self {
7081                        fidl::decode!(InstalledRouteV6, D, val, decoder, _inner_offset, depth)?;
7082                    } else {
7083                        unreachable!()
7084                    }
7085                }
7086                4 => {
7087                    #[allow(irrefutable_let_patterns)]
7088                    if let EventV6::Removed(_) = self {
7089                        // Do nothing, read the value into the object
7090                    } else {
7091                        // Initialize `self` to the right variant
7092                        *self = EventV6::Removed(fidl::new_empty!(InstalledRouteV6, D));
7093                    }
7094                    #[allow(irrefutable_let_patterns)]
7095                    if let EventV6::Removed(ref mut val) = self {
7096                        fidl::decode!(InstalledRouteV6, D, val, decoder, _inner_offset, depth)?;
7097                    } else {
7098                        unreachable!()
7099                    }
7100                }
7101                #[allow(deprecated)]
7102                ordinal => {
7103                    for _ in 0..num_handles {
7104                        decoder.drop_next_handle()?;
7105                    }
7106                    *self = EventV6::__SourceBreaking { unknown_ordinal: ordinal };
7107                }
7108            }
7109            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
7110                return Err(fidl::Error::InvalidNumBytesInEnvelope);
7111            }
7112            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7113                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7114            }
7115            Ok(())
7116        }
7117    }
7118
7119    impl fidl::encoding::ValueTypeMarker for InterfaceMatcher {
7120        type Borrowed<'a> = &'a Self;
7121        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7122            value
7123        }
7124    }
7125
7126    unsafe impl fidl::encoding::TypeMarker for InterfaceMatcher {
7127        type Owned = Self;
7128
7129        #[inline(always)]
7130        fn inline_align(_context: fidl::encoding::Context) -> usize {
7131            8
7132        }
7133
7134        #[inline(always)]
7135        fn inline_size(_context: fidl::encoding::Context) -> usize {
7136            16
7137        }
7138    }
7139
7140    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InterfaceMatcher, D>
7141        for &InterfaceMatcher
7142    {
7143        #[inline]
7144        unsafe fn encode(
7145            self,
7146            encoder: &mut fidl::encoding::Encoder<'_, D>,
7147            offset: usize,
7148            _depth: fidl::encoding::Depth,
7149        ) -> fidl::Result<()> {
7150            encoder.debug_check_bounds::<InterfaceMatcher>(offset);
7151            encoder.write_num::<u64>(self.ordinal(), offset);
7152            match self {
7153                InterfaceMatcher::DeviceName(ref val) => fidl::encoding::encode_in_envelope::<
7154                    fidl::encoding::BoundedString<15>,
7155                    D,
7156                >(
7157                    <fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
7158                        val,
7159                    ),
7160                    encoder,
7161                    offset + 8,
7162                    _depth,
7163                ),
7164                InterfaceMatcher::Unbound(ref val) => {
7165                    fidl::encoding::encode_in_envelope::<Unbound, D>(
7166                        <Unbound as fidl::encoding::ValueTypeMarker>::borrow(val),
7167                        encoder,
7168                        offset + 8,
7169                        _depth,
7170                    )
7171                }
7172                InterfaceMatcher::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
7173            }
7174        }
7175    }
7176
7177    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterfaceMatcher {
7178        #[inline(always)]
7179        fn new_empty() -> Self {
7180            Self::__SourceBreaking { unknown_ordinal: 0 }
7181        }
7182
7183        #[inline]
7184        unsafe fn decode(
7185            &mut self,
7186            decoder: &mut fidl::encoding::Decoder<'_, D>,
7187            offset: usize,
7188            mut depth: fidl::encoding::Depth,
7189        ) -> fidl::Result<()> {
7190            decoder.debug_check_bounds::<Self>(offset);
7191            #[allow(unused_variables)]
7192            let next_out_of_line = decoder.next_out_of_line();
7193            let handles_before = decoder.remaining_handles();
7194            let (ordinal, inlined, num_bytes, num_handles) =
7195                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
7196
7197            let member_inline_size = match ordinal {
7198                1 => {
7199                    <fidl::encoding::BoundedString<15> as fidl::encoding::TypeMarker>::inline_size(
7200                        decoder.context,
7201                    )
7202                }
7203                2 => <Unbound as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7204                0 => return Err(fidl::Error::UnknownUnionTag),
7205                _ => num_bytes as usize,
7206            };
7207
7208            if inlined != (member_inline_size <= 4) {
7209                return Err(fidl::Error::InvalidInlineBitInEnvelope);
7210            }
7211            let _inner_offset;
7212            if inlined {
7213                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
7214                _inner_offset = offset + 8;
7215            } else {
7216                depth.increment()?;
7217                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7218            }
7219            match ordinal {
7220                1 => {
7221                    #[allow(irrefutable_let_patterns)]
7222                    if let InterfaceMatcher::DeviceName(_) = self {
7223                        // Do nothing, read the value into the object
7224                    } else {
7225                        // Initialize `self` to the right variant
7226                        *self = InterfaceMatcher::DeviceName(fidl::new_empty!(
7227                            fidl::encoding::BoundedString<15>,
7228                            D
7229                        ));
7230                    }
7231                    #[allow(irrefutable_let_patterns)]
7232                    if let InterfaceMatcher::DeviceName(ref mut val) = self {
7233                        fidl::decode!(
7234                            fidl::encoding::BoundedString<15>,
7235                            D,
7236                            val,
7237                            decoder,
7238                            _inner_offset,
7239                            depth
7240                        )?;
7241                    } else {
7242                        unreachable!()
7243                    }
7244                }
7245                2 => {
7246                    #[allow(irrefutable_let_patterns)]
7247                    if let InterfaceMatcher::Unbound(_) = self {
7248                        // Do nothing, read the value into the object
7249                    } else {
7250                        // Initialize `self` to the right variant
7251                        *self = InterfaceMatcher::Unbound(fidl::new_empty!(Unbound, D));
7252                    }
7253                    #[allow(irrefutable_let_patterns)]
7254                    if let InterfaceMatcher::Unbound(ref mut val) = self {
7255                        fidl::decode!(Unbound, D, val, decoder, _inner_offset, depth)?;
7256                    } else {
7257                        unreachable!()
7258                    }
7259                }
7260                #[allow(deprecated)]
7261                ordinal => {
7262                    for _ in 0..num_handles {
7263                        decoder.drop_next_handle()?;
7264                    }
7265                    *self = InterfaceMatcher::__SourceBreaking { unknown_ordinal: ordinal };
7266                }
7267            }
7268            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
7269                return Err(fidl::Error::InvalidNumBytesInEnvelope);
7270            }
7271            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7272                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7273            }
7274            Ok(())
7275        }
7276    }
7277
7278    impl fidl::encoding::ValueTypeMarker for MarkMatcher {
7279        type Borrowed<'a> = &'a Self;
7280        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7281            value
7282        }
7283    }
7284
7285    unsafe impl fidl::encoding::TypeMarker for MarkMatcher {
7286        type Owned = Self;
7287
7288        #[inline(always)]
7289        fn inline_align(_context: fidl::encoding::Context) -> usize {
7290            8
7291        }
7292
7293        #[inline(always)]
7294        fn inline_size(_context: fidl::encoding::Context) -> usize {
7295            16
7296        }
7297    }
7298
7299    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MarkMatcher, D>
7300        for &MarkMatcher
7301    {
7302        #[inline]
7303        unsafe fn encode(
7304            self,
7305            encoder: &mut fidl::encoding::Encoder<'_, D>,
7306            offset: usize,
7307            _depth: fidl::encoding::Depth,
7308        ) -> fidl::Result<()> {
7309            encoder.debug_check_bounds::<MarkMatcher>(offset);
7310            encoder.write_num::<u64>(self.ordinal(), offset);
7311            match self {
7312                MarkMatcher::Unmarked(ref val) => {
7313                    fidl::encoding::encode_in_envelope::<Unmarked, D>(
7314                        <Unmarked as fidl::encoding::ValueTypeMarker>::borrow(val),
7315                        encoder,
7316                        offset + 8,
7317                        _depth,
7318                    )
7319                }
7320                MarkMatcher::Marked(ref val) => fidl::encoding::encode_in_envelope::<Marked, D>(
7321                    <Marked as fidl::encoding::ValueTypeMarker>::borrow(val),
7322                    encoder,
7323                    offset + 8,
7324                    _depth,
7325                ),
7326                MarkMatcher::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
7327            }
7328        }
7329    }
7330
7331    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MarkMatcher {
7332        #[inline(always)]
7333        fn new_empty() -> Self {
7334            Self::__SourceBreaking { unknown_ordinal: 0 }
7335        }
7336
7337        #[inline]
7338        unsafe fn decode(
7339            &mut self,
7340            decoder: &mut fidl::encoding::Decoder<'_, D>,
7341            offset: usize,
7342            mut depth: fidl::encoding::Depth,
7343        ) -> fidl::Result<()> {
7344            decoder.debug_check_bounds::<Self>(offset);
7345            #[allow(unused_variables)]
7346            let next_out_of_line = decoder.next_out_of_line();
7347            let handles_before = decoder.remaining_handles();
7348            let (ordinal, inlined, num_bytes, num_handles) =
7349                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
7350
7351            let member_inline_size = match ordinal {
7352                1 => <Unmarked as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7353                2 => <Marked as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7354                0 => return Err(fidl::Error::UnknownUnionTag),
7355                _ => num_bytes as usize,
7356            };
7357
7358            if inlined != (member_inline_size <= 4) {
7359                return Err(fidl::Error::InvalidInlineBitInEnvelope);
7360            }
7361            let _inner_offset;
7362            if inlined {
7363                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
7364                _inner_offset = offset + 8;
7365            } else {
7366                depth.increment()?;
7367                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7368            }
7369            match ordinal {
7370                1 => {
7371                    #[allow(irrefutable_let_patterns)]
7372                    if let MarkMatcher::Unmarked(_) = self {
7373                        // Do nothing, read the value into the object
7374                    } else {
7375                        // Initialize `self` to the right variant
7376                        *self = MarkMatcher::Unmarked(fidl::new_empty!(Unmarked, D));
7377                    }
7378                    #[allow(irrefutable_let_patterns)]
7379                    if let MarkMatcher::Unmarked(ref mut val) = self {
7380                        fidl::decode!(Unmarked, D, val, decoder, _inner_offset, depth)?;
7381                    } else {
7382                        unreachable!()
7383                    }
7384                }
7385                2 => {
7386                    #[allow(irrefutable_let_patterns)]
7387                    if let MarkMatcher::Marked(_) = self {
7388                        // Do nothing, read the value into the object
7389                    } else {
7390                        // Initialize `self` to the right variant
7391                        *self = MarkMatcher::Marked(fidl::new_empty!(Marked, D));
7392                    }
7393                    #[allow(irrefutable_let_patterns)]
7394                    if let MarkMatcher::Marked(ref mut val) = self {
7395                        fidl::decode!(Marked, D, val, decoder, _inner_offset, depth)?;
7396                    } else {
7397                        unreachable!()
7398                    }
7399                }
7400                #[allow(deprecated)]
7401                ordinal => {
7402                    for _ in 0..num_handles {
7403                        decoder.drop_next_handle()?;
7404                    }
7405                    *self = MarkMatcher::__SourceBreaking { unknown_ordinal: ordinal };
7406                }
7407            }
7408            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
7409                return Err(fidl::Error::InvalidNumBytesInEnvelope);
7410            }
7411            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7412                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7413            }
7414            Ok(())
7415        }
7416    }
7417
7418    impl fidl::encoding::ValueTypeMarker for ResolveResult {
7419        type Borrowed<'a> = &'a Self;
7420        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7421            value
7422        }
7423    }
7424
7425    unsafe impl fidl::encoding::TypeMarker for ResolveResult {
7426        type Owned = Self;
7427
7428        #[inline(always)]
7429        fn inline_align(_context: fidl::encoding::Context) -> usize {
7430            8
7431        }
7432
7433        #[inline(always)]
7434        fn inline_size(_context: fidl::encoding::Context) -> usize {
7435            16
7436        }
7437    }
7438
7439    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResolveResult, D>
7440        for &ResolveResult
7441    {
7442        #[inline]
7443        unsafe fn encode(
7444            self,
7445            encoder: &mut fidl::encoding::Encoder<'_, D>,
7446            offset: usize,
7447            _depth: fidl::encoding::Depth,
7448        ) -> fidl::Result<()> {
7449            encoder.debug_check_bounds::<ResolveResult>(offset);
7450            encoder.write_num::<u64>(self.ordinal(), offset);
7451            match self {
7452                ResolveResult::Direct(ref val) => {
7453                    fidl::encoding::encode_in_envelope::<Destination, D>(
7454                        <Destination as fidl::encoding::ValueTypeMarker>::borrow(val),
7455                        encoder,
7456                        offset + 8,
7457                        _depth,
7458                    )
7459                }
7460                ResolveResult::Gateway(ref val) => {
7461                    fidl::encoding::encode_in_envelope::<Destination, D>(
7462                        <Destination as fidl::encoding::ValueTypeMarker>::borrow(val),
7463                        encoder,
7464                        offset + 8,
7465                        _depth,
7466                    )
7467                }
7468                ResolveResult::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
7469            }
7470        }
7471    }
7472
7473    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolveResult {
7474        #[inline(always)]
7475        fn new_empty() -> Self {
7476            Self::__SourceBreaking { unknown_ordinal: 0 }
7477        }
7478
7479        #[inline]
7480        unsafe fn decode(
7481            &mut self,
7482            decoder: &mut fidl::encoding::Decoder<'_, D>,
7483            offset: usize,
7484            mut depth: fidl::encoding::Depth,
7485        ) -> fidl::Result<()> {
7486            decoder.debug_check_bounds::<Self>(offset);
7487            #[allow(unused_variables)]
7488            let next_out_of_line = decoder.next_out_of_line();
7489            let handles_before = decoder.remaining_handles();
7490            let (ordinal, inlined, num_bytes, num_handles) =
7491                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
7492
7493            let member_inline_size = match ordinal {
7494                1 => <Destination as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7495                2 => <Destination as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7496                0 => return Err(fidl::Error::UnknownUnionTag),
7497                _ => num_bytes as usize,
7498            };
7499
7500            if inlined != (member_inline_size <= 4) {
7501                return Err(fidl::Error::InvalidInlineBitInEnvelope);
7502            }
7503            let _inner_offset;
7504            if inlined {
7505                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
7506                _inner_offset = offset + 8;
7507            } else {
7508                depth.increment()?;
7509                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7510            }
7511            match ordinal {
7512                1 => {
7513                    #[allow(irrefutable_let_patterns)]
7514                    if let ResolveResult::Direct(_) = self {
7515                        // Do nothing, read the value into the object
7516                    } else {
7517                        // Initialize `self` to the right variant
7518                        *self = ResolveResult::Direct(fidl::new_empty!(Destination, D));
7519                    }
7520                    #[allow(irrefutable_let_patterns)]
7521                    if let ResolveResult::Direct(ref mut val) = self {
7522                        fidl::decode!(Destination, D, val, decoder, _inner_offset, depth)?;
7523                    } else {
7524                        unreachable!()
7525                    }
7526                }
7527                2 => {
7528                    #[allow(irrefutable_let_patterns)]
7529                    if let ResolveResult::Gateway(_) = self {
7530                        // Do nothing, read the value into the object
7531                    } else {
7532                        // Initialize `self` to the right variant
7533                        *self = ResolveResult::Gateway(fidl::new_empty!(Destination, D));
7534                    }
7535                    #[allow(irrefutable_let_patterns)]
7536                    if let ResolveResult::Gateway(ref mut val) = self {
7537                        fidl::decode!(Destination, D, val, decoder, _inner_offset, depth)?;
7538                    } else {
7539                        unreachable!()
7540                    }
7541                }
7542                #[allow(deprecated)]
7543                ordinal => {
7544                    for _ in 0..num_handles {
7545                        decoder.drop_next_handle()?;
7546                    }
7547                    *self = ResolveResult::__SourceBreaking { unknown_ordinal: ordinal };
7548                }
7549            }
7550            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
7551                return Err(fidl::Error::InvalidNumBytesInEnvelope);
7552            }
7553            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7554                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7555            }
7556            Ok(())
7557        }
7558    }
7559
7560    impl fidl::encoding::ValueTypeMarker for Resolved {
7561        type Borrowed<'a> = &'a Self;
7562        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7563            value
7564        }
7565    }
7566
7567    unsafe impl fidl::encoding::TypeMarker for Resolved {
7568        type Owned = Self;
7569
7570        #[inline(always)]
7571        fn inline_align(_context: fidl::encoding::Context) -> usize {
7572            8
7573        }
7574
7575        #[inline(always)]
7576        fn inline_size(_context: fidl::encoding::Context) -> usize {
7577            16
7578        }
7579    }
7580
7581    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Resolved, D> for &Resolved {
7582        #[inline]
7583        unsafe fn encode(
7584            self,
7585            encoder: &mut fidl::encoding::Encoder<'_, D>,
7586            offset: usize,
7587            _depth: fidl::encoding::Depth,
7588        ) -> fidl::Result<()> {
7589            encoder.debug_check_bounds::<Resolved>(offset);
7590            encoder.write_num::<u64>(self.ordinal(), offset);
7591            match self {
7592                Resolved::Direct(ref val) => fidl::encoding::encode_in_envelope::<Destination, D>(
7593                    <Destination as fidl::encoding::ValueTypeMarker>::borrow(val),
7594                    encoder,
7595                    offset + 8,
7596                    _depth,
7597                ),
7598                Resolved::Gateway(ref val) => fidl::encoding::encode_in_envelope::<Destination, D>(
7599                    <Destination as fidl::encoding::ValueTypeMarker>::borrow(val),
7600                    encoder,
7601                    offset + 8,
7602                    _depth,
7603                ),
7604            }
7605        }
7606    }
7607
7608    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Resolved {
7609        #[inline(always)]
7610        fn new_empty() -> Self {
7611            Self::Direct(fidl::new_empty!(Destination, D))
7612        }
7613
7614        #[inline]
7615        unsafe fn decode(
7616            &mut self,
7617            decoder: &mut fidl::encoding::Decoder<'_, D>,
7618            offset: usize,
7619            mut depth: fidl::encoding::Depth,
7620        ) -> fidl::Result<()> {
7621            decoder.debug_check_bounds::<Self>(offset);
7622            #[allow(unused_variables)]
7623            let next_out_of_line = decoder.next_out_of_line();
7624            let handles_before = decoder.remaining_handles();
7625            let (ordinal, inlined, num_bytes, num_handles) =
7626                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
7627
7628            let member_inline_size = match ordinal {
7629                1 => <Destination as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7630                2 => <Destination as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7631                _ => return Err(fidl::Error::UnknownUnionTag),
7632            };
7633
7634            if inlined != (member_inline_size <= 4) {
7635                return Err(fidl::Error::InvalidInlineBitInEnvelope);
7636            }
7637            let _inner_offset;
7638            if inlined {
7639                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
7640                _inner_offset = offset + 8;
7641            } else {
7642                depth.increment()?;
7643                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7644            }
7645            match ordinal {
7646                1 => {
7647                    #[allow(irrefutable_let_patterns)]
7648                    if let Resolved::Direct(_) = self {
7649                        // Do nothing, read the value into the object
7650                    } else {
7651                        // Initialize `self` to the right variant
7652                        *self = Resolved::Direct(fidl::new_empty!(Destination, D));
7653                    }
7654                    #[allow(irrefutable_let_patterns)]
7655                    if let Resolved::Direct(ref mut val) = self {
7656                        fidl::decode!(Destination, D, val, decoder, _inner_offset, depth)?;
7657                    } else {
7658                        unreachable!()
7659                    }
7660                }
7661                2 => {
7662                    #[allow(irrefutable_let_patterns)]
7663                    if let Resolved::Gateway(_) = self {
7664                        // Do nothing, read the value into the object
7665                    } else {
7666                        // Initialize `self` to the right variant
7667                        *self = Resolved::Gateway(fidl::new_empty!(Destination, D));
7668                    }
7669                    #[allow(irrefutable_let_patterns)]
7670                    if let Resolved::Gateway(ref mut val) = self {
7671                        fidl::decode!(Destination, D, val, decoder, _inner_offset, depth)?;
7672                    } else {
7673                        unreachable!()
7674                    }
7675                }
7676                ordinal => panic!("unexpected ordinal {:?}", ordinal),
7677            }
7678            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
7679                return Err(fidl::Error::InvalidNumBytesInEnvelope);
7680            }
7681            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7682                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7683            }
7684            Ok(())
7685        }
7686    }
7687
7688    impl fidl::encoding::ValueTypeMarker for RouteActionV4 {
7689        type Borrowed<'a> = &'a Self;
7690        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7691            value
7692        }
7693    }
7694
7695    unsafe impl fidl::encoding::TypeMarker for RouteActionV4 {
7696        type Owned = Self;
7697
7698        #[inline(always)]
7699        fn inline_align(_context: fidl::encoding::Context) -> usize {
7700            8
7701        }
7702
7703        #[inline(always)]
7704        fn inline_size(_context: fidl::encoding::Context) -> usize {
7705            16
7706        }
7707    }
7708
7709    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RouteActionV4, D>
7710        for &RouteActionV4
7711    {
7712        #[inline]
7713        unsafe fn encode(
7714            self,
7715            encoder: &mut fidl::encoding::Encoder<'_, D>,
7716            offset: usize,
7717            _depth: fidl::encoding::Depth,
7718        ) -> fidl::Result<()> {
7719            encoder.debug_check_bounds::<RouteActionV4>(offset);
7720            encoder.write_num::<u64>(self.ordinal(), offset);
7721            match self {
7722                RouteActionV4::Forward(ref val) => {
7723                    fidl::encoding::encode_in_envelope::<RouteTargetV4, D>(
7724                        <RouteTargetV4 as fidl::encoding::ValueTypeMarker>::borrow(val),
7725                        encoder,
7726                        offset + 8,
7727                        _depth,
7728                    )
7729                }
7730                RouteActionV4::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
7731            }
7732        }
7733    }
7734
7735    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteActionV4 {
7736        #[inline(always)]
7737        fn new_empty() -> Self {
7738            Self::__SourceBreaking { unknown_ordinal: 0 }
7739        }
7740
7741        #[inline]
7742        unsafe fn decode(
7743            &mut self,
7744            decoder: &mut fidl::encoding::Decoder<'_, D>,
7745            offset: usize,
7746            mut depth: fidl::encoding::Depth,
7747        ) -> fidl::Result<()> {
7748            decoder.debug_check_bounds::<Self>(offset);
7749            #[allow(unused_variables)]
7750            let next_out_of_line = decoder.next_out_of_line();
7751            let handles_before = decoder.remaining_handles();
7752            let (ordinal, inlined, num_bytes, num_handles) =
7753                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
7754
7755            let member_inline_size = match ordinal {
7756                1 => <RouteTargetV4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7757                0 => return Err(fidl::Error::UnknownUnionTag),
7758                _ => num_bytes as usize,
7759            };
7760
7761            if inlined != (member_inline_size <= 4) {
7762                return Err(fidl::Error::InvalidInlineBitInEnvelope);
7763            }
7764            let _inner_offset;
7765            if inlined {
7766                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
7767                _inner_offset = offset + 8;
7768            } else {
7769                depth.increment()?;
7770                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7771            }
7772            match ordinal {
7773                1 => {
7774                    #[allow(irrefutable_let_patterns)]
7775                    if let RouteActionV4::Forward(_) = self {
7776                        // Do nothing, read the value into the object
7777                    } else {
7778                        // Initialize `self` to the right variant
7779                        *self = RouteActionV4::Forward(fidl::new_empty!(RouteTargetV4, D));
7780                    }
7781                    #[allow(irrefutable_let_patterns)]
7782                    if let RouteActionV4::Forward(ref mut val) = self {
7783                        fidl::decode!(RouteTargetV4, D, val, decoder, _inner_offset, depth)?;
7784                    } else {
7785                        unreachable!()
7786                    }
7787                }
7788                #[allow(deprecated)]
7789                ordinal => {
7790                    for _ in 0..num_handles {
7791                        decoder.drop_next_handle()?;
7792                    }
7793                    *self = RouteActionV4::__SourceBreaking { unknown_ordinal: ordinal };
7794                }
7795            }
7796            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
7797                return Err(fidl::Error::InvalidNumBytesInEnvelope);
7798            }
7799            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7800                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7801            }
7802            Ok(())
7803        }
7804    }
7805
7806    impl fidl::encoding::ValueTypeMarker for RouteActionV6 {
7807        type Borrowed<'a> = &'a Self;
7808        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7809            value
7810        }
7811    }
7812
7813    unsafe impl fidl::encoding::TypeMarker for RouteActionV6 {
7814        type Owned = Self;
7815
7816        #[inline(always)]
7817        fn inline_align(_context: fidl::encoding::Context) -> usize {
7818            8
7819        }
7820
7821        #[inline(always)]
7822        fn inline_size(_context: fidl::encoding::Context) -> usize {
7823            16
7824        }
7825    }
7826
7827    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RouteActionV6, D>
7828        for &RouteActionV6
7829    {
7830        #[inline]
7831        unsafe fn encode(
7832            self,
7833            encoder: &mut fidl::encoding::Encoder<'_, D>,
7834            offset: usize,
7835            _depth: fidl::encoding::Depth,
7836        ) -> fidl::Result<()> {
7837            encoder.debug_check_bounds::<RouteActionV6>(offset);
7838            encoder.write_num::<u64>(self.ordinal(), offset);
7839            match self {
7840                RouteActionV6::Forward(ref val) => {
7841                    fidl::encoding::encode_in_envelope::<RouteTargetV6, D>(
7842                        <RouteTargetV6 as fidl::encoding::ValueTypeMarker>::borrow(val),
7843                        encoder,
7844                        offset + 8,
7845                        _depth,
7846                    )
7847                }
7848                RouteActionV6::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
7849            }
7850        }
7851    }
7852
7853    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteActionV6 {
7854        #[inline(always)]
7855        fn new_empty() -> Self {
7856            Self::__SourceBreaking { unknown_ordinal: 0 }
7857        }
7858
7859        #[inline]
7860        unsafe fn decode(
7861            &mut self,
7862            decoder: &mut fidl::encoding::Decoder<'_, D>,
7863            offset: usize,
7864            mut depth: fidl::encoding::Depth,
7865        ) -> fidl::Result<()> {
7866            decoder.debug_check_bounds::<Self>(offset);
7867            #[allow(unused_variables)]
7868            let next_out_of_line = decoder.next_out_of_line();
7869            let handles_before = decoder.remaining_handles();
7870            let (ordinal, inlined, num_bytes, num_handles) =
7871                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
7872
7873            let member_inline_size = match ordinal {
7874                1 => <RouteTargetV6 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7875                0 => return Err(fidl::Error::UnknownUnionTag),
7876                _ => num_bytes as usize,
7877            };
7878
7879            if inlined != (member_inline_size <= 4) {
7880                return Err(fidl::Error::InvalidInlineBitInEnvelope);
7881            }
7882            let _inner_offset;
7883            if inlined {
7884                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
7885                _inner_offset = offset + 8;
7886            } else {
7887                depth.increment()?;
7888                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7889            }
7890            match ordinal {
7891                1 => {
7892                    #[allow(irrefutable_let_patterns)]
7893                    if let RouteActionV6::Forward(_) = self {
7894                        // Do nothing, read the value into the object
7895                    } else {
7896                        // Initialize `self` to the right variant
7897                        *self = RouteActionV6::Forward(fidl::new_empty!(RouteTargetV6, D));
7898                    }
7899                    #[allow(irrefutable_let_patterns)]
7900                    if let RouteActionV6::Forward(ref mut val) = self {
7901                        fidl::decode!(RouteTargetV6, D, val, decoder, _inner_offset, depth)?;
7902                    } else {
7903                        unreachable!()
7904                    }
7905                }
7906                #[allow(deprecated)]
7907                ordinal => {
7908                    for _ in 0..num_handles {
7909                        decoder.drop_next_handle()?;
7910                    }
7911                    *self = RouteActionV6::__SourceBreaking { unknown_ordinal: ordinal };
7912                }
7913            }
7914            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
7915                return Err(fidl::Error::InvalidNumBytesInEnvelope);
7916            }
7917            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7918                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7919            }
7920            Ok(())
7921        }
7922    }
7923
7924    impl fidl::encoding::ValueTypeMarker for RuleAction {
7925        type Borrowed<'a> = &'a Self;
7926        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7927            value
7928        }
7929    }
7930
7931    unsafe impl fidl::encoding::TypeMarker for RuleAction {
7932        type Owned = Self;
7933
7934        #[inline(always)]
7935        fn inline_align(_context: fidl::encoding::Context) -> usize {
7936            8
7937        }
7938
7939        #[inline(always)]
7940        fn inline_size(_context: fidl::encoding::Context) -> usize {
7941            16
7942        }
7943    }
7944
7945    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RuleAction, D>
7946        for &RuleAction
7947    {
7948        #[inline]
7949        unsafe fn encode(
7950            self,
7951            encoder: &mut fidl::encoding::Encoder<'_, D>,
7952            offset: usize,
7953            _depth: fidl::encoding::Depth,
7954        ) -> fidl::Result<()> {
7955            encoder.debug_check_bounds::<RuleAction>(offset);
7956            encoder.write_num::<u64>(self.ordinal(), offset);
7957            match self {
7958                RuleAction::Lookup(ref val) => fidl::encoding::encode_in_envelope::<u32, D>(
7959                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
7960                    encoder,
7961                    offset + 8,
7962                    _depth,
7963                ),
7964                RuleAction::Unreachable(ref val) => {
7965                    fidl::encoding::encode_in_envelope::<Unreachable, D>(
7966                        <Unreachable as fidl::encoding::ValueTypeMarker>::borrow(val),
7967                        encoder,
7968                        offset + 8,
7969                        _depth,
7970                    )
7971                }
7972                RuleAction::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
7973            }
7974        }
7975    }
7976
7977    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RuleAction {
7978        #[inline(always)]
7979        fn new_empty() -> Self {
7980            Self::__SourceBreaking { unknown_ordinal: 0 }
7981        }
7982
7983        #[inline]
7984        unsafe fn decode(
7985            &mut self,
7986            decoder: &mut fidl::encoding::Decoder<'_, D>,
7987            offset: usize,
7988            mut depth: fidl::encoding::Depth,
7989        ) -> fidl::Result<()> {
7990            decoder.debug_check_bounds::<Self>(offset);
7991            #[allow(unused_variables)]
7992            let next_out_of_line = decoder.next_out_of_line();
7993            let handles_before = decoder.remaining_handles();
7994            let (ordinal, inlined, num_bytes, num_handles) =
7995                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
7996
7997            let member_inline_size = match ordinal {
7998                1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7999                2 => <Unreachable as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8000                0 => return Err(fidl::Error::UnknownUnionTag),
8001                _ => num_bytes as usize,
8002            };
8003
8004            if inlined != (member_inline_size <= 4) {
8005                return Err(fidl::Error::InvalidInlineBitInEnvelope);
8006            }
8007            let _inner_offset;
8008            if inlined {
8009                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
8010                _inner_offset = offset + 8;
8011            } else {
8012                depth.increment()?;
8013                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8014            }
8015            match ordinal {
8016                1 => {
8017                    #[allow(irrefutable_let_patterns)]
8018                    if let RuleAction::Lookup(_) = self {
8019                        // Do nothing, read the value into the object
8020                    } else {
8021                        // Initialize `self` to the right variant
8022                        *self = RuleAction::Lookup(fidl::new_empty!(u32, D));
8023                    }
8024                    #[allow(irrefutable_let_patterns)]
8025                    if let RuleAction::Lookup(ref mut val) = self {
8026                        fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
8027                    } else {
8028                        unreachable!()
8029                    }
8030                }
8031                2 => {
8032                    #[allow(irrefutable_let_patterns)]
8033                    if let RuleAction::Unreachable(_) = self {
8034                        // Do nothing, read the value into the object
8035                    } else {
8036                        // Initialize `self` to the right variant
8037                        *self = RuleAction::Unreachable(fidl::new_empty!(Unreachable, D));
8038                    }
8039                    #[allow(irrefutable_let_patterns)]
8040                    if let RuleAction::Unreachable(ref mut val) = self {
8041                        fidl::decode!(Unreachable, D, val, decoder, _inner_offset, depth)?;
8042                    } else {
8043                        unreachable!()
8044                    }
8045                }
8046                #[allow(deprecated)]
8047                ordinal => {
8048                    for _ in 0..num_handles {
8049                        decoder.drop_next_handle()?;
8050                    }
8051                    *self = RuleAction::__SourceBreaking { unknown_ordinal: ordinal };
8052                }
8053            }
8054            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
8055                return Err(fidl::Error::InvalidNumBytesInEnvelope);
8056            }
8057            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8058                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8059            }
8060            Ok(())
8061        }
8062    }
8063
8064    impl fidl::encoding::ValueTypeMarker for RuleEventV4 {
8065        type Borrowed<'a> = &'a Self;
8066        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8067            value
8068        }
8069    }
8070
8071    unsafe impl fidl::encoding::TypeMarker for RuleEventV4 {
8072        type Owned = Self;
8073
8074        #[inline(always)]
8075        fn inline_align(_context: fidl::encoding::Context) -> usize {
8076            8
8077        }
8078
8079        #[inline(always)]
8080        fn inline_size(_context: fidl::encoding::Context) -> usize {
8081            16
8082        }
8083    }
8084
8085    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RuleEventV4, D>
8086        for &RuleEventV4
8087    {
8088        #[inline]
8089        unsafe fn encode(
8090            self,
8091            encoder: &mut fidl::encoding::Encoder<'_, D>,
8092            offset: usize,
8093            _depth: fidl::encoding::Depth,
8094        ) -> fidl::Result<()> {
8095            encoder.debug_check_bounds::<RuleEventV4>(offset);
8096            encoder.write_num::<u64>(self.ordinal(), offset);
8097            match self {
8098                RuleEventV4::Existing(ref val) => {
8099                    fidl::encoding::encode_in_envelope::<InstalledRuleV4, D>(
8100                        <InstalledRuleV4 as fidl::encoding::ValueTypeMarker>::borrow(val),
8101                        encoder,
8102                        offset + 8,
8103                        _depth,
8104                    )
8105                }
8106                RuleEventV4::Idle(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
8107                    <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
8108                    encoder,
8109                    offset + 8,
8110                    _depth,
8111                ),
8112                RuleEventV4::Added(ref val) => {
8113                    fidl::encoding::encode_in_envelope::<InstalledRuleV4, D>(
8114                        <InstalledRuleV4 as fidl::encoding::ValueTypeMarker>::borrow(val),
8115                        encoder,
8116                        offset + 8,
8117                        _depth,
8118                    )
8119                }
8120                RuleEventV4::Removed(ref val) => {
8121                    fidl::encoding::encode_in_envelope::<InstalledRuleV4, D>(
8122                        <InstalledRuleV4 as fidl::encoding::ValueTypeMarker>::borrow(val),
8123                        encoder,
8124                        offset + 8,
8125                        _depth,
8126                    )
8127                }
8128                RuleEventV4::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
8129            }
8130        }
8131    }
8132
8133    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RuleEventV4 {
8134        #[inline(always)]
8135        fn new_empty() -> Self {
8136            Self::__SourceBreaking { unknown_ordinal: 0 }
8137        }
8138
8139        #[inline]
8140        unsafe fn decode(
8141            &mut self,
8142            decoder: &mut fidl::encoding::Decoder<'_, D>,
8143            offset: usize,
8144            mut depth: fidl::encoding::Depth,
8145        ) -> fidl::Result<()> {
8146            decoder.debug_check_bounds::<Self>(offset);
8147            #[allow(unused_variables)]
8148            let next_out_of_line = decoder.next_out_of_line();
8149            let handles_before = decoder.remaining_handles();
8150            let (ordinal, inlined, num_bytes, num_handles) =
8151                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
8152
8153            let member_inline_size = match ordinal {
8154                1 => <InstalledRuleV4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8155                2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8156                3 => <InstalledRuleV4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8157                4 => <InstalledRuleV4 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8158                0 => return Err(fidl::Error::UnknownUnionTag),
8159                _ => num_bytes as usize,
8160            };
8161
8162            if inlined != (member_inline_size <= 4) {
8163                return Err(fidl::Error::InvalidInlineBitInEnvelope);
8164            }
8165            let _inner_offset;
8166            if inlined {
8167                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
8168                _inner_offset = offset + 8;
8169            } else {
8170                depth.increment()?;
8171                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8172            }
8173            match ordinal {
8174                1 => {
8175                    #[allow(irrefutable_let_patterns)]
8176                    if let RuleEventV4::Existing(_) = self {
8177                        // Do nothing, read the value into the object
8178                    } else {
8179                        // Initialize `self` to the right variant
8180                        *self = RuleEventV4::Existing(fidl::new_empty!(InstalledRuleV4, D));
8181                    }
8182                    #[allow(irrefutable_let_patterns)]
8183                    if let RuleEventV4::Existing(ref mut val) = self {
8184                        fidl::decode!(InstalledRuleV4, D, val, decoder, _inner_offset, depth)?;
8185                    } else {
8186                        unreachable!()
8187                    }
8188                }
8189                2 => {
8190                    #[allow(irrefutable_let_patterns)]
8191                    if let RuleEventV4::Idle(_) = self {
8192                        // Do nothing, read the value into the object
8193                    } else {
8194                        // Initialize `self` to the right variant
8195                        *self = RuleEventV4::Idle(fidl::new_empty!(Empty, D));
8196                    }
8197                    #[allow(irrefutable_let_patterns)]
8198                    if let RuleEventV4::Idle(ref mut val) = self {
8199                        fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
8200                    } else {
8201                        unreachable!()
8202                    }
8203                }
8204                3 => {
8205                    #[allow(irrefutable_let_patterns)]
8206                    if let RuleEventV4::Added(_) = self {
8207                        // Do nothing, read the value into the object
8208                    } else {
8209                        // Initialize `self` to the right variant
8210                        *self = RuleEventV4::Added(fidl::new_empty!(InstalledRuleV4, D));
8211                    }
8212                    #[allow(irrefutable_let_patterns)]
8213                    if let RuleEventV4::Added(ref mut val) = self {
8214                        fidl::decode!(InstalledRuleV4, D, val, decoder, _inner_offset, depth)?;
8215                    } else {
8216                        unreachable!()
8217                    }
8218                }
8219                4 => {
8220                    #[allow(irrefutable_let_patterns)]
8221                    if let RuleEventV4::Removed(_) = self {
8222                        // Do nothing, read the value into the object
8223                    } else {
8224                        // Initialize `self` to the right variant
8225                        *self = RuleEventV4::Removed(fidl::new_empty!(InstalledRuleV4, D));
8226                    }
8227                    #[allow(irrefutable_let_patterns)]
8228                    if let RuleEventV4::Removed(ref mut val) = self {
8229                        fidl::decode!(InstalledRuleV4, D, val, decoder, _inner_offset, depth)?;
8230                    } else {
8231                        unreachable!()
8232                    }
8233                }
8234                #[allow(deprecated)]
8235                ordinal => {
8236                    for _ in 0..num_handles {
8237                        decoder.drop_next_handle()?;
8238                    }
8239                    *self = RuleEventV4::__SourceBreaking { unknown_ordinal: ordinal };
8240                }
8241            }
8242            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
8243                return Err(fidl::Error::InvalidNumBytesInEnvelope);
8244            }
8245            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8246                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8247            }
8248            Ok(())
8249        }
8250    }
8251
8252    impl fidl::encoding::ValueTypeMarker for RuleEventV6 {
8253        type Borrowed<'a> = &'a Self;
8254        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8255            value
8256        }
8257    }
8258
8259    unsafe impl fidl::encoding::TypeMarker for RuleEventV6 {
8260        type Owned = Self;
8261
8262        #[inline(always)]
8263        fn inline_align(_context: fidl::encoding::Context) -> usize {
8264            8
8265        }
8266
8267        #[inline(always)]
8268        fn inline_size(_context: fidl::encoding::Context) -> usize {
8269            16
8270        }
8271    }
8272
8273    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RuleEventV6, D>
8274        for &RuleEventV6
8275    {
8276        #[inline]
8277        unsafe fn encode(
8278            self,
8279            encoder: &mut fidl::encoding::Encoder<'_, D>,
8280            offset: usize,
8281            _depth: fidl::encoding::Depth,
8282        ) -> fidl::Result<()> {
8283            encoder.debug_check_bounds::<RuleEventV6>(offset);
8284            encoder.write_num::<u64>(self.ordinal(), offset);
8285            match self {
8286                RuleEventV6::Existing(ref val) => {
8287                    fidl::encoding::encode_in_envelope::<InstalledRuleV6, D>(
8288                        <InstalledRuleV6 as fidl::encoding::ValueTypeMarker>::borrow(val),
8289                        encoder,
8290                        offset + 8,
8291                        _depth,
8292                    )
8293                }
8294                RuleEventV6::Idle(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
8295                    <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
8296                    encoder,
8297                    offset + 8,
8298                    _depth,
8299                ),
8300                RuleEventV6::Added(ref val) => {
8301                    fidl::encoding::encode_in_envelope::<InstalledRuleV6, D>(
8302                        <InstalledRuleV6 as fidl::encoding::ValueTypeMarker>::borrow(val),
8303                        encoder,
8304                        offset + 8,
8305                        _depth,
8306                    )
8307                }
8308                RuleEventV6::Removed(ref val) => {
8309                    fidl::encoding::encode_in_envelope::<InstalledRuleV6, D>(
8310                        <InstalledRuleV6 as fidl::encoding::ValueTypeMarker>::borrow(val),
8311                        encoder,
8312                        offset + 8,
8313                        _depth,
8314                    )
8315                }
8316                RuleEventV6::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
8317            }
8318        }
8319    }
8320
8321    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RuleEventV6 {
8322        #[inline(always)]
8323        fn new_empty() -> Self {
8324            Self::__SourceBreaking { unknown_ordinal: 0 }
8325        }
8326
8327        #[inline]
8328        unsafe fn decode(
8329            &mut self,
8330            decoder: &mut fidl::encoding::Decoder<'_, D>,
8331            offset: usize,
8332            mut depth: fidl::encoding::Depth,
8333        ) -> fidl::Result<()> {
8334            decoder.debug_check_bounds::<Self>(offset);
8335            #[allow(unused_variables)]
8336            let next_out_of_line = decoder.next_out_of_line();
8337            let handles_before = decoder.remaining_handles();
8338            let (ordinal, inlined, num_bytes, num_handles) =
8339                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
8340
8341            let member_inline_size = match ordinal {
8342                1 => <InstalledRuleV6 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8343                2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8344                3 => <InstalledRuleV6 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8345                6 => <InstalledRuleV6 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8346                0 => return Err(fidl::Error::UnknownUnionTag),
8347                _ => num_bytes as usize,
8348            };
8349
8350            if inlined != (member_inline_size <= 4) {
8351                return Err(fidl::Error::InvalidInlineBitInEnvelope);
8352            }
8353            let _inner_offset;
8354            if inlined {
8355                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
8356                _inner_offset = offset + 8;
8357            } else {
8358                depth.increment()?;
8359                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8360            }
8361            match ordinal {
8362                1 => {
8363                    #[allow(irrefutable_let_patterns)]
8364                    if let RuleEventV6::Existing(_) = self {
8365                        // Do nothing, read the value into the object
8366                    } else {
8367                        // Initialize `self` to the right variant
8368                        *self = RuleEventV6::Existing(fidl::new_empty!(InstalledRuleV6, D));
8369                    }
8370                    #[allow(irrefutable_let_patterns)]
8371                    if let RuleEventV6::Existing(ref mut val) = self {
8372                        fidl::decode!(InstalledRuleV6, D, val, decoder, _inner_offset, depth)?;
8373                    } else {
8374                        unreachable!()
8375                    }
8376                }
8377                2 => {
8378                    #[allow(irrefutable_let_patterns)]
8379                    if let RuleEventV6::Idle(_) = self {
8380                        // Do nothing, read the value into the object
8381                    } else {
8382                        // Initialize `self` to the right variant
8383                        *self = RuleEventV6::Idle(fidl::new_empty!(Empty, D));
8384                    }
8385                    #[allow(irrefutable_let_patterns)]
8386                    if let RuleEventV6::Idle(ref mut val) = self {
8387                        fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
8388                    } else {
8389                        unreachable!()
8390                    }
8391                }
8392                3 => {
8393                    #[allow(irrefutable_let_patterns)]
8394                    if let RuleEventV6::Added(_) = self {
8395                        // Do nothing, read the value into the object
8396                    } else {
8397                        // Initialize `self` to the right variant
8398                        *self = RuleEventV6::Added(fidl::new_empty!(InstalledRuleV6, D));
8399                    }
8400                    #[allow(irrefutable_let_patterns)]
8401                    if let RuleEventV6::Added(ref mut val) = self {
8402                        fidl::decode!(InstalledRuleV6, D, val, decoder, _inner_offset, depth)?;
8403                    } else {
8404                        unreachable!()
8405                    }
8406                }
8407                6 => {
8408                    #[allow(irrefutable_let_patterns)]
8409                    if let RuleEventV6::Removed(_) = self {
8410                        // Do nothing, read the value into the object
8411                    } else {
8412                        // Initialize `self` to the right variant
8413                        *self = RuleEventV6::Removed(fidl::new_empty!(InstalledRuleV6, D));
8414                    }
8415                    #[allow(irrefutable_let_patterns)]
8416                    if let RuleEventV6::Removed(ref mut val) = self {
8417                        fidl::decode!(InstalledRuleV6, D, val, decoder, _inner_offset, depth)?;
8418                    } else {
8419                        unreachable!()
8420                    }
8421                }
8422                #[allow(deprecated)]
8423                ordinal => {
8424                    for _ in 0..num_handles {
8425                        decoder.drop_next_handle()?;
8426                    }
8427                    *self = RuleEventV6::__SourceBreaking { unknown_ordinal: ordinal };
8428                }
8429            }
8430            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
8431                return Err(fidl::Error::InvalidNumBytesInEnvelope);
8432            }
8433            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8434                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8435            }
8436            Ok(())
8437        }
8438    }
8439
8440    impl fidl::encoding::ValueTypeMarker for SpecifiedMetric {
8441        type Borrowed<'a> = &'a Self;
8442        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8443            value
8444        }
8445    }
8446
8447    unsafe impl fidl::encoding::TypeMarker for SpecifiedMetric {
8448        type Owned = Self;
8449
8450        #[inline(always)]
8451        fn inline_align(_context: fidl::encoding::Context) -> usize {
8452            8
8453        }
8454
8455        #[inline(always)]
8456        fn inline_size(_context: fidl::encoding::Context) -> usize {
8457            16
8458        }
8459    }
8460
8461    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SpecifiedMetric, D>
8462        for &SpecifiedMetric
8463    {
8464        #[inline]
8465        unsafe fn encode(
8466            self,
8467            encoder: &mut fidl::encoding::Encoder<'_, D>,
8468            offset: usize,
8469            _depth: fidl::encoding::Depth,
8470        ) -> fidl::Result<()> {
8471            encoder.debug_check_bounds::<SpecifiedMetric>(offset);
8472            encoder.write_num::<u64>(self.ordinal(), offset);
8473            match self {
8474                SpecifiedMetric::ExplicitMetric(ref val) => {
8475                    fidl::encoding::encode_in_envelope::<u32, D>(
8476                        <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
8477                        encoder,
8478                        offset + 8,
8479                        _depth,
8480                    )
8481                }
8482                SpecifiedMetric::InheritedFromInterface(ref val) => {
8483                    fidl::encoding::encode_in_envelope::<Empty, D>(
8484                        <Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
8485                        encoder,
8486                        offset + 8,
8487                        _depth,
8488                    )
8489                }
8490            }
8491        }
8492    }
8493
8494    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SpecifiedMetric {
8495        #[inline(always)]
8496        fn new_empty() -> Self {
8497            Self::ExplicitMetric(fidl::new_empty!(u32, D))
8498        }
8499
8500        #[inline]
8501        unsafe fn decode(
8502            &mut self,
8503            decoder: &mut fidl::encoding::Decoder<'_, D>,
8504            offset: usize,
8505            mut depth: fidl::encoding::Depth,
8506        ) -> fidl::Result<()> {
8507            decoder.debug_check_bounds::<Self>(offset);
8508            #[allow(unused_variables)]
8509            let next_out_of_line = decoder.next_out_of_line();
8510            let handles_before = decoder.remaining_handles();
8511            let (ordinal, inlined, num_bytes, num_handles) =
8512                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
8513
8514            let member_inline_size = match ordinal {
8515                1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8516                2 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8517                _ => return Err(fidl::Error::UnknownUnionTag),
8518            };
8519
8520            if inlined != (member_inline_size <= 4) {
8521                return Err(fidl::Error::InvalidInlineBitInEnvelope);
8522            }
8523            let _inner_offset;
8524            if inlined {
8525                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
8526                _inner_offset = offset + 8;
8527            } else {
8528                depth.increment()?;
8529                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8530            }
8531            match ordinal {
8532                1 => {
8533                    #[allow(irrefutable_let_patterns)]
8534                    if let SpecifiedMetric::ExplicitMetric(_) = self {
8535                        // Do nothing, read the value into the object
8536                    } else {
8537                        // Initialize `self` to the right variant
8538                        *self = SpecifiedMetric::ExplicitMetric(fidl::new_empty!(u32, D));
8539                    }
8540                    #[allow(irrefutable_let_patterns)]
8541                    if let SpecifiedMetric::ExplicitMetric(ref mut val) = self {
8542                        fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
8543                    } else {
8544                        unreachable!()
8545                    }
8546                }
8547                2 => {
8548                    #[allow(irrefutable_let_patterns)]
8549                    if let SpecifiedMetric::InheritedFromInterface(_) = self {
8550                        // Do nothing, read the value into the object
8551                    } else {
8552                        // Initialize `self` to the right variant
8553                        *self = SpecifiedMetric::InheritedFromInterface(fidl::new_empty!(Empty, D));
8554                    }
8555                    #[allow(irrefutable_let_patterns)]
8556                    if let SpecifiedMetric::InheritedFromInterface(ref mut val) = self {
8557                        fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
8558                    } else {
8559                        unreachable!()
8560                    }
8561                }
8562                ordinal => panic!("unexpected ordinal {:?}", ordinal),
8563            }
8564            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
8565                return Err(fidl::Error::InvalidNumBytesInEnvelope);
8566            }
8567            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8568                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8569            }
8570            Ok(())
8571        }
8572    }
8573
8574    impl fidl::encoding::ValueTypeMarker for TableInterest {
8575        type Borrowed<'a> = &'a Self;
8576        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8577            value
8578        }
8579    }
8580
8581    unsafe impl fidl::encoding::TypeMarker for TableInterest {
8582        type Owned = Self;
8583
8584        #[inline(always)]
8585        fn inline_align(_context: fidl::encoding::Context) -> usize {
8586            8
8587        }
8588
8589        #[inline(always)]
8590        fn inline_size(_context: fidl::encoding::Context) -> usize {
8591            16
8592        }
8593    }
8594
8595    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TableInterest, D>
8596        for &TableInterest
8597    {
8598        #[inline]
8599        unsafe fn encode(
8600            self,
8601            encoder: &mut fidl::encoding::Encoder<'_, D>,
8602            offset: usize,
8603            _depth: fidl::encoding::Depth,
8604        ) -> fidl::Result<()> {
8605            encoder.debug_check_bounds::<TableInterest>(offset);
8606            encoder.write_num::<u64>(self.ordinal(), offset);
8607            match self {
8608                TableInterest::Only(ref val) => fidl::encoding::encode_in_envelope::<u32, D>(
8609                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
8610                    encoder,
8611                    offset + 8,
8612                    _depth,
8613                ),
8614                TableInterest::Main(ref val) => fidl::encoding::encode_in_envelope::<Main, D>(
8615                    <Main as fidl::encoding::ValueTypeMarker>::borrow(val),
8616                    encoder,
8617                    offset + 8,
8618                    _depth,
8619                ),
8620                TableInterest::All(ref val) => fidl::encoding::encode_in_envelope::<All, D>(
8621                    <All as fidl::encoding::ValueTypeMarker>::borrow(val),
8622                    encoder,
8623                    offset + 8,
8624                    _depth,
8625                ),
8626                TableInterest::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
8627            }
8628        }
8629    }
8630
8631    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TableInterest {
8632        #[inline(always)]
8633        fn new_empty() -> Self {
8634            Self::__SourceBreaking { unknown_ordinal: 0 }
8635        }
8636
8637        #[inline]
8638        unsafe fn decode(
8639            &mut self,
8640            decoder: &mut fidl::encoding::Decoder<'_, D>,
8641            offset: usize,
8642            mut depth: fidl::encoding::Depth,
8643        ) -> fidl::Result<()> {
8644            decoder.debug_check_bounds::<Self>(offset);
8645            #[allow(unused_variables)]
8646            let next_out_of_line = decoder.next_out_of_line();
8647            let handles_before = decoder.remaining_handles();
8648            let (ordinal, inlined, num_bytes, num_handles) =
8649                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
8650
8651            let member_inline_size = match ordinal {
8652                1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8653                2 => <Main as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8654                3 => <All as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8655                0 => return Err(fidl::Error::UnknownUnionTag),
8656                _ => num_bytes as usize,
8657            };
8658
8659            if inlined != (member_inline_size <= 4) {
8660                return Err(fidl::Error::InvalidInlineBitInEnvelope);
8661            }
8662            let _inner_offset;
8663            if inlined {
8664                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
8665                _inner_offset = offset + 8;
8666            } else {
8667                depth.increment()?;
8668                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8669            }
8670            match ordinal {
8671                1 => {
8672                    #[allow(irrefutable_let_patterns)]
8673                    if let TableInterest::Only(_) = self {
8674                        // Do nothing, read the value into the object
8675                    } else {
8676                        // Initialize `self` to the right variant
8677                        *self = TableInterest::Only(fidl::new_empty!(u32, D));
8678                    }
8679                    #[allow(irrefutable_let_patterns)]
8680                    if let TableInterest::Only(ref mut val) = self {
8681                        fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
8682                    } else {
8683                        unreachable!()
8684                    }
8685                }
8686                2 => {
8687                    #[allow(irrefutable_let_patterns)]
8688                    if let TableInterest::Main(_) = self {
8689                        // Do nothing, read the value into the object
8690                    } else {
8691                        // Initialize `self` to the right variant
8692                        *self = TableInterest::Main(fidl::new_empty!(Main, D));
8693                    }
8694                    #[allow(irrefutable_let_patterns)]
8695                    if let TableInterest::Main(ref mut val) = self {
8696                        fidl::decode!(Main, D, val, decoder, _inner_offset, depth)?;
8697                    } else {
8698                        unreachable!()
8699                    }
8700                }
8701                3 => {
8702                    #[allow(irrefutable_let_patterns)]
8703                    if let TableInterest::All(_) = self {
8704                        // Do nothing, read the value into the object
8705                    } else {
8706                        // Initialize `self` to the right variant
8707                        *self = TableInterest::All(fidl::new_empty!(All, D));
8708                    }
8709                    #[allow(irrefutable_let_patterns)]
8710                    if let TableInterest::All(ref mut val) = self {
8711                        fidl::decode!(All, D, val, decoder, _inner_offset, depth)?;
8712                    } else {
8713                        unreachable!()
8714                    }
8715                }
8716                #[allow(deprecated)]
8717                ordinal => {
8718                    for _ in 0..num_handles {
8719                        decoder.drop_next_handle()?;
8720                    }
8721                    *self = TableInterest::__SourceBreaking { unknown_ordinal: ordinal };
8722                }
8723            }
8724            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
8725                return Err(fidl::Error::InvalidNumBytesInEnvelope);
8726            }
8727            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8728                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8729            }
8730            Ok(())
8731        }
8732    }
8733}