Skip to main content

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