fidl_fuchsia_net_routes__common/
fidl_fuchsia_net_routes__common.rs

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