fidl_fuchsia_net_routes__common/
fidl_fuchsia_net_routes__common.rs

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