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