Skip to main content

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