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    #[deprecated = "Strict enums should not use `is_unknown`"]
120    #[inline]
121    pub fn is_unknown(&self) -> bool {
122        false
123    }
124}
125
126#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
127pub struct All;
128
129impl fidl::Persistable for All {}
130
131#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
132#[repr(C)]
133pub struct Between {
134    /// start of the range, inclusive.
135    pub start: u32,
136    /// end of the range, inclusive.
137    pub end: u32,
138}
139
140impl fidl::Persistable for Between {}
141
142/// A placeholder for empty values.
143#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
144pub struct Empty;
145
146impl fidl::Persistable for Empty {}
147
148/// An installed IPv4 routing rule.
149#[derive(Clone, Debug, PartialEq)]
150pub struct InstalledRuleV4 {
151    /// Rule sets are ordered by the rule set priority, rule sets are disjoint
152    /// and don’t have interleaving rules among them.
153    pub rule_set_priority: u32,
154    /// Rules within a rule set are locally ordered, together with the rule set
155    /// priority, this defines a global order for all installed rules.
156    pub rule_index: u32,
157    /// The matcher part of the rule, the rule is a no-op if the matcher does
158    /// not match the packet.
159    pub matcher: RuleMatcherV4,
160    /// The action part of the rule that describes what to do if the matcher
161    /// matches the packet.
162    pub action: RuleAction,
163}
164
165impl fidl::Persistable for InstalledRuleV4 {}
166
167/// An installed IPv6 routing rule.
168#[derive(Clone, Debug, PartialEq)]
169pub struct InstalledRuleV6 {
170    /// Rule sets are ordered by the rule set priority, rule sets are disjoint
171    /// and don’t have interleaving rules among them.
172    pub rule_set_priority: u32,
173    /// Rules within a rule set are locally ordered, together with the rule set
174    /// priority, this defines a global order for all installed rules.
175    pub rule_index: u32,
176    /// The matcher part of the rule, the rule is a no-op if the matcher does
177    /// not match the packet.
178    pub matcher: RuleMatcherV6,
179    /// The action part of the rule that describes what to do if the matcher
180    /// matches the packet.
181    pub action: RuleAction,
182}
183
184impl fidl::Persistable for InstalledRuleV6 {}
185
186#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
187pub struct Main;
188
189impl fidl::Persistable for Main {}
190
191#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
192#[repr(C)]
193pub struct Marked {
194    /// Mask to apply before comparing to the range in `between`.
195    pub mask: u32,
196    /// The mark is between the given range.
197    pub between: Between,
198}
199
200impl fidl::Persistable for Marked {}
201
202#[derive(Clone, Debug, PartialEq)]
203pub struct RouteTargetV4 {
204    /// The interface ID of the target's outbound interface.
205    pub outbound_interface: u64,
206    /// The optional next-hop of the target. If provided, the address
207    /// must be a unicast address.
208    pub next_hop: Option<Box<fidl_fuchsia_net::Ipv4Address>>,
209}
210
211impl fidl::Persistable for RouteTargetV4 {}
212
213#[derive(Clone, Debug, PartialEq)]
214pub struct RouteTargetV6 {
215    /// The interface ID of the target's outbound interface.
216    pub outbound_interface: u64,
217    /// The optional next-hop of the target. If provided, the address
218    /// must be a unicast address.
219    pub next_hop: Option<Box<fidl_fuchsia_net::Ipv6Address>>,
220}
221
222impl fidl::Persistable for RouteTargetV6 {}
223
224/// A `RouteV4` specifies an IPv4 network route.
225#[derive(Clone, Debug, PartialEq)]
226pub struct RouteV4 {
227    /// The destination subnet of the route. When making a routing decision
228    /// for a given packet the route whose destination forms the longest
229    /// matching prefix will be selected, with ties being broken by the route's
230    /// metric.
231    pub destination: fidl_fuchsia_net::Ipv4AddressWithPrefix,
232    /// Packets matching this route will have the specified action applied to
233    /// them.
234    pub action: RouteActionV4,
235    /// The additional properties of the IPv4 route.
236    pub properties: RoutePropertiesV4,
237}
238
239impl fidl::Persistable for RouteV4 {}
240
241/// A `RouteV6` specifies an IPv6 network route.
242#[derive(Clone, Debug, PartialEq)]
243pub struct RouteV6 {
244    /// The destination subnet of the route. When making a routing decision
245    /// for a given packet the route whose destination forms the longest
246    /// matching prefix will be selected, with ties being broken by the route's
247    /// metric.
248    pub destination: fidl_fuchsia_net::Ipv6AddressWithPrefix,
249    /// Packets matching this route will have the specified action applied to
250    /// them.
251    pub action: RouteActionV6,
252    /// The additional properties of the IPv6 route.
253    pub properties: RoutePropertiesV6,
254}
255
256impl fidl::Persistable for RouteV6 {}
257
258#[derive(Clone, Debug, PartialEq)]
259pub struct RuleWatcherV4WatchResponse {
260    pub events: Vec<RuleEventV4>,
261}
262
263impl fidl::Persistable for RuleWatcherV4WatchResponse {}
264
265#[derive(Clone, Debug, PartialEq)]
266pub struct RuleWatcherV6WatchResponse {
267    pub events: Vec<RuleEventV6>,
268}
269
270impl fidl::Persistable for RuleWatcherV6WatchResponse {}
271
272#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
273#[repr(C)]
274pub struct StateGetRouteTableNameRequest {
275    pub table_id: u32,
276}
277
278impl fidl::Persistable for StateGetRouteTableNameRequest {}
279
280#[derive(Clone, Debug, PartialEq)]
281pub struct StateResolve2Request {
282    pub destination: fidl_fuchsia_net::IpAddress,
283    pub options: ResolveOptions,
284}
285
286impl fidl::Persistable for StateResolve2Request {}
287
288#[derive(Clone, Debug, PartialEq)]
289pub struct StateResolveRequest {
290    pub destination: fidl_fuchsia_net::IpAddress,
291}
292
293impl fidl::Persistable for StateResolveRequest {}
294
295#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
296pub struct StateGetRouteTableNameResponse {
297    pub table_name: String,
298}
299
300impl fidl::Persistable for StateGetRouteTableNameResponse {}
301
302#[derive(Clone, Debug, PartialEq)]
303pub struct StateResolve2Response {
304    /// A resolved route.
305    ///
306    /// Contains the information for the "next-hop" or immediate-destination
307    /// that is the result of a route resolution. A resolved route is only
308    /// meaningful in the context of a requested destination.
309    pub result: ResolveResult,
310}
311
312impl fidl::Persistable for StateResolve2Response {}
313
314#[derive(Clone, Debug, PartialEq)]
315pub struct StateResolveResponse {
316    /// A resolved route.
317    ///
318    /// Contains the information for the "next-hop" or immediate-destination
319    /// that is the result of a route resolution. A resolved route is only
320    /// meaningful in the context of a requested destination.
321    pub result: Resolved,
322}
323
324impl fidl::Persistable for StateResolveResponse {}
325
326#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
327pub struct Unbound;
328
329impl fidl::Persistable for Unbound {}
330
331#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
332pub struct Unmarked;
333
334impl fidl::Persistable for Unmarked {}
335
336#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
337pub struct Unreachable;
338
339impl fidl::Persistable for Unreachable {}
340
341#[derive(Clone, Debug, PartialEq)]
342pub struct WatcherV4WatchResponse {
343    pub events: Vec<EventV4>,
344}
345
346impl fidl::Persistable for WatcherV4WatchResponse {}
347
348#[derive(Clone, Debug, PartialEq)]
349pub struct WatcherV6WatchResponse {
350    pub events: Vec<EventV6>,
351}
352
353impl fidl::Persistable for WatcherV6WatchResponse {}
354
355/// The common matcher that can be matched to both IPv4 and IPv6 packets.
356///
357/// A matcher matches a packet if all of the present fields match the
358/// corresponding properties.
359#[derive(Clone, Debug, Default, PartialEq)]
360pub struct BaseMatcher {
361    /// Matches the packet iff the packet was locally generated.
362    pub locally_generated: Option<bool>,
363    /// Matches the packet iff the packet is sent with `SO_BINDTODEVICE`.
364    pub bound_device: Option<InterfaceMatcher>,
365    /// Matches the MARK_1 domain.
366    pub mark_1: Option<MarkMatcher>,
367    /// Matches for the MARK_2 domain.
368    pub mark_2: Option<MarkMatcher>,
369    #[doc(hidden)]
370    pub __source_breaking: fidl::marker::SourceBreaking,
371}
372
373impl fidl::Persistable for BaseMatcher {}
374
375/// Collection of addresses and identifiers describing a network destination.
376///
377/// A `Destination` is the "next-hop" for a routed packet.
378#[derive(Clone, Debug, Default, PartialEq)]
379pub struct Destination {
380    /// The IP address of the destination.
381    pub address: Option<fidl_fuchsia_net::IpAddress>,
382    /// The MAC address of the destination. Only set if the destination is on a
383    /// link that requires a MAC address.
384    pub mac: Option<fidl_fuchsia_net::MacAddress>,
385    /// The interface identifier over which the destination can be reached.
386    pub interface_id: Option<u64>,
387    /// The preferred local IP address used to communicate with the destination.
388    pub source_address: Option<fidl_fuchsia_net::IpAddress>,
389    #[doc(hidden)]
390    pub __source_breaking: fidl::marker::SourceBreaking,
391}
392
393impl fidl::Persistable for Destination {}
394
395/// The effective properties of a route installed in the system.
396#[derive(Clone, Debug, Default, PartialEq)]
397pub struct EffectiveRouteProperties {
398    /// The route's effective metric, dependent on the value of the route's
399    /// [`SpecifiedRouteProperties`]. If the `specified_metric` is
400    /// `explicit_metric`, this value will be identical to the provided value;
401    /// if the `specified_metric` is `inherited_from_interface` this value will
402    /// be the interface's routing metric.
403    pub metric: Option<u32>,
404    #[doc(hidden)]
405    pub __source_breaking: fidl::marker::SourceBreaking,
406}
407
408impl fidl::Persistable for EffectiveRouteProperties {}
409
410/// An `InstalledRouteV4` specifies an IPv4 network route that is installed in
411/// the system's routing table.
412#[derive(Clone, Debug, Default, PartialEq)]
413pub struct InstalledRouteV4 {
414    /// The route.
415    pub route: Option<RouteV4>,
416    /// The route's effective properties.
417    pub effective_properties: Option<EffectiveRouteProperties>,
418    /// The ID of the table to which this route belongs.
419    pub table_id: Option<u32>,
420    #[doc(hidden)]
421    pub __source_breaking: fidl::marker::SourceBreaking,
422}
423
424impl fidl::Persistable for InstalledRouteV4 {}
425
426/// An `InstalledRouteV6` specifies an IPv6 network route that is installed in
427/// the system's routing table.
428#[derive(Clone, Debug, Default, PartialEq)]
429pub struct InstalledRouteV6 {
430    /// The route.
431    pub route: Option<RouteV6>,
432    /// The route's effective properties.
433    pub effective_properties: Option<EffectiveRouteProperties>,
434    /// The ID of the table to which this route belongs.
435    pub table_id: Option<u32>,
436    #[doc(hidden)]
437    pub __source_breaking: fidl::marker::SourceBreaking,
438}
439
440impl fidl::Persistable for InstalledRouteV6 {}
441
442#[derive(Clone, Debug, Default, PartialEq)]
443pub struct ResolveOptions {
444    /// The marks used for the route resolution.
445    ///
446    /// For mark domains that are not present, the route resolution will
447    /// happen with no marks for the domain. This field is also optional.
448    /// If absent, all mark domains are considered to be unmarked for the
449    /// route resolution.
450    pub marks: Option<fidl_fuchsia_net::Marks>,
451    #[doc(hidden)]
452    pub __source_breaking: fidl::marker::SourceBreaking,
453}
454
455impl fidl::Persistable for ResolveOptions {}
456
457#[derive(Clone, Debug, Default, PartialEq)]
458pub struct RoutePropertiesV4 {
459    /// The route's specified properties.
460    pub specified_properties: Option<SpecifiedRouteProperties>,
461    #[doc(hidden)]
462    pub __source_breaking: fidl::marker::SourceBreaking,
463}
464
465impl fidl::Persistable for RoutePropertiesV4 {}
466
467#[derive(Clone, Debug, Default, PartialEq)]
468pub struct RoutePropertiesV6 {
469    /// The route's specified properties.
470    pub specified_properties: Option<SpecifiedRouteProperties>,
471    #[doc(hidden)]
472    pub __source_breaking: fidl::marker::SourceBreaking,
473}
474
475impl fidl::Persistable for RoutePropertiesV6 {}
476
477/// The matcher part of the rule that is used to match packets.
478///
479/// A matcher matches a packet if all of the present fields match the
480/// corresponding properties.
481#[derive(Clone, Debug, Default, PartialEq)]
482pub struct RuleMatcherV4 {
483    /// Matches whether the source address of the packet is from the subnet.
484    pub from: Option<fidl_fuchsia_net::Ipv4AddressWithPrefix>,
485    /// The rest of the matcher that is common between IP versions.
486    pub base: Option<BaseMatcher>,
487    #[doc(hidden)]
488    pub __source_breaking: fidl::marker::SourceBreaking,
489}
490
491impl fidl::Persistable for RuleMatcherV4 {}
492
493/// The matcher part of the rule that is used to match packets.
494///
495/// A matcher matches a packet if all of the present fields match the
496/// corresponding properties.
497#[derive(Clone, Debug, Default, PartialEq)]
498pub struct RuleMatcherV6 {
499    /// Matches whether the source address of the packet is from the subnet.
500    pub from: Option<fidl_fuchsia_net::Ipv6AddressWithPrefix>,
501    /// The rest of the matchers that is common between IP versions.
502    pub base: Option<BaseMatcher>,
503    #[doc(hidden)]
504    pub __source_breaking: fidl::marker::SourceBreaking,
505}
506
507impl fidl::Persistable for RuleMatcherV6 {}
508
509#[derive(Clone, Debug, Default, PartialEq)]
510pub struct RuleWatcherOptionsV4 {
511    #[doc(hidden)]
512    pub __source_breaking: fidl::marker::SourceBreaking,
513}
514
515impl fidl::Persistable for RuleWatcherOptionsV4 {}
516
517#[derive(Clone, Debug, Default, PartialEq)]
518pub struct RuleWatcherOptionsV6 {
519    #[doc(hidden)]
520    pub __source_breaking: fidl::marker::SourceBreaking,
521}
522
523impl fidl::Persistable for RuleWatcherOptionsV6 {}
524
525/// The properties of the route that were explicitly specified at the time the
526/// route was created.
527#[derive(Clone, Debug, Default, PartialEq)]
528pub struct SpecifiedRouteProperties {
529    /// The route's effective metric will be determined by whichever value is
530    /// specified below.
531    pub metric: Option<SpecifiedMetric>,
532    #[doc(hidden)]
533    pub __source_breaking: fidl::marker::SourceBreaking,
534}
535
536impl fidl::Persistable for SpecifiedRouteProperties {}
537
538#[derive(Clone, Debug, Default, PartialEq)]
539pub struct WatcherOptionsV4 {
540    /// Filter events on tables matching `table_interest`.
541    ///
542    /// Interpreted as `all` if absent. The server does not validate if
543    /// `TableInterest` contains valid table IDs.
544    pub table_interest: Option<TableInterest>,
545    #[doc(hidden)]
546    pub __source_breaking: fidl::marker::SourceBreaking,
547}
548
549impl fidl::Persistable for WatcherOptionsV4 {}
550
551#[derive(Clone, Debug, Default, PartialEq)]
552pub struct WatcherOptionsV6 {
553    /// Filter events on tables matching `table_interest`.
554    ///
555    /// Interpreted as `all` if absent. The server does not validate if
556    /// `TableInterest` contains valid table IDs.
557    pub table_interest: Option<TableInterest>,
558    #[doc(hidden)]
559    pub __source_breaking: fidl::marker::SourceBreaking,
560}
561
562impl fidl::Persistable for WatcherOptionsV6 {}
563
564#[derive(Clone, Debug)]
565pub enum EventV4 {
566    /// A route that already existed when watching started.
567    Existing(InstalledRouteV4),
568    /// Sentinel value indicating no more `existing` events will be
569    /// received.
570    Idle(Empty),
571    /// A route that was added while watching.
572    Added(InstalledRouteV4),
573    /// A route that was removed while watching.
574    Removed(InstalledRouteV4),
575    #[doc(hidden)]
576    __SourceBreaking { unknown_ordinal: u64 },
577}
578
579/// Pattern that matches an unknown `EventV4` member.
580#[macro_export]
581macro_rules! EventV4Unknown {
582    () => {
583        _
584    };
585}
586
587// Custom PartialEq so that unknown variants are not equal to themselves.
588impl PartialEq for EventV4 {
589    fn eq(&self, other: &Self) -> bool {
590        match (self, other) {
591            (Self::Existing(x), Self::Existing(y)) => *x == *y,
592            (Self::Idle(x), Self::Idle(y)) => *x == *y,
593            (Self::Added(x), Self::Added(y)) => *x == *y,
594            (Self::Removed(x), Self::Removed(y)) => *x == *y,
595            _ => false,
596        }
597    }
598}
599
600impl EventV4 {
601    #[inline]
602    pub fn ordinal(&self) -> u64 {
603        match *self {
604            Self::Existing(_) => 1,
605            Self::Idle(_) => 2,
606            Self::Added(_) => 3,
607            Self::Removed(_) => 4,
608            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
609        }
610    }
611
612    #[inline]
613    pub fn unknown_variant_for_testing() -> Self {
614        Self::__SourceBreaking { unknown_ordinal: 0 }
615    }
616
617    #[inline]
618    pub fn is_unknown(&self) -> bool {
619        match self {
620            Self::__SourceBreaking { .. } => true,
621            _ => false,
622        }
623    }
624}
625
626impl fidl::Persistable for EventV4 {}
627
628#[derive(Clone, Debug)]
629pub enum EventV6 {
630    /// A route that already existed when watching started.
631    Existing(InstalledRouteV6),
632    /// Sentinel value indicating no more `existing` events will be
633    /// received.
634    Idle(Empty),
635    /// A route that was added while watching.
636    Added(InstalledRouteV6),
637    /// A route that was removed while watching.
638    Removed(InstalledRouteV6),
639    #[doc(hidden)]
640    __SourceBreaking { unknown_ordinal: u64 },
641}
642
643/// Pattern that matches an unknown `EventV6` member.
644#[macro_export]
645macro_rules! EventV6Unknown {
646    () => {
647        _
648    };
649}
650
651// Custom PartialEq so that unknown variants are not equal to themselves.
652impl PartialEq for EventV6 {
653    fn eq(&self, other: &Self) -> bool {
654        match (self, other) {
655            (Self::Existing(x), Self::Existing(y)) => *x == *y,
656            (Self::Idle(x), Self::Idle(y)) => *x == *y,
657            (Self::Added(x), Self::Added(y)) => *x == *y,
658            (Self::Removed(x), Self::Removed(y)) => *x == *y,
659            _ => false,
660        }
661    }
662}
663
664impl EventV6 {
665    #[inline]
666    pub fn ordinal(&self) -> u64 {
667        match *self {
668            Self::Existing(_) => 1,
669            Self::Idle(_) => 2,
670            Self::Added(_) => 3,
671            Self::Removed(_) => 4,
672            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
673        }
674    }
675
676    #[inline]
677    pub fn unknown_variant_for_testing() -> Self {
678        Self::__SourceBreaking { unknown_ordinal: 0 }
679    }
680
681    #[inline]
682    pub fn is_unknown(&self) -> bool {
683        match self {
684            Self::__SourceBreaking { .. } => true,
685            _ => false,
686        }
687    }
688}
689
690impl fidl::Persistable for EventV6 {}
691
692/// Matches on the originating interface of the outgoing packet.
693#[derive(Clone, Debug)]
694pub enum InterfaceMatcher {
695    /// Matches the device iff the names match.
696    ///
697    /// The name is not a pattern or regex, it needs to be an exact match for
698    /// the rule to be chosen.
699    DeviceName(String),
700    /// Matches iff the outgoing traffic is not bound to a device.
701    Unbound(Unbound),
702    #[doc(hidden)]
703    __SourceBreaking { unknown_ordinal: u64 },
704}
705
706/// Pattern that matches an unknown `InterfaceMatcher` member.
707#[macro_export]
708macro_rules! InterfaceMatcherUnknown {
709    () => {
710        _
711    };
712}
713
714// Custom PartialEq so that unknown variants are not equal to themselves.
715impl PartialEq for InterfaceMatcher {
716    fn eq(&self, other: &Self) -> bool {
717        match (self, other) {
718            (Self::DeviceName(x), Self::DeviceName(y)) => *x == *y,
719            (Self::Unbound(x), Self::Unbound(y)) => *x == *y,
720            _ => false,
721        }
722    }
723}
724
725impl InterfaceMatcher {
726    #[inline]
727    pub fn ordinal(&self) -> u64 {
728        match *self {
729            Self::DeviceName(_) => 1,
730            Self::Unbound(_) => 2,
731            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
732        }
733    }
734
735    #[inline]
736    pub fn unknown_variant_for_testing() -> Self {
737        Self::__SourceBreaking { unknown_ordinal: 0 }
738    }
739
740    #[inline]
741    pub fn is_unknown(&self) -> bool {
742        match self {
743            Self::__SourceBreaking { .. } => true,
744            _ => false,
745        }
746    }
747}
748
749impl fidl::Persistable for InterfaceMatcher {}
750
751/// Matches the mark value of a packet.
752#[derive(Clone, Debug)]
753pub enum MarkMatcher {
754    /// This mark domain does not have a mark.
755    Unmarked(Unmarked),
756    Marked(Marked),
757    #[doc(hidden)]
758    __SourceBreaking {
759        unknown_ordinal: u64,
760    },
761}
762
763/// Pattern that matches an unknown `MarkMatcher` member.
764#[macro_export]
765macro_rules! MarkMatcherUnknown {
766    () => {
767        _
768    };
769}
770
771// Custom PartialEq so that unknown variants are not equal to themselves.
772impl PartialEq for MarkMatcher {
773    fn eq(&self, other: &Self) -> bool {
774        match (self, other) {
775            (Self::Unmarked(x), Self::Unmarked(y)) => *x == *y,
776            (Self::Marked(x), Self::Marked(y)) => *x == *y,
777            _ => false,
778        }
779    }
780}
781
782impl MarkMatcher {
783    #[inline]
784    pub fn ordinal(&self) -> u64 {
785        match *self {
786            Self::Unmarked(_) => 1,
787            Self::Marked(_) => 2,
788            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
789        }
790    }
791
792    #[inline]
793    pub fn unknown_variant_for_testing() -> Self {
794        Self::__SourceBreaking { unknown_ordinal: 0 }
795    }
796
797    #[inline]
798    pub fn is_unknown(&self) -> bool {
799        match self {
800            Self::__SourceBreaking { .. } => true,
801            _ => false,
802        }
803    }
804}
805
806impl fidl::Persistable for MarkMatcher {}
807
808#[derive(Clone, Debug)]
809pub enum ResolveResult {
810    /// The requested destination is directly reachable.
811    Direct(Destination),
812    /// The requested destination is reachable through a gateway, thus
813    /// the next hop is the gateway.
814    Gateway(Destination),
815    #[doc(hidden)]
816    __SourceBreaking { unknown_ordinal: u64 },
817}
818
819/// Pattern that matches an unknown `ResolveResult` member.
820#[macro_export]
821macro_rules! ResolveResultUnknown {
822    () => {
823        _
824    };
825}
826
827// Custom PartialEq so that unknown variants are not equal to themselves.
828impl PartialEq for ResolveResult {
829    fn eq(&self, other: &Self) -> bool {
830        match (self, other) {
831            (Self::Direct(x), Self::Direct(y)) => *x == *y,
832            (Self::Gateway(x), Self::Gateway(y)) => *x == *y,
833            _ => false,
834        }
835    }
836}
837
838impl ResolveResult {
839    #[inline]
840    pub fn ordinal(&self) -> u64 {
841        match *self {
842            Self::Direct(_) => 1,
843            Self::Gateway(_) => 2,
844            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
845        }
846    }
847
848    #[inline]
849    pub fn unknown_variant_for_testing() -> Self {
850        Self::__SourceBreaking { unknown_ordinal: 0 }
851    }
852
853    #[inline]
854    pub fn is_unknown(&self) -> bool {
855        match self {
856            Self::__SourceBreaking { .. } => true,
857            _ => false,
858        }
859    }
860}
861
862impl fidl::Persistable for ResolveResult {}
863
864#[derive(Clone, Debug, PartialEq)]
865pub enum Resolved {
866    /// The requested destination is directly reachable.
867    Direct(Destination),
868    /// The requested destination is reachable through a gateway, thus
869    /// the next hop is the gateway.
870    Gateway(Destination),
871}
872
873impl Resolved {
874    #[inline]
875    pub fn ordinal(&self) -> u64 {
876        match *self {
877            Self::Direct(_) => 1,
878            Self::Gateway(_) => 2,
879        }
880    }
881
882    #[deprecated = "Strict unions should not use `is_unknown`"]
883    #[inline]
884    pub fn is_unknown(&self) -> bool {
885        false
886    }
887}
888
889impl fidl::Persistable for Resolved {}
890
891#[derive(Clone, Debug)]
892pub enum RouteActionV4 {
893    /// Forward the packet to the specified target.
894    Forward(RouteTargetV4),
895    #[doc(hidden)]
896    __SourceBreaking { unknown_ordinal: u64 },
897}
898
899/// Pattern that matches an unknown `RouteActionV4` member.
900#[macro_export]
901macro_rules! RouteActionV4Unknown {
902    () => {
903        _
904    };
905}
906
907// Custom PartialEq so that unknown variants are not equal to themselves.
908impl PartialEq for RouteActionV4 {
909    fn eq(&self, other: &Self) -> bool {
910        match (self, other) {
911            (Self::Forward(x), Self::Forward(y)) => *x == *y,
912            _ => false,
913        }
914    }
915}
916
917impl RouteActionV4 {
918    #[inline]
919    pub fn ordinal(&self) -> u64 {
920        match *self {
921            Self::Forward(_) => 1,
922            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
923        }
924    }
925
926    #[inline]
927    pub fn unknown_variant_for_testing() -> Self {
928        Self::__SourceBreaking { unknown_ordinal: 0 }
929    }
930
931    #[inline]
932    pub fn is_unknown(&self) -> bool {
933        match self {
934            Self::__SourceBreaking { .. } => true,
935            _ => false,
936        }
937    }
938}
939
940impl fidl::Persistable for RouteActionV4 {}
941
942#[derive(Clone, Debug)]
943pub enum RouteActionV6 {
944    /// Forward the packet to the specified target.
945    Forward(RouteTargetV6),
946    #[doc(hidden)]
947    __SourceBreaking { unknown_ordinal: u64 },
948}
949
950/// Pattern that matches an unknown `RouteActionV6` member.
951#[macro_export]
952macro_rules! RouteActionV6Unknown {
953    () => {
954        _
955    };
956}
957
958// Custom PartialEq so that unknown variants are not equal to themselves.
959impl PartialEq for RouteActionV6 {
960    fn eq(&self, other: &Self) -> bool {
961        match (self, other) {
962            (Self::Forward(x), Self::Forward(y)) => *x == *y,
963            _ => false,
964        }
965    }
966}
967
968impl RouteActionV6 {
969    #[inline]
970    pub fn ordinal(&self) -> u64 {
971        match *self {
972            Self::Forward(_) => 1,
973            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
974        }
975    }
976
977    #[inline]
978    pub fn unknown_variant_for_testing() -> Self {
979        Self::__SourceBreaking { unknown_ordinal: 0 }
980    }
981
982    #[inline]
983    pub fn is_unknown(&self) -> bool {
984        match self {
985            Self::__SourceBreaking { .. } => true,
986            _ => false,
987        }
988    }
989}
990
991impl fidl::Persistable for RouteActionV6 {}
992
993/// Actions of a rule if the matcher matches.
994#[derive(Clone, Debug)]
995pub enum RuleAction {
996    /// Look for a route in the indicated route table. If there is no matching
997    /// route in the target table, the lookup will continue to consider the
998    /// next rule.
999    Lookup(u32),
1000    /// Return network is unreachable. This is contrary to if a `lookup` table
1001    /// is empty or no matching routes, this decision is terminal and stops
1002    /// the lookup process from continuing.
1003    Unreachable(Unreachable),
1004    #[doc(hidden)]
1005    __SourceBreaking { unknown_ordinal: u64 },
1006}
1007
1008/// Pattern that matches an unknown `RuleAction` member.
1009#[macro_export]
1010macro_rules! RuleActionUnknown {
1011    () => {
1012        _
1013    };
1014}
1015
1016// Custom PartialEq so that unknown variants are not equal to themselves.
1017impl PartialEq for RuleAction {
1018    fn eq(&self, other: &Self) -> bool {
1019        match (self, other) {
1020            (Self::Lookup(x), Self::Lookup(y)) => *x == *y,
1021            (Self::Unreachable(x), Self::Unreachable(y)) => *x == *y,
1022            _ => false,
1023        }
1024    }
1025}
1026
1027impl RuleAction {
1028    #[inline]
1029    pub fn ordinal(&self) -> u64 {
1030        match *self {
1031            Self::Lookup(_) => 1,
1032            Self::Unreachable(_) => 2,
1033            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
1034        }
1035    }
1036
1037    #[inline]
1038    pub fn unknown_variant_for_testing() -> Self {
1039        Self::__SourceBreaking { unknown_ordinal: 0 }
1040    }
1041
1042    #[inline]
1043    pub fn is_unknown(&self) -> bool {
1044        match self {
1045            Self::__SourceBreaking { .. } => true,
1046            _ => false,
1047        }
1048    }
1049}
1050
1051impl fidl::Persistable for RuleAction {}
1052
1053#[derive(Clone, Debug)]
1054pub enum RuleEventV4 {
1055    /// A rule that already existed when watching started.
1056    Existing(InstalledRuleV4),
1057    /// Sentinel value indicating no more `existing` events will be
1058    /// received.
1059    Idle(Empty),
1060    /// A rule that was added while watching.
1061    Added(InstalledRuleV4),
1062    /// A rule that was removed while watching.
1063    Removed(InstalledRuleV4),
1064    #[doc(hidden)]
1065    __SourceBreaking { unknown_ordinal: u64 },
1066}
1067
1068/// Pattern that matches an unknown `RuleEventV4` member.
1069#[macro_export]
1070macro_rules! RuleEventV4Unknown {
1071    () => {
1072        _
1073    };
1074}
1075
1076// Custom PartialEq so that unknown variants are not equal to themselves.
1077impl PartialEq for RuleEventV4 {
1078    fn eq(&self, other: &Self) -> bool {
1079        match (self, other) {
1080            (Self::Existing(x), Self::Existing(y)) => *x == *y,
1081            (Self::Idle(x), Self::Idle(y)) => *x == *y,
1082            (Self::Added(x), Self::Added(y)) => *x == *y,
1083            (Self::Removed(x), Self::Removed(y)) => *x == *y,
1084            _ => false,
1085        }
1086    }
1087}
1088
1089impl RuleEventV4 {
1090    #[inline]
1091    pub fn ordinal(&self) -> u64 {
1092        match *self {
1093            Self::Existing(_) => 1,
1094            Self::Idle(_) => 2,
1095            Self::Added(_) => 3,
1096            Self::Removed(_) => 4,
1097            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
1098        }
1099    }
1100
1101    #[inline]
1102    pub fn unknown_variant_for_testing() -> Self {
1103        Self::__SourceBreaking { unknown_ordinal: 0 }
1104    }
1105
1106    #[inline]
1107    pub fn is_unknown(&self) -> bool {
1108        match self {
1109            Self::__SourceBreaking { .. } => true,
1110            _ => false,
1111        }
1112    }
1113}
1114
1115impl fidl::Persistable for RuleEventV4 {}
1116
1117#[derive(Clone, Debug)]
1118pub enum RuleEventV6 {
1119    /// A rule that already existed when watching started.
1120    Existing(InstalledRuleV6),
1121    /// Sentinel value indicating no more `existing` events will be
1122    /// received.
1123    Idle(Empty),
1124    /// A rule that was added while watching.
1125    Added(InstalledRuleV6),
1126    /// A rule that was removed while watching.
1127    Removed(InstalledRuleV6),
1128    #[doc(hidden)]
1129    __SourceBreaking { unknown_ordinal: u64 },
1130}
1131
1132/// Pattern that matches an unknown `RuleEventV6` member.
1133#[macro_export]
1134macro_rules! RuleEventV6Unknown {
1135    () => {
1136        _
1137    };
1138}
1139
1140// Custom PartialEq so that unknown variants are not equal to themselves.
1141impl PartialEq for RuleEventV6 {
1142    fn eq(&self, other: &Self) -> bool {
1143        match (self, other) {
1144            (Self::Existing(x), Self::Existing(y)) => *x == *y,
1145            (Self::Idle(x), Self::Idle(y)) => *x == *y,
1146            (Self::Added(x), Self::Added(y)) => *x == *y,
1147            (Self::Removed(x), Self::Removed(y)) => *x == *y,
1148            _ => false,
1149        }
1150    }
1151}
1152
1153impl RuleEventV6 {
1154    #[inline]
1155    pub fn ordinal(&self) -> u64 {
1156        match *self {
1157            Self::Existing(_) => 1,
1158            Self::Idle(_) => 2,
1159            Self::Added(_) => 3,
1160            Self::Removed(_) => 6,
1161            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
1162        }
1163    }
1164
1165    #[inline]
1166    pub fn unknown_variant_for_testing() -> Self {
1167        Self::__SourceBreaking { unknown_ordinal: 0 }
1168    }
1169
1170    #[inline]
1171    pub fn is_unknown(&self) -> bool {
1172        match self {
1173            Self::__SourceBreaking { .. } => true,
1174            _ => false,
1175        }
1176    }
1177}
1178
1179impl fidl::Persistable for RuleEventV6 {}
1180
1181#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1182pub enum SpecifiedMetric {
1183    /// The route's metric will be this explicitly specified value.
1184    ExplicitMetric(u32),
1185    /// The route's metric is inherited from its outbound interface, and
1186    /// will track this value as it changes throughout the route's lifetime.
1187    /// Clients may prefer this approach if they wish to offload the
1188    /// responsibility of "which route is best" to the system.
1189    InheritedFromInterface(Empty),
1190}
1191
1192impl SpecifiedMetric {
1193    #[inline]
1194    pub fn ordinal(&self) -> u64 {
1195        match *self {
1196            Self::ExplicitMetric(_) => 1,
1197            Self::InheritedFromInterface(_) => 2,
1198        }
1199    }
1200
1201    #[deprecated = "Strict unions should not use `is_unknown`"]
1202    #[inline]
1203    pub fn is_unknown(&self) -> bool {
1204        false
1205    }
1206}
1207
1208impl fidl::Persistable for SpecifiedMetric {}
1209
1210/// Specifies which table(s) the watcher is interested in.
1211#[derive(Clone, Debug)]
1212pub enum TableInterest {
1213    /// Only watch for events on the specified table.
1214    Only(u32),
1215    /// Watches on the main table without knowing the table ID.
1216    Main(Main),
1217    /// Watches for all routing tables.
1218    All(All),
1219    #[doc(hidden)]
1220    __SourceBreaking { unknown_ordinal: u64 },
1221}
1222
1223/// Pattern that matches an unknown `TableInterest` member.
1224#[macro_export]
1225macro_rules! TableInterestUnknown {
1226    () => {
1227        _
1228    };
1229}
1230
1231// Custom PartialEq so that unknown variants are not equal to themselves.
1232impl PartialEq for TableInterest {
1233    fn eq(&self, other: &Self) -> bool {
1234        match (self, other) {
1235            (Self::Only(x), Self::Only(y)) => *x == *y,
1236            (Self::Main(x), Self::Main(y)) => *x == *y,
1237            (Self::All(x), Self::All(y)) => *x == *y,
1238            _ => false,
1239        }
1240    }
1241}
1242
1243impl TableInterest {
1244    #[inline]
1245    pub fn ordinal(&self) -> u64 {
1246        match *self {
1247            Self::Only(_) => 1,
1248            Self::Main(_) => 2,
1249            Self::All(_) => 3,
1250            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
1251        }
1252    }
1253
1254    #[inline]
1255    pub fn unknown_variant_for_testing() -> Self {
1256        Self::__SourceBreaking { unknown_ordinal: 0 }
1257    }
1258
1259    #[inline]
1260    pub fn is_unknown(&self) -> bool {
1261        match self {
1262            Self::__SourceBreaking { .. } => true,
1263            _ => false,
1264        }
1265    }
1266}
1267
1268impl fidl::Persistable for TableInterest {}
1269
1270mod internal {
1271    use super::*;
1272    unsafe impl fidl::encoding::TypeMarker for ResolveError {
1273        type Owned = Self;
1274
1275        #[inline(always)]
1276        fn inline_align(_context: fidl::encoding::Context) -> usize {
1277            std::mem::align_of::<u32>()
1278        }
1279
1280        #[inline(always)]
1281        fn inline_size(_context: fidl::encoding::Context) -> usize {
1282            std::mem::size_of::<u32>()
1283        }
1284
1285        #[inline(always)]
1286        fn encode_is_copy() -> bool {
1287            false
1288        }
1289
1290        #[inline(always)]
1291        fn decode_is_copy() -> bool {
1292            false
1293        }
1294    }
1295
1296    impl fidl::encoding::ValueTypeMarker for ResolveError {
1297        type Borrowed<'a> = Self;
1298        #[inline(always)]
1299        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1300            *value
1301        }
1302    }
1303
1304    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ResolveError {
1305        #[inline]
1306        unsafe fn encode(
1307            self,
1308            encoder: &mut fidl::encoding::Encoder<'_, D>,
1309            offset: usize,
1310            _depth: fidl::encoding::Depth,
1311        ) -> fidl::Result<()> {
1312            encoder.debug_check_bounds::<Self>(offset);
1313            encoder.write_num(self.into_primitive(), offset);
1314            Ok(())
1315        }
1316    }
1317
1318    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolveError {
1319        #[inline(always)]
1320        fn new_empty() -> Self {
1321            Self::unknown()
1322        }
1323
1324        #[inline]
1325        unsafe fn decode(
1326            &mut self,
1327            decoder: &mut fidl::encoding::Decoder<'_, D>,
1328            offset: usize,
1329            _depth: fidl::encoding::Depth,
1330        ) -> fidl::Result<()> {
1331            decoder.debug_check_bounds::<Self>(offset);
1332            let prim = decoder.read_num::<u32>(offset);
1333
1334            *self = Self::from_primitive_allow_unknown(prim);
1335            Ok(())
1336        }
1337    }
1338    unsafe impl fidl::encoding::TypeMarker for StateGetRouteTableNameError {
1339        type Owned = Self;
1340
1341        #[inline(always)]
1342        fn inline_align(_context: fidl::encoding::Context) -> usize {
1343            std::mem::align_of::<u32>()
1344        }
1345
1346        #[inline(always)]
1347        fn inline_size(_context: fidl::encoding::Context) -> usize {
1348            std::mem::size_of::<u32>()
1349        }
1350
1351        #[inline(always)]
1352        fn encode_is_copy() -> bool {
1353            true
1354        }
1355
1356        #[inline(always)]
1357        fn decode_is_copy() -> bool {
1358            false
1359        }
1360    }
1361
1362    impl fidl::encoding::ValueTypeMarker for StateGetRouteTableNameError {
1363        type Borrowed<'a> = Self;
1364        #[inline(always)]
1365        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1366            *value
1367        }
1368    }
1369
1370    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1371        for StateGetRouteTableNameError
1372    {
1373        #[inline]
1374        unsafe fn encode(
1375            self,
1376            encoder: &mut fidl::encoding::Encoder<'_, D>,
1377            offset: usize,
1378            _depth: fidl::encoding::Depth,
1379        ) -> fidl::Result<()> {
1380            encoder.debug_check_bounds::<Self>(offset);
1381            encoder.write_num(self.into_primitive(), offset);
1382            Ok(())
1383        }
1384    }
1385
1386    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1387        for StateGetRouteTableNameError
1388    {
1389        #[inline(always)]
1390        fn new_empty() -> Self {
1391            Self::NoTable
1392        }
1393
1394        #[inline]
1395        unsafe fn decode(
1396            &mut self,
1397            decoder: &mut fidl::encoding::Decoder<'_, D>,
1398            offset: usize,
1399            _depth: fidl::encoding::Depth,
1400        ) -> fidl::Result<()> {
1401            decoder.debug_check_bounds::<Self>(offset);
1402            let prim = decoder.read_num::<u32>(offset);
1403
1404            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1405            Ok(())
1406        }
1407    }
1408
1409    impl fidl::encoding::ValueTypeMarker for All {
1410        type Borrowed<'a> = &'a Self;
1411        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1412            value
1413        }
1414    }
1415
1416    unsafe impl fidl::encoding::TypeMarker for All {
1417        type Owned = Self;
1418
1419        #[inline(always)]
1420        fn inline_align(_context: fidl::encoding::Context) -> usize {
1421            1
1422        }
1423
1424        #[inline(always)]
1425        fn inline_size(_context: fidl::encoding::Context) -> usize {
1426            1
1427        }
1428    }
1429
1430    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<All, D> for &All {
1431        #[inline]
1432        unsafe fn encode(
1433            self,
1434            encoder: &mut fidl::encoding::Encoder<'_, D>,
1435            offset: usize,
1436            _depth: fidl::encoding::Depth,
1437        ) -> fidl::Result<()> {
1438            encoder.debug_check_bounds::<All>(offset);
1439            encoder.write_num(0u8, offset);
1440            Ok(())
1441        }
1442    }
1443
1444    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for All {
1445        #[inline(always)]
1446        fn new_empty() -> Self {
1447            Self
1448        }
1449
1450        #[inline]
1451        unsafe fn decode(
1452            &mut self,
1453            decoder: &mut fidl::encoding::Decoder<'_, D>,
1454            offset: usize,
1455            _depth: fidl::encoding::Depth,
1456        ) -> fidl::Result<()> {
1457            decoder.debug_check_bounds::<Self>(offset);
1458            match decoder.read_num::<u8>(offset) {
1459                0 => Ok(()),
1460                _ => Err(fidl::Error::Invalid),
1461            }
1462        }
1463    }
1464
1465    impl fidl::encoding::ValueTypeMarker for Between {
1466        type Borrowed<'a> = &'a Self;
1467        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1468            value
1469        }
1470    }
1471
1472    unsafe impl fidl::encoding::TypeMarker for Between {
1473        type Owned = Self;
1474
1475        #[inline(always)]
1476        fn inline_align(_context: fidl::encoding::Context) -> usize {
1477            4
1478        }
1479
1480        #[inline(always)]
1481        fn inline_size(_context: fidl::encoding::Context) -> usize {
1482            8
1483        }
1484        #[inline(always)]
1485        fn encode_is_copy() -> bool {
1486            true
1487        }
1488
1489        #[inline(always)]
1490        fn decode_is_copy() -> bool {
1491            true
1492        }
1493    }
1494
1495    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Between, D> for &Between {
1496        #[inline]
1497        unsafe fn encode(
1498            self,
1499            encoder: &mut fidl::encoding::Encoder<'_, D>,
1500            offset: usize,
1501            _depth: fidl::encoding::Depth,
1502        ) -> fidl::Result<()> {
1503            encoder.debug_check_bounds::<Between>(offset);
1504            unsafe {
1505                // Copy the object into the buffer.
1506                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1507                (buf_ptr as *mut Between).write_unaligned((self as *const Between).read());
1508                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1509                // done second because the memcpy will write garbage to these bytes.
1510            }
1511            Ok(())
1512        }
1513    }
1514    unsafe impl<
1515            D: fidl::encoding::ResourceDialect,
1516            T0: fidl::encoding::Encode<u32, D>,
1517            T1: fidl::encoding::Encode<u32, D>,
1518        > fidl::encoding::Encode<Between, D> for (T0, T1)
1519    {
1520        #[inline]
1521        unsafe fn encode(
1522            self,
1523            encoder: &mut fidl::encoding::Encoder<'_, D>,
1524            offset: usize,
1525            depth: fidl::encoding::Depth,
1526        ) -> fidl::Result<()> {
1527            encoder.debug_check_bounds::<Between>(offset);
1528            // Zero out padding regions. There's no need to apply masks
1529            // because the unmasked parts will be overwritten by fields.
1530            // Write the fields.
1531            self.0.encode(encoder, offset + 0, depth)?;
1532            self.1.encode(encoder, offset + 4, depth)?;
1533            Ok(())
1534        }
1535    }
1536
1537    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Between {
1538        #[inline(always)]
1539        fn new_empty() -> Self {
1540            Self { start: fidl::new_empty!(u32, D), end: fidl::new_empty!(u32, D) }
1541        }
1542
1543        #[inline]
1544        unsafe fn decode(
1545            &mut self,
1546            decoder: &mut fidl::encoding::Decoder<'_, D>,
1547            offset: usize,
1548            _depth: fidl::encoding::Depth,
1549        ) -> fidl::Result<()> {
1550            decoder.debug_check_bounds::<Self>(offset);
1551            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1552            // Verify that padding bytes are zero.
1553            // Copy from the buffer into the object.
1554            unsafe {
1555                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1556            }
1557            Ok(())
1558        }
1559    }
1560
1561    impl fidl::encoding::ValueTypeMarker for Empty {
1562        type Borrowed<'a> = &'a Self;
1563        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1564            value
1565        }
1566    }
1567
1568    unsafe impl fidl::encoding::TypeMarker for Empty {
1569        type Owned = Self;
1570
1571        #[inline(always)]
1572        fn inline_align(_context: fidl::encoding::Context) -> usize {
1573            1
1574        }
1575
1576        #[inline(always)]
1577        fn inline_size(_context: fidl::encoding::Context) -> usize {
1578            1
1579        }
1580    }
1581
1582    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
1583        #[inline]
1584        unsafe fn encode(
1585            self,
1586            encoder: &mut fidl::encoding::Encoder<'_, D>,
1587            offset: usize,
1588            _depth: fidl::encoding::Depth,
1589        ) -> fidl::Result<()> {
1590            encoder.debug_check_bounds::<Empty>(offset);
1591            encoder.write_num(0u8, offset);
1592            Ok(())
1593        }
1594    }
1595
1596    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
1597        #[inline(always)]
1598        fn new_empty() -> Self {
1599            Self
1600        }
1601
1602        #[inline]
1603        unsafe fn decode(
1604            &mut self,
1605            decoder: &mut fidl::encoding::Decoder<'_, D>,
1606            offset: usize,
1607            _depth: fidl::encoding::Depth,
1608        ) -> fidl::Result<()> {
1609            decoder.debug_check_bounds::<Self>(offset);
1610            match decoder.read_num::<u8>(offset) {
1611                0 => Ok(()),
1612                _ => Err(fidl::Error::Invalid),
1613            }
1614        }
1615    }
1616
1617    impl fidl::encoding::ValueTypeMarker for InstalledRuleV4 {
1618        type Borrowed<'a> = &'a Self;
1619        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1620            value
1621        }
1622    }
1623
1624    unsafe impl fidl::encoding::TypeMarker for InstalledRuleV4 {
1625        type Owned = Self;
1626
1627        #[inline(always)]
1628        fn inline_align(_context: fidl::encoding::Context) -> usize {
1629            8
1630        }
1631
1632        #[inline(always)]
1633        fn inline_size(_context: fidl::encoding::Context) -> usize {
1634            40
1635        }
1636    }
1637
1638    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InstalledRuleV4, D>
1639        for &InstalledRuleV4
1640    {
1641        #[inline]
1642        unsafe fn encode(
1643            self,
1644            encoder: &mut fidl::encoding::Encoder<'_, D>,
1645            offset: usize,
1646            _depth: fidl::encoding::Depth,
1647        ) -> fidl::Result<()> {
1648            encoder.debug_check_bounds::<InstalledRuleV4>(offset);
1649            // Delegate to tuple encoding.
1650            fidl::encoding::Encode::<InstalledRuleV4, D>::encode(
1651                (
1652                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.rule_set_priority),
1653                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.rule_index),
1654                    <RuleMatcherV4 as fidl::encoding::ValueTypeMarker>::borrow(&self.matcher),
1655                    <RuleAction as fidl::encoding::ValueTypeMarker>::borrow(&self.action),
1656                ),
1657                encoder,
1658                offset,
1659                _depth,
1660            )
1661        }
1662    }
1663    unsafe impl<
1664            D: fidl::encoding::ResourceDialect,
1665            T0: fidl::encoding::Encode<u32, D>,
1666            T1: fidl::encoding::Encode<u32, D>,
1667            T2: fidl::encoding::Encode<RuleMatcherV4, D>,
1668            T3: fidl::encoding::Encode<RuleAction, D>,
1669        > fidl::encoding::Encode<InstalledRuleV4, D> for (T0, T1, T2, T3)
1670    {
1671        #[inline]
1672        unsafe fn encode(
1673            self,
1674            encoder: &mut fidl::encoding::Encoder<'_, D>,
1675            offset: usize,
1676            depth: fidl::encoding::Depth,
1677        ) -> fidl::Result<()> {
1678            encoder.debug_check_bounds::<InstalledRuleV4>(offset);
1679            // Zero out padding regions. There's no need to apply masks
1680            // because the unmasked parts will be overwritten by fields.
1681            // Write the fields.
1682            self.0.encode(encoder, offset + 0, depth)?;
1683            self.1.encode(encoder, offset + 4, depth)?;
1684            self.2.encode(encoder, offset + 8, depth)?;
1685            self.3.encode(encoder, offset + 24, depth)?;
1686            Ok(())
1687        }
1688    }
1689
1690    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InstalledRuleV4 {
1691        #[inline(always)]
1692        fn new_empty() -> Self {
1693            Self {
1694                rule_set_priority: fidl::new_empty!(u32, D),
1695                rule_index: fidl::new_empty!(u32, D),
1696                matcher: fidl::new_empty!(RuleMatcherV4, D),
1697                action: fidl::new_empty!(RuleAction, D),
1698            }
1699        }
1700
1701        #[inline]
1702        unsafe fn decode(
1703            &mut self,
1704            decoder: &mut fidl::encoding::Decoder<'_, D>,
1705            offset: usize,
1706            _depth: fidl::encoding::Depth,
1707        ) -> fidl::Result<()> {
1708            decoder.debug_check_bounds::<Self>(offset);
1709            // Verify that padding bytes are zero.
1710            fidl::decode!(u32, D, &mut self.rule_set_priority, decoder, offset + 0, _depth)?;
1711            fidl::decode!(u32, D, &mut self.rule_index, decoder, offset + 4, _depth)?;
1712            fidl::decode!(RuleMatcherV4, D, &mut self.matcher, decoder, offset + 8, _depth)?;
1713            fidl::decode!(RuleAction, D, &mut self.action, decoder, offset + 24, _depth)?;
1714            Ok(())
1715        }
1716    }
1717
1718    impl fidl::encoding::ValueTypeMarker for InstalledRuleV6 {
1719        type Borrowed<'a> = &'a Self;
1720        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1721            value
1722        }
1723    }
1724
1725    unsafe impl fidl::encoding::TypeMarker for InstalledRuleV6 {
1726        type Owned = Self;
1727
1728        #[inline(always)]
1729        fn inline_align(_context: fidl::encoding::Context) -> usize {
1730            8
1731        }
1732
1733        #[inline(always)]
1734        fn inline_size(_context: fidl::encoding::Context) -> usize {
1735            40
1736        }
1737    }
1738
1739    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InstalledRuleV6, D>
1740        for &InstalledRuleV6
1741    {
1742        #[inline]
1743        unsafe fn encode(
1744            self,
1745            encoder: &mut fidl::encoding::Encoder<'_, D>,
1746            offset: usize,
1747            _depth: fidl::encoding::Depth,
1748        ) -> fidl::Result<()> {
1749            encoder.debug_check_bounds::<InstalledRuleV6>(offset);
1750            // Delegate to tuple encoding.
1751            fidl::encoding::Encode::<InstalledRuleV6, D>::encode(
1752                (
1753                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.rule_set_priority),
1754                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.rule_index),
1755                    <RuleMatcherV6 as fidl::encoding::ValueTypeMarker>::borrow(&self.matcher),
1756                    <RuleAction as fidl::encoding::ValueTypeMarker>::borrow(&self.action),
1757                ),
1758                encoder,
1759                offset,
1760                _depth,
1761            )
1762        }
1763    }
1764    unsafe impl<
1765            D: fidl::encoding::ResourceDialect,
1766            T0: fidl::encoding::Encode<u32, D>,
1767            T1: fidl::encoding::Encode<u32, D>,
1768            T2: fidl::encoding::Encode<RuleMatcherV6, D>,
1769            T3: fidl::encoding::Encode<RuleAction, D>,
1770        > fidl::encoding::Encode<InstalledRuleV6, D> for (T0, T1, T2, T3)
1771    {
1772        #[inline]
1773        unsafe fn encode(
1774            self,
1775            encoder: &mut fidl::encoding::Encoder<'_, D>,
1776            offset: usize,
1777            depth: fidl::encoding::Depth,
1778        ) -> fidl::Result<()> {
1779            encoder.debug_check_bounds::<InstalledRuleV6>(offset);
1780            // Zero out padding regions. There's no need to apply masks
1781            // because the unmasked parts will be overwritten by fields.
1782            // Write the fields.
1783            self.0.encode(encoder, offset + 0, depth)?;
1784            self.1.encode(encoder, offset + 4, depth)?;
1785            self.2.encode(encoder, offset + 8, depth)?;
1786            self.3.encode(encoder, offset + 24, depth)?;
1787            Ok(())
1788        }
1789    }
1790
1791    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InstalledRuleV6 {
1792        #[inline(always)]
1793        fn new_empty() -> Self {
1794            Self {
1795                rule_set_priority: fidl::new_empty!(u32, D),
1796                rule_index: fidl::new_empty!(u32, D),
1797                matcher: fidl::new_empty!(RuleMatcherV6, D),
1798                action: fidl::new_empty!(RuleAction, D),
1799            }
1800        }
1801
1802        #[inline]
1803        unsafe fn decode(
1804            &mut self,
1805            decoder: &mut fidl::encoding::Decoder<'_, D>,
1806            offset: usize,
1807            _depth: fidl::encoding::Depth,
1808        ) -> fidl::Result<()> {
1809            decoder.debug_check_bounds::<Self>(offset);
1810            // Verify that padding bytes are zero.
1811            fidl::decode!(u32, D, &mut self.rule_set_priority, decoder, offset + 0, _depth)?;
1812            fidl::decode!(u32, D, &mut self.rule_index, decoder, offset + 4, _depth)?;
1813            fidl::decode!(RuleMatcherV6, D, &mut self.matcher, decoder, offset + 8, _depth)?;
1814            fidl::decode!(RuleAction, D, &mut self.action, decoder, offset + 24, _depth)?;
1815            Ok(())
1816        }
1817    }
1818
1819    impl fidl::encoding::ValueTypeMarker for Main {
1820        type Borrowed<'a> = &'a Self;
1821        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1822            value
1823        }
1824    }
1825
1826    unsafe impl fidl::encoding::TypeMarker for Main {
1827        type Owned = Self;
1828
1829        #[inline(always)]
1830        fn inline_align(_context: fidl::encoding::Context) -> usize {
1831            1
1832        }
1833
1834        #[inline(always)]
1835        fn inline_size(_context: fidl::encoding::Context) -> usize {
1836            1
1837        }
1838    }
1839
1840    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Main, D> for &Main {
1841        #[inline]
1842        unsafe fn encode(
1843            self,
1844            encoder: &mut fidl::encoding::Encoder<'_, D>,
1845            offset: usize,
1846            _depth: fidl::encoding::Depth,
1847        ) -> fidl::Result<()> {
1848            encoder.debug_check_bounds::<Main>(offset);
1849            encoder.write_num(0u8, offset);
1850            Ok(())
1851        }
1852    }
1853
1854    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Main {
1855        #[inline(always)]
1856        fn new_empty() -> Self {
1857            Self
1858        }
1859
1860        #[inline]
1861        unsafe fn decode(
1862            &mut self,
1863            decoder: &mut fidl::encoding::Decoder<'_, D>,
1864            offset: usize,
1865            _depth: fidl::encoding::Depth,
1866        ) -> fidl::Result<()> {
1867            decoder.debug_check_bounds::<Self>(offset);
1868            match decoder.read_num::<u8>(offset) {
1869                0 => Ok(()),
1870                _ => Err(fidl::Error::Invalid),
1871            }
1872        }
1873    }
1874
1875    impl fidl::encoding::ValueTypeMarker for Marked {
1876        type Borrowed<'a> = &'a Self;
1877        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1878            value
1879        }
1880    }
1881
1882    unsafe impl fidl::encoding::TypeMarker for Marked {
1883        type Owned = Self;
1884
1885        #[inline(always)]
1886        fn inline_align(_context: fidl::encoding::Context) -> usize {
1887            4
1888        }
1889
1890        #[inline(always)]
1891        fn inline_size(_context: fidl::encoding::Context) -> usize {
1892            12
1893        }
1894        #[inline(always)]
1895        fn encode_is_copy() -> bool {
1896            true
1897        }
1898
1899        #[inline(always)]
1900        fn decode_is_copy() -> bool {
1901            true
1902        }
1903    }
1904
1905    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Marked, D> for &Marked {
1906        #[inline]
1907        unsafe fn encode(
1908            self,
1909            encoder: &mut fidl::encoding::Encoder<'_, D>,
1910            offset: usize,
1911            _depth: fidl::encoding::Depth,
1912        ) -> fidl::Result<()> {
1913            encoder.debug_check_bounds::<Marked>(offset);
1914            unsafe {
1915                // Copy the object into the buffer.
1916                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1917                (buf_ptr as *mut Marked).write_unaligned((self as *const Marked).read());
1918                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1919                // done second because the memcpy will write garbage to these bytes.
1920            }
1921            Ok(())
1922        }
1923    }
1924    unsafe impl<
1925            D: fidl::encoding::ResourceDialect,
1926            T0: fidl::encoding::Encode<u32, D>,
1927            T1: fidl::encoding::Encode<Between, D>,
1928        > fidl::encoding::Encode<Marked, D> for (T0, T1)
1929    {
1930        #[inline]
1931        unsafe fn encode(
1932            self,
1933            encoder: &mut fidl::encoding::Encoder<'_, D>,
1934            offset: usize,
1935            depth: fidl::encoding::Depth,
1936        ) -> fidl::Result<()> {
1937            encoder.debug_check_bounds::<Marked>(offset);
1938            // Zero out padding regions. There's no need to apply masks
1939            // because the unmasked parts will be overwritten by fields.
1940            // Write the fields.
1941            self.0.encode(encoder, offset + 0, depth)?;
1942            self.1.encode(encoder, offset + 4, depth)?;
1943            Ok(())
1944        }
1945    }
1946
1947    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Marked {
1948        #[inline(always)]
1949        fn new_empty() -> Self {
1950            Self { mask: fidl::new_empty!(u32, D), between: fidl::new_empty!(Between, D) }
1951        }
1952
1953        #[inline]
1954        unsafe fn decode(
1955            &mut self,
1956            decoder: &mut fidl::encoding::Decoder<'_, D>,
1957            offset: usize,
1958            _depth: fidl::encoding::Depth,
1959        ) -> fidl::Result<()> {
1960            decoder.debug_check_bounds::<Self>(offset);
1961            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1962            // Verify that padding bytes are zero.
1963            // Copy from the buffer into the object.
1964            unsafe {
1965                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
1966            }
1967            Ok(())
1968        }
1969    }
1970
1971    impl fidl::encoding::ValueTypeMarker for RouteTargetV4 {
1972        type Borrowed<'a> = &'a Self;
1973        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1974            value
1975        }
1976    }
1977
1978    unsafe impl fidl::encoding::TypeMarker for RouteTargetV4 {
1979        type Owned = Self;
1980
1981        #[inline(always)]
1982        fn inline_align(_context: fidl::encoding::Context) -> usize {
1983            8
1984        }
1985
1986        #[inline(always)]
1987        fn inline_size(_context: fidl::encoding::Context) -> usize {
1988            16
1989        }
1990    }
1991
1992    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RouteTargetV4, D>
1993        for &RouteTargetV4
1994    {
1995        #[inline]
1996        unsafe fn encode(
1997            self,
1998            encoder: &mut fidl::encoding::Encoder<'_, D>,
1999            offset: usize,
2000            _depth: fidl::encoding::Depth,
2001        ) -> fidl::Result<()> {
2002            encoder.debug_check_bounds::<RouteTargetV4>(offset);
2003            // Delegate to tuple encoding.
2004            fidl::encoding::Encode::<RouteTargetV4, D>::encode(
2005                (
2006                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.outbound_interface),
2007                    <fidl::encoding::Boxed<fidl_fuchsia_net::Ipv4Address> as fidl::encoding::ValueTypeMarker>::borrow(&self.next_hop),
2008                ),
2009                encoder, offset, _depth
2010            )
2011        }
2012    }
2013    unsafe impl<
2014            D: fidl::encoding::ResourceDialect,
2015            T0: fidl::encoding::Encode<u64, D>,
2016            T1: fidl::encoding::Encode<fidl::encoding::Boxed<fidl_fuchsia_net::Ipv4Address>, D>,
2017        > fidl::encoding::Encode<RouteTargetV4, D> for (T0, T1)
2018    {
2019        #[inline]
2020        unsafe fn encode(
2021            self,
2022            encoder: &mut fidl::encoding::Encoder<'_, D>,
2023            offset: usize,
2024            depth: fidl::encoding::Depth,
2025        ) -> fidl::Result<()> {
2026            encoder.debug_check_bounds::<RouteTargetV4>(offset);
2027            // Zero out padding regions. There's no need to apply masks
2028            // because the unmasked parts will be overwritten by fields.
2029            // Write the fields.
2030            self.0.encode(encoder, offset + 0, depth)?;
2031            self.1.encode(encoder, offset + 8, depth)?;
2032            Ok(())
2033        }
2034    }
2035
2036    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteTargetV4 {
2037        #[inline(always)]
2038        fn new_empty() -> Self {
2039            Self {
2040                outbound_interface: fidl::new_empty!(u64, D),
2041                next_hop: fidl::new_empty!(fidl::encoding::Boxed<fidl_fuchsia_net::Ipv4Address>, D),
2042            }
2043        }
2044
2045        #[inline]
2046        unsafe fn decode(
2047            &mut self,
2048            decoder: &mut fidl::encoding::Decoder<'_, D>,
2049            offset: usize,
2050            _depth: fidl::encoding::Depth,
2051        ) -> fidl::Result<()> {
2052            decoder.debug_check_bounds::<Self>(offset);
2053            // Verify that padding bytes are zero.
2054            fidl::decode!(u64, D, &mut self.outbound_interface, decoder, offset + 0, _depth)?;
2055            fidl::decode!(
2056                fidl::encoding::Boxed<fidl_fuchsia_net::Ipv4Address>,
2057                D,
2058                &mut self.next_hop,
2059                decoder,
2060                offset + 8,
2061                _depth
2062            )?;
2063            Ok(())
2064        }
2065    }
2066
2067    impl fidl::encoding::ValueTypeMarker for RouteTargetV6 {
2068        type Borrowed<'a> = &'a Self;
2069        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2070            value
2071        }
2072    }
2073
2074    unsafe impl fidl::encoding::TypeMarker for RouteTargetV6 {
2075        type Owned = Self;
2076
2077        #[inline(always)]
2078        fn inline_align(_context: fidl::encoding::Context) -> usize {
2079            8
2080        }
2081
2082        #[inline(always)]
2083        fn inline_size(_context: fidl::encoding::Context) -> usize {
2084            16
2085        }
2086    }
2087
2088    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RouteTargetV6, D>
2089        for &RouteTargetV6
2090    {
2091        #[inline]
2092        unsafe fn encode(
2093            self,
2094            encoder: &mut fidl::encoding::Encoder<'_, D>,
2095            offset: usize,
2096            _depth: fidl::encoding::Depth,
2097        ) -> fidl::Result<()> {
2098            encoder.debug_check_bounds::<RouteTargetV6>(offset);
2099            // Delegate to tuple encoding.
2100            fidl::encoding::Encode::<RouteTargetV6, D>::encode(
2101                (
2102                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.outbound_interface),
2103                    <fidl::encoding::Boxed<fidl_fuchsia_net::Ipv6Address> as fidl::encoding::ValueTypeMarker>::borrow(&self.next_hop),
2104                ),
2105                encoder, offset, _depth
2106            )
2107        }
2108    }
2109    unsafe impl<
2110            D: fidl::encoding::ResourceDialect,
2111            T0: fidl::encoding::Encode<u64, D>,
2112            T1: fidl::encoding::Encode<fidl::encoding::Boxed<fidl_fuchsia_net::Ipv6Address>, D>,
2113        > fidl::encoding::Encode<RouteTargetV6, D> for (T0, T1)
2114    {
2115        #[inline]
2116        unsafe fn encode(
2117            self,
2118            encoder: &mut fidl::encoding::Encoder<'_, D>,
2119            offset: usize,
2120            depth: fidl::encoding::Depth,
2121        ) -> fidl::Result<()> {
2122            encoder.debug_check_bounds::<RouteTargetV6>(offset);
2123            // Zero out padding regions. There's no need to apply masks
2124            // because the unmasked parts will be overwritten by fields.
2125            // Write the fields.
2126            self.0.encode(encoder, offset + 0, depth)?;
2127            self.1.encode(encoder, offset + 8, depth)?;
2128            Ok(())
2129        }
2130    }
2131
2132    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteTargetV6 {
2133        #[inline(always)]
2134        fn new_empty() -> Self {
2135            Self {
2136                outbound_interface: fidl::new_empty!(u64, D),
2137                next_hop: fidl::new_empty!(fidl::encoding::Boxed<fidl_fuchsia_net::Ipv6Address>, D),
2138            }
2139        }
2140
2141        #[inline]
2142        unsafe fn decode(
2143            &mut self,
2144            decoder: &mut fidl::encoding::Decoder<'_, D>,
2145            offset: usize,
2146            _depth: fidl::encoding::Depth,
2147        ) -> fidl::Result<()> {
2148            decoder.debug_check_bounds::<Self>(offset);
2149            // Verify that padding bytes are zero.
2150            fidl::decode!(u64, D, &mut self.outbound_interface, decoder, offset + 0, _depth)?;
2151            fidl::decode!(
2152                fidl::encoding::Boxed<fidl_fuchsia_net::Ipv6Address>,
2153                D,
2154                &mut self.next_hop,
2155                decoder,
2156                offset + 8,
2157                _depth
2158            )?;
2159            Ok(())
2160        }
2161    }
2162
2163    impl fidl::encoding::ValueTypeMarker for RouteV4 {
2164        type Borrowed<'a> = &'a Self;
2165        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2166            value
2167        }
2168    }
2169
2170    unsafe impl fidl::encoding::TypeMarker for RouteV4 {
2171        type Owned = Self;
2172
2173        #[inline(always)]
2174        fn inline_align(_context: fidl::encoding::Context) -> usize {
2175            8
2176        }
2177
2178        #[inline(always)]
2179        fn inline_size(_context: fidl::encoding::Context) -> usize {
2180            40
2181        }
2182    }
2183
2184    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RouteV4, D> for &RouteV4 {
2185        #[inline]
2186        unsafe fn encode(
2187            self,
2188            encoder: &mut fidl::encoding::Encoder<'_, D>,
2189            offset: usize,
2190            _depth: fidl::encoding::Depth,
2191        ) -> fidl::Result<()> {
2192            encoder.debug_check_bounds::<RouteV4>(offset);
2193            // Delegate to tuple encoding.
2194            fidl::encoding::Encode::<RouteV4, D>::encode(
2195                (
2196                    <fidl_fuchsia_net::Ipv4AddressWithPrefix as fidl::encoding::ValueTypeMarker>::borrow(&self.destination),
2197                    <RouteActionV4 as fidl::encoding::ValueTypeMarker>::borrow(&self.action),
2198                    <RoutePropertiesV4 as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
2199                ),
2200                encoder, offset, _depth
2201            )
2202        }
2203    }
2204    unsafe impl<
2205            D: fidl::encoding::ResourceDialect,
2206            T0: fidl::encoding::Encode<fidl_fuchsia_net::Ipv4AddressWithPrefix, D>,
2207            T1: fidl::encoding::Encode<RouteActionV4, D>,
2208            T2: fidl::encoding::Encode<RoutePropertiesV4, D>,
2209        > fidl::encoding::Encode<RouteV4, D> for (T0, T1, T2)
2210    {
2211        #[inline]
2212        unsafe fn encode(
2213            self,
2214            encoder: &mut fidl::encoding::Encoder<'_, D>,
2215            offset: usize,
2216            depth: fidl::encoding::Depth,
2217        ) -> fidl::Result<()> {
2218            encoder.debug_check_bounds::<RouteV4>(offset);
2219            // Zero out padding regions. There's no need to apply masks
2220            // because the unmasked parts will be overwritten by fields.
2221            unsafe {
2222                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2223                (ptr as *mut u64).write_unaligned(0);
2224            }
2225            // Write the fields.
2226            self.0.encode(encoder, offset + 0, depth)?;
2227            self.1.encode(encoder, offset + 8, depth)?;
2228            self.2.encode(encoder, offset + 24, depth)?;
2229            Ok(())
2230        }
2231    }
2232
2233    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteV4 {
2234        #[inline(always)]
2235        fn new_empty() -> Self {
2236            Self {
2237                destination: fidl::new_empty!(fidl_fuchsia_net::Ipv4AddressWithPrefix, D),
2238                action: fidl::new_empty!(RouteActionV4, D),
2239                properties: fidl::new_empty!(RoutePropertiesV4, D),
2240            }
2241        }
2242
2243        #[inline]
2244        unsafe fn decode(
2245            &mut self,
2246            decoder: &mut fidl::encoding::Decoder<'_, D>,
2247            offset: usize,
2248            _depth: fidl::encoding::Depth,
2249        ) -> fidl::Result<()> {
2250            decoder.debug_check_bounds::<Self>(offset);
2251            // Verify that padding bytes are zero.
2252            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2253            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2254            let mask = 0xffffff0000000000u64;
2255            let maskedval = padval & mask;
2256            if maskedval != 0 {
2257                return Err(fidl::Error::NonZeroPadding {
2258                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2259                });
2260            }
2261            fidl::decode!(
2262                fidl_fuchsia_net::Ipv4AddressWithPrefix,
2263                D,
2264                &mut self.destination,
2265                decoder,
2266                offset + 0,
2267                _depth
2268            )?;
2269            fidl::decode!(RouteActionV4, D, &mut self.action, decoder, offset + 8, _depth)?;
2270            fidl::decode!(
2271                RoutePropertiesV4,
2272                D,
2273                &mut self.properties,
2274                decoder,
2275                offset + 24,
2276                _depth
2277            )?;
2278            Ok(())
2279        }
2280    }
2281
2282    impl fidl::encoding::ValueTypeMarker for RouteV6 {
2283        type Borrowed<'a> = &'a Self;
2284        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2285            value
2286        }
2287    }
2288
2289    unsafe impl fidl::encoding::TypeMarker for RouteV6 {
2290        type Owned = Self;
2291
2292        #[inline(always)]
2293        fn inline_align(_context: fidl::encoding::Context) -> usize {
2294            8
2295        }
2296
2297        #[inline(always)]
2298        fn inline_size(_context: fidl::encoding::Context) -> usize {
2299            56
2300        }
2301    }
2302
2303    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RouteV6, D> for &RouteV6 {
2304        #[inline]
2305        unsafe fn encode(
2306            self,
2307            encoder: &mut fidl::encoding::Encoder<'_, D>,
2308            offset: usize,
2309            _depth: fidl::encoding::Depth,
2310        ) -> fidl::Result<()> {
2311            encoder.debug_check_bounds::<RouteV6>(offset);
2312            // Delegate to tuple encoding.
2313            fidl::encoding::Encode::<RouteV6, D>::encode(
2314                (
2315                    <fidl_fuchsia_net::Ipv6AddressWithPrefix as fidl::encoding::ValueTypeMarker>::borrow(&self.destination),
2316                    <RouteActionV6 as fidl::encoding::ValueTypeMarker>::borrow(&self.action),
2317                    <RoutePropertiesV6 as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
2318                ),
2319                encoder, offset, _depth
2320            )
2321        }
2322    }
2323    unsafe impl<
2324            D: fidl::encoding::ResourceDialect,
2325            T0: fidl::encoding::Encode<fidl_fuchsia_net::Ipv6AddressWithPrefix, D>,
2326            T1: fidl::encoding::Encode<RouteActionV6, D>,
2327            T2: fidl::encoding::Encode<RoutePropertiesV6, D>,
2328        > fidl::encoding::Encode<RouteV6, D> for (T0, T1, T2)
2329    {
2330        #[inline]
2331        unsafe fn encode(
2332            self,
2333            encoder: &mut fidl::encoding::Encoder<'_, D>,
2334            offset: usize,
2335            depth: fidl::encoding::Depth,
2336        ) -> fidl::Result<()> {
2337            encoder.debug_check_bounds::<RouteV6>(offset);
2338            // Zero out padding regions. There's no need to apply masks
2339            // because the unmasked parts will be overwritten by fields.
2340            unsafe {
2341                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
2342                (ptr as *mut u64).write_unaligned(0);
2343            }
2344            // Write the fields.
2345            self.0.encode(encoder, offset + 0, depth)?;
2346            self.1.encode(encoder, offset + 24, depth)?;
2347            self.2.encode(encoder, offset + 40, depth)?;
2348            Ok(())
2349        }
2350    }
2351
2352    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteV6 {
2353        #[inline(always)]
2354        fn new_empty() -> Self {
2355            Self {
2356                destination: fidl::new_empty!(fidl_fuchsia_net::Ipv6AddressWithPrefix, D),
2357                action: fidl::new_empty!(RouteActionV6, D),
2358                properties: fidl::new_empty!(RoutePropertiesV6, D),
2359            }
2360        }
2361
2362        #[inline]
2363        unsafe fn decode(
2364            &mut self,
2365            decoder: &mut fidl::encoding::Decoder<'_, D>,
2366            offset: usize,
2367            _depth: fidl::encoding::Depth,
2368        ) -> fidl::Result<()> {
2369            decoder.debug_check_bounds::<Self>(offset);
2370            // Verify that padding bytes are zero.
2371            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
2372            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2373            let mask = 0xffffffffffffff00u64;
2374            let maskedval = padval & mask;
2375            if maskedval != 0 {
2376                return Err(fidl::Error::NonZeroPadding {
2377                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
2378                });
2379            }
2380            fidl::decode!(
2381                fidl_fuchsia_net::Ipv6AddressWithPrefix,
2382                D,
2383                &mut self.destination,
2384                decoder,
2385                offset + 0,
2386                _depth
2387            )?;
2388            fidl::decode!(RouteActionV6, D, &mut self.action, decoder, offset + 24, _depth)?;
2389            fidl::decode!(
2390                RoutePropertiesV6,
2391                D,
2392                &mut self.properties,
2393                decoder,
2394                offset + 40,
2395                _depth
2396            )?;
2397            Ok(())
2398        }
2399    }
2400
2401    impl fidl::encoding::ValueTypeMarker for RuleWatcherV4WatchResponse {
2402        type Borrowed<'a> = &'a Self;
2403        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2404            value
2405        }
2406    }
2407
2408    unsafe impl fidl::encoding::TypeMarker for RuleWatcherV4WatchResponse {
2409        type Owned = Self;
2410
2411        #[inline(always)]
2412        fn inline_align(_context: fidl::encoding::Context) -> usize {
2413            8
2414        }
2415
2416        #[inline(always)]
2417        fn inline_size(_context: fidl::encoding::Context) -> usize {
2418            16
2419        }
2420    }
2421
2422    unsafe impl<D: fidl::encoding::ResourceDialect>
2423        fidl::encoding::Encode<RuleWatcherV4WatchResponse, D> for &RuleWatcherV4WatchResponse
2424    {
2425        #[inline]
2426        unsafe fn encode(
2427            self,
2428            encoder: &mut fidl::encoding::Encoder<'_, D>,
2429            offset: usize,
2430            _depth: fidl::encoding::Depth,
2431        ) -> fidl::Result<()> {
2432            encoder.debug_check_bounds::<RuleWatcherV4WatchResponse>(offset);
2433            // Delegate to tuple encoding.
2434            fidl::encoding::Encode::<RuleWatcherV4WatchResponse, D>::encode(
2435                (
2436                    <fidl::encoding::Vector<RuleEventV4, 512> as fidl::encoding::ValueTypeMarker>::borrow(&self.events),
2437                ),
2438                encoder, offset, _depth
2439            )
2440        }
2441    }
2442    unsafe impl<
2443            D: fidl::encoding::ResourceDialect,
2444            T0: fidl::encoding::Encode<fidl::encoding::Vector<RuleEventV4, 512>, D>,
2445        > fidl::encoding::Encode<RuleWatcherV4WatchResponse, D> for (T0,)
2446    {
2447        #[inline]
2448        unsafe fn encode(
2449            self,
2450            encoder: &mut fidl::encoding::Encoder<'_, D>,
2451            offset: usize,
2452            depth: fidl::encoding::Depth,
2453        ) -> fidl::Result<()> {
2454            encoder.debug_check_bounds::<RuleWatcherV4WatchResponse>(offset);
2455            // Zero out padding regions. There's no need to apply masks
2456            // because the unmasked parts will be overwritten by fields.
2457            // Write the fields.
2458            self.0.encode(encoder, offset + 0, depth)?;
2459            Ok(())
2460        }
2461    }
2462
2463    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2464        for RuleWatcherV4WatchResponse
2465    {
2466        #[inline(always)]
2467        fn new_empty() -> Self {
2468            Self { events: fidl::new_empty!(fidl::encoding::Vector<RuleEventV4, 512>, D) }
2469        }
2470
2471        #[inline]
2472        unsafe fn decode(
2473            &mut self,
2474            decoder: &mut fidl::encoding::Decoder<'_, D>,
2475            offset: usize,
2476            _depth: fidl::encoding::Depth,
2477        ) -> fidl::Result<()> {
2478            decoder.debug_check_bounds::<Self>(offset);
2479            // Verify that padding bytes are zero.
2480            fidl::decode!(fidl::encoding::Vector<RuleEventV4, 512>, D, &mut self.events, decoder, offset + 0, _depth)?;
2481            Ok(())
2482        }
2483    }
2484
2485    impl fidl::encoding::ValueTypeMarker for RuleWatcherV6WatchResponse {
2486        type Borrowed<'a> = &'a Self;
2487        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2488            value
2489        }
2490    }
2491
2492    unsafe impl fidl::encoding::TypeMarker for RuleWatcherV6WatchResponse {
2493        type Owned = Self;
2494
2495        #[inline(always)]
2496        fn inline_align(_context: fidl::encoding::Context) -> usize {
2497            8
2498        }
2499
2500        #[inline(always)]
2501        fn inline_size(_context: fidl::encoding::Context) -> usize {
2502            16
2503        }
2504    }
2505
2506    unsafe impl<D: fidl::encoding::ResourceDialect>
2507        fidl::encoding::Encode<RuleWatcherV6WatchResponse, D> for &RuleWatcherV6WatchResponse
2508    {
2509        #[inline]
2510        unsafe fn encode(
2511            self,
2512            encoder: &mut fidl::encoding::Encoder<'_, D>,
2513            offset: usize,
2514            _depth: fidl::encoding::Depth,
2515        ) -> fidl::Result<()> {
2516            encoder.debug_check_bounds::<RuleWatcherV6WatchResponse>(offset);
2517            // Delegate to tuple encoding.
2518            fidl::encoding::Encode::<RuleWatcherV6WatchResponse, D>::encode(
2519                (
2520                    <fidl::encoding::Vector<RuleEventV6, 512> as fidl::encoding::ValueTypeMarker>::borrow(&self.events),
2521                ),
2522                encoder, offset, _depth
2523            )
2524        }
2525    }
2526    unsafe impl<
2527            D: fidl::encoding::ResourceDialect,
2528            T0: fidl::encoding::Encode<fidl::encoding::Vector<RuleEventV6, 512>, D>,
2529        > fidl::encoding::Encode<RuleWatcherV6WatchResponse, D> for (T0,)
2530    {
2531        #[inline]
2532        unsafe fn encode(
2533            self,
2534            encoder: &mut fidl::encoding::Encoder<'_, D>,
2535            offset: usize,
2536            depth: fidl::encoding::Depth,
2537        ) -> fidl::Result<()> {
2538            encoder.debug_check_bounds::<RuleWatcherV6WatchResponse>(offset);
2539            // Zero out padding regions. There's no need to apply masks
2540            // because the unmasked parts will be overwritten by fields.
2541            // Write the fields.
2542            self.0.encode(encoder, offset + 0, depth)?;
2543            Ok(())
2544        }
2545    }
2546
2547    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2548        for RuleWatcherV6WatchResponse
2549    {
2550        #[inline(always)]
2551        fn new_empty() -> Self {
2552            Self { events: fidl::new_empty!(fidl::encoding::Vector<RuleEventV6, 512>, D) }
2553        }
2554
2555        #[inline]
2556        unsafe fn decode(
2557            &mut self,
2558            decoder: &mut fidl::encoding::Decoder<'_, D>,
2559            offset: usize,
2560            _depth: fidl::encoding::Depth,
2561        ) -> fidl::Result<()> {
2562            decoder.debug_check_bounds::<Self>(offset);
2563            // Verify that padding bytes are zero.
2564            fidl::decode!(fidl::encoding::Vector<RuleEventV6, 512>, D, &mut self.events, decoder, offset + 0, _depth)?;
2565            Ok(())
2566        }
2567    }
2568
2569    impl fidl::encoding::ValueTypeMarker for StateGetRouteTableNameRequest {
2570        type Borrowed<'a> = &'a Self;
2571        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2572            value
2573        }
2574    }
2575
2576    unsafe impl fidl::encoding::TypeMarker for StateGetRouteTableNameRequest {
2577        type Owned = Self;
2578
2579        #[inline(always)]
2580        fn inline_align(_context: fidl::encoding::Context) -> usize {
2581            4
2582        }
2583
2584        #[inline(always)]
2585        fn inline_size(_context: fidl::encoding::Context) -> usize {
2586            4
2587        }
2588        #[inline(always)]
2589        fn encode_is_copy() -> bool {
2590            true
2591        }
2592
2593        #[inline(always)]
2594        fn decode_is_copy() -> bool {
2595            true
2596        }
2597    }
2598
2599    unsafe impl<D: fidl::encoding::ResourceDialect>
2600        fidl::encoding::Encode<StateGetRouteTableNameRequest, D>
2601        for &StateGetRouteTableNameRequest
2602    {
2603        #[inline]
2604        unsafe fn encode(
2605            self,
2606            encoder: &mut fidl::encoding::Encoder<'_, D>,
2607            offset: usize,
2608            _depth: fidl::encoding::Depth,
2609        ) -> fidl::Result<()> {
2610            encoder.debug_check_bounds::<StateGetRouteTableNameRequest>(offset);
2611            unsafe {
2612                // Copy the object into the buffer.
2613                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2614                (buf_ptr as *mut StateGetRouteTableNameRequest)
2615                    .write_unaligned((self as *const StateGetRouteTableNameRequest).read());
2616                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2617                // done second because the memcpy will write garbage to these bytes.
2618            }
2619            Ok(())
2620        }
2621    }
2622    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
2623        fidl::encoding::Encode<StateGetRouteTableNameRequest, D> for (T0,)
2624    {
2625        #[inline]
2626        unsafe fn encode(
2627            self,
2628            encoder: &mut fidl::encoding::Encoder<'_, D>,
2629            offset: usize,
2630            depth: fidl::encoding::Depth,
2631        ) -> fidl::Result<()> {
2632            encoder.debug_check_bounds::<StateGetRouteTableNameRequest>(offset);
2633            // Zero out padding regions. There's no need to apply masks
2634            // because the unmasked parts will be overwritten by fields.
2635            // Write the fields.
2636            self.0.encode(encoder, offset + 0, depth)?;
2637            Ok(())
2638        }
2639    }
2640
2641    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2642        for StateGetRouteTableNameRequest
2643    {
2644        #[inline(always)]
2645        fn new_empty() -> Self {
2646            Self { table_id: fidl::new_empty!(u32, D) }
2647        }
2648
2649        #[inline]
2650        unsafe fn decode(
2651            &mut self,
2652            decoder: &mut fidl::encoding::Decoder<'_, D>,
2653            offset: usize,
2654            _depth: fidl::encoding::Depth,
2655        ) -> fidl::Result<()> {
2656            decoder.debug_check_bounds::<Self>(offset);
2657            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2658            // Verify that padding bytes are zero.
2659            // Copy from the buffer into the object.
2660            unsafe {
2661                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2662            }
2663            Ok(())
2664        }
2665    }
2666
2667    impl fidl::encoding::ValueTypeMarker for StateResolve2Request {
2668        type Borrowed<'a> = &'a Self;
2669        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2670            value
2671        }
2672    }
2673
2674    unsafe impl fidl::encoding::TypeMarker for StateResolve2Request {
2675        type Owned = Self;
2676
2677        #[inline(always)]
2678        fn inline_align(_context: fidl::encoding::Context) -> usize {
2679            8
2680        }
2681
2682        #[inline(always)]
2683        fn inline_size(_context: fidl::encoding::Context) -> usize {
2684            32
2685        }
2686    }
2687
2688    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StateResolve2Request, D>
2689        for &StateResolve2Request
2690    {
2691        #[inline]
2692        unsafe fn encode(
2693            self,
2694            encoder: &mut fidl::encoding::Encoder<'_, D>,
2695            offset: usize,
2696            _depth: fidl::encoding::Depth,
2697        ) -> fidl::Result<()> {
2698            encoder.debug_check_bounds::<StateResolve2Request>(offset);
2699            // Delegate to tuple encoding.
2700            fidl::encoding::Encode::<StateResolve2Request, D>::encode(
2701                (
2702                    <fidl_fuchsia_net::IpAddress as fidl::encoding::ValueTypeMarker>::borrow(
2703                        &self.destination,
2704                    ),
2705                    <ResolveOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
2706                ),
2707                encoder,
2708                offset,
2709                _depth,
2710            )
2711        }
2712    }
2713    unsafe impl<
2714            D: fidl::encoding::ResourceDialect,
2715            T0: fidl::encoding::Encode<fidl_fuchsia_net::IpAddress, D>,
2716            T1: fidl::encoding::Encode<ResolveOptions, D>,
2717        > fidl::encoding::Encode<StateResolve2Request, D> for (T0, T1)
2718    {
2719        #[inline]
2720        unsafe fn encode(
2721            self,
2722            encoder: &mut fidl::encoding::Encoder<'_, D>,
2723            offset: usize,
2724            depth: fidl::encoding::Depth,
2725        ) -> fidl::Result<()> {
2726            encoder.debug_check_bounds::<StateResolve2Request>(offset);
2727            // Zero out padding regions. There's no need to apply masks
2728            // because the unmasked parts will be overwritten by fields.
2729            // Write the fields.
2730            self.0.encode(encoder, offset + 0, depth)?;
2731            self.1.encode(encoder, offset + 16, depth)?;
2732            Ok(())
2733        }
2734    }
2735
2736    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StateResolve2Request {
2737        #[inline(always)]
2738        fn new_empty() -> Self {
2739            Self {
2740                destination: fidl::new_empty!(fidl_fuchsia_net::IpAddress, D),
2741                options: fidl::new_empty!(ResolveOptions, D),
2742            }
2743        }
2744
2745        #[inline]
2746        unsafe fn decode(
2747            &mut self,
2748            decoder: &mut fidl::encoding::Decoder<'_, D>,
2749            offset: usize,
2750            _depth: fidl::encoding::Depth,
2751        ) -> fidl::Result<()> {
2752            decoder.debug_check_bounds::<Self>(offset);
2753            // Verify that padding bytes are zero.
2754            fidl::decode!(
2755                fidl_fuchsia_net::IpAddress,
2756                D,
2757                &mut self.destination,
2758                decoder,
2759                offset + 0,
2760                _depth
2761            )?;
2762            fidl::decode!(ResolveOptions, D, &mut self.options, decoder, offset + 16, _depth)?;
2763            Ok(())
2764        }
2765    }
2766
2767    impl fidl::encoding::ValueTypeMarker for StateResolveRequest {
2768        type Borrowed<'a> = &'a Self;
2769        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2770            value
2771        }
2772    }
2773
2774    unsafe impl fidl::encoding::TypeMarker for StateResolveRequest {
2775        type Owned = Self;
2776
2777        #[inline(always)]
2778        fn inline_align(_context: fidl::encoding::Context) -> usize {
2779            8
2780        }
2781
2782        #[inline(always)]
2783        fn inline_size(_context: fidl::encoding::Context) -> usize {
2784            16
2785        }
2786    }
2787
2788    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StateResolveRequest, D>
2789        for &StateResolveRequest
2790    {
2791        #[inline]
2792        unsafe fn encode(
2793            self,
2794            encoder: &mut fidl::encoding::Encoder<'_, D>,
2795            offset: usize,
2796            _depth: fidl::encoding::Depth,
2797        ) -> fidl::Result<()> {
2798            encoder.debug_check_bounds::<StateResolveRequest>(offset);
2799            // Delegate to tuple encoding.
2800            fidl::encoding::Encode::<StateResolveRequest, D>::encode(
2801                (<fidl_fuchsia_net::IpAddress as fidl::encoding::ValueTypeMarker>::borrow(
2802                    &self.destination,
2803                ),),
2804                encoder,
2805                offset,
2806                _depth,
2807            )
2808        }
2809    }
2810    unsafe impl<
2811            D: fidl::encoding::ResourceDialect,
2812            T0: fidl::encoding::Encode<fidl_fuchsia_net::IpAddress, D>,
2813        > fidl::encoding::Encode<StateResolveRequest, D> for (T0,)
2814    {
2815        #[inline]
2816        unsafe fn encode(
2817            self,
2818            encoder: &mut fidl::encoding::Encoder<'_, D>,
2819            offset: usize,
2820            depth: fidl::encoding::Depth,
2821        ) -> fidl::Result<()> {
2822            encoder.debug_check_bounds::<StateResolveRequest>(offset);
2823            // Zero out padding regions. There's no need to apply masks
2824            // because the unmasked parts will be overwritten by fields.
2825            // Write the fields.
2826            self.0.encode(encoder, offset + 0, depth)?;
2827            Ok(())
2828        }
2829    }
2830
2831    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StateResolveRequest {
2832        #[inline(always)]
2833        fn new_empty() -> Self {
2834            Self { destination: fidl::new_empty!(fidl_fuchsia_net::IpAddress, D) }
2835        }
2836
2837        #[inline]
2838        unsafe fn decode(
2839            &mut self,
2840            decoder: &mut fidl::encoding::Decoder<'_, D>,
2841            offset: usize,
2842            _depth: fidl::encoding::Depth,
2843        ) -> fidl::Result<()> {
2844            decoder.debug_check_bounds::<Self>(offset);
2845            // Verify that padding bytes are zero.
2846            fidl::decode!(
2847                fidl_fuchsia_net::IpAddress,
2848                D,
2849                &mut self.destination,
2850                decoder,
2851                offset + 0,
2852                _depth
2853            )?;
2854            Ok(())
2855        }
2856    }
2857
2858    impl fidl::encoding::ValueTypeMarker for StateGetRouteTableNameResponse {
2859        type Borrowed<'a> = &'a Self;
2860        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2861            value
2862        }
2863    }
2864
2865    unsafe impl fidl::encoding::TypeMarker for StateGetRouteTableNameResponse {
2866        type Owned = Self;
2867
2868        #[inline(always)]
2869        fn inline_align(_context: fidl::encoding::Context) -> usize {
2870            8
2871        }
2872
2873        #[inline(always)]
2874        fn inline_size(_context: fidl::encoding::Context) -> usize {
2875            16
2876        }
2877    }
2878
2879    unsafe impl<D: fidl::encoding::ResourceDialect>
2880        fidl::encoding::Encode<StateGetRouteTableNameResponse, D>
2881        for &StateGetRouteTableNameResponse
2882    {
2883        #[inline]
2884        unsafe fn encode(
2885            self,
2886            encoder: &mut fidl::encoding::Encoder<'_, D>,
2887            offset: usize,
2888            _depth: fidl::encoding::Depth,
2889        ) -> fidl::Result<()> {
2890            encoder.debug_check_bounds::<StateGetRouteTableNameResponse>(offset);
2891            // Delegate to tuple encoding.
2892            fidl::encoding::Encode::<StateGetRouteTableNameResponse, D>::encode(
2893                (<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
2894                    &self.table_name,
2895                ),),
2896                encoder,
2897                offset,
2898                _depth,
2899            )
2900        }
2901    }
2902    unsafe impl<
2903            D: fidl::encoding::ResourceDialect,
2904            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
2905        > fidl::encoding::Encode<StateGetRouteTableNameResponse, D> for (T0,)
2906    {
2907        #[inline]
2908        unsafe fn encode(
2909            self,
2910            encoder: &mut fidl::encoding::Encoder<'_, D>,
2911            offset: usize,
2912            depth: fidl::encoding::Depth,
2913        ) -> fidl::Result<()> {
2914            encoder.debug_check_bounds::<StateGetRouteTableNameResponse>(offset);
2915            // Zero out padding regions. There's no need to apply masks
2916            // because the unmasked parts will be overwritten by fields.
2917            // Write the fields.
2918            self.0.encode(encoder, offset + 0, depth)?;
2919            Ok(())
2920        }
2921    }
2922
2923    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2924        for StateGetRouteTableNameResponse
2925    {
2926        #[inline(always)]
2927        fn new_empty() -> Self {
2928            Self { table_name: fidl::new_empty!(fidl::encoding::BoundedString<255>, D) }
2929        }
2930
2931        #[inline]
2932        unsafe fn decode(
2933            &mut self,
2934            decoder: &mut fidl::encoding::Decoder<'_, D>,
2935            offset: usize,
2936            _depth: fidl::encoding::Depth,
2937        ) -> fidl::Result<()> {
2938            decoder.debug_check_bounds::<Self>(offset);
2939            // Verify that padding bytes are zero.
2940            fidl::decode!(
2941                fidl::encoding::BoundedString<255>,
2942                D,
2943                &mut self.table_name,
2944                decoder,
2945                offset + 0,
2946                _depth
2947            )?;
2948            Ok(())
2949        }
2950    }
2951
2952    impl fidl::encoding::ValueTypeMarker for StateResolve2Response {
2953        type Borrowed<'a> = &'a Self;
2954        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2955            value
2956        }
2957    }
2958
2959    unsafe impl fidl::encoding::TypeMarker for StateResolve2Response {
2960        type Owned = Self;
2961
2962        #[inline(always)]
2963        fn inline_align(_context: fidl::encoding::Context) -> usize {
2964            8
2965        }
2966
2967        #[inline(always)]
2968        fn inline_size(_context: fidl::encoding::Context) -> usize {
2969            16
2970        }
2971    }
2972
2973    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StateResolve2Response, D>
2974        for &StateResolve2Response
2975    {
2976        #[inline]
2977        unsafe fn encode(
2978            self,
2979            encoder: &mut fidl::encoding::Encoder<'_, D>,
2980            offset: usize,
2981            _depth: fidl::encoding::Depth,
2982        ) -> fidl::Result<()> {
2983            encoder.debug_check_bounds::<StateResolve2Response>(offset);
2984            // Delegate to tuple encoding.
2985            fidl::encoding::Encode::<StateResolve2Response, D>::encode(
2986                (<ResolveResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
2987                encoder,
2988                offset,
2989                _depth,
2990            )
2991        }
2992    }
2993    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ResolveResult, D>>
2994        fidl::encoding::Encode<StateResolve2Response, D> for (T0,)
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            // Zero out padding regions. There's no need to apply masks
3005            // because the unmasked parts will be overwritten by fields.
3006            // Write the fields.
3007            self.0.encode(encoder, offset + 0, depth)?;
3008            Ok(())
3009        }
3010    }
3011
3012    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StateResolve2Response {
3013        #[inline(always)]
3014        fn new_empty() -> Self {
3015            Self { result: fidl::new_empty!(ResolveResult, D) }
3016        }
3017
3018        #[inline]
3019        unsafe fn decode(
3020            &mut self,
3021            decoder: &mut fidl::encoding::Decoder<'_, D>,
3022            offset: usize,
3023            _depth: fidl::encoding::Depth,
3024        ) -> fidl::Result<()> {
3025            decoder.debug_check_bounds::<Self>(offset);
3026            // Verify that padding bytes are zero.
3027            fidl::decode!(ResolveResult, D, &mut self.result, decoder, offset + 0, _depth)?;
3028            Ok(())
3029        }
3030    }
3031
3032    impl fidl::encoding::ValueTypeMarker for StateResolveResponse {
3033        type Borrowed<'a> = &'a Self;
3034        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3035            value
3036        }
3037    }
3038
3039    unsafe impl fidl::encoding::TypeMarker for StateResolveResponse {
3040        type Owned = Self;
3041
3042        #[inline(always)]
3043        fn inline_align(_context: fidl::encoding::Context) -> usize {
3044            8
3045        }
3046
3047        #[inline(always)]
3048        fn inline_size(_context: fidl::encoding::Context) -> usize {
3049            16
3050        }
3051    }
3052
3053    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StateResolveResponse, D>
3054        for &StateResolveResponse
3055    {
3056        #[inline]
3057        unsafe fn encode(
3058            self,
3059            encoder: &mut fidl::encoding::Encoder<'_, D>,
3060            offset: usize,
3061            _depth: fidl::encoding::Depth,
3062        ) -> fidl::Result<()> {
3063            encoder.debug_check_bounds::<StateResolveResponse>(offset);
3064            // Delegate to tuple encoding.
3065            fidl::encoding::Encode::<StateResolveResponse, D>::encode(
3066                (<Resolved as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
3067                encoder,
3068                offset,
3069                _depth,
3070            )
3071        }
3072    }
3073    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Resolved, D>>
3074        fidl::encoding::Encode<StateResolveResponse, D> for (T0,)
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            // Zero out padding regions. There's no need to apply masks
3085            // because the unmasked parts will be overwritten by fields.
3086            // Write the fields.
3087            self.0.encode(encoder, offset + 0, depth)?;
3088            Ok(())
3089        }
3090    }
3091
3092    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StateResolveResponse {
3093        #[inline(always)]
3094        fn new_empty() -> Self {
3095            Self { result: fidl::new_empty!(Resolved, D) }
3096        }
3097
3098        #[inline]
3099        unsafe fn decode(
3100            &mut self,
3101            decoder: &mut fidl::encoding::Decoder<'_, D>,
3102            offset: usize,
3103            _depth: fidl::encoding::Depth,
3104        ) -> fidl::Result<()> {
3105            decoder.debug_check_bounds::<Self>(offset);
3106            // Verify that padding bytes are zero.
3107            fidl::decode!(Resolved, D, &mut self.result, decoder, offset + 0, _depth)?;
3108            Ok(())
3109        }
3110    }
3111
3112    impl fidl::encoding::ValueTypeMarker for Unbound {
3113        type Borrowed<'a> = &'a Self;
3114        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3115            value
3116        }
3117    }
3118
3119    unsafe impl fidl::encoding::TypeMarker for Unbound {
3120        type Owned = Self;
3121
3122        #[inline(always)]
3123        fn inline_align(_context: fidl::encoding::Context) -> usize {
3124            1
3125        }
3126
3127        #[inline(always)]
3128        fn inline_size(_context: fidl::encoding::Context) -> usize {
3129            1
3130        }
3131    }
3132
3133    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Unbound, D> for &Unbound {
3134        #[inline]
3135        unsafe fn encode(
3136            self,
3137            encoder: &mut fidl::encoding::Encoder<'_, D>,
3138            offset: usize,
3139            _depth: fidl::encoding::Depth,
3140        ) -> fidl::Result<()> {
3141            encoder.debug_check_bounds::<Unbound>(offset);
3142            encoder.write_num(0u8, offset);
3143            Ok(())
3144        }
3145    }
3146
3147    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Unbound {
3148        #[inline(always)]
3149        fn new_empty() -> Self {
3150            Self
3151        }
3152
3153        #[inline]
3154        unsafe fn decode(
3155            &mut self,
3156            decoder: &mut fidl::encoding::Decoder<'_, D>,
3157            offset: usize,
3158            _depth: fidl::encoding::Depth,
3159        ) -> fidl::Result<()> {
3160            decoder.debug_check_bounds::<Self>(offset);
3161            match decoder.read_num::<u8>(offset) {
3162                0 => Ok(()),
3163                _ => Err(fidl::Error::Invalid),
3164            }
3165        }
3166    }
3167
3168    impl fidl::encoding::ValueTypeMarker for Unmarked {
3169        type Borrowed<'a> = &'a Self;
3170        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3171            value
3172        }
3173    }
3174
3175    unsafe impl fidl::encoding::TypeMarker for Unmarked {
3176        type Owned = Self;
3177
3178        #[inline(always)]
3179        fn inline_align(_context: fidl::encoding::Context) -> usize {
3180            1
3181        }
3182
3183        #[inline(always)]
3184        fn inline_size(_context: fidl::encoding::Context) -> usize {
3185            1
3186        }
3187    }
3188
3189    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Unmarked, D> for &Unmarked {
3190        #[inline]
3191        unsafe fn encode(
3192            self,
3193            encoder: &mut fidl::encoding::Encoder<'_, D>,
3194            offset: usize,
3195            _depth: fidl::encoding::Depth,
3196        ) -> fidl::Result<()> {
3197            encoder.debug_check_bounds::<Unmarked>(offset);
3198            encoder.write_num(0u8, offset);
3199            Ok(())
3200        }
3201    }
3202
3203    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Unmarked {
3204        #[inline(always)]
3205        fn new_empty() -> Self {
3206            Self
3207        }
3208
3209        #[inline]
3210        unsafe fn decode(
3211            &mut self,
3212            decoder: &mut fidl::encoding::Decoder<'_, D>,
3213            offset: usize,
3214            _depth: fidl::encoding::Depth,
3215        ) -> fidl::Result<()> {
3216            decoder.debug_check_bounds::<Self>(offset);
3217            match decoder.read_num::<u8>(offset) {
3218                0 => Ok(()),
3219                _ => Err(fidl::Error::Invalid),
3220            }
3221        }
3222    }
3223
3224    impl fidl::encoding::ValueTypeMarker for Unreachable {
3225        type Borrowed<'a> = &'a Self;
3226        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3227            value
3228        }
3229    }
3230
3231    unsafe impl fidl::encoding::TypeMarker for Unreachable {
3232        type Owned = Self;
3233
3234        #[inline(always)]
3235        fn inline_align(_context: fidl::encoding::Context) -> usize {
3236            1
3237        }
3238
3239        #[inline(always)]
3240        fn inline_size(_context: fidl::encoding::Context) -> usize {
3241            1
3242        }
3243    }
3244
3245    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Unreachable, D>
3246        for &Unreachable
3247    {
3248        #[inline]
3249        unsafe fn encode(
3250            self,
3251            encoder: &mut fidl::encoding::Encoder<'_, D>,
3252            offset: usize,
3253            _depth: fidl::encoding::Depth,
3254        ) -> fidl::Result<()> {
3255            encoder.debug_check_bounds::<Unreachable>(offset);
3256            encoder.write_num(0u8, offset);
3257            Ok(())
3258        }
3259    }
3260
3261    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Unreachable {
3262        #[inline(always)]
3263        fn new_empty() -> Self {
3264            Self
3265        }
3266
3267        #[inline]
3268        unsafe fn decode(
3269            &mut self,
3270            decoder: &mut fidl::encoding::Decoder<'_, D>,
3271            offset: usize,
3272            _depth: fidl::encoding::Depth,
3273        ) -> fidl::Result<()> {
3274            decoder.debug_check_bounds::<Self>(offset);
3275            match decoder.read_num::<u8>(offset) {
3276                0 => Ok(()),
3277                _ => Err(fidl::Error::Invalid),
3278            }
3279        }
3280    }
3281
3282    impl fidl::encoding::ValueTypeMarker for WatcherV4WatchResponse {
3283        type Borrowed<'a> = &'a Self;
3284        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3285            value
3286        }
3287    }
3288
3289    unsafe impl fidl::encoding::TypeMarker for WatcherV4WatchResponse {
3290        type Owned = Self;
3291
3292        #[inline(always)]
3293        fn inline_align(_context: fidl::encoding::Context) -> usize {
3294            8
3295        }
3296
3297        #[inline(always)]
3298        fn inline_size(_context: fidl::encoding::Context) -> usize {
3299            16
3300        }
3301    }
3302
3303    unsafe impl<D: fidl::encoding::ResourceDialect>
3304        fidl::encoding::Encode<WatcherV4WatchResponse, D> for &WatcherV4WatchResponse
3305    {
3306        #[inline]
3307        unsafe fn encode(
3308            self,
3309            encoder: &mut fidl::encoding::Encoder<'_, D>,
3310            offset: usize,
3311            _depth: fidl::encoding::Depth,
3312        ) -> fidl::Result<()> {
3313            encoder.debug_check_bounds::<WatcherV4WatchResponse>(offset);
3314            // Delegate to tuple encoding.
3315            fidl::encoding::Encode::<WatcherV4WatchResponse, D>::encode(
3316                (
3317                    <fidl::encoding::Vector<EventV4, 512> as fidl::encoding::ValueTypeMarker>::borrow(&self.events),
3318                ),
3319                encoder, offset, _depth
3320            )
3321        }
3322    }
3323    unsafe impl<
3324            D: fidl::encoding::ResourceDialect,
3325            T0: fidl::encoding::Encode<fidl::encoding::Vector<EventV4, 512>, D>,
3326        > fidl::encoding::Encode<WatcherV4WatchResponse, D> for (T0,)
3327    {
3328        #[inline]
3329        unsafe fn encode(
3330            self,
3331            encoder: &mut fidl::encoding::Encoder<'_, D>,
3332            offset: usize,
3333            depth: fidl::encoding::Depth,
3334        ) -> fidl::Result<()> {
3335            encoder.debug_check_bounds::<WatcherV4WatchResponse>(offset);
3336            // Zero out padding regions. There's no need to apply masks
3337            // because the unmasked parts will be overwritten by fields.
3338            // Write the fields.
3339            self.0.encode(encoder, offset + 0, depth)?;
3340            Ok(())
3341        }
3342    }
3343
3344    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3345        for WatcherV4WatchResponse
3346    {
3347        #[inline(always)]
3348        fn new_empty() -> Self {
3349            Self { events: fidl::new_empty!(fidl::encoding::Vector<EventV4, 512>, D) }
3350        }
3351
3352        #[inline]
3353        unsafe fn decode(
3354            &mut self,
3355            decoder: &mut fidl::encoding::Decoder<'_, D>,
3356            offset: usize,
3357            _depth: fidl::encoding::Depth,
3358        ) -> fidl::Result<()> {
3359            decoder.debug_check_bounds::<Self>(offset);
3360            // Verify that padding bytes are zero.
3361            fidl::decode!(fidl::encoding::Vector<EventV4, 512>, D, &mut self.events, decoder, offset + 0, _depth)?;
3362            Ok(())
3363        }
3364    }
3365
3366    impl fidl::encoding::ValueTypeMarker for WatcherV6WatchResponse {
3367        type Borrowed<'a> = &'a Self;
3368        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3369            value
3370        }
3371    }
3372
3373    unsafe impl fidl::encoding::TypeMarker for WatcherV6WatchResponse {
3374        type Owned = Self;
3375
3376        #[inline(always)]
3377        fn inline_align(_context: fidl::encoding::Context) -> usize {
3378            8
3379        }
3380
3381        #[inline(always)]
3382        fn inline_size(_context: fidl::encoding::Context) -> usize {
3383            16
3384        }
3385    }
3386
3387    unsafe impl<D: fidl::encoding::ResourceDialect>
3388        fidl::encoding::Encode<WatcherV6WatchResponse, D> for &WatcherV6WatchResponse
3389    {
3390        #[inline]
3391        unsafe fn encode(
3392            self,
3393            encoder: &mut fidl::encoding::Encoder<'_, D>,
3394            offset: usize,
3395            _depth: fidl::encoding::Depth,
3396        ) -> fidl::Result<()> {
3397            encoder.debug_check_bounds::<WatcherV6WatchResponse>(offset);
3398            // Delegate to tuple encoding.
3399            fidl::encoding::Encode::<WatcherV6WatchResponse, D>::encode(
3400                (
3401                    <fidl::encoding::Vector<EventV6, 512> as fidl::encoding::ValueTypeMarker>::borrow(&self.events),
3402                ),
3403                encoder, offset, _depth
3404            )
3405        }
3406    }
3407    unsafe impl<
3408            D: fidl::encoding::ResourceDialect,
3409            T0: fidl::encoding::Encode<fidl::encoding::Vector<EventV6, 512>, D>,
3410        > fidl::encoding::Encode<WatcherV6WatchResponse, D> for (T0,)
3411    {
3412        #[inline]
3413        unsafe fn encode(
3414            self,
3415            encoder: &mut fidl::encoding::Encoder<'_, D>,
3416            offset: usize,
3417            depth: fidl::encoding::Depth,
3418        ) -> fidl::Result<()> {
3419            encoder.debug_check_bounds::<WatcherV6WatchResponse>(offset);
3420            // Zero out padding regions. There's no need to apply masks
3421            // because the unmasked parts will be overwritten by fields.
3422            // Write the fields.
3423            self.0.encode(encoder, offset + 0, depth)?;
3424            Ok(())
3425        }
3426    }
3427
3428    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3429        for WatcherV6WatchResponse
3430    {
3431        #[inline(always)]
3432        fn new_empty() -> Self {
3433            Self { events: fidl::new_empty!(fidl::encoding::Vector<EventV6, 512>, D) }
3434        }
3435
3436        #[inline]
3437        unsafe fn decode(
3438            &mut self,
3439            decoder: &mut fidl::encoding::Decoder<'_, D>,
3440            offset: usize,
3441            _depth: fidl::encoding::Depth,
3442        ) -> fidl::Result<()> {
3443            decoder.debug_check_bounds::<Self>(offset);
3444            // Verify that padding bytes are zero.
3445            fidl::decode!(fidl::encoding::Vector<EventV6, 512>, D, &mut self.events, decoder, offset + 0, _depth)?;
3446            Ok(())
3447        }
3448    }
3449
3450    impl BaseMatcher {
3451        #[inline(always)]
3452        fn max_ordinal_present(&self) -> u64 {
3453            if let Some(_) = self.mark_2 {
3454                return 4;
3455            }
3456            if let Some(_) = self.mark_1 {
3457                return 3;
3458            }
3459            if let Some(_) = self.bound_device {
3460                return 2;
3461            }
3462            if let Some(_) = self.locally_generated {
3463                return 1;
3464            }
3465            0
3466        }
3467    }
3468
3469    impl fidl::encoding::ValueTypeMarker for BaseMatcher {
3470        type Borrowed<'a> = &'a Self;
3471        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3472            value
3473        }
3474    }
3475
3476    unsafe impl fidl::encoding::TypeMarker for BaseMatcher {
3477        type Owned = Self;
3478
3479        #[inline(always)]
3480        fn inline_align(_context: fidl::encoding::Context) -> usize {
3481            8
3482        }
3483
3484        #[inline(always)]
3485        fn inline_size(_context: fidl::encoding::Context) -> usize {
3486            16
3487        }
3488    }
3489
3490    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BaseMatcher, D>
3491        for &BaseMatcher
3492    {
3493        unsafe fn encode(
3494            self,
3495            encoder: &mut fidl::encoding::Encoder<'_, D>,
3496            offset: usize,
3497            mut depth: fidl::encoding::Depth,
3498        ) -> fidl::Result<()> {
3499            encoder.debug_check_bounds::<BaseMatcher>(offset);
3500            // Vector header
3501            let max_ordinal: u64 = self.max_ordinal_present();
3502            encoder.write_num(max_ordinal, offset);
3503            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3504            // Calling encoder.out_of_line_offset(0) is not allowed.
3505            if max_ordinal == 0 {
3506                return Ok(());
3507            }
3508            depth.increment()?;
3509            let envelope_size = 8;
3510            let bytes_len = max_ordinal as usize * envelope_size;
3511            #[allow(unused_variables)]
3512            let offset = encoder.out_of_line_offset(bytes_len);
3513            let mut _prev_end_offset: usize = 0;
3514            if 1 > max_ordinal {
3515                return Ok(());
3516            }
3517
3518            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3519            // are envelope_size bytes.
3520            let cur_offset: usize = (1 - 1) * envelope_size;
3521
3522            // Zero reserved fields.
3523            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3524
3525            // Safety:
3526            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3527            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3528            //   envelope_size bytes, there is always sufficient room.
3529            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3530                self.locally_generated
3531                    .as_ref()
3532                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3533                encoder,
3534                offset + cur_offset,
3535                depth,
3536            )?;
3537
3538            _prev_end_offset = cur_offset + envelope_size;
3539            if 2 > max_ordinal {
3540                return Ok(());
3541            }
3542
3543            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3544            // are envelope_size bytes.
3545            let cur_offset: usize = (2 - 1) * envelope_size;
3546
3547            // Zero reserved fields.
3548            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3549
3550            // Safety:
3551            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3552            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3553            //   envelope_size bytes, there is always sufficient room.
3554            fidl::encoding::encode_in_envelope_optional::<InterfaceMatcher, D>(
3555                self.bound_device
3556                    .as_ref()
3557                    .map(<InterfaceMatcher as fidl::encoding::ValueTypeMarker>::borrow),
3558                encoder,
3559                offset + cur_offset,
3560                depth,
3561            )?;
3562
3563            _prev_end_offset = cur_offset + envelope_size;
3564            if 3 > max_ordinal {
3565                return Ok(());
3566            }
3567
3568            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3569            // are envelope_size bytes.
3570            let cur_offset: usize = (3 - 1) * envelope_size;
3571
3572            // Zero reserved fields.
3573            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3574
3575            // Safety:
3576            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3577            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3578            //   envelope_size bytes, there is always sufficient room.
3579            fidl::encoding::encode_in_envelope_optional::<MarkMatcher, D>(
3580                self.mark_1.as_ref().map(<MarkMatcher as fidl::encoding::ValueTypeMarker>::borrow),
3581                encoder,
3582                offset + cur_offset,
3583                depth,
3584            )?;
3585
3586            _prev_end_offset = cur_offset + envelope_size;
3587            if 4 > max_ordinal {
3588                return Ok(());
3589            }
3590
3591            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3592            // are envelope_size bytes.
3593            let cur_offset: usize = (4 - 1) * envelope_size;
3594
3595            // Zero reserved fields.
3596            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3597
3598            // Safety:
3599            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3600            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3601            //   envelope_size bytes, there is always sufficient room.
3602            fidl::encoding::encode_in_envelope_optional::<MarkMatcher, D>(
3603                self.mark_2.as_ref().map(<MarkMatcher as fidl::encoding::ValueTypeMarker>::borrow),
3604                encoder,
3605                offset + cur_offset,
3606                depth,
3607            )?;
3608
3609            _prev_end_offset = cur_offset + envelope_size;
3610
3611            Ok(())
3612        }
3613    }
3614
3615    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BaseMatcher {
3616        #[inline(always)]
3617        fn new_empty() -> Self {
3618            Self::default()
3619        }
3620
3621        unsafe fn decode(
3622            &mut self,
3623            decoder: &mut fidl::encoding::Decoder<'_, D>,
3624            offset: usize,
3625            mut depth: fidl::encoding::Depth,
3626        ) -> fidl::Result<()> {
3627            decoder.debug_check_bounds::<Self>(offset);
3628            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3629                None => return Err(fidl::Error::NotNullable),
3630                Some(len) => len,
3631            };
3632            // Calling decoder.out_of_line_offset(0) is not allowed.
3633            if len == 0 {
3634                return Ok(());
3635            };
3636            depth.increment()?;
3637            let envelope_size = 8;
3638            let bytes_len = len * envelope_size;
3639            let offset = decoder.out_of_line_offset(bytes_len)?;
3640            // Decode the envelope for each type.
3641            let mut _next_ordinal_to_read = 0;
3642            let mut next_offset = offset;
3643            let end_offset = offset + bytes_len;
3644            _next_ordinal_to_read += 1;
3645            if next_offset >= end_offset {
3646                return Ok(());
3647            }
3648
3649            // Decode unknown envelopes for gaps in ordinals.
3650            while _next_ordinal_to_read < 1 {
3651                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3652                _next_ordinal_to_read += 1;
3653                next_offset += envelope_size;
3654            }
3655
3656            let next_out_of_line = decoder.next_out_of_line();
3657            let handles_before = decoder.remaining_handles();
3658            if let Some((inlined, num_bytes, num_handles)) =
3659                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3660            {
3661                let member_inline_size =
3662                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3663                if inlined != (member_inline_size <= 4) {
3664                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3665                }
3666                let inner_offset;
3667                let mut inner_depth = depth.clone();
3668                if inlined {
3669                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3670                    inner_offset = next_offset;
3671                } else {
3672                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3673                    inner_depth.increment()?;
3674                }
3675                let val_ref =
3676                    self.locally_generated.get_or_insert_with(|| fidl::new_empty!(bool, D));
3677                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3678                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3679                {
3680                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3681                }
3682                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3683                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3684                }
3685            }
3686
3687            next_offset += envelope_size;
3688            _next_ordinal_to_read += 1;
3689            if next_offset >= end_offset {
3690                return Ok(());
3691            }
3692
3693            // Decode unknown envelopes for gaps in ordinals.
3694            while _next_ordinal_to_read < 2 {
3695                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3696                _next_ordinal_to_read += 1;
3697                next_offset += envelope_size;
3698            }
3699
3700            let next_out_of_line = decoder.next_out_of_line();
3701            let handles_before = decoder.remaining_handles();
3702            if let Some((inlined, num_bytes, num_handles)) =
3703                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3704            {
3705                let member_inline_size =
3706                    <InterfaceMatcher as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3707                if inlined != (member_inline_size <= 4) {
3708                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3709                }
3710                let inner_offset;
3711                let mut inner_depth = depth.clone();
3712                if inlined {
3713                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3714                    inner_offset = next_offset;
3715                } else {
3716                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3717                    inner_depth.increment()?;
3718                }
3719                let val_ref =
3720                    self.bound_device.get_or_insert_with(|| fidl::new_empty!(InterfaceMatcher, D));
3721                fidl::decode!(InterfaceMatcher, D, val_ref, decoder, inner_offset, inner_depth)?;
3722                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3723                {
3724                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3725                }
3726                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3727                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3728                }
3729            }
3730
3731            next_offset += envelope_size;
3732            _next_ordinal_to_read += 1;
3733            if next_offset >= end_offset {
3734                return Ok(());
3735            }
3736
3737            // Decode unknown envelopes for gaps in ordinals.
3738            while _next_ordinal_to_read < 3 {
3739                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3740                _next_ordinal_to_read += 1;
3741                next_offset += envelope_size;
3742            }
3743
3744            let next_out_of_line = decoder.next_out_of_line();
3745            let handles_before = decoder.remaining_handles();
3746            if let Some((inlined, num_bytes, num_handles)) =
3747                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3748            {
3749                let member_inline_size =
3750                    <MarkMatcher as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3751                if inlined != (member_inline_size <= 4) {
3752                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3753                }
3754                let inner_offset;
3755                let mut inner_depth = depth.clone();
3756                if inlined {
3757                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3758                    inner_offset = next_offset;
3759                } else {
3760                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3761                    inner_depth.increment()?;
3762                }
3763                let val_ref = self.mark_1.get_or_insert_with(|| fidl::new_empty!(MarkMatcher, D));
3764                fidl::decode!(MarkMatcher, D, val_ref, decoder, inner_offset, inner_depth)?;
3765                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3766                {
3767                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3768                }
3769                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3770                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3771                }
3772            }
3773
3774            next_offset += envelope_size;
3775            _next_ordinal_to_read += 1;
3776            if next_offset >= end_offset {
3777                return Ok(());
3778            }
3779
3780            // Decode unknown envelopes for gaps in ordinals.
3781            while _next_ordinal_to_read < 4 {
3782                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3783                _next_ordinal_to_read += 1;
3784                next_offset += envelope_size;
3785            }
3786
3787            let next_out_of_line = decoder.next_out_of_line();
3788            let handles_before = decoder.remaining_handles();
3789            if let Some((inlined, num_bytes, num_handles)) =
3790                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3791            {
3792                let member_inline_size =
3793                    <MarkMatcher as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3794                if inlined != (member_inline_size <= 4) {
3795                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3796                }
3797                let inner_offset;
3798                let mut inner_depth = depth.clone();
3799                if inlined {
3800                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3801                    inner_offset = next_offset;
3802                } else {
3803                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3804                    inner_depth.increment()?;
3805                }
3806                let val_ref = self.mark_2.get_or_insert_with(|| fidl::new_empty!(MarkMatcher, D));
3807                fidl::decode!(MarkMatcher, D, val_ref, decoder, inner_offset, inner_depth)?;
3808                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3809                {
3810                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3811                }
3812                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3813                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3814                }
3815            }
3816
3817            next_offset += envelope_size;
3818
3819            // Decode the remaining unknown envelopes.
3820            while next_offset < end_offset {
3821                _next_ordinal_to_read += 1;
3822                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3823                next_offset += envelope_size;
3824            }
3825
3826            Ok(())
3827        }
3828    }
3829
3830    impl Destination {
3831        #[inline(always)]
3832        fn max_ordinal_present(&self) -> u64 {
3833            if let Some(_) = self.source_address {
3834                return 4;
3835            }
3836            if let Some(_) = self.interface_id {
3837                return 3;
3838            }
3839            if let Some(_) = self.mac {
3840                return 2;
3841            }
3842            if let Some(_) = self.address {
3843                return 1;
3844            }
3845            0
3846        }
3847    }
3848
3849    impl fidl::encoding::ValueTypeMarker for Destination {
3850        type Borrowed<'a> = &'a Self;
3851        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3852            value
3853        }
3854    }
3855
3856    unsafe impl fidl::encoding::TypeMarker for Destination {
3857        type Owned = Self;
3858
3859        #[inline(always)]
3860        fn inline_align(_context: fidl::encoding::Context) -> usize {
3861            8
3862        }
3863
3864        #[inline(always)]
3865        fn inline_size(_context: fidl::encoding::Context) -> usize {
3866            16
3867        }
3868    }
3869
3870    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Destination, D>
3871        for &Destination
3872    {
3873        unsafe fn encode(
3874            self,
3875            encoder: &mut fidl::encoding::Encoder<'_, D>,
3876            offset: usize,
3877            mut depth: fidl::encoding::Depth,
3878        ) -> fidl::Result<()> {
3879            encoder.debug_check_bounds::<Destination>(offset);
3880            // Vector header
3881            let max_ordinal: u64 = self.max_ordinal_present();
3882            encoder.write_num(max_ordinal, offset);
3883            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3884            // Calling encoder.out_of_line_offset(0) is not allowed.
3885            if max_ordinal == 0 {
3886                return Ok(());
3887            }
3888            depth.increment()?;
3889            let envelope_size = 8;
3890            let bytes_len = max_ordinal as usize * envelope_size;
3891            #[allow(unused_variables)]
3892            let offset = encoder.out_of_line_offset(bytes_len);
3893            let mut _prev_end_offset: usize = 0;
3894            if 1 > max_ordinal {
3895                return Ok(());
3896            }
3897
3898            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3899            // are envelope_size bytes.
3900            let cur_offset: usize = (1 - 1) * envelope_size;
3901
3902            // Zero reserved fields.
3903            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3904
3905            // Safety:
3906            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3907            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3908            //   envelope_size bytes, there is always sufficient room.
3909            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net::IpAddress, D>(
3910                self.address
3911                    .as_ref()
3912                    .map(<fidl_fuchsia_net::IpAddress as fidl::encoding::ValueTypeMarker>::borrow),
3913                encoder,
3914                offset + cur_offset,
3915                depth,
3916            )?;
3917
3918            _prev_end_offset = cur_offset + envelope_size;
3919            if 2 > max_ordinal {
3920                return Ok(());
3921            }
3922
3923            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3924            // are envelope_size bytes.
3925            let cur_offset: usize = (2 - 1) * envelope_size;
3926
3927            // Zero reserved fields.
3928            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3929
3930            // Safety:
3931            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3932            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3933            //   envelope_size bytes, there is always sufficient room.
3934            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net::MacAddress, D>(
3935                self.mac
3936                    .as_ref()
3937                    .map(<fidl_fuchsia_net::MacAddress as fidl::encoding::ValueTypeMarker>::borrow),
3938                encoder,
3939                offset + cur_offset,
3940                depth,
3941            )?;
3942
3943            _prev_end_offset = cur_offset + envelope_size;
3944            if 3 > max_ordinal {
3945                return Ok(());
3946            }
3947
3948            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3949            // are envelope_size bytes.
3950            let cur_offset: usize = (3 - 1) * envelope_size;
3951
3952            // Zero reserved fields.
3953            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3954
3955            // Safety:
3956            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3957            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3958            //   envelope_size bytes, there is always sufficient room.
3959            fidl::encoding::encode_in_envelope_optional::<u64, D>(
3960                self.interface_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3961                encoder,
3962                offset + cur_offset,
3963                depth,
3964            )?;
3965
3966            _prev_end_offset = cur_offset + envelope_size;
3967            if 4 > max_ordinal {
3968                return Ok(());
3969            }
3970
3971            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3972            // are envelope_size bytes.
3973            let cur_offset: usize = (4 - 1) * envelope_size;
3974
3975            // Zero reserved fields.
3976            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3977
3978            // Safety:
3979            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3980            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3981            //   envelope_size bytes, there is always sufficient room.
3982            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net::IpAddress, D>(
3983                self.source_address
3984                    .as_ref()
3985                    .map(<fidl_fuchsia_net::IpAddress as fidl::encoding::ValueTypeMarker>::borrow),
3986                encoder,
3987                offset + cur_offset,
3988                depth,
3989            )?;
3990
3991            _prev_end_offset = cur_offset + envelope_size;
3992
3993            Ok(())
3994        }
3995    }
3996
3997    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Destination {
3998        #[inline(always)]
3999        fn new_empty() -> Self {
4000            Self::default()
4001        }
4002
4003        unsafe fn decode(
4004            &mut self,
4005            decoder: &mut fidl::encoding::Decoder<'_, D>,
4006            offset: usize,
4007            mut depth: fidl::encoding::Depth,
4008        ) -> fidl::Result<()> {
4009            decoder.debug_check_bounds::<Self>(offset);
4010            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4011                None => return Err(fidl::Error::NotNullable),
4012                Some(len) => len,
4013            };
4014            // Calling decoder.out_of_line_offset(0) is not allowed.
4015            if len == 0 {
4016                return Ok(());
4017            };
4018            depth.increment()?;
4019            let envelope_size = 8;
4020            let bytes_len = len * envelope_size;
4021            let offset = decoder.out_of_line_offset(bytes_len)?;
4022            // Decode the envelope for each type.
4023            let mut _next_ordinal_to_read = 0;
4024            let mut next_offset = offset;
4025            let end_offset = offset + bytes_len;
4026            _next_ordinal_to_read += 1;
4027            if next_offset >= end_offset {
4028                return Ok(());
4029            }
4030
4031            // Decode unknown envelopes for gaps in ordinals.
4032            while _next_ordinal_to_read < 1 {
4033                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4034                _next_ordinal_to_read += 1;
4035                next_offset += envelope_size;
4036            }
4037
4038            let next_out_of_line = decoder.next_out_of_line();
4039            let handles_before = decoder.remaining_handles();
4040            if let Some((inlined, num_bytes, num_handles)) =
4041                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4042            {
4043                let member_inline_size =
4044                    <fidl_fuchsia_net::IpAddress as fidl::encoding::TypeMarker>::inline_size(
4045                        decoder.context,
4046                    );
4047                if inlined != (member_inline_size <= 4) {
4048                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4049                }
4050                let inner_offset;
4051                let mut inner_depth = depth.clone();
4052                if inlined {
4053                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4054                    inner_offset = next_offset;
4055                } else {
4056                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4057                    inner_depth.increment()?;
4058                }
4059                let val_ref = self
4060                    .address
4061                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net::IpAddress, D));
4062                fidl::decode!(
4063                    fidl_fuchsia_net::IpAddress,
4064                    D,
4065                    val_ref,
4066                    decoder,
4067                    inner_offset,
4068                    inner_depth
4069                )?;
4070                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4071                {
4072                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4073                }
4074                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4075                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4076                }
4077            }
4078
4079            next_offset += envelope_size;
4080            _next_ordinal_to_read += 1;
4081            if next_offset >= end_offset {
4082                return Ok(());
4083            }
4084
4085            // Decode unknown envelopes for gaps in ordinals.
4086            while _next_ordinal_to_read < 2 {
4087                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4088                _next_ordinal_to_read += 1;
4089                next_offset += envelope_size;
4090            }
4091
4092            let next_out_of_line = decoder.next_out_of_line();
4093            let handles_before = decoder.remaining_handles();
4094            if let Some((inlined, num_bytes, num_handles)) =
4095                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4096            {
4097                let member_inline_size =
4098                    <fidl_fuchsia_net::MacAddress as fidl::encoding::TypeMarker>::inline_size(
4099                        decoder.context,
4100                    );
4101                if inlined != (member_inline_size <= 4) {
4102                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4103                }
4104                let inner_offset;
4105                let mut inner_depth = depth.clone();
4106                if inlined {
4107                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4108                    inner_offset = next_offset;
4109                } else {
4110                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4111                    inner_depth.increment()?;
4112                }
4113                let val_ref = self
4114                    .mac
4115                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net::MacAddress, D));
4116                fidl::decode!(
4117                    fidl_fuchsia_net::MacAddress,
4118                    D,
4119                    val_ref,
4120                    decoder,
4121                    inner_offset,
4122                    inner_depth
4123                )?;
4124                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4125                {
4126                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4127                }
4128                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4129                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4130                }
4131            }
4132
4133            next_offset += envelope_size;
4134            _next_ordinal_to_read += 1;
4135            if next_offset >= end_offset {
4136                return Ok(());
4137            }
4138
4139            // Decode unknown envelopes for gaps in ordinals.
4140            while _next_ordinal_to_read < 3 {
4141                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4142                _next_ordinal_to_read += 1;
4143                next_offset += envelope_size;
4144            }
4145
4146            let next_out_of_line = decoder.next_out_of_line();
4147            let handles_before = decoder.remaining_handles();
4148            if let Some((inlined, num_bytes, num_handles)) =
4149                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4150            {
4151                let member_inline_size =
4152                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4153                if inlined != (member_inline_size <= 4) {
4154                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4155                }
4156                let inner_offset;
4157                let mut inner_depth = depth.clone();
4158                if inlined {
4159                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4160                    inner_offset = next_offset;
4161                } else {
4162                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4163                    inner_depth.increment()?;
4164                }
4165                let val_ref = self.interface_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
4166                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4167                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4168                {
4169                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4170                }
4171                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4172                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4173                }
4174            }
4175
4176            next_offset += envelope_size;
4177            _next_ordinal_to_read += 1;
4178            if next_offset >= end_offset {
4179                return Ok(());
4180            }
4181
4182            // Decode unknown envelopes for gaps in ordinals.
4183            while _next_ordinal_to_read < 4 {
4184                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4185                _next_ordinal_to_read += 1;
4186                next_offset += envelope_size;
4187            }
4188
4189            let next_out_of_line = decoder.next_out_of_line();
4190            let handles_before = decoder.remaining_handles();
4191            if let Some((inlined, num_bytes, num_handles)) =
4192                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4193            {
4194                let member_inline_size =
4195                    <fidl_fuchsia_net::IpAddress as fidl::encoding::TypeMarker>::inline_size(
4196                        decoder.context,
4197                    );
4198                if inlined != (member_inline_size <= 4) {
4199                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4200                }
4201                let inner_offset;
4202                let mut inner_depth = depth.clone();
4203                if inlined {
4204                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4205                    inner_offset = next_offset;
4206                } else {
4207                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4208                    inner_depth.increment()?;
4209                }
4210                let val_ref = self
4211                    .source_address
4212                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net::IpAddress, D));
4213                fidl::decode!(
4214                    fidl_fuchsia_net::IpAddress,
4215                    D,
4216                    val_ref,
4217                    decoder,
4218                    inner_offset,
4219                    inner_depth
4220                )?;
4221                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4222                {
4223                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4224                }
4225                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4226                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4227                }
4228            }
4229
4230            next_offset += envelope_size;
4231
4232            // Decode the remaining unknown envelopes.
4233            while next_offset < end_offset {
4234                _next_ordinal_to_read += 1;
4235                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4236                next_offset += envelope_size;
4237            }
4238
4239            Ok(())
4240        }
4241    }
4242
4243    impl EffectiveRouteProperties {
4244        #[inline(always)]
4245        fn max_ordinal_present(&self) -> u64 {
4246            if let Some(_) = self.metric {
4247                return 1;
4248            }
4249            0
4250        }
4251    }
4252
4253    impl fidl::encoding::ValueTypeMarker for EffectiveRouteProperties {
4254        type Borrowed<'a> = &'a Self;
4255        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4256            value
4257        }
4258    }
4259
4260    unsafe impl fidl::encoding::TypeMarker for EffectiveRouteProperties {
4261        type Owned = Self;
4262
4263        #[inline(always)]
4264        fn inline_align(_context: fidl::encoding::Context) -> usize {
4265            8
4266        }
4267
4268        #[inline(always)]
4269        fn inline_size(_context: fidl::encoding::Context) -> usize {
4270            16
4271        }
4272    }
4273
4274    unsafe impl<D: fidl::encoding::ResourceDialect>
4275        fidl::encoding::Encode<EffectiveRouteProperties, D> for &EffectiveRouteProperties
4276    {
4277        unsafe fn encode(
4278            self,
4279            encoder: &mut fidl::encoding::Encoder<'_, D>,
4280            offset: usize,
4281            mut depth: fidl::encoding::Depth,
4282        ) -> fidl::Result<()> {
4283            encoder.debug_check_bounds::<EffectiveRouteProperties>(offset);
4284            // Vector header
4285            let max_ordinal: u64 = self.max_ordinal_present();
4286            encoder.write_num(max_ordinal, offset);
4287            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4288            // Calling encoder.out_of_line_offset(0) is not allowed.
4289            if max_ordinal == 0 {
4290                return Ok(());
4291            }
4292            depth.increment()?;
4293            let envelope_size = 8;
4294            let bytes_len = max_ordinal as usize * envelope_size;
4295            #[allow(unused_variables)]
4296            let offset = encoder.out_of_line_offset(bytes_len);
4297            let mut _prev_end_offset: usize = 0;
4298            if 1 > max_ordinal {
4299                return Ok(());
4300            }
4301
4302            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4303            // are envelope_size bytes.
4304            let cur_offset: usize = (1 - 1) * envelope_size;
4305
4306            // Zero reserved fields.
4307            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4308
4309            // Safety:
4310            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4311            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4312            //   envelope_size bytes, there is always sufficient room.
4313            fidl::encoding::encode_in_envelope_optional::<u32, D>(
4314                self.metric.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4315                encoder,
4316                offset + cur_offset,
4317                depth,
4318            )?;
4319
4320            _prev_end_offset = cur_offset + envelope_size;
4321
4322            Ok(())
4323        }
4324    }
4325
4326    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4327        for EffectiveRouteProperties
4328    {
4329        #[inline(always)]
4330        fn new_empty() -> Self {
4331            Self::default()
4332        }
4333
4334        unsafe fn decode(
4335            &mut self,
4336            decoder: &mut fidl::encoding::Decoder<'_, D>,
4337            offset: usize,
4338            mut depth: fidl::encoding::Depth,
4339        ) -> fidl::Result<()> {
4340            decoder.debug_check_bounds::<Self>(offset);
4341            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4342                None => return Err(fidl::Error::NotNullable),
4343                Some(len) => len,
4344            };
4345            // Calling decoder.out_of_line_offset(0) is not allowed.
4346            if len == 0 {
4347                return Ok(());
4348            };
4349            depth.increment()?;
4350            let envelope_size = 8;
4351            let bytes_len = len * envelope_size;
4352            let offset = decoder.out_of_line_offset(bytes_len)?;
4353            // Decode the envelope for each type.
4354            let mut _next_ordinal_to_read = 0;
4355            let mut next_offset = offset;
4356            let end_offset = offset + bytes_len;
4357            _next_ordinal_to_read += 1;
4358            if next_offset >= end_offset {
4359                return Ok(());
4360            }
4361
4362            // Decode unknown envelopes for gaps in ordinals.
4363            while _next_ordinal_to_read < 1 {
4364                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4365                _next_ordinal_to_read += 1;
4366                next_offset += envelope_size;
4367            }
4368
4369            let next_out_of_line = decoder.next_out_of_line();
4370            let handles_before = decoder.remaining_handles();
4371            if let Some((inlined, num_bytes, num_handles)) =
4372                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4373            {
4374                let member_inline_size =
4375                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4376                if inlined != (member_inline_size <= 4) {
4377                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4378                }
4379                let inner_offset;
4380                let mut inner_depth = depth.clone();
4381                if inlined {
4382                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4383                    inner_offset = next_offset;
4384                } else {
4385                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4386                    inner_depth.increment()?;
4387                }
4388                let val_ref = self.metric.get_or_insert_with(|| fidl::new_empty!(u32, D));
4389                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
4390                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4391                {
4392                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4393                }
4394                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4395                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4396                }
4397            }
4398
4399            next_offset += envelope_size;
4400
4401            // Decode the remaining unknown envelopes.
4402            while next_offset < end_offset {
4403                _next_ordinal_to_read += 1;
4404                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4405                next_offset += envelope_size;
4406            }
4407
4408            Ok(())
4409        }
4410    }
4411
4412    impl InstalledRouteV4 {
4413        #[inline(always)]
4414        fn max_ordinal_present(&self) -> u64 {
4415            if let Some(_) = self.table_id {
4416                return 3;
4417            }
4418            if let Some(_) = self.effective_properties {
4419                return 2;
4420            }
4421            if let Some(_) = self.route {
4422                return 1;
4423            }
4424            0
4425        }
4426    }
4427
4428    impl fidl::encoding::ValueTypeMarker for InstalledRouteV4 {
4429        type Borrowed<'a> = &'a Self;
4430        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4431            value
4432        }
4433    }
4434
4435    unsafe impl fidl::encoding::TypeMarker for InstalledRouteV4 {
4436        type Owned = Self;
4437
4438        #[inline(always)]
4439        fn inline_align(_context: fidl::encoding::Context) -> usize {
4440            8
4441        }
4442
4443        #[inline(always)]
4444        fn inline_size(_context: fidl::encoding::Context) -> usize {
4445            16
4446        }
4447    }
4448
4449    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InstalledRouteV4, D>
4450        for &InstalledRouteV4
4451    {
4452        unsafe fn encode(
4453            self,
4454            encoder: &mut fidl::encoding::Encoder<'_, D>,
4455            offset: usize,
4456            mut depth: fidl::encoding::Depth,
4457        ) -> fidl::Result<()> {
4458            encoder.debug_check_bounds::<InstalledRouteV4>(offset);
4459            // Vector header
4460            let max_ordinal: u64 = self.max_ordinal_present();
4461            encoder.write_num(max_ordinal, offset);
4462            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4463            // Calling encoder.out_of_line_offset(0) is not allowed.
4464            if max_ordinal == 0 {
4465                return Ok(());
4466            }
4467            depth.increment()?;
4468            let envelope_size = 8;
4469            let bytes_len = max_ordinal as usize * envelope_size;
4470            #[allow(unused_variables)]
4471            let offset = encoder.out_of_line_offset(bytes_len);
4472            let mut _prev_end_offset: usize = 0;
4473            if 1 > max_ordinal {
4474                return Ok(());
4475            }
4476
4477            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4478            // are envelope_size bytes.
4479            let cur_offset: usize = (1 - 1) * envelope_size;
4480
4481            // Zero reserved fields.
4482            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4483
4484            // Safety:
4485            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4486            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4487            //   envelope_size bytes, there is always sufficient room.
4488            fidl::encoding::encode_in_envelope_optional::<RouteV4, D>(
4489                self.route.as_ref().map(<RouteV4 as fidl::encoding::ValueTypeMarker>::borrow),
4490                encoder,
4491                offset + cur_offset,
4492                depth,
4493            )?;
4494
4495            _prev_end_offset = cur_offset + envelope_size;
4496            if 2 > max_ordinal {
4497                return Ok(());
4498            }
4499
4500            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4501            // are envelope_size bytes.
4502            let cur_offset: usize = (2 - 1) * envelope_size;
4503
4504            // Zero reserved fields.
4505            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4506
4507            // Safety:
4508            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4509            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4510            //   envelope_size bytes, there is always sufficient room.
4511            fidl::encoding::encode_in_envelope_optional::<EffectiveRouteProperties, D>(
4512                self.effective_properties
4513                    .as_ref()
4514                    .map(<EffectiveRouteProperties as fidl::encoding::ValueTypeMarker>::borrow),
4515                encoder,
4516                offset + cur_offset,
4517                depth,
4518            )?;
4519
4520            _prev_end_offset = cur_offset + envelope_size;
4521            if 3 > max_ordinal {
4522                return Ok(());
4523            }
4524
4525            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4526            // are envelope_size bytes.
4527            let cur_offset: usize = (3 - 1) * envelope_size;
4528
4529            // Zero reserved fields.
4530            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4531
4532            // Safety:
4533            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4534            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4535            //   envelope_size bytes, there is always sufficient room.
4536            fidl::encoding::encode_in_envelope_optional::<u32, D>(
4537                self.table_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4538                encoder,
4539                offset + cur_offset,
4540                depth,
4541            )?;
4542
4543            _prev_end_offset = cur_offset + envelope_size;
4544
4545            Ok(())
4546        }
4547    }
4548
4549    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InstalledRouteV4 {
4550        #[inline(always)]
4551        fn new_empty() -> Self {
4552            Self::default()
4553        }
4554
4555        unsafe fn decode(
4556            &mut self,
4557            decoder: &mut fidl::encoding::Decoder<'_, D>,
4558            offset: usize,
4559            mut depth: fidl::encoding::Depth,
4560        ) -> fidl::Result<()> {
4561            decoder.debug_check_bounds::<Self>(offset);
4562            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4563                None => return Err(fidl::Error::NotNullable),
4564                Some(len) => len,
4565            };
4566            // Calling decoder.out_of_line_offset(0) is not allowed.
4567            if len == 0 {
4568                return Ok(());
4569            };
4570            depth.increment()?;
4571            let envelope_size = 8;
4572            let bytes_len = len * envelope_size;
4573            let offset = decoder.out_of_line_offset(bytes_len)?;
4574            // Decode the envelope for each type.
4575            let mut _next_ordinal_to_read = 0;
4576            let mut next_offset = offset;
4577            let end_offset = offset + bytes_len;
4578            _next_ordinal_to_read += 1;
4579            if next_offset >= end_offset {
4580                return Ok(());
4581            }
4582
4583            // Decode unknown envelopes for gaps in ordinals.
4584            while _next_ordinal_to_read < 1 {
4585                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4586                _next_ordinal_to_read += 1;
4587                next_offset += envelope_size;
4588            }
4589
4590            let next_out_of_line = decoder.next_out_of_line();
4591            let handles_before = decoder.remaining_handles();
4592            if let Some((inlined, num_bytes, num_handles)) =
4593                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4594            {
4595                let member_inline_size =
4596                    <RouteV4 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4597                if inlined != (member_inline_size <= 4) {
4598                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4599                }
4600                let inner_offset;
4601                let mut inner_depth = depth.clone();
4602                if inlined {
4603                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4604                    inner_offset = next_offset;
4605                } else {
4606                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4607                    inner_depth.increment()?;
4608                }
4609                let val_ref = self.route.get_or_insert_with(|| fidl::new_empty!(RouteV4, D));
4610                fidl::decode!(RouteV4, D, val_ref, decoder, inner_offset, inner_depth)?;
4611                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4612                {
4613                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4614                }
4615                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4616                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4617                }
4618            }
4619
4620            next_offset += envelope_size;
4621            _next_ordinal_to_read += 1;
4622            if next_offset >= end_offset {
4623                return Ok(());
4624            }
4625
4626            // Decode unknown envelopes for gaps in ordinals.
4627            while _next_ordinal_to_read < 2 {
4628                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4629                _next_ordinal_to_read += 1;
4630                next_offset += envelope_size;
4631            }
4632
4633            let next_out_of_line = decoder.next_out_of_line();
4634            let handles_before = decoder.remaining_handles();
4635            if let Some((inlined, num_bytes, num_handles)) =
4636                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4637            {
4638                let member_inline_size =
4639                    <EffectiveRouteProperties as fidl::encoding::TypeMarker>::inline_size(
4640                        decoder.context,
4641                    );
4642                if inlined != (member_inline_size <= 4) {
4643                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4644                }
4645                let inner_offset;
4646                let mut inner_depth = depth.clone();
4647                if inlined {
4648                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4649                    inner_offset = next_offset;
4650                } else {
4651                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4652                    inner_depth.increment()?;
4653                }
4654                let val_ref = self
4655                    .effective_properties
4656                    .get_or_insert_with(|| fidl::new_empty!(EffectiveRouteProperties, D));
4657                fidl::decode!(
4658                    EffectiveRouteProperties,
4659                    D,
4660                    val_ref,
4661                    decoder,
4662                    inner_offset,
4663                    inner_depth
4664                )?;
4665                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4666                {
4667                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4668                }
4669                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4670                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4671                }
4672            }
4673
4674            next_offset += envelope_size;
4675            _next_ordinal_to_read += 1;
4676            if next_offset >= end_offset {
4677                return Ok(());
4678            }
4679
4680            // Decode unknown envelopes for gaps in ordinals.
4681            while _next_ordinal_to_read < 3 {
4682                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4683                _next_ordinal_to_read += 1;
4684                next_offset += envelope_size;
4685            }
4686
4687            let next_out_of_line = decoder.next_out_of_line();
4688            let handles_before = decoder.remaining_handles();
4689            if let Some((inlined, num_bytes, num_handles)) =
4690                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4691            {
4692                let member_inline_size =
4693                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4694                if inlined != (member_inline_size <= 4) {
4695                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4696                }
4697                let inner_offset;
4698                let mut inner_depth = depth.clone();
4699                if inlined {
4700                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4701                    inner_offset = next_offset;
4702                } else {
4703                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4704                    inner_depth.increment()?;
4705                }
4706                let val_ref = self.table_id.get_or_insert_with(|| fidl::new_empty!(u32, D));
4707                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
4708                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4709                {
4710                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4711                }
4712                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4713                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4714                }
4715            }
4716
4717            next_offset += envelope_size;
4718
4719            // Decode the remaining unknown envelopes.
4720            while next_offset < end_offset {
4721                _next_ordinal_to_read += 1;
4722                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4723                next_offset += envelope_size;
4724            }
4725
4726            Ok(())
4727        }
4728    }
4729
4730    impl InstalledRouteV6 {
4731        #[inline(always)]
4732        fn max_ordinal_present(&self) -> u64 {
4733            if let Some(_) = self.table_id {
4734                return 3;
4735            }
4736            if let Some(_) = self.effective_properties {
4737                return 2;
4738            }
4739            if let Some(_) = self.route {
4740                return 1;
4741            }
4742            0
4743        }
4744    }
4745
4746    impl fidl::encoding::ValueTypeMarker for InstalledRouteV6 {
4747        type Borrowed<'a> = &'a Self;
4748        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4749            value
4750        }
4751    }
4752
4753    unsafe impl fidl::encoding::TypeMarker for InstalledRouteV6 {
4754        type Owned = Self;
4755
4756        #[inline(always)]
4757        fn inline_align(_context: fidl::encoding::Context) -> usize {
4758            8
4759        }
4760
4761        #[inline(always)]
4762        fn inline_size(_context: fidl::encoding::Context) -> usize {
4763            16
4764        }
4765    }
4766
4767    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InstalledRouteV6, D>
4768        for &InstalledRouteV6
4769    {
4770        unsafe fn encode(
4771            self,
4772            encoder: &mut fidl::encoding::Encoder<'_, D>,
4773            offset: usize,
4774            mut depth: fidl::encoding::Depth,
4775        ) -> fidl::Result<()> {
4776            encoder.debug_check_bounds::<InstalledRouteV6>(offset);
4777            // Vector header
4778            let max_ordinal: u64 = self.max_ordinal_present();
4779            encoder.write_num(max_ordinal, offset);
4780            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4781            // Calling encoder.out_of_line_offset(0) is not allowed.
4782            if max_ordinal == 0 {
4783                return Ok(());
4784            }
4785            depth.increment()?;
4786            let envelope_size = 8;
4787            let bytes_len = max_ordinal as usize * envelope_size;
4788            #[allow(unused_variables)]
4789            let offset = encoder.out_of_line_offset(bytes_len);
4790            let mut _prev_end_offset: usize = 0;
4791            if 1 > max_ordinal {
4792                return Ok(());
4793            }
4794
4795            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4796            // are envelope_size bytes.
4797            let cur_offset: usize = (1 - 1) * envelope_size;
4798
4799            // Zero reserved fields.
4800            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4801
4802            // Safety:
4803            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4804            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4805            //   envelope_size bytes, there is always sufficient room.
4806            fidl::encoding::encode_in_envelope_optional::<RouteV6, D>(
4807                self.route.as_ref().map(<RouteV6 as fidl::encoding::ValueTypeMarker>::borrow),
4808                encoder,
4809                offset + cur_offset,
4810                depth,
4811            )?;
4812
4813            _prev_end_offset = cur_offset + envelope_size;
4814            if 2 > max_ordinal {
4815                return Ok(());
4816            }
4817
4818            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4819            // are envelope_size bytes.
4820            let cur_offset: usize = (2 - 1) * envelope_size;
4821
4822            // Zero reserved fields.
4823            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4824
4825            // Safety:
4826            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4827            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4828            //   envelope_size bytes, there is always sufficient room.
4829            fidl::encoding::encode_in_envelope_optional::<EffectiveRouteProperties, D>(
4830                self.effective_properties
4831                    .as_ref()
4832                    .map(<EffectiveRouteProperties as fidl::encoding::ValueTypeMarker>::borrow),
4833                encoder,
4834                offset + cur_offset,
4835                depth,
4836            )?;
4837
4838            _prev_end_offset = cur_offset + envelope_size;
4839            if 3 > max_ordinal {
4840                return Ok(());
4841            }
4842
4843            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4844            // are envelope_size bytes.
4845            let cur_offset: usize = (3 - 1) * envelope_size;
4846
4847            // Zero reserved fields.
4848            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4849
4850            // Safety:
4851            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4852            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4853            //   envelope_size bytes, there is always sufficient room.
4854            fidl::encoding::encode_in_envelope_optional::<u32, D>(
4855                self.table_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4856                encoder,
4857                offset + cur_offset,
4858                depth,
4859            )?;
4860
4861            _prev_end_offset = cur_offset + envelope_size;
4862
4863            Ok(())
4864        }
4865    }
4866
4867    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InstalledRouteV6 {
4868        #[inline(always)]
4869        fn new_empty() -> Self {
4870            Self::default()
4871        }
4872
4873        unsafe fn decode(
4874            &mut self,
4875            decoder: &mut fidl::encoding::Decoder<'_, D>,
4876            offset: usize,
4877            mut depth: fidl::encoding::Depth,
4878        ) -> fidl::Result<()> {
4879            decoder.debug_check_bounds::<Self>(offset);
4880            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4881                None => return Err(fidl::Error::NotNullable),
4882                Some(len) => len,
4883            };
4884            // Calling decoder.out_of_line_offset(0) is not allowed.
4885            if len == 0 {
4886                return Ok(());
4887            };
4888            depth.increment()?;
4889            let envelope_size = 8;
4890            let bytes_len = len * envelope_size;
4891            let offset = decoder.out_of_line_offset(bytes_len)?;
4892            // Decode the envelope for each type.
4893            let mut _next_ordinal_to_read = 0;
4894            let mut next_offset = offset;
4895            let end_offset = offset + bytes_len;
4896            _next_ordinal_to_read += 1;
4897            if next_offset >= end_offset {
4898                return Ok(());
4899            }
4900
4901            // Decode unknown envelopes for gaps in ordinals.
4902            while _next_ordinal_to_read < 1 {
4903                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4904                _next_ordinal_to_read += 1;
4905                next_offset += envelope_size;
4906            }
4907
4908            let next_out_of_line = decoder.next_out_of_line();
4909            let handles_before = decoder.remaining_handles();
4910            if let Some((inlined, num_bytes, num_handles)) =
4911                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4912            {
4913                let member_inline_size =
4914                    <RouteV6 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4915                if inlined != (member_inline_size <= 4) {
4916                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4917                }
4918                let inner_offset;
4919                let mut inner_depth = depth.clone();
4920                if inlined {
4921                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4922                    inner_offset = next_offset;
4923                } else {
4924                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4925                    inner_depth.increment()?;
4926                }
4927                let val_ref = self.route.get_or_insert_with(|| fidl::new_empty!(RouteV6, D));
4928                fidl::decode!(RouteV6, D, val_ref, decoder, inner_offset, inner_depth)?;
4929                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4930                {
4931                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4932                }
4933                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4934                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4935                }
4936            }
4937
4938            next_offset += envelope_size;
4939            _next_ordinal_to_read += 1;
4940            if next_offset >= end_offset {
4941                return Ok(());
4942            }
4943
4944            // Decode unknown envelopes for gaps in ordinals.
4945            while _next_ordinal_to_read < 2 {
4946                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4947                _next_ordinal_to_read += 1;
4948                next_offset += envelope_size;
4949            }
4950
4951            let next_out_of_line = decoder.next_out_of_line();
4952            let handles_before = decoder.remaining_handles();
4953            if let Some((inlined, num_bytes, num_handles)) =
4954                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4955            {
4956                let member_inline_size =
4957                    <EffectiveRouteProperties as fidl::encoding::TypeMarker>::inline_size(
4958                        decoder.context,
4959                    );
4960                if inlined != (member_inline_size <= 4) {
4961                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4962                }
4963                let inner_offset;
4964                let mut inner_depth = depth.clone();
4965                if inlined {
4966                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4967                    inner_offset = next_offset;
4968                } else {
4969                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4970                    inner_depth.increment()?;
4971                }
4972                let val_ref = self
4973                    .effective_properties
4974                    .get_or_insert_with(|| fidl::new_empty!(EffectiveRouteProperties, D));
4975                fidl::decode!(
4976                    EffectiveRouteProperties,
4977                    D,
4978                    val_ref,
4979                    decoder,
4980                    inner_offset,
4981                    inner_depth
4982                )?;
4983                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4984                {
4985                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4986                }
4987                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4988                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4989                }
4990            }
4991
4992            next_offset += envelope_size;
4993            _next_ordinal_to_read += 1;
4994            if next_offset >= end_offset {
4995                return Ok(());
4996            }
4997
4998            // Decode unknown envelopes for gaps in ordinals.
4999            while _next_ordinal_to_read < 3 {
5000                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5001                _next_ordinal_to_read += 1;
5002                next_offset += envelope_size;
5003            }
5004
5005            let next_out_of_line = decoder.next_out_of_line();
5006            let handles_before = decoder.remaining_handles();
5007            if let Some((inlined, num_bytes, num_handles)) =
5008                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5009            {
5010                let member_inline_size =
5011                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5012                if inlined != (member_inline_size <= 4) {
5013                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5014                }
5015                let inner_offset;
5016                let mut inner_depth = depth.clone();
5017                if inlined {
5018                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5019                    inner_offset = next_offset;
5020                } else {
5021                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5022                    inner_depth.increment()?;
5023                }
5024                let val_ref = self.table_id.get_or_insert_with(|| fidl::new_empty!(u32, D));
5025                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
5026                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5027                {
5028                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5029                }
5030                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5031                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5032                }
5033            }
5034
5035            next_offset += envelope_size;
5036
5037            // Decode the remaining unknown envelopes.
5038            while next_offset < end_offset {
5039                _next_ordinal_to_read += 1;
5040                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5041                next_offset += envelope_size;
5042            }
5043
5044            Ok(())
5045        }
5046    }
5047
5048    impl ResolveOptions {
5049        #[inline(always)]
5050        fn max_ordinal_present(&self) -> u64 {
5051            if let Some(_) = self.marks {
5052                return 1;
5053            }
5054            0
5055        }
5056    }
5057
5058    impl fidl::encoding::ValueTypeMarker for ResolveOptions {
5059        type Borrowed<'a> = &'a Self;
5060        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5061            value
5062        }
5063    }
5064
5065    unsafe impl fidl::encoding::TypeMarker for ResolveOptions {
5066        type Owned = Self;
5067
5068        #[inline(always)]
5069        fn inline_align(_context: fidl::encoding::Context) -> usize {
5070            8
5071        }
5072
5073        #[inline(always)]
5074        fn inline_size(_context: fidl::encoding::Context) -> usize {
5075            16
5076        }
5077    }
5078
5079    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResolveOptions, D>
5080        for &ResolveOptions
5081    {
5082        unsafe fn encode(
5083            self,
5084            encoder: &mut fidl::encoding::Encoder<'_, D>,
5085            offset: usize,
5086            mut depth: fidl::encoding::Depth,
5087        ) -> fidl::Result<()> {
5088            encoder.debug_check_bounds::<ResolveOptions>(offset);
5089            // Vector header
5090            let max_ordinal: u64 = self.max_ordinal_present();
5091            encoder.write_num(max_ordinal, offset);
5092            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5093            // Calling encoder.out_of_line_offset(0) is not allowed.
5094            if max_ordinal == 0 {
5095                return Ok(());
5096            }
5097            depth.increment()?;
5098            let envelope_size = 8;
5099            let bytes_len = max_ordinal as usize * envelope_size;
5100            #[allow(unused_variables)]
5101            let offset = encoder.out_of_line_offset(bytes_len);
5102            let mut _prev_end_offset: usize = 0;
5103            if 1 > max_ordinal {
5104                return Ok(());
5105            }
5106
5107            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5108            // are envelope_size bytes.
5109            let cur_offset: usize = (1 - 1) * envelope_size;
5110
5111            // Zero reserved fields.
5112            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5113
5114            // Safety:
5115            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5116            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5117            //   envelope_size bytes, there is always sufficient room.
5118            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net::Marks, D>(
5119                self.marks
5120                    .as_ref()
5121                    .map(<fidl_fuchsia_net::Marks as fidl::encoding::ValueTypeMarker>::borrow),
5122                encoder,
5123                offset + cur_offset,
5124                depth,
5125            )?;
5126
5127            _prev_end_offset = cur_offset + envelope_size;
5128
5129            Ok(())
5130        }
5131    }
5132
5133    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolveOptions {
5134        #[inline(always)]
5135        fn new_empty() -> Self {
5136            Self::default()
5137        }
5138
5139        unsafe fn decode(
5140            &mut self,
5141            decoder: &mut fidl::encoding::Decoder<'_, D>,
5142            offset: usize,
5143            mut depth: fidl::encoding::Depth,
5144        ) -> fidl::Result<()> {
5145            decoder.debug_check_bounds::<Self>(offset);
5146            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5147                None => return Err(fidl::Error::NotNullable),
5148                Some(len) => len,
5149            };
5150            // Calling decoder.out_of_line_offset(0) is not allowed.
5151            if len == 0 {
5152                return Ok(());
5153            };
5154            depth.increment()?;
5155            let envelope_size = 8;
5156            let bytes_len = len * envelope_size;
5157            let offset = decoder.out_of_line_offset(bytes_len)?;
5158            // Decode the envelope for each type.
5159            let mut _next_ordinal_to_read = 0;
5160            let mut next_offset = offset;
5161            let end_offset = offset + bytes_len;
5162            _next_ordinal_to_read += 1;
5163            if next_offset >= end_offset {
5164                return Ok(());
5165            }
5166
5167            // Decode unknown envelopes for gaps in ordinals.
5168            while _next_ordinal_to_read < 1 {
5169                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5170                _next_ordinal_to_read += 1;
5171                next_offset += envelope_size;
5172            }
5173
5174            let next_out_of_line = decoder.next_out_of_line();
5175            let handles_before = decoder.remaining_handles();
5176            if let Some((inlined, num_bytes, num_handles)) =
5177                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5178            {
5179                let member_inline_size =
5180                    <fidl_fuchsia_net::Marks as fidl::encoding::TypeMarker>::inline_size(
5181                        decoder.context,
5182                    );
5183                if inlined != (member_inline_size <= 4) {
5184                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5185                }
5186                let inner_offset;
5187                let mut inner_depth = depth.clone();
5188                if inlined {
5189                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5190                    inner_offset = next_offset;
5191                } else {
5192                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5193                    inner_depth.increment()?;
5194                }
5195                let val_ref =
5196                    self.marks.get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net::Marks, D));
5197                fidl::decode!(
5198                    fidl_fuchsia_net::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::Ipv4AddressWithPrefix, D>(
5661            self.from.as_ref().map(<fidl_fuchsia_net::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::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::Ipv4AddressWithPrefix, D)
5755                });
5756                fidl::decode!(
5757                    fidl_fuchsia_net::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::Ipv6AddressWithPrefix, D>(
5903            self.from.as_ref().map(<fidl_fuchsia_net::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::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::Ipv6AddressWithPrefix, D)
5997                });
5998                fidl::decode!(
5999                    fidl_fuchsia_net::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}