fidl_fuchsia_settings__common/
fidl_fuchsia_settings__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 MAX_LIGHT_NAME_LENGTH: u8 = 32;
12
13bitflags! {
14    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
15    pub struct ConfigurationInterfaces: u32 {
16        const ETHERNET = 1;
17        const WIFI = 2;
18    }
19}
20
21impl ConfigurationInterfaces {}
22
23bitflags! {
24    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
25    pub struct ThemeMode: u32 {
26        /// Product can choose a theme based on ambient cues.
27        const AUTO = 1;
28    }
29}
30
31impl ThemeMode {}
32
33bitflags! {
34    /// A series of flags determining the state of an input device mute toggle.
35    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
36    pub struct ToggleStateFlags: u64 {
37        /// The input device exists and is neither muted nor disabled.
38        const AVAILABLE = 1;
39        /// The input device is being used.
40        const ACTIVE = 2;
41        /// The input device could be available if it was enabled, but it is muted.
42        const MUTED = 4;
43        /// The input device is permanently disabled, e.g. by policy.
44        const DISABLED = 8;
45        /// The state cannot be determined.
46        const ERROR = 16;
47    }
48}
49
50impl ToggleStateFlags {}
51
52/// The source of the volume settings. The volume is set according to the source.
53#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
54#[repr(u32)]
55pub enum AudioStreamSettingSource {
56    /// The volume is set by the user. When the `source` in AudioStreamSettings is
57    /// set to this, the audio volume is set to `user_volume`.
58    User = 0,
59    /// The system takes control of the volume. This is used when the system constantly
60    /// calculates and changes the volume. The volume is not stored for this source.
61    System = 1,
62    /// The system takes control of the volume. This is used when the system changes
63    /// the volume, but we still want to play feedback sounds for these changes. The
64    /// volume is not stored for this source.
65    SystemWithFeedback = 2,
66}
67
68impl AudioStreamSettingSource {
69    #[inline]
70    pub fn from_primitive(prim: u32) -> Option<Self> {
71        match prim {
72            0 => Some(Self::User),
73            1 => Some(Self::System),
74            2 => Some(Self::SystemWithFeedback),
75            _ => None,
76        }
77    }
78
79    #[inline]
80    pub const fn into_primitive(self) -> u32 {
81        self as u32
82    }
83}
84
85/// Font family groups for closed captions, specified by 47 CFR §79.102(k).
86#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
87#[repr(u32)]
88pub enum CaptionFontFamily {
89    Unknown = 0,
90    MonospacedSerif = 1,
91    ProportionalSerif = 2,
92    MonospacedSansSerif = 3,
93    ProportionalSansSerif = 4,
94    Casual = 5,
95    Cursive = 6,
96    SmallCapitals = 7,
97}
98
99impl CaptionFontFamily {
100    #[inline]
101    pub fn from_primitive(prim: u32) -> Option<Self> {
102        match prim {
103            0 => Some(Self::Unknown),
104            1 => Some(Self::MonospacedSerif),
105            2 => Some(Self::ProportionalSerif),
106            3 => Some(Self::MonospacedSansSerif),
107            4 => Some(Self::ProportionalSansSerif),
108            5 => Some(Self::Casual),
109            6 => Some(Self::Cursive),
110            7 => Some(Self::SmallCapitals),
111            _ => None,
112        }
113    }
114
115    #[inline]
116    pub const fn into_primitive(self) -> u32 {
117        self as u32
118    }
119}
120
121#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
122#[repr(u32)]
123pub enum ColorBlindnessType {
124    /// No color blindness.
125    None = 0,
126    /// Red-green color blindness due to reduced sensitivity to red light.
127    Protanomaly = 1,
128    /// Red-green color blindness due to reduced sensitivity to green light.
129    Deuteranomaly = 2,
130    /// Blue-yellow color blindness. It is due to reduced sensitivity to blue
131    /// light.
132    Tritanomaly = 3,
133}
134
135impl ColorBlindnessType {
136    #[inline]
137    pub fn from_primitive(prim: u32) -> Option<Self> {
138        match prim {
139            0 => Some(Self::None),
140            1 => Some(Self::Protanomaly),
141            2 => Some(Self::Deuteranomaly),
142            3 => Some(Self::Tritanomaly),
143            _ => None,
144        }
145    }
146
147    #[inline]
148    pub const fn into_primitive(self) -> u32 {
149        self as u32
150    }
151}
152
153#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
154#[repr(u32)]
155pub enum DeviceStateSource {
156    Hardware = 1,
157    Software = 2,
158}
159
160impl DeviceStateSource {
161    #[inline]
162    pub fn from_primitive(prim: u32) -> Option<Self> {
163        match prim {
164            1 => Some(Self::Hardware),
165            2 => Some(Self::Software),
166            _ => None,
167        }
168    }
169
170    #[inline]
171    pub const fn into_primitive(self) -> u32 {
172        self as u32
173    }
174}
175
176#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
177#[repr(u32)]
178pub enum DeviceType {
179    Microphone = 1,
180    Camera = 2,
181}
182
183impl DeviceType {
184    #[inline]
185    pub fn from_primitive(prim: u32) -> Option<Self> {
186        match prim {
187            1 => Some(Self::Microphone),
188            2 => Some(Self::Camera),
189            _ => None,
190        }
191    }
192
193    #[inline]
194    pub const fn into_primitive(self) -> u32 {
195        self as u32
196    }
197}
198
199/// Edge style for fonts as specified in 47 CFR §79.103(c)(7)
200#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
201#[repr(u32)]
202pub enum EdgeStyle {
203    /// No border around fonts.
204    None = 0,
205    /// A shadow "behind" and slightly offset from each edge.
206    DropShadow = 1,
207    /// A bevel that mimics a 3D raised effect.
208    Raised = 2,
209    /// A bevel that mimics a 3D depressed effect.
210    Depressed = 3,
211    /// A plain border around each shapes.
212    Outline = 4,
213}
214
215impl EdgeStyle {
216    #[inline]
217    pub fn from_primitive(prim: u32) -> Option<Self> {
218        match prim {
219            0 => Some(Self::None),
220            1 => Some(Self::DropShadow),
221            2 => Some(Self::Raised),
222            3 => Some(Self::Depressed),
223            4 => Some(Self::Outline),
224            _ => None,
225        }
226    }
227
228    #[inline]
229    pub const fn into_primitive(self) -> u32 {
230        self as u32
231    }
232}
233
234/// Common error code used across different settings.
235#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
236#[repr(u32)]
237pub enum Error {
238    Failed = 1,
239    Unsupported = 2,
240}
241
242impl Error {
243    #[inline]
244    pub fn from_primitive(prim: u32) -> Option<Self> {
245        match prim {
246            1 => Some(Self::Failed),
247            2 => Some(Self::Unsupported),
248            _ => None,
249        }
250    }
251
252    #[inline]
253    pub const fn into_primitive(self) -> u32 {
254        self as u32
255    }
256}
257
258/// Whether if the time format should be using 12 hour or 24 hour clock. H indicates the
259/// maximum number that the hour indicator will ever show.
260#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
261#[repr(u32)]
262pub enum HourCycle {
263    Unknown = 0,
264    /// 12-hour clock, 0:10am after midnight.
265    H11 = 1,
266    /// 12-hour clock, 12:10am after midnight.
267    H12 = 2,
268    /// 24-hour clock, 0:10 after midnight.
269    H23 = 3,
270    /// 24-hour clock, 24:10 after midnight.
271    H24 = 4,
272}
273
274impl HourCycle {
275    #[inline]
276    pub fn from_primitive(prim: u32) -> Option<Self> {
277        match prim {
278            0 => Some(Self::Unknown),
279            1 => Some(Self::H11),
280            2 => Some(Self::H12),
281            3 => Some(Self::H23),
282            4 => Some(Self::H24),
283            _ => None,
284        }
285    }
286
287    #[inline]
288    pub const fn into_primitive(self) -> u32 {
289        self as u32
290    }
291}
292
293#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
294#[repr(u32)]
295pub enum LightError {
296    /// Call failed for unspecified reasons.
297    Failed = 1,
298    /// Call not supported, this setting may not be present on this .
299    Unsupported = 2,
300    /// An invalid/unknown light group name was provided.
301    InvalidName = 3,
302    /// An invalid LightValue was provided that did not match the light group's
303    /// LightType or did not match the requirements for the value type.
304    InvalidValue = 4,
305}
306
307impl LightError {
308    #[inline]
309    pub fn from_primitive(prim: u32) -> Option<Self> {
310        match prim {
311            1 => Some(Self::Failed),
312            2 => Some(Self::Unsupported),
313            3 => Some(Self::InvalidName),
314            4 => Some(Self::InvalidValue),
315            _ => None,
316        }
317    }
318
319    #[inline]
320    pub const fn into_primitive(self) -> u32 {
321        self as u32
322    }
323}
324
325/// Enum describing the possible types of values for controlling a light.
326#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
327#[repr(u32)]
328pub enum LightType {
329    /// This type of light supports setting brightness to a uint8_t value.
330    Brightness = 1,
331    /// This type of light supports setting an RGB value.
332    Rgb = 2,
333    /// Light can only be turned on or off.
334    Simple = 3,
335}
336
337impl LightType {
338    #[inline]
339    pub fn from_primitive(prim: u32) -> Option<Self> {
340        match prim {
341            1 => Some(Self::Brightness),
342            2 => Some(Self::Rgb),
343            3 => Some(Self::Simple),
344            _ => None,
345        }
346    }
347
348    #[inline]
349    pub const fn into_primitive(self) -> u32 {
350        self as u32
351    }
352}
353
354#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
355#[repr(u32)]
356pub enum LowLightMode {
357    /// Device should not be in low-light mode.
358    Disable = 0,
359    /// Device should not be in low-light mode and should transition
360    /// out of it immediately.
361    DisableImmediately = 1,
362    /// Device should be in low-light mode.
363    Enable = 2,
364}
365
366impl LowLightMode {
367    #[inline]
368    pub fn from_primitive(prim: u32) -> Option<Self> {
369        match prim {
370            0 => Some(Self::Disable),
371            1 => Some(Self::DisableImmediately),
372            2 => Some(Self::Enable),
373            _ => None,
374        }
375    }
376
377    #[inline]
378    pub const fn into_primitive(self) -> u32 {
379        self as u32
380    }
381}
382
383/// Common epitaph messages used across different settings.
384#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
385#[repr(u32)]
386pub enum SettingsEpitaph {
387    RequestNotSupported = 1,
388    InternalServiceError = 2,
389    PersistentStorageError = 3,
390    FileReadError = 4,
391}
392
393impl SettingsEpitaph {
394    #[inline]
395    pub fn from_primitive(prim: u32) -> Option<Self> {
396        match prim {
397            1 => Some(Self::RequestNotSupported),
398            2 => Some(Self::InternalServiceError),
399            3 => Some(Self::PersistentStorageError),
400            4 => Some(Self::FileReadError),
401            _ => None,
402        }
403    }
404
405    #[inline]
406    pub const fn into_primitive(self) -> u32 {
407        self as u32
408    }
409}
410
411#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
412#[repr(u32)]
413pub enum ThemeType {
414    /// When `ThemeType` is set to `DEFAULT` it is up to the specific
415    /// [product](https://fuchsia.dev/fuchsia-src/concepts/build_system/boards_and_products#products)
416    /// to determine what that actually means.
417    Default = 0,
418    Light = 1,
419    Dark = 2,
420}
421
422impl ThemeType {
423    #[inline]
424    pub fn from_primitive(prim: u32) -> Option<Self> {
425        match prim {
426            0 => Some(Self::Default),
427            1 => Some(Self::Light),
428            2 => Some(Self::Dark),
429            _ => None,
430        }
431    }
432
433    #[inline]
434    pub const fn into_primitive(self) -> u32 {
435        self as u32
436    }
437}
438
439#[derive(Clone, Debug, PartialEq)]
440pub struct AccessibilitySetRequest {
441    pub settings: AccessibilitySettings,
442}
443
444impl fidl::Persistable for AccessibilitySetRequest {}
445
446#[derive(Clone, Debug, PartialEq)]
447pub struct AccessibilityWatchResponse {
448    pub settings: AccessibilitySettings,
449}
450
451impl fidl::Persistable for AccessibilityWatchResponse {}
452
453#[derive(Clone, Debug, PartialEq)]
454pub struct AudioSet2Request {
455    pub settings: AudioSettings2,
456}
457
458impl fidl::Persistable for AudioSet2Request {}
459
460#[derive(Clone, Debug, PartialEq)]
461pub struct AudioSetRequest {
462    pub settings: AudioSettings,
463}
464
465impl fidl::Persistable for AudioSetRequest {}
466
467#[derive(Clone, Debug, PartialEq)]
468pub struct AudioWatchResponse {
469    pub settings: AudioSettings,
470}
471
472impl fidl::Persistable for AudioWatchResponse {}
473
474#[derive(Clone, Debug, PartialEq)]
475pub struct AudioWatch2Response {
476    pub settings: AudioSettings2,
477}
478
479impl fidl::Persistable for AudioWatch2Response {}
480
481#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
482#[repr(C)]
483pub struct Autorepeat {
484    /// The duration between key actuation and autorepeat actuation.
485    pub delay: i64,
486    /// The duration between two successive autorepeat actuations (1/rate). Rate is defined as
487    /// once the autorepeat kicks in, the frequency at which repeated key actuations are
488    /// generated per second.
489    pub period: i64,
490}
491
492impl fidl::Persistable for Autorepeat {}
493
494#[derive(Clone, Debug, PartialEq)]
495pub struct DisplaySetRequest {
496    pub settings: DisplaySettings,
497}
498
499impl fidl::Persistable for DisplaySetRequest {}
500
501#[derive(Clone, Debug, PartialEq)]
502pub struct DisplayWatchResponse {
503    pub settings: DisplaySettings,
504}
505
506impl fidl::Persistable for DisplayWatchResponse {}
507
508#[derive(Clone, Debug, PartialEq)]
509pub struct DoNotDisturbSetRequest {
510    pub settings: DoNotDisturbSettings,
511}
512
513impl fidl::Persistable for DoNotDisturbSetRequest {}
514
515#[derive(Clone, Debug, PartialEq)]
516pub struct DoNotDisturbWatchResponse {
517    pub settings: DoNotDisturbSettings,
518}
519
520impl fidl::Persistable for DoNotDisturbWatchResponse {}
521
522#[derive(Clone, Debug, PartialEq)]
523pub struct FactoryResetSetRequest {
524    pub settings: FactoryResetSettings,
525}
526
527impl fidl::Persistable for FactoryResetSetRequest {}
528
529#[derive(Clone, Debug, PartialEq)]
530pub struct FactoryResetWatchResponse {
531    pub settings: FactoryResetSettings,
532}
533
534impl fidl::Persistable for FactoryResetWatchResponse {}
535
536#[derive(Clone, Debug, PartialEq)]
537pub struct InputSetRequest {
538    pub input_states: Vec<InputState>,
539}
540
541impl fidl::Persistable for InputSetRequest {}
542
543#[derive(Clone, Debug, PartialEq)]
544pub struct InputWatchResponse {
545    pub settings: InputSettings,
546}
547
548impl fidl::Persistable for InputWatchResponse {}
549
550#[derive(Clone, Debug, PartialEq)]
551pub struct IntlSetRequest {
552    pub settings: IntlSettings,
553}
554
555impl fidl::Persistable for IntlSetRequest {}
556
557#[derive(Clone, Debug, PartialEq)]
558pub struct IntlWatchResponse {
559    pub settings: IntlSettings,
560}
561
562impl fidl::Persistable for IntlWatchResponse {}
563
564#[derive(Clone, Debug, PartialEq)]
565pub struct KeyboardSetSetRequest {
566    pub settings: KeyboardSettings,
567}
568
569impl fidl::Persistable for KeyboardSetSetRequest {}
570
571#[derive(Clone, Debug, PartialEq)]
572pub struct KeyboardWatchWatchResponse {
573    pub settings: KeyboardSettings,
574}
575
576impl fidl::Persistable for KeyboardWatchWatchResponse {}
577
578#[derive(Clone, Debug, PartialEq)]
579pub struct LightSetLightGroupValuesRequest {
580    pub name: String,
581    pub state: Vec<LightState>,
582}
583
584impl fidl::Persistable for LightSetLightGroupValuesRequest {}
585
586#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
587pub struct LightWatchLightGroupRequest {
588    pub name: String,
589}
590
591impl fidl::Persistable for LightWatchLightGroupRequest {}
592
593#[derive(Clone, Debug, PartialEq)]
594pub struct LightWatchLightGroupResponse {
595    pub group: LightGroup,
596}
597
598impl fidl::Persistable for LightWatchLightGroupResponse {}
599
600#[derive(Clone, Debug, PartialEq)]
601pub struct LightWatchLightGroupsResponse {
602    pub groups: Vec<LightGroup>,
603}
604
605impl fidl::Persistable for LightWatchLightGroupsResponse {}
606
607#[derive(Clone, Debug, PartialEq)]
608pub struct NightModeSetRequest {
609    pub settings: NightModeSettings,
610}
611
612impl fidl::Persistable for NightModeSetRequest {}
613
614#[derive(Clone, Debug, PartialEq)]
615pub struct NightModeWatchResponse {
616    pub settings: NightModeSettings,
617}
618
619impl fidl::Persistable for NightModeWatchResponse {}
620
621#[derive(Clone, Debug, PartialEq)]
622pub struct PrivacySetRequest {
623    pub settings: PrivacySettings,
624}
625
626impl fidl::Persistable for PrivacySetRequest {}
627
628#[derive(Clone, Debug, PartialEq)]
629pub struct PrivacyWatchResponse {
630    pub settings: PrivacySettings,
631}
632
633impl fidl::Persistable for PrivacyWatchResponse {}
634
635#[derive(Clone, Debug, PartialEq)]
636pub struct SetupSetRequest {
637    pub settings: SetupSettings,
638    pub reboot_device: bool,
639}
640
641impl fidl::Persistable for SetupSetRequest {}
642
643#[derive(Clone, Debug, PartialEq)]
644pub struct SetupWatchResponse {
645    pub settings: SetupSettings,
646}
647
648impl fidl::Persistable for SetupWatchResponse {}
649
650/// Supported accessibility settings.
651#[derive(Clone, Debug, Default, PartialEq)]
652pub struct AccessibilitySettings {
653    /// For videos, use an alternative audio track (akin to changing languages)
654    /// that explains what is happening visually while there is no dialogue.
655    pub audio_description: Option<bool>,
656    /// Read aloud elements of the screen selected by the user.
657    pub screen_reader: Option<bool>,
658    /// Invert colors on the screen.
659    pub color_inversion: Option<bool>,
660    /// Interpret triple-tap on the touchscreen as a command to zoom in.
661    pub enable_magnification: Option<bool>,
662    /// What type of color-blindness, if any, to correct for.
663    pub color_correction: Option<ColorBlindnessType>,
664    /// What kind of sources get closed captions, and how they look.
665    pub captions_settings: Option<CaptionsSettings>,
666    #[doc(hidden)]
667    pub __source_breaking: fidl::marker::SourceBreaking,
668}
669
670impl fidl::Persistable for AccessibilitySettings {}
671
672#[derive(Clone, Debug, Default, PartialEq)]
673pub struct AudioSettings {
674    /// Contains the volume setting for 'legacy' audio stream settings (those in AudioRenderUsage).
675    /// There should only be one AudioStreamSettings for each fuchsia.media.AudioRenderUsage.
676    pub streams: Option<Vec<AudioStreamSettings>>,
677    #[doc(hidden)]
678    pub __source_breaking: fidl::marker::SourceBreaking,
679}
680
681impl fidl::Persistable for AudioSettings {}
682
683#[derive(Clone, Debug, Default, PartialEq)]
684pub struct AudioSettings2 {
685    /// Contains the volume setting for all audio stream settings. There should only be
686    /// one AudioStreamSettings for each fuchsia.media.AudioRenderUsage2.
687    pub streams: Option<Vec<AudioStreamSettings2>>,
688    #[doc(hidden)]
689    pub __source_breaking: fidl::marker::SourceBreaking,
690}
691
692impl fidl::Persistable for AudioSettings2 {}
693
694#[derive(Clone, Debug, Default, PartialEq)]
695pub struct AudioStreamSettings {
696    /// The audio stream which the settings are applying to.
697    pub stream: Option<fidl_fuchsia_media__common::AudioRenderUsage>,
698    /// The volume of `stream` is set according to the volume settings from `source`.
699    pub source: Option<AudioStreamSettingSource>,
700    /// User level volume setting. If the `source` is USER, then the volume is set to
701    /// `user_volume`.
702    pub user_volume: Option<Volume>,
703    #[doc(hidden)]
704    pub __source_breaking: fidl::marker::SourceBreaking,
705}
706
707impl fidl::Persistable for AudioStreamSettings {}
708
709#[derive(Clone, Debug, Default, PartialEq)]
710pub struct AudioStreamSettings2 {
711    /// The audio stream which the settings are applying to.
712    pub stream: Option<fidl_fuchsia_media__common::AudioRenderUsage2>,
713    /// The volume of `stream` is set according to the volume settings from `source`.
714    pub source: Option<AudioStreamSettingSource>,
715    /// User level volume setting. If the `source` is USER, then the volume is set to
716    /// `user_volume`.
717    pub user_volume: Option<Volume>,
718    #[doc(hidden)]
719    pub __source_breaking: fidl::marker::SourceBreaking,
720}
721
722impl fidl::Persistable for AudioStreamSettings2 {}
723
724/// Font, size, and color of closed captions text.
725#[derive(Clone, Debug, Default, PartialEq)]
726pub struct CaptionFontStyle {
727    pub family: Option<CaptionFontFamily>,
728    /// 47 CFR §79.103(c)(2) requires at least 3-bit RGB for user override of
729    /// closed-captions color.
730    ///
731    /// Each color channel should be a finite number otherwise will cause
732    /// SetAccessibilityInfo to fail with INVALID_VALUE.
733    pub color: Option<fidl_fuchsia_ui_types__common::ColorRgba>,
734    /// Size of closed captions text relative to the default captions size. A
735    /// range of [0.5, 2] is guaranteed to be supported (as 47 CFR §79.103(c)(4)
736    /// establishes). Size should be a finite number.
737    pub relative_size: Option<f32>,
738    pub char_edge_style: Option<EdgeStyle>,
739    #[doc(hidden)]
740    pub __source_breaking: fidl::marker::SourceBreaking,
741}
742
743impl fidl::Persistable for CaptionFontStyle {}
744
745/// What kind of sources get closed captions, and how they look.
746#[derive(Clone, Debug, Default, PartialEq)]
747pub struct CaptionsSettings {
748    /// Closed captions enabled for media sources of audio.
749    pub for_media: Option<bool>,
750    /// Closed captions enabled for Text-To-Speech sources of audio.
751    pub for_tts: Option<bool>,
752    /// Font style and color used for the closed captions text.
753    pub font_style: Option<CaptionFontStyle>,
754    /// Border color used around the closed captions window.
755    ///
756    /// Each color channel should be a finite number otherwise will cause
757    /// SetAccessibilityInfo to fail with INVALID_VALUE.
758    pub window_color: Option<fidl_fuchsia_ui_types__common::ColorRgba>,
759    /// Background color of the closed captions window.
760    ///
761    /// Each color channel should be a finite number otherwise will cause
762    /// SetAccessibilityInfo to fail with INVALID_VALUE.
763    pub background_color: Option<fidl_fuchsia_ui_types__common::ColorRgba>,
764    #[doc(hidden)]
765    pub __source_breaking: fidl::marker::SourceBreaking,
766}
767
768impl fidl::Persistable for CaptionsSettings {}
769
770/// Holds the state for an |InputDevice|.
771#[derive(Clone, Debug, Default, PartialEq)]
772pub struct DeviceState {
773    /// Controls the on/off state of the input device.
774    pub toggle_flags: Option<ToggleStateFlags>,
775    #[doc(hidden)]
776    pub __source_breaking: fidl::marker::SourceBreaking,
777}
778
779impl fidl::Persistable for DeviceState {}
780
781/// DisplaySettings are used to determine the output state of the display.
782/// The display can be toggled between two modes, auto-brightness on and
783/// auto-brightness off.
784///
785/// Adjusted_auto_brightness is used to set a specific brightness level for the
786/// current lighting conditions. Auto-brightness will continue to make the
787/// screen darker and brighter as the surrounding light changes.
788///
789/// Brightness_value is used in manual mode to set a specific brightness level
790/// for the screen. This level will be maintained while in manual mode.
791#[derive(Clone, Debug, Default, PartialEq)]
792pub struct DisplaySettings {
793    /// Auto brightness enabled.
794    pub auto_brightness: Option<bool>,
795    /// Manually set brightness value [0.0 - 1.0]. Not a number, infinity or
796    /// negative infinity will cause SetDisplayInfo to fail with INVALID_VALUE.
797    pub brightness_value: Option<f32>,
798    /// The low light mode state of the device.
799    pub low_light_mode: Option<LowLightMode>,
800    /// Whether the screen is enabled.
801    pub screen_enabled: Option<bool>,
802    /// Theme to be used for the device's user interface.
803    pub theme: Option<Theme>,
804    /// Brightness value to adjust auto-brightness to [0.0 - 1.0].
805    pub adjusted_auto_brightness: Option<f32>,
806    #[doc(hidden)]
807    pub __source_breaking: fidl::marker::SourceBreaking,
808}
809
810impl fidl::Persistable for DisplaySettings {}
811
812/// Settings related to do-not-disturb (DND) mode.
813#[derive(Clone, Debug, Default, PartialEq)]
814pub struct DoNotDisturbSettings {
815    /// If true, the device is in do-not-disturb (DND) mode. Change this value
816    /// if you're directly responding to a user-initiated event.
817    ///
818    /// Note that the device could still be in DND mode even if this is set to
819    /// `false`, as [`night_mode_initiated_do_not_disturb`] might be `true`. To
820    /// actually disable DND mode, set both fields to `false`.
821    ///
822    /// To know whether DND is enabled, you need to do a boolean OR of both
823    /// fields.
824    pub user_initiated_do_not_disturb: Option<bool>,
825    /// If true, the device is in do-not-disturb (DND) mode. Change this value
826    /// if you're trying to enable or disable DND based on a nightly schedule.
827    ///
828    /// Note that the device could still be in DND mode even if this is set to
829    /// `false`, as [`user_initiated_do_not_disturb`] might be `true`. Do not
830    /// set that field to `false` unless you're directly responding to a
831    /// user-initiated event.
832    ///
833    /// To know whether DND is enabled, you need to do a boolean OR of both
834    /// fields.
835    pub night_mode_initiated_do_not_disturb: Option<bool>,
836    #[doc(hidden)]
837    pub __source_breaking: fidl::marker::SourceBreaking,
838}
839
840impl fidl::Persistable for DoNotDisturbSettings {}
841
842/// Information about the factory reset settings.
843#[derive(Clone, Debug, Default, PartialEq)]
844pub struct FactoryResetSettings {
845    /// When set to true, a user is able to physically perform a factory reset.
846    /// When false, that functionality is disabled.
847    pub is_local_reset_allowed: Option<bool>,
848    #[doc(hidden)]
849    pub __source_breaking: fidl::marker::SourceBreaking,
850}
851
852impl fidl::Persistable for FactoryResetSettings {}
853
854/// Contains the information for an input device. The device is uniquely identified
855/// by the combination of device_name and device_type.
856#[derive(Clone, Debug, Default, PartialEq)]
857pub struct InputDevice {
858    /// Uniquely identifies a device within a device type.
859    pub device_name: Option<String>,
860    /// The type of input device (e.g. camera, microphone).
861    pub device_type: Option<DeviceType>,
862    /// The state for each individual [DeviceStateSource].
863    pub source_states: Option<Vec<SourceState>>,
864    /// The software toggle states which are allowed to be changed for a device.
865    pub mutable_toggle_state: Option<ToggleStateFlags>,
866    /// The overall state of the device, considering the combination
867    /// of the source states.
868    pub state: Option<DeviceState>,
869    #[doc(hidden)]
870    pub __source_breaking: fidl::marker::SourceBreaking,
871}
872
873impl fidl::Persistable for InputDevice {}
874
875/// Settings related to device input. New format for InputDeviceSettings.
876///
877/// InputSettings contains a list of input devices, e.g. Microphone and Camera
878/// devices. There may be multiple devices of each type. If so, they will be
879/// differentiated by the device_name. If there is only one device of a certain
880/// [DeviceType], then the name defaults to the same as the device type, e.g.
881/// DeviceType::Microphone -> "microphone".
882#[derive(Clone, Debug, Default, PartialEq)]
883pub struct InputSettings {
884    pub devices: Option<Vec<InputDevice>>,
885    #[doc(hidden)]
886    pub __source_breaking: fidl::marker::SourceBreaking,
887}
888
889impl fidl::Persistable for InputSettings {}
890
891/// A subset of |DeviceState|'s properties that clients may pass to change the
892/// software state of an InputDevice.
893#[derive(Clone, Debug, Default, PartialEq)]
894pub struct InputState {
895    pub name: Option<String>,
896    pub device_type: Option<DeviceType>,
897    pub state: Option<DeviceState>,
898    #[doc(hidden)]
899    pub __source_breaking: fidl::marker::SourceBreaking,
900}
901
902impl fidl::Persistable for InputState {}
903
904/// Collection of internationalization-related settings.
905#[derive(Clone, Debug, Default, PartialEq)]
906pub struct IntlSettings {
907    /// An ordered list of preferred locales.
908    pub locales: Option<Vec<fidl_fuchsia_intl__common::LocaleId>>,
909    /// The preferred temperature unit.
910    pub temperature_unit: Option<fidl_fuchsia_intl__common::TemperatureUnit>,
911    /// The currently set time zone.
912    pub time_zone_id: Option<fidl_fuchsia_intl__common::TimeZoneId>,
913    /// The preferred hour cycle.
914    pub hour_cycle: Option<HourCycle>,
915    #[doc(hidden)]
916    pub __source_breaking: fidl::marker::SourceBreaking,
917}
918
919impl fidl::Persistable for IntlSettings {}
920
921/// The various keyboard settings.
922#[derive(Clone, Debug, Default, PartialEq)]
923pub struct KeyboardSettings {
924    pub keymap: Option<fidl_fuchsia_input__common::KeymapId>,
925    pub autorepeat: Option<Autorepeat>,
926    #[doc(hidden)]
927    pub __source_breaking: fidl::marker::SourceBreaking,
928}
929
930impl fidl::Persistable for KeyboardSettings {}
931
932/// Information about a controllable light group. A group may have one or more
933/// lights.
934#[derive(Clone, Debug, Default, PartialEq)]
935pub struct LightGroup {
936    /// Identifier for this light group, clients should pass this back into the
937    /// service to set the group's light values.
938    pub name: Option<String>,
939    /// True if the light group is enabled and changes will be visible to the
940    /// user. False if the light group is forced off by hardware. If the light
941    /// group is disabled, its value can still be set, but the change may not be
942    /// visible until the light group is back on.
943    pub enabled: Option<bool>,
944    /// Defines the acceptable value type for controlling this light group.
945    pub type_: Option<LightType>,
946    /// States of the lights in this group.
947    pub lights: Option<Vec<LightState>>,
948    #[doc(hidden)]
949    pub __source_breaking: fidl::marker::SourceBreaking,
950}
951
952impl fidl::Persistable for LightGroup {}
953
954/// State of a given light.
955#[derive(Clone, Debug, Default, PartialEq)]
956pub struct LightState {
957    pub value: Option<LightValue>,
958    #[doc(hidden)]
959    pub __source_breaking: fidl::marker::SourceBreaking,
960}
961
962impl fidl::Persistable for LightState {}
963
964/// Settings related to Night mode.
965#[derive(Clone, Debug, Default, PartialEq)]
966pub struct NightModeSettings {
967    /// If true, the device/user have opted in for NightMode routine.
968    pub night_mode_enabled: Option<bool>,
969    #[doc(hidden)]
970    pub __source_breaking: fidl::marker::SourceBreaking,
971}
972
973impl fidl::Persistable for NightModeSettings {}
974
975#[derive(Clone, Debug, Default, PartialEq)]
976pub struct PrivacySettings {
977    /// Reflects the user consent to have their user data shared with the product owner, e.g., for
978    /// metrics collection and crash reporting.
979    pub user_data_sharing_consent: Option<bool>,
980    #[doc(hidden)]
981    pub __source_breaking: fidl::marker::SourceBreaking,
982}
983
984impl fidl::Persistable for PrivacySettings {}
985
986#[derive(Clone, Debug, Default, PartialEq)]
987pub struct SetupSettings {
988    /// Specifies the network interfaces that the device can be configured
989    /// over during setup.
990    pub enabled_configuration_interfaces: Option<ConfigurationInterfaces>,
991    #[doc(hidden)]
992    pub __source_breaking: fidl::marker::SourceBreaking,
993}
994
995impl fidl::Persistable for SetupSettings {}
996
997/// Describes what the |source|'s |state| is.
998#[derive(Clone, Debug, Default, PartialEq)]
999pub struct SourceState {
1000    pub source: Option<DeviceStateSource>,
1001    pub state: Option<DeviceState>,
1002    #[doc(hidden)]
1003    pub __source_breaking: fidl::marker::SourceBreaking,
1004}
1005
1006impl fidl::Persistable for SourceState {}
1007
1008#[derive(Clone, Debug, Default, PartialEq)]
1009pub struct Theme {
1010    pub theme_type: Option<ThemeType>,
1011    pub theme_mode: Option<ThemeMode>,
1012    #[doc(hidden)]
1013    pub __source_breaking: fidl::marker::SourceBreaking,
1014}
1015
1016impl fidl::Persistable for Theme {}
1017
1018#[derive(Clone, Debug, Default, PartialEq)]
1019pub struct Volume {
1020    /// The volume level ranged [0.0, 1.0]. The level maps to a dbfs value from a volume
1021    /// curve in the setting service. Not a number (NaN), infinity or negative infinity
1022    /// will cause SetVolume to fail with INVALID_VALUE.
1023    pub level: Option<f32>,
1024    /// True if the volume should be muted. If this is true, then the volume is silent,
1025    /// regardless of `level`.
1026    pub muted: Option<bool>,
1027    #[doc(hidden)]
1028    pub __source_breaking: fidl::marker::SourceBreaking,
1029}
1030
1031impl fidl::Persistable for Volume {}
1032
1033/// Value of a light. Only one of the three values in the union will be present,
1034/// depending on the light's LightType.
1035#[derive(Clone, Debug, PartialEq)]
1036pub enum LightValue {
1037    /// Lights with LightType.SIMPLE will have this value.
1038    On(bool),
1039    /// Lights with LightType.BRIGHTNESS will have this value, a floating point
1040    /// value 0.0 to 1.0 inclusive, where 0.0 means the light is off. Not a
1041    /// number (NaN), infinity or negative infinity will cause SetLightGroup to
1042    /// fail with INVALID_VALUE.
1043    Brightness(f64),
1044    /// Lights with LightType.RGB will have this value.
1045    ///
1046    /// Each color channel should be a value between 0.0 and 1.0 inclusive.
1047    /// Values outside this range will cause SetLightGroup to fail with
1048    /// INVALID_VALUE.
1049    Color(fidl_fuchsia_ui_types__common::ColorRgb),
1050}
1051
1052impl LightValue {
1053    #[inline]
1054    pub fn ordinal(&self) -> u64 {
1055        match *self {
1056            Self::On(_) => 1,
1057            Self::Brightness(_) => 2,
1058            Self::Color(_) => 3,
1059        }
1060    }
1061}
1062
1063impl fidl::Persistable for LightValue {}
1064
1065pub mod accessibility_ordinals {
1066    pub const WATCH: u64 = 0x417d0b95ddbf7674;
1067    pub const SET: u64 = 0x298485ef354fb8cb;
1068}
1069
1070pub mod audio_ordinals {
1071    pub const WATCH: u64 = 0x2995cf83f9d0f805;
1072    pub const WATCH2: u64 = 0x4d10b204de1796e2;
1073    pub const SET: u64 = 0x4f3865db04da626c;
1074    pub const SET2: u64 = 0x1f027e9ed7beefe3;
1075}
1076
1077pub mod display_ordinals {
1078    pub const WATCH: u64 = 0x7da3212470364db1;
1079    pub const SET: u64 = 0x1029e06ace17479c;
1080}
1081
1082pub mod do_not_disturb_ordinals {
1083    pub const WATCH: u64 = 0x1eeae2f97a5547fb;
1084    pub const SET: u64 = 0x7fef934e7f5777b0;
1085}
1086
1087pub mod factory_reset_ordinals {
1088    pub const WATCH: u64 = 0x50cfc9906eb406a1;
1089    pub const SET: u64 = 0x5b35942c1cb1eca8;
1090}
1091
1092pub mod input_ordinals {
1093    pub const WATCH: u64 = 0x1bc41a7e0edd19c9;
1094    pub const SET: u64 = 0x2447379e693141ca;
1095}
1096
1097pub mod intl_ordinals {
1098    pub const WATCH: u64 = 0x3c85d6b8a85ab6e3;
1099    pub const SET: u64 = 0x273014eb4d880c5a;
1100}
1101
1102pub mod keyboard_ordinals {
1103    pub const SET: u64 = 0x691f4493d263c843;
1104    pub const WATCH: u64 = 0x357f6213b3a54527;
1105}
1106
1107pub mod keyboard_set_ordinals {
1108    pub const SET: u64 = 0x691f4493d263c843;
1109}
1110
1111pub mod keyboard_watch_ordinals {
1112    pub const WATCH: u64 = 0x357f6213b3a54527;
1113}
1114
1115pub mod light_ordinals {
1116    pub const WATCH_LIGHT_GROUPS: u64 = 0x3f506de229db5930;
1117    pub const WATCH_LIGHT_GROUP: u64 = 0x3ef0331c388d56a3;
1118    pub const SET_LIGHT_GROUP_VALUES: u64 = 0x15d9b62431fdf8d5;
1119}
1120
1121pub mod night_mode_ordinals {
1122    pub const WATCH: u64 = 0x7e1509bf8c7582f6;
1123    pub const SET: u64 = 0x28c3d78ab05b55cd;
1124}
1125
1126pub mod privacy_ordinals {
1127    pub const WATCH: u64 = 0x1cb0c420ed81f47c;
1128    pub const SET: u64 = 0xe2f4a1c85885537;
1129}
1130
1131pub mod setup_ordinals {
1132    pub const WATCH: u64 = 0xd3893c0e63c0a6e;
1133    pub const SET: u64 = 0x66a20be769388128;
1134}
1135
1136mod internal {
1137    use super::*;
1138    unsafe impl fidl::encoding::TypeMarker for ConfigurationInterfaces {
1139        type Owned = Self;
1140
1141        #[inline(always)]
1142        fn inline_align(_context: fidl::encoding::Context) -> usize {
1143            4
1144        }
1145
1146        #[inline(always)]
1147        fn inline_size(_context: fidl::encoding::Context) -> usize {
1148            4
1149        }
1150    }
1151
1152    impl fidl::encoding::ValueTypeMarker for ConfigurationInterfaces {
1153        type Borrowed<'a> = Self;
1154        #[inline(always)]
1155        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1156            *value
1157        }
1158    }
1159
1160    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1161        for ConfigurationInterfaces
1162    {
1163        #[inline]
1164        unsafe fn encode(
1165            self,
1166            encoder: &mut fidl::encoding::Encoder<'_, D>,
1167            offset: usize,
1168            _depth: fidl::encoding::Depth,
1169        ) -> fidl::Result<()> {
1170            encoder.debug_check_bounds::<Self>(offset);
1171            if self.bits() & Self::all().bits() != self.bits() {
1172                return Err(fidl::Error::InvalidBitsValue);
1173            }
1174            encoder.write_num(self.bits(), offset);
1175            Ok(())
1176        }
1177    }
1178
1179    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1180        for ConfigurationInterfaces
1181    {
1182        #[inline(always)]
1183        fn new_empty() -> Self {
1184            Self::empty()
1185        }
1186
1187        #[inline]
1188        unsafe fn decode(
1189            &mut self,
1190            decoder: &mut fidl::encoding::Decoder<'_, D>,
1191            offset: usize,
1192            _depth: fidl::encoding::Depth,
1193        ) -> fidl::Result<()> {
1194            decoder.debug_check_bounds::<Self>(offset);
1195            let prim = decoder.read_num::<u32>(offset);
1196            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1197            Ok(())
1198        }
1199    }
1200    unsafe impl fidl::encoding::TypeMarker for ThemeMode {
1201        type Owned = Self;
1202
1203        #[inline(always)]
1204        fn inline_align(_context: fidl::encoding::Context) -> usize {
1205            4
1206        }
1207
1208        #[inline(always)]
1209        fn inline_size(_context: fidl::encoding::Context) -> usize {
1210            4
1211        }
1212    }
1213
1214    impl fidl::encoding::ValueTypeMarker for ThemeMode {
1215        type Borrowed<'a> = Self;
1216        #[inline(always)]
1217        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1218            *value
1219        }
1220    }
1221
1222    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ThemeMode {
1223        #[inline]
1224        unsafe fn encode(
1225            self,
1226            encoder: &mut fidl::encoding::Encoder<'_, D>,
1227            offset: usize,
1228            _depth: fidl::encoding::Depth,
1229        ) -> fidl::Result<()> {
1230            encoder.debug_check_bounds::<Self>(offset);
1231            if self.bits() & Self::all().bits() != self.bits() {
1232                return Err(fidl::Error::InvalidBitsValue);
1233            }
1234            encoder.write_num(self.bits(), offset);
1235            Ok(())
1236        }
1237    }
1238
1239    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThemeMode {
1240        #[inline(always)]
1241        fn new_empty() -> Self {
1242            Self::empty()
1243        }
1244
1245        #[inline]
1246        unsafe fn decode(
1247            &mut self,
1248            decoder: &mut fidl::encoding::Decoder<'_, D>,
1249            offset: usize,
1250            _depth: fidl::encoding::Depth,
1251        ) -> fidl::Result<()> {
1252            decoder.debug_check_bounds::<Self>(offset);
1253            let prim = decoder.read_num::<u32>(offset);
1254            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1255            Ok(())
1256        }
1257    }
1258    unsafe impl fidl::encoding::TypeMarker for ToggleStateFlags {
1259        type Owned = Self;
1260
1261        #[inline(always)]
1262        fn inline_align(_context: fidl::encoding::Context) -> usize {
1263            8
1264        }
1265
1266        #[inline(always)]
1267        fn inline_size(_context: fidl::encoding::Context) -> usize {
1268            8
1269        }
1270    }
1271
1272    impl fidl::encoding::ValueTypeMarker for ToggleStateFlags {
1273        type Borrowed<'a> = Self;
1274        #[inline(always)]
1275        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1276            *value
1277        }
1278    }
1279
1280    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1281        for ToggleStateFlags
1282    {
1283        #[inline]
1284        unsafe fn encode(
1285            self,
1286            encoder: &mut fidl::encoding::Encoder<'_, D>,
1287            offset: usize,
1288            _depth: fidl::encoding::Depth,
1289        ) -> fidl::Result<()> {
1290            encoder.debug_check_bounds::<Self>(offset);
1291            if self.bits() & Self::all().bits() != self.bits() {
1292                return Err(fidl::Error::InvalidBitsValue);
1293            }
1294            encoder.write_num(self.bits(), offset);
1295            Ok(())
1296        }
1297    }
1298
1299    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ToggleStateFlags {
1300        #[inline(always)]
1301        fn new_empty() -> Self {
1302            Self::empty()
1303        }
1304
1305        #[inline]
1306        unsafe fn decode(
1307            &mut self,
1308            decoder: &mut fidl::encoding::Decoder<'_, D>,
1309            offset: usize,
1310            _depth: fidl::encoding::Depth,
1311        ) -> fidl::Result<()> {
1312            decoder.debug_check_bounds::<Self>(offset);
1313            let prim = decoder.read_num::<u64>(offset);
1314            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1315            Ok(())
1316        }
1317    }
1318    unsafe impl fidl::encoding::TypeMarker for AudioStreamSettingSource {
1319        type Owned = Self;
1320
1321        #[inline(always)]
1322        fn inline_align(_context: fidl::encoding::Context) -> usize {
1323            std::mem::align_of::<u32>()
1324        }
1325
1326        #[inline(always)]
1327        fn inline_size(_context: fidl::encoding::Context) -> usize {
1328            std::mem::size_of::<u32>()
1329        }
1330
1331        #[inline(always)]
1332        fn encode_is_copy() -> bool {
1333            true
1334        }
1335
1336        #[inline(always)]
1337        fn decode_is_copy() -> bool {
1338            false
1339        }
1340    }
1341
1342    impl fidl::encoding::ValueTypeMarker for AudioStreamSettingSource {
1343        type Borrowed<'a> = Self;
1344        #[inline(always)]
1345        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1346            *value
1347        }
1348    }
1349
1350    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1351        for AudioStreamSettingSource
1352    {
1353        #[inline]
1354        unsafe fn encode(
1355            self,
1356            encoder: &mut fidl::encoding::Encoder<'_, D>,
1357            offset: usize,
1358            _depth: fidl::encoding::Depth,
1359        ) -> fidl::Result<()> {
1360            encoder.debug_check_bounds::<Self>(offset);
1361            encoder.write_num(self.into_primitive(), offset);
1362            Ok(())
1363        }
1364    }
1365
1366    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1367        for AudioStreamSettingSource
1368    {
1369        #[inline(always)]
1370        fn new_empty() -> Self {
1371            Self::User
1372        }
1373
1374        #[inline]
1375        unsafe fn decode(
1376            &mut self,
1377            decoder: &mut fidl::encoding::Decoder<'_, D>,
1378            offset: usize,
1379            _depth: fidl::encoding::Depth,
1380        ) -> fidl::Result<()> {
1381            decoder.debug_check_bounds::<Self>(offset);
1382            let prim = decoder.read_num::<u32>(offset);
1383
1384            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1385            Ok(())
1386        }
1387    }
1388    unsafe impl fidl::encoding::TypeMarker for CaptionFontFamily {
1389        type Owned = Self;
1390
1391        #[inline(always)]
1392        fn inline_align(_context: fidl::encoding::Context) -> usize {
1393            std::mem::align_of::<u32>()
1394        }
1395
1396        #[inline(always)]
1397        fn inline_size(_context: fidl::encoding::Context) -> usize {
1398            std::mem::size_of::<u32>()
1399        }
1400
1401        #[inline(always)]
1402        fn encode_is_copy() -> bool {
1403            true
1404        }
1405
1406        #[inline(always)]
1407        fn decode_is_copy() -> bool {
1408            false
1409        }
1410    }
1411
1412    impl fidl::encoding::ValueTypeMarker for CaptionFontFamily {
1413        type Borrowed<'a> = Self;
1414        #[inline(always)]
1415        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1416            *value
1417        }
1418    }
1419
1420    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1421        for CaptionFontFamily
1422    {
1423        #[inline]
1424        unsafe fn encode(
1425            self,
1426            encoder: &mut fidl::encoding::Encoder<'_, D>,
1427            offset: usize,
1428            _depth: fidl::encoding::Depth,
1429        ) -> fidl::Result<()> {
1430            encoder.debug_check_bounds::<Self>(offset);
1431            encoder.write_num(self.into_primitive(), offset);
1432            Ok(())
1433        }
1434    }
1435
1436    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CaptionFontFamily {
1437        #[inline(always)]
1438        fn new_empty() -> Self {
1439            Self::Unknown
1440        }
1441
1442        #[inline]
1443        unsafe fn decode(
1444            &mut self,
1445            decoder: &mut fidl::encoding::Decoder<'_, D>,
1446            offset: usize,
1447            _depth: fidl::encoding::Depth,
1448        ) -> fidl::Result<()> {
1449            decoder.debug_check_bounds::<Self>(offset);
1450            let prim = decoder.read_num::<u32>(offset);
1451
1452            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1453            Ok(())
1454        }
1455    }
1456    unsafe impl fidl::encoding::TypeMarker for ColorBlindnessType {
1457        type Owned = Self;
1458
1459        #[inline(always)]
1460        fn inline_align(_context: fidl::encoding::Context) -> usize {
1461            std::mem::align_of::<u32>()
1462        }
1463
1464        #[inline(always)]
1465        fn inline_size(_context: fidl::encoding::Context) -> usize {
1466            std::mem::size_of::<u32>()
1467        }
1468
1469        #[inline(always)]
1470        fn encode_is_copy() -> bool {
1471            true
1472        }
1473
1474        #[inline(always)]
1475        fn decode_is_copy() -> bool {
1476            false
1477        }
1478    }
1479
1480    impl fidl::encoding::ValueTypeMarker for ColorBlindnessType {
1481        type Borrowed<'a> = Self;
1482        #[inline(always)]
1483        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1484            *value
1485        }
1486    }
1487
1488    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1489        for ColorBlindnessType
1490    {
1491        #[inline]
1492        unsafe fn encode(
1493            self,
1494            encoder: &mut fidl::encoding::Encoder<'_, D>,
1495            offset: usize,
1496            _depth: fidl::encoding::Depth,
1497        ) -> fidl::Result<()> {
1498            encoder.debug_check_bounds::<Self>(offset);
1499            encoder.write_num(self.into_primitive(), offset);
1500            Ok(())
1501        }
1502    }
1503
1504    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorBlindnessType {
1505        #[inline(always)]
1506        fn new_empty() -> Self {
1507            Self::None
1508        }
1509
1510        #[inline]
1511        unsafe fn decode(
1512            &mut self,
1513            decoder: &mut fidl::encoding::Decoder<'_, D>,
1514            offset: usize,
1515            _depth: fidl::encoding::Depth,
1516        ) -> fidl::Result<()> {
1517            decoder.debug_check_bounds::<Self>(offset);
1518            let prim = decoder.read_num::<u32>(offset);
1519
1520            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1521            Ok(())
1522        }
1523    }
1524    unsafe impl fidl::encoding::TypeMarker for DeviceStateSource {
1525        type Owned = Self;
1526
1527        #[inline(always)]
1528        fn inline_align(_context: fidl::encoding::Context) -> usize {
1529            std::mem::align_of::<u32>()
1530        }
1531
1532        #[inline(always)]
1533        fn inline_size(_context: fidl::encoding::Context) -> usize {
1534            std::mem::size_of::<u32>()
1535        }
1536
1537        #[inline(always)]
1538        fn encode_is_copy() -> bool {
1539            true
1540        }
1541
1542        #[inline(always)]
1543        fn decode_is_copy() -> bool {
1544            false
1545        }
1546    }
1547
1548    impl fidl::encoding::ValueTypeMarker for DeviceStateSource {
1549        type Borrowed<'a> = Self;
1550        #[inline(always)]
1551        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1552            *value
1553        }
1554    }
1555
1556    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1557        for DeviceStateSource
1558    {
1559        #[inline]
1560        unsafe fn encode(
1561            self,
1562            encoder: &mut fidl::encoding::Encoder<'_, D>,
1563            offset: usize,
1564            _depth: fidl::encoding::Depth,
1565        ) -> fidl::Result<()> {
1566            encoder.debug_check_bounds::<Self>(offset);
1567            encoder.write_num(self.into_primitive(), offset);
1568            Ok(())
1569        }
1570    }
1571
1572    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceStateSource {
1573        #[inline(always)]
1574        fn new_empty() -> Self {
1575            Self::Hardware
1576        }
1577
1578        #[inline]
1579        unsafe fn decode(
1580            &mut self,
1581            decoder: &mut fidl::encoding::Decoder<'_, D>,
1582            offset: usize,
1583            _depth: fidl::encoding::Depth,
1584        ) -> fidl::Result<()> {
1585            decoder.debug_check_bounds::<Self>(offset);
1586            let prim = decoder.read_num::<u32>(offset);
1587
1588            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1589            Ok(())
1590        }
1591    }
1592    unsafe impl fidl::encoding::TypeMarker for DeviceType {
1593        type Owned = Self;
1594
1595        #[inline(always)]
1596        fn inline_align(_context: fidl::encoding::Context) -> usize {
1597            std::mem::align_of::<u32>()
1598        }
1599
1600        #[inline(always)]
1601        fn inline_size(_context: fidl::encoding::Context) -> usize {
1602            std::mem::size_of::<u32>()
1603        }
1604
1605        #[inline(always)]
1606        fn encode_is_copy() -> bool {
1607            true
1608        }
1609
1610        #[inline(always)]
1611        fn decode_is_copy() -> bool {
1612            false
1613        }
1614    }
1615
1616    impl fidl::encoding::ValueTypeMarker for DeviceType {
1617        type Borrowed<'a> = Self;
1618        #[inline(always)]
1619        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1620            *value
1621        }
1622    }
1623
1624    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DeviceType {
1625        #[inline]
1626        unsafe fn encode(
1627            self,
1628            encoder: &mut fidl::encoding::Encoder<'_, D>,
1629            offset: usize,
1630            _depth: fidl::encoding::Depth,
1631        ) -> fidl::Result<()> {
1632            encoder.debug_check_bounds::<Self>(offset);
1633            encoder.write_num(self.into_primitive(), offset);
1634            Ok(())
1635        }
1636    }
1637
1638    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceType {
1639        #[inline(always)]
1640        fn new_empty() -> Self {
1641            Self::Microphone
1642        }
1643
1644        #[inline]
1645        unsafe fn decode(
1646            &mut self,
1647            decoder: &mut fidl::encoding::Decoder<'_, D>,
1648            offset: usize,
1649            _depth: fidl::encoding::Depth,
1650        ) -> fidl::Result<()> {
1651            decoder.debug_check_bounds::<Self>(offset);
1652            let prim = decoder.read_num::<u32>(offset);
1653
1654            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1655            Ok(())
1656        }
1657    }
1658    unsafe impl fidl::encoding::TypeMarker for EdgeStyle {
1659        type Owned = Self;
1660
1661        #[inline(always)]
1662        fn inline_align(_context: fidl::encoding::Context) -> usize {
1663            std::mem::align_of::<u32>()
1664        }
1665
1666        #[inline(always)]
1667        fn inline_size(_context: fidl::encoding::Context) -> usize {
1668            std::mem::size_of::<u32>()
1669        }
1670
1671        #[inline(always)]
1672        fn encode_is_copy() -> bool {
1673            true
1674        }
1675
1676        #[inline(always)]
1677        fn decode_is_copy() -> bool {
1678            false
1679        }
1680    }
1681
1682    impl fidl::encoding::ValueTypeMarker for EdgeStyle {
1683        type Borrowed<'a> = Self;
1684        #[inline(always)]
1685        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1686            *value
1687        }
1688    }
1689
1690    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for EdgeStyle {
1691        #[inline]
1692        unsafe fn encode(
1693            self,
1694            encoder: &mut fidl::encoding::Encoder<'_, D>,
1695            offset: usize,
1696            _depth: fidl::encoding::Depth,
1697        ) -> fidl::Result<()> {
1698            encoder.debug_check_bounds::<Self>(offset);
1699            encoder.write_num(self.into_primitive(), offset);
1700            Ok(())
1701        }
1702    }
1703
1704    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EdgeStyle {
1705        #[inline(always)]
1706        fn new_empty() -> Self {
1707            Self::None
1708        }
1709
1710        #[inline]
1711        unsafe fn decode(
1712            &mut self,
1713            decoder: &mut fidl::encoding::Decoder<'_, D>,
1714            offset: usize,
1715            _depth: fidl::encoding::Depth,
1716        ) -> fidl::Result<()> {
1717            decoder.debug_check_bounds::<Self>(offset);
1718            let prim = decoder.read_num::<u32>(offset);
1719
1720            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1721            Ok(())
1722        }
1723    }
1724    unsafe impl fidl::encoding::TypeMarker for Error {
1725        type Owned = Self;
1726
1727        #[inline(always)]
1728        fn inline_align(_context: fidl::encoding::Context) -> usize {
1729            std::mem::align_of::<u32>()
1730        }
1731
1732        #[inline(always)]
1733        fn inline_size(_context: fidl::encoding::Context) -> usize {
1734            std::mem::size_of::<u32>()
1735        }
1736
1737        #[inline(always)]
1738        fn encode_is_copy() -> bool {
1739            true
1740        }
1741
1742        #[inline(always)]
1743        fn decode_is_copy() -> bool {
1744            false
1745        }
1746    }
1747
1748    impl fidl::encoding::ValueTypeMarker for Error {
1749        type Borrowed<'a> = Self;
1750        #[inline(always)]
1751        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1752            *value
1753        }
1754    }
1755
1756    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Error {
1757        #[inline]
1758        unsafe fn encode(
1759            self,
1760            encoder: &mut fidl::encoding::Encoder<'_, D>,
1761            offset: usize,
1762            _depth: fidl::encoding::Depth,
1763        ) -> fidl::Result<()> {
1764            encoder.debug_check_bounds::<Self>(offset);
1765            encoder.write_num(self.into_primitive(), offset);
1766            Ok(())
1767        }
1768    }
1769
1770    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Error {
1771        #[inline(always)]
1772        fn new_empty() -> Self {
1773            Self::Failed
1774        }
1775
1776        #[inline]
1777        unsafe fn decode(
1778            &mut self,
1779            decoder: &mut fidl::encoding::Decoder<'_, D>,
1780            offset: usize,
1781            _depth: fidl::encoding::Depth,
1782        ) -> fidl::Result<()> {
1783            decoder.debug_check_bounds::<Self>(offset);
1784            let prim = decoder.read_num::<u32>(offset);
1785
1786            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1787            Ok(())
1788        }
1789    }
1790    unsafe impl fidl::encoding::TypeMarker for HourCycle {
1791        type Owned = Self;
1792
1793        #[inline(always)]
1794        fn inline_align(_context: fidl::encoding::Context) -> usize {
1795            std::mem::align_of::<u32>()
1796        }
1797
1798        #[inline(always)]
1799        fn inline_size(_context: fidl::encoding::Context) -> usize {
1800            std::mem::size_of::<u32>()
1801        }
1802
1803        #[inline(always)]
1804        fn encode_is_copy() -> bool {
1805            true
1806        }
1807
1808        #[inline(always)]
1809        fn decode_is_copy() -> bool {
1810            false
1811        }
1812    }
1813
1814    impl fidl::encoding::ValueTypeMarker for HourCycle {
1815        type Borrowed<'a> = Self;
1816        #[inline(always)]
1817        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1818            *value
1819        }
1820    }
1821
1822    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for HourCycle {
1823        #[inline]
1824        unsafe fn encode(
1825            self,
1826            encoder: &mut fidl::encoding::Encoder<'_, D>,
1827            offset: usize,
1828            _depth: fidl::encoding::Depth,
1829        ) -> fidl::Result<()> {
1830            encoder.debug_check_bounds::<Self>(offset);
1831            encoder.write_num(self.into_primitive(), offset);
1832            Ok(())
1833        }
1834    }
1835
1836    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HourCycle {
1837        #[inline(always)]
1838        fn new_empty() -> Self {
1839            Self::Unknown
1840        }
1841
1842        #[inline]
1843        unsafe fn decode(
1844            &mut self,
1845            decoder: &mut fidl::encoding::Decoder<'_, D>,
1846            offset: usize,
1847            _depth: fidl::encoding::Depth,
1848        ) -> fidl::Result<()> {
1849            decoder.debug_check_bounds::<Self>(offset);
1850            let prim = decoder.read_num::<u32>(offset);
1851
1852            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1853            Ok(())
1854        }
1855    }
1856    unsafe impl fidl::encoding::TypeMarker for LightError {
1857        type Owned = Self;
1858
1859        #[inline(always)]
1860        fn inline_align(_context: fidl::encoding::Context) -> usize {
1861            std::mem::align_of::<u32>()
1862        }
1863
1864        #[inline(always)]
1865        fn inline_size(_context: fidl::encoding::Context) -> usize {
1866            std::mem::size_of::<u32>()
1867        }
1868
1869        #[inline(always)]
1870        fn encode_is_copy() -> bool {
1871            true
1872        }
1873
1874        #[inline(always)]
1875        fn decode_is_copy() -> bool {
1876            false
1877        }
1878    }
1879
1880    impl fidl::encoding::ValueTypeMarker for LightError {
1881        type Borrowed<'a> = Self;
1882        #[inline(always)]
1883        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1884            *value
1885        }
1886    }
1887
1888    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for LightError {
1889        #[inline]
1890        unsafe fn encode(
1891            self,
1892            encoder: &mut fidl::encoding::Encoder<'_, D>,
1893            offset: usize,
1894            _depth: fidl::encoding::Depth,
1895        ) -> fidl::Result<()> {
1896            encoder.debug_check_bounds::<Self>(offset);
1897            encoder.write_num(self.into_primitive(), offset);
1898            Ok(())
1899        }
1900    }
1901
1902    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightError {
1903        #[inline(always)]
1904        fn new_empty() -> Self {
1905            Self::Failed
1906        }
1907
1908        #[inline]
1909        unsafe fn decode(
1910            &mut self,
1911            decoder: &mut fidl::encoding::Decoder<'_, D>,
1912            offset: usize,
1913            _depth: fidl::encoding::Depth,
1914        ) -> fidl::Result<()> {
1915            decoder.debug_check_bounds::<Self>(offset);
1916            let prim = decoder.read_num::<u32>(offset);
1917
1918            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1919            Ok(())
1920        }
1921    }
1922    unsafe impl fidl::encoding::TypeMarker for LightType {
1923        type Owned = Self;
1924
1925        #[inline(always)]
1926        fn inline_align(_context: fidl::encoding::Context) -> usize {
1927            std::mem::align_of::<u32>()
1928        }
1929
1930        #[inline(always)]
1931        fn inline_size(_context: fidl::encoding::Context) -> usize {
1932            std::mem::size_of::<u32>()
1933        }
1934
1935        #[inline(always)]
1936        fn encode_is_copy() -> bool {
1937            true
1938        }
1939
1940        #[inline(always)]
1941        fn decode_is_copy() -> bool {
1942            false
1943        }
1944    }
1945
1946    impl fidl::encoding::ValueTypeMarker for LightType {
1947        type Borrowed<'a> = Self;
1948        #[inline(always)]
1949        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1950            *value
1951        }
1952    }
1953
1954    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for LightType {
1955        #[inline]
1956        unsafe fn encode(
1957            self,
1958            encoder: &mut fidl::encoding::Encoder<'_, D>,
1959            offset: usize,
1960            _depth: fidl::encoding::Depth,
1961        ) -> fidl::Result<()> {
1962            encoder.debug_check_bounds::<Self>(offset);
1963            encoder.write_num(self.into_primitive(), offset);
1964            Ok(())
1965        }
1966    }
1967
1968    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightType {
1969        #[inline(always)]
1970        fn new_empty() -> Self {
1971            Self::Brightness
1972        }
1973
1974        #[inline]
1975        unsafe fn decode(
1976            &mut self,
1977            decoder: &mut fidl::encoding::Decoder<'_, D>,
1978            offset: usize,
1979            _depth: fidl::encoding::Depth,
1980        ) -> fidl::Result<()> {
1981            decoder.debug_check_bounds::<Self>(offset);
1982            let prim = decoder.read_num::<u32>(offset);
1983
1984            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1985            Ok(())
1986        }
1987    }
1988    unsafe impl fidl::encoding::TypeMarker for LowLightMode {
1989        type Owned = Self;
1990
1991        #[inline(always)]
1992        fn inline_align(_context: fidl::encoding::Context) -> usize {
1993            std::mem::align_of::<u32>()
1994        }
1995
1996        #[inline(always)]
1997        fn inline_size(_context: fidl::encoding::Context) -> usize {
1998            std::mem::size_of::<u32>()
1999        }
2000
2001        #[inline(always)]
2002        fn encode_is_copy() -> bool {
2003            true
2004        }
2005
2006        #[inline(always)]
2007        fn decode_is_copy() -> bool {
2008            false
2009        }
2010    }
2011
2012    impl fidl::encoding::ValueTypeMarker for LowLightMode {
2013        type Borrowed<'a> = Self;
2014        #[inline(always)]
2015        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2016            *value
2017        }
2018    }
2019
2020    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for LowLightMode {
2021        #[inline]
2022        unsafe fn encode(
2023            self,
2024            encoder: &mut fidl::encoding::Encoder<'_, D>,
2025            offset: usize,
2026            _depth: fidl::encoding::Depth,
2027        ) -> fidl::Result<()> {
2028            encoder.debug_check_bounds::<Self>(offset);
2029            encoder.write_num(self.into_primitive(), offset);
2030            Ok(())
2031        }
2032    }
2033
2034    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LowLightMode {
2035        #[inline(always)]
2036        fn new_empty() -> Self {
2037            Self::Disable
2038        }
2039
2040        #[inline]
2041        unsafe fn decode(
2042            &mut self,
2043            decoder: &mut fidl::encoding::Decoder<'_, D>,
2044            offset: usize,
2045            _depth: fidl::encoding::Depth,
2046        ) -> fidl::Result<()> {
2047            decoder.debug_check_bounds::<Self>(offset);
2048            let prim = decoder.read_num::<u32>(offset);
2049
2050            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2051            Ok(())
2052        }
2053    }
2054    unsafe impl fidl::encoding::TypeMarker for SettingsEpitaph {
2055        type Owned = Self;
2056
2057        #[inline(always)]
2058        fn inline_align(_context: fidl::encoding::Context) -> usize {
2059            std::mem::align_of::<u32>()
2060        }
2061
2062        #[inline(always)]
2063        fn inline_size(_context: fidl::encoding::Context) -> usize {
2064            std::mem::size_of::<u32>()
2065        }
2066
2067        #[inline(always)]
2068        fn encode_is_copy() -> bool {
2069            true
2070        }
2071
2072        #[inline(always)]
2073        fn decode_is_copy() -> bool {
2074            false
2075        }
2076    }
2077
2078    impl fidl::encoding::ValueTypeMarker for SettingsEpitaph {
2079        type Borrowed<'a> = Self;
2080        #[inline(always)]
2081        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2082            *value
2083        }
2084    }
2085
2086    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2087        for SettingsEpitaph
2088    {
2089        #[inline]
2090        unsafe fn encode(
2091            self,
2092            encoder: &mut fidl::encoding::Encoder<'_, D>,
2093            offset: usize,
2094            _depth: fidl::encoding::Depth,
2095        ) -> fidl::Result<()> {
2096            encoder.debug_check_bounds::<Self>(offset);
2097            encoder.write_num(self.into_primitive(), offset);
2098            Ok(())
2099        }
2100    }
2101
2102    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SettingsEpitaph {
2103        #[inline(always)]
2104        fn new_empty() -> Self {
2105            Self::RequestNotSupported
2106        }
2107
2108        #[inline]
2109        unsafe fn decode(
2110            &mut self,
2111            decoder: &mut fidl::encoding::Decoder<'_, D>,
2112            offset: usize,
2113            _depth: fidl::encoding::Depth,
2114        ) -> fidl::Result<()> {
2115            decoder.debug_check_bounds::<Self>(offset);
2116            let prim = decoder.read_num::<u32>(offset);
2117
2118            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2119            Ok(())
2120        }
2121    }
2122    unsafe impl fidl::encoding::TypeMarker for ThemeType {
2123        type Owned = Self;
2124
2125        #[inline(always)]
2126        fn inline_align(_context: fidl::encoding::Context) -> usize {
2127            std::mem::align_of::<u32>()
2128        }
2129
2130        #[inline(always)]
2131        fn inline_size(_context: fidl::encoding::Context) -> usize {
2132            std::mem::size_of::<u32>()
2133        }
2134
2135        #[inline(always)]
2136        fn encode_is_copy() -> bool {
2137            true
2138        }
2139
2140        #[inline(always)]
2141        fn decode_is_copy() -> bool {
2142            false
2143        }
2144    }
2145
2146    impl fidl::encoding::ValueTypeMarker for ThemeType {
2147        type Borrowed<'a> = Self;
2148        #[inline(always)]
2149        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2150            *value
2151        }
2152    }
2153
2154    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ThemeType {
2155        #[inline]
2156        unsafe fn encode(
2157            self,
2158            encoder: &mut fidl::encoding::Encoder<'_, D>,
2159            offset: usize,
2160            _depth: fidl::encoding::Depth,
2161        ) -> fidl::Result<()> {
2162            encoder.debug_check_bounds::<Self>(offset);
2163            encoder.write_num(self.into_primitive(), offset);
2164            Ok(())
2165        }
2166    }
2167
2168    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ThemeType {
2169        #[inline(always)]
2170        fn new_empty() -> Self {
2171            Self::Default
2172        }
2173
2174        #[inline]
2175        unsafe fn decode(
2176            &mut self,
2177            decoder: &mut fidl::encoding::Decoder<'_, D>,
2178            offset: usize,
2179            _depth: fidl::encoding::Depth,
2180        ) -> fidl::Result<()> {
2181            decoder.debug_check_bounds::<Self>(offset);
2182            let prim = decoder.read_num::<u32>(offset);
2183
2184            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2185            Ok(())
2186        }
2187    }
2188
2189    impl fidl::encoding::ValueTypeMarker for AccessibilitySetRequest {
2190        type Borrowed<'a> = &'a Self;
2191        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2192            value
2193        }
2194    }
2195
2196    unsafe impl fidl::encoding::TypeMarker for AccessibilitySetRequest {
2197        type Owned = Self;
2198
2199        #[inline(always)]
2200        fn inline_align(_context: fidl::encoding::Context) -> usize {
2201            8
2202        }
2203
2204        #[inline(always)]
2205        fn inline_size(_context: fidl::encoding::Context) -> usize {
2206            16
2207        }
2208    }
2209
2210    unsafe impl<D: fidl::encoding::ResourceDialect>
2211        fidl::encoding::Encode<AccessibilitySetRequest, D> for &AccessibilitySetRequest
2212    {
2213        #[inline]
2214        unsafe fn encode(
2215            self,
2216            encoder: &mut fidl::encoding::Encoder<'_, D>,
2217            offset: usize,
2218            _depth: fidl::encoding::Depth,
2219        ) -> fidl::Result<()> {
2220            encoder.debug_check_bounds::<AccessibilitySetRequest>(offset);
2221            // Delegate to tuple encoding.
2222            fidl::encoding::Encode::<AccessibilitySetRequest, D>::encode(
2223                (<AccessibilitySettings as fidl::encoding::ValueTypeMarker>::borrow(
2224                    &self.settings,
2225                ),),
2226                encoder,
2227                offset,
2228                _depth,
2229            )
2230        }
2231    }
2232    unsafe impl<
2233        D: fidl::encoding::ResourceDialect,
2234        T0: fidl::encoding::Encode<AccessibilitySettings, D>,
2235    > fidl::encoding::Encode<AccessibilitySetRequest, D> for (T0,)
2236    {
2237        #[inline]
2238        unsafe fn encode(
2239            self,
2240            encoder: &mut fidl::encoding::Encoder<'_, D>,
2241            offset: usize,
2242            depth: fidl::encoding::Depth,
2243        ) -> fidl::Result<()> {
2244            encoder.debug_check_bounds::<AccessibilitySetRequest>(offset);
2245            // Zero out padding regions. There's no need to apply masks
2246            // because the unmasked parts will be overwritten by fields.
2247            // Write the fields.
2248            self.0.encode(encoder, offset + 0, depth)?;
2249            Ok(())
2250        }
2251    }
2252
2253    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2254        for AccessibilitySetRequest
2255    {
2256        #[inline(always)]
2257        fn new_empty() -> Self {
2258            Self { settings: fidl::new_empty!(AccessibilitySettings, D) }
2259        }
2260
2261        #[inline]
2262        unsafe fn decode(
2263            &mut self,
2264            decoder: &mut fidl::encoding::Decoder<'_, D>,
2265            offset: usize,
2266            _depth: fidl::encoding::Depth,
2267        ) -> fidl::Result<()> {
2268            decoder.debug_check_bounds::<Self>(offset);
2269            // Verify that padding bytes are zero.
2270            fidl::decode!(
2271                AccessibilitySettings,
2272                D,
2273                &mut self.settings,
2274                decoder,
2275                offset + 0,
2276                _depth
2277            )?;
2278            Ok(())
2279        }
2280    }
2281
2282    impl fidl::encoding::ValueTypeMarker for AccessibilityWatchResponse {
2283        type Borrowed<'a> = &'a Self;
2284        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2285            value
2286        }
2287    }
2288
2289    unsafe impl fidl::encoding::TypeMarker for AccessibilityWatchResponse {
2290        type Owned = Self;
2291
2292        #[inline(always)]
2293        fn inline_align(_context: fidl::encoding::Context) -> usize {
2294            8
2295        }
2296
2297        #[inline(always)]
2298        fn inline_size(_context: fidl::encoding::Context) -> usize {
2299            16
2300        }
2301    }
2302
2303    unsafe impl<D: fidl::encoding::ResourceDialect>
2304        fidl::encoding::Encode<AccessibilityWatchResponse, D> for &AccessibilityWatchResponse
2305    {
2306        #[inline]
2307        unsafe fn encode(
2308            self,
2309            encoder: &mut fidl::encoding::Encoder<'_, D>,
2310            offset: usize,
2311            _depth: fidl::encoding::Depth,
2312        ) -> fidl::Result<()> {
2313            encoder.debug_check_bounds::<AccessibilityWatchResponse>(offset);
2314            // Delegate to tuple encoding.
2315            fidl::encoding::Encode::<AccessibilityWatchResponse, D>::encode(
2316                (<AccessibilitySettings as fidl::encoding::ValueTypeMarker>::borrow(
2317                    &self.settings,
2318                ),),
2319                encoder,
2320                offset,
2321                _depth,
2322            )
2323        }
2324    }
2325    unsafe impl<
2326        D: fidl::encoding::ResourceDialect,
2327        T0: fidl::encoding::Encode<AccessibilitySettings, D>,
2328    > fidl::encoding::Encode<AccessibilityWatchResponse, D> for (T0,)
2329    {
2330        #[inline]
2331        unsafe fn encode(
2332            self,
2333            encoder: &mut fidl::encoding::Encoder<'_, D>,
2334            offset: usize,
2335            depth: fidl::encoding::Depth,
2336        ) -> fidl::Result<()> {
2337            encoder.debug_check_bounds::<AccessibilityWatchResponse>(offset);
2338            // Zero out padding regions. There's no need to apply masks
2339            // because the unmasked parts will be overwritten by fields.
2340            // Write the fields.
2341            self.0.encode(encoder, offset + 0, depth)?;
2342            Ok(())
2343        }
2344    }
2345
2346    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2347        for AccessibilityWatchResponse
2348    {
2349        #[inline(always)]
2350        fn new_empty() -> Self {
2351            Self { settings: fidl::new_empty!(AccessibilitySettings, D) }
2352        }
2353
2354        #[inline]
2355        unsafe fn decode(
2356            &mut self,
2357            decoder: &mut fidl::encoding::Decoder<'_, D>,
2358            offset: usize,
2359            _depth: fidl::encoding::Depth,
2360        ) -> fidl::Result<()> {
2361            decoder.debug_check_bounds::<Self>(offset);
2362            // Verify that padding bytes are zero.
2363            fidl::decode!(
2364                AccessibilitySettings,
2365                D,
2366                &mut self.settings,
2367                decoder,
2368                offset + 0,
2369                _depth
2370            )?;
2371            Ok(())
2372        }
2373    }
2374
2375    impl fidl::encoding::ValueTypeMarker for AudioSet2Request {
2376        type Borrowed<'a> = &'a Self;
2377        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2378            value
2379        }
2380    }
2381
2382    unsafe impl fidl::encoding::TypeMarker for AudioSet2Request {
2383        type Owned = Self;
2384
2385        #[inline(always)]
2386        fn inline_align(_context: fidl::encoding::Context) -> usize {
2387            8
2388        }
2389
2390        #[inline(always)]
2391        fn inline_size(_context: fidl::encoding::Context) -> usize {
2392            16
2393        }
2394    }
2395
2396    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioSet2Request, D>
2397        for &AudioSet2Request
2398    {
2399        #[inline]
2400        unsafe fn encode(
2401            self,
2402            encoder: &mut fidl::encoding::Encoder<'_, D>,
2403            offset: usize,
2404            _depth: fidl::encoding::Depth,
2405        ) -> fidl::Result<()> {
2406            encoder.debug_check_bounds::<AudioSet2Request>(offset);
2407            // Delegate to tuple encoding.
2408            fidl::encoding::Encode::<AudioSet2Request, D>::encode(
2409                (<AudioSettings2 as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
2410                encoder,
2411                offset,
2412                _depth,
2413            )
2414        }
2415    }
2416    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AudioSettings2, D>>
2417        fidl::encoding::Encode<AudioSet2Request, D> for (T0,)
2418    {
2419        #[inline]
2420        unsafe fn encode(
2421            self,
2422            encoder: &mut fidl::encoding::Encoder<'_, D>,
2423            offset: usize,
2424            depth: fidl::encoding::Depth,
2425        ) -> fidl::Result<()> {
2426            encoder.debug_check_bounds::<AudioSet2Request>(offset);
2427            // Zero out padding regions. There's no need to apply masks
2428            // because the unmasked parts will be overwritten by fields.
2429            // Write the fields.
2430            self.0.encode(encoder, offset + 0, depth)?;
2431            Ok(())
2432        }
2433    }
2434
2435    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioSet2Request {
2436        #[inline(always)]
2437        fn new_empty() -> Self {
2438            Self { settings: fidl::new_empty!(AudioSettings2, D) }
2439        }
2440
2441        #[inline]
2442        unsafe fn decode(
2443            &mut self,
2444            decoder: &mut fidl::encoding::Decoder<'_, D>,
2445            offset: usize,
2446            _depth: fidl::encoding::Depth,
2447        ) -> fidl::Result<()> {
2448            decoder.debug_check_bounds::<Self>(offset);
2449            // Verify that padding bytes are zero.
2450            fidl::decode!(AudioSettings2, D, &mut self.settings, decoder, offset + 0, _depth)?;
2451            Ok(())
2452        }
2453    }
2454
2455    impl fidl::encoding::ValueTypeMarker for AudioSetRequest {
2456        type Borrowed<'a> = &'a Self;
2457        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2458            value
2459        }
2460    }
2461
2462    unsafe impl fidl::encoding::TypeMarker for AudioSetRequest {
2463        type Owned = Self;
2464
2465        #[inline(always)]
2466        fn inline_align(_context: fidl::encoding::Context) -> usize {
2467            8
2468        }
2469
2470        #[inline(always)]
2471        fn inline_size(_context: fidl::encoding::Context) -> usize {
2472            16
2473        }
2474    }
2475
2476    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioSetRequest, D>
2477        for &AudioSetRequest
2478    {
2479        #[inline]
2480        unsafe fn encode(
2481            self,
2482            encoder: &mut fidl::encoding::Encoder<'_, D>,
2483            offset: usize,
2484            _depth: fidl::encoding::Depth,
2485        ) -> fidl::Result<()> {
2486            encoder.debug_check_bounds::<AudioSetRequest>(offset);
2487            // Delegate to tuple encoding.
2488            fidl::encoding::Encode::<AudioSetRequest, D>::encode(
2489                (<AudioSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
2490                encoder,
2491                offset,
2492                _depth,
2493            )
2494        }
2495    }
2496    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AudioSettings, D>>
2497        fidl::encoding::Encode<AudioSetRequest, D> for (T0,)
2498    {
2499        #[inline]
2500        unsafe fn encode(
2501            self,
2502            encoder: &mut fidl::encoding::Encoder<'_, D>,
2503            offset: usize,
2504            depth: fidl::encoding::Depth,
2505        ) -> fidl::Result<()> {
2506            encoder.debug_check_bounds::<AudioSetRequest>(offset);
2507            // Zero out padding regions. There's no need to apply masks
2508            // because the unmasked parts will be overwritten by fields.
2509            // Write the fields.
2510            self.0.encode(encoder, offset + 0, depth)?;
2511            Ok(())
2512        }
2513    }
2514
2515    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioSetRequest {
2516        #[inline(always)]
2517        fn new_empty() -> Self {
2518            Self { settings: fidl::new_empty!(AudioSettings, D) }
2519        }
2520
2521        #[inline]
2522        unsafe fn decode(
2523            &mut self,
2524            decoder: &mut fidl::encoding::Decoder<'_, D>,
2525            offset: usize,
2526            _depth: fidl::encoding::Depth,
2527        ) -> fidl::Result<()> {
2528            decoder.debug_check_bounds::<Self>(offset);
2529            // Verify that padding bytes are zero.
2530            fidl::decode!(AudioSettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
2531            Ok(())
2532        }
2533    }
2534
2535    impl fidl::encoding::ValueTypeMarker for AudioWatchResponse {
2536        type Borrowed<'a> = &'a Self;
2537        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2538            value
2539        }
2540    }
2541
2542    unsafe impl fidl::encoding::TypeMarker for AudioWatchResponse {
2543        type Owned = Self;
2544
2545        #[inline(always)]
2546        fn inline_align(_context: fidl::encoding::Context) -> usize {
2547            8
2548        }
2549
2550        #[inline(always)]
2551        fn inline_size(_context: fidl::encoding::Context) -> usize {
2552            16
2553        }
2554    }
2555
2556    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioWatchResponse, D>
2557        for &AudioWatchResponse
2558    {
2559        #[inline]
2560        unsafe fn encode(
2561            self,
2562            encoder: &mut fidl::encoding::Encoder<'_, D>,
2563            offset: usize,
2564            _depth: fidl::encoding::Depth,
2565        ) -> fidl::Result<()> {
2566            encoder.debug_check_bounds::<AudioWatchResponse>(offset);
2567            // Delegate to tuple encoding.
2568            fidl::encoding::Encode::<AudioWatchResponse, D>::encode(
2569                (<AudioSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
2570                encoder,
2571                offset,
2572                _depth,
2573            )
2574        }
2575    }
2576    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AudioSettings, D>>
2577        fidl::encoding::Encode<AudioWatchResponse, D> for (T0,)
2578    {
2579        #[inline]
2580        unsafe fn encode(
2581            self,
2582            encoder: &mut fidl::encoding::Encoder<'_, D>,
2583            offset: usize,
2584            depth: fidl::encoding::Depth,
2585        ) -> fidl::Result<()> {
2586            encoder.debug_check_bounds::<AudioWatchResponse>(offset);
2587            // Zero out padding regions. There's no need to apply masks
2588            // because the unmasked parts will be overwritten by fields.
2589            // Write the fields.
2590            self.0.encode(encoder, offset + 0, depth)?;
2591            Ok(())
2592        }
2593    }
2594
2595    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioWatchResponse {
2596        #[inline(always)]
2597        fn new_empty() -> Self {
2598            Self { settings: fidl::new_empty!(AudioSettings, D) }
2599        }
2600
2601        #[inline]
2602        unsafe fn decode(
2603            &mut self,
2604            decoder: &mut fidl::encoding::Decoder<'_, D>,
2605            offset: usize,
2606            _depth: fidl::encoding::Depth,
2607        ) -> fidl::Result<()> {
2608            decoder.debug_check_bounds::<Self>(offset);
2609            // Verify that padding bytes are zero.
2610            fidl::decode!(AudioSettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
2611            Ok(())
2612        }
2613    }
2614
2615    impl fidl::encoding::ValueTypeMarker for AudioWatch2Response {
2616        type Borrowed<'a> = &'a Self;
2617        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2618            value
2619        }
2620    }
2621
2622    unsafe impl fidl::encoding::TypeMarker for AudioWatch2Response {
2623        type Owned = Self;
2624
2625        #[inline(always)]
2626        fn inline_align(_context: fidl::encoding::Context) -> usize {
2627            8
2628        }
2629
2630        #[inline(always)]
2631        fn inline_size(_context: fidl::encoding::Context) -> usize {
2632            16
2633        }
2634    }
2635
2636    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioWatch2Response, D>
2637        for &AudioWatch2Response
2638    {
2639        #[inline]
2640        unsafe fn encode(
2641            self,
2642            encoder: &mut fidl::encoding::Encoder<'_, D>,
2643            offset: usize,
2644            _depth: fidl::encoding::Depth,
2645        ) -> fidl::Result<()> {
2646            encoder.debug_check_bounds::<AudioWatch2Response>(offset);
2647            // Delegate to tuple encoding.
2648            fidl::encoding::Encode::<AudioWatch2Response, D>::encode(
2649                (<AudioSettings2 as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
2650                encoder,
2651                offset,
2652                _depth,
2653            )
2654        }
2655    }
2656    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AudioSettings2, D>>
2657        fidl::encoding::Encode<AudioWatch2Response, D> for (T0,)
2658    {
2659        #[inline]
2660        unsafe fn encode(
2661            self,
2662            encoder: &mut fidl::encoding::Encoder<'_, D>,
2663            offset: usize,
2664            depth: fidl::encoding::Depth,
2665        ) -> fidl::Result<()> {
2666            encoder.debug_check_bounds::<AudioWatch2Response>(offset);
2667            // Zero out padding regions. There's no need to apply masks
2668            // because the unmasked parts will be overwritten by fields.
2669            // Write the fields.
2670            self.0.encode(encoder, offset + 0, depth)?;
2671            Ok(())
2672        }
2673    }
2674
2675    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioWatch2Response {
2676        #[inline(always)]
2677        fn new_empty() -> Self {
2678            Self { settings: fidl::new_empty!(AudioSettings2, D) }
2679        }
2680
2681        #[inline]
2682        unsafe fn decode(
2683            &mut self,
2684            decoder: &mut fidl::encoding::Decoder<'_, D>,
2685            offset: usize,
2686            _depth: fidl::encoding::Depth,
2687        ) -> fidl::Result<()> {
2688            decoder.debug_check_bounds::<Self>(offset);
2689            // Verify that padding bytes are zero.
2690            fidl::decode!(AudioSettings2, D, &mut self.settings, decoder, offset + 0, _depth)?;
2691            Ok(())
2692        }
2693    }
2694
2695    impl fidl::encoding::ValueTypeMarker for Autorepeat {
2696        type Borrowed<'a> = &'a Self;
2697        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2698            value
2699        }
2700    }
2701
2702    unsafe impl fidl::encoding::TypeMarker for Autorepeat {
2703        type Owned = Self;
2704
2705        #[inline(always)]
2706        fn inline_align(_context: fidl::encoding::Context) -> usize {
2707            8
2708        }
2709
2710        #[inline(always)]
2711        fn inline_size(_context: fidl::encoding::Context) -> usize {
2712            16
2713        }
2714        #[inline(always)]
2715        fn encode_is_copy() -> bool {
2716            true
2717        }
2718
2719        #[inline(always)]
2720        fn decode_is_copy() -> bool {
2721            true
2722        }
2723    }
2724
2725    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Autorepeat, D>
2726        for &Autorepeat
2727    {
2728        #[inline]
2729        unsafe fn encode(
2730            self,
2731            encoder: &mut fidl::encoding::Encoder<'_, D>,
2732            offset: usize,
2733            _depth: fidl::encoding::Depth,
2734        ) -> fidl::Result<()> {
2735            encoder.debug_check_bounds::<Autorepeat>(offset);
2736            unsafe {
2737                // Copy the object into the buffer.
2738                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2739                (buf_ptr as *mut Autorepeat).write_unaligned((self as *const Autorepeat).read());
2740                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2741                // done second because the memcpy will write garbage to these bytes.
2742            }
2743            Ok(())
2744        }
2745    }
2746    unsafe impl<
2747        D: fidl::encoding::ResourceDialect,
2748        T0: fidl::encoding::Encode<i64, D>,
2749        T1: fidl::encoding::Encode<i64, D>,
2750    > fidl::encoding::Encode<Autorepeat, D> for (T0, T1)
2751    {
2752        #[inline]
2753        unsafe fn encode(
2754            self,
2755            encoder: &mut fidl::encoding::Encoder<'_, D>,
2756            offset: usize,
2757            depth: fidl::encoding::Depth,
2758        ) -> fidl::Result<()> {
2759            encoder.debug_check_bounds::<Autorepeat>(offset);
2760            // Zero out padding regions. There's no need to apply masks
2761            // because the unmasked parts will be overwritten by fields.
2762            // Write the fields.
2763            self.0.encode(encoder, offset + 0, depth)?;
2764            self.1.encode(encoder, offset + 8, depth)?;
2765            Ok(())
2766        }
2767    }
2768
2769    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Autorepeat {
2770        #[inline(always)]
2771        fn new_empty() -> Self {
2772            Self { delay: fidl::new_empty!(i64, D), period: fidl::new_empty!(i64, D) }
2773        }
2774
2775        #[inline]
2776        unsafe fn decode(
2777            &mut self,
2778            decoder: &mut fidl::encoding::Decoder<'_, D>,
2779            offset: usize,
2780            _depth: fidl::encoding::Depth,
2781        ) -> fidl::Result<()> {
2782            decoder.debug_check_bounds::<Self>(offset);
2783            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2784            // Verify that padding bytes are zero.
2785            // Copy from the buffer into the object.
2786            unsafe {
2787                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2788            }
2789            Ok(())
2790        }
2791    }
2792
2793    impl fidl::encoding::ValueTypeMarker for DisplaySetRequest {
2794        type Borrowed<'a> = &'a Self;
2795        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2796            value
2797        }
2798    }
2799
2800    unsafe impl fidl::encoding::TypeMarker for DisplaySetRequest {
2801        type Owned = Self;
2802
2803        #[inline(always)]
2804        fn inline_align(_context: fidl::encoding::Context) -> usize {
2805            8
2806        }
2807
2808        #[inline(always)]
2809        fn inline_size(_context: fidl::encoding::Context) -> usize {
2810            16
2811        }
2812    }
2813
2814    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DisplaySetRequest, D>
2815        for &DisplaySetRequest
2816    {
2817        #[inline]
2818        unsafe fn encode(
2819            self,
2820            encoder: &mut fidl::encoding::Encoder<'_, D>,
2821            offset: usize,
2822            _depth: fidl::encoding::Depth,
2823        ) -> fidl::Result<()> {
2824            encoder.debug_check_bounds::<DisplaySetRequest>(offset);
2825            // Delegate to tuple encoding.
2826            fidl::encoding::Encode::<DisplaySetRequest, D>::encode(
2827                (<DisplaySettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
2828                encoder,
2829                offset,
2830                _depth,
2831            )
2832        }
2833    }
2834    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DisplaySettings, D>>
2835        fidl::encoding::Encode<DisplaySetRequest, D> for (T0,)
2836    {
2837        #[inline]
2838        unsafe fn encode(
2839            self,
2840            encoder: &mut fidl::encoding::Encoder<'_, D>,
2841            offset: usize,
2842            depth: fidl::encoding::Depth,
2843        ) -> fidl::Result<()> {
2844            encoder.debug_check_bounds::<DisplaySetRequest>(offset);
2845            // Zero out padding regions. There's no need to apply masks
2846            // because the unmasked parts will be overwritten by fields.
2847            // Write the fields.
2848            self.0.encode(encoder, offset + 0, depth)?;
2849            Ok(())
2850        }
2851    }
2852
2853    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DisplaySetRequest {
2854        #[inline(always)]
2855        fn new_empty() -> Self {
2856            Self { settings: fidl::new_empty!(DisplaySettings, D) }
2857        }
2858
2859        #[inline]
2860        unsafe fn decode(
2861            &mut self,
2862            decoder: &mut fidl::encoding::Decoder<'_, D>,
2863            offset: usize,
2864            _depth: fidl::encoding::Depth,
2865        ) -> fidl::Result<()> {
2866            decoder.debug_check_bounds::<Self>(offset);
2867            // Verify that padding bytes are zero.
2868            fidl::decode!(DisplaySettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
2869            Ok(())
2870        }
2871    }
2872
2873    impl fidl::encoding::ValueTypeMarker for DisplayWatchResponse {
2874        type Borrowed<'a> = &'a Self;
2875        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2876            value
2877        }
2878    }
2879
2880    unsafe impl fidl::encoding::TypeMarker for DisplayWatchResponse {
2881        type Owned = Self;
2882
2883        #[inline(always)]
2884        fn inline_align(_context: fidl::encoding::Context) -> usize {
2885            8
2886        }
2887
2888        #[inline(always)]
2889        fn inline_size(_context: fidl::encoding::Context) -> usize {
2890            16
2891        }
2892    }
2893
2894    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DisplayWatchResponse, D>
2895        for &DisplayWatchResponse
2896    {
2897        #[inline]
2898        unsafe fn encode(
2899            self,
2900            encoder: &mut fidl::encoding::Encoder<'_, D>,
2901            offset: usize,
2902            _depth: fidl::encoding::Depth,
2903        ) -> fidl::Result<()> {
2904            encoder.debug_check_bounds::<DisplayWatchResponse>(offset);
2905            // Delegate to tuple encoding.
2906            fidl::encoding::Encode::<DisplayWatchResponse, D>::encode(
2907                (<DisplaySettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
2908                encoder,
2909                offset,
2910                _depth,
2911            )
2912        }
2913    }
2914    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DisplaySettings, D>>
2915        fidl::encoding::Encode<DisplayWatchResponse, D> for (T0,)
2916    {
2917        #[inline]
2918        unsafe fn encode(
2919            self,
2920            encoder: &mut fidl::encoding::Encoder<'_, D>,
2921            offset: usize,
2922            depth: fidl::encoding::Depth,
2923        ) -> fidl::Result<()> {
2924            encoder.debug_check_bounds::<DisplayWatchResponse>(offset);
2925            // Zero out padding regions. There's no need to apply masks
2926            // because the unmasked parts will be overwritten by fields.
2927            // Write the fields.
2928            self.0.encode(encoder, offset + 0, depth)?;
2929            Ok(())
2930        }
2931    }
2932
2933    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DisplayWatchResponse {
2934        #[inline(always)]
2935        fn new_empty() -> Self {
2936            Self { settings: fidl::new_empty!(DisplaySettings, D) }
2937        }
2938
2939        #[inline]
2940        unsafe fn decode(
2941            &mut self,
2942            decoder: &mut fidl::encoding::Decoder<'_, D>,
2943            offset: usize,
2944            _depth: fidl::encoding::Depth,
2945        ) -> fidl::Result<()> {
2946            decoder.debug_check_bounds::<Self>(offset);
2947            // Verify that padding bytes are zero.
2948            fidl::decode!(DisplaySettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
2949            Ok(())
2950        }
2951    }
2952
2953    impl fidl::encoding::ValueTypeMarker for DoNotDisturbSetRequest {
2954        type Borrowed<'a> = &'a Self;
2955        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2956            value
2957        }
2958    }
2959
2960    unsafe impl fidl::encoding::TypeMarker for DoNotDisturbSetRequest {
2961        type Owned = Self;
2962
2963        #[inline(always)]
2964        fn inline_align(_context: fidl::encoding::Context) -> usize {
2965            8
2966        }
2967
2968        #[inline(always)]
2969        fn inline_size(_context: fidl::encoding::Context) -> usize {
2970            16
2971        }
2972    }
2973
2974    unsafe impl<D: fidl::encoding::ResourceDialect>
2975        fidl::encoding::Encode<DoNotDisturbSetRequest, D> for &DoNotDisturbSetRequest
2976    {
2977        #[inline]
2978        unsafe fn encode(
2979            self,
2980            encoder: &mut fidl::encoding::Encoder<'_, D>,
2981            offset: usize,
2982            _depth: fidl::encoding::Depth,
2983        ) -> fidl::Result<()> {
2984            encoder.debug_check_bounds::<DoNotDisturbSetRequest>(offset);
2985            // Delegate to tuple encoding.
2986            fidl::encoding::Encode::<DoNotDisturbSetRequest, D>::encode(
2987                (<DoNotDisturbSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
2988                encoder,
2989                offset,
2990                _depth,
2991            )
2992        }
2993    }
2994    unsafe impl<
2995        D: fidl::encoding::ResourceDialect,
2996        T0: fidl::encoding::Encode<DoNotDisturbSettings, D>,
2997    > fidl::encoding::Encode<DoNotDisturbSetRequest, D> for (T0,)
2998    {
2999        #[inline]
3000        unsafe fn encode(
3001            self,
3002            encoder: &mut fidl::encoding::Encoder<'_, D>,
3003            offset: usize,
3004            depth: fidl::encoding::Depth,
3005        ) -> fidl::Result<()> {
3006            encoder.debug_check_bounds::<DoNotDisturbSetRequest>(offset);
3007            // Zero out padding regions. There's no need to apply masks
3008            // because the unmasked parts will be overwritten by fields.
3009            // Write the fields.
3010            self.0.encode(encoder, offset + 0, depth)?;
3011            Ok(())
3012        }
3013    }
3014
3015    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3016        for DoNotDisturbSetRequest
3017    {
3018        #[inline(always)]
3019        fn new_empty() -> Self {
3020            Self { settings: fidl::new_empty!(DoNotDisturbSettings, D) }
3021        }
3022
3023        #[inline]
3024        unsafe fn decode(
3025            &mut self,
3026            decoder: &mut fidl::encoding::Decoder<'_, D>,
3027            offset: usize,
3028            _depth: fidl::encoding::Depth,
3029        ) -> fidl::Result<()> {
3030            decoder.debug_check_bounds::<Self>(offset);
3031            // Verify that padding bytes are zero.
3032            fidl::decode!(
3033                DoNotDisturbSettings,
3034                D,
3035                &mut self.settings,
3036                decoder,
3037                offset + 0,
3038                _depth
3039            )?;
3040            Ok(())
3041        }
3042    }
3043
3044    impl fidl::encoding::ValueTypeMarker for DoNotDisturbWatchResponse {
3045        type Borrowed<'a> = &'a Self;
3046        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3047            value
3048        }
3049    }
3050
3051    unsafe impl fidl::encoding::TypeMarker for DoNotDisturbWatchResponse {
3052        type Owned = Self;
3053
3054        #[inline(always)]
3055        fn inline_align(_context: fidl::encoding::Context) -> usize {
3056            8
3057        }
3058
3059        #[inline(always)]
3060        fn inline_size(_context: fidl::encoding::Context) -> usize {
3061            16
3062        }
3063    }
3064
3065    unsafe impl<D: fidl::encoding::ResourceDialect>
3066        fidl::encoding::Encode<DoNotDisturbWatchResponse, D> for &DoNotDisturbWatchResponse
3067    {
3068        #[inline]
3069        unsafe fn encode(
3070            self,
3071            encoder: &mut fidl::encoding::Encoder<'_, D>,
3072            offset: usize,
3073            _depth: fidl::encoding::Depth,
3074        ) -> fidl::Result<()> {
3075            encoder.debug_check_bounds::<DoNotDisturbWatchResponse>(offset);
3076            // Delegate to tuple encoding.
3077            fidl::encoding::Encode::<DoNotDisturbWatchResponse, D>::encode(
3078                (<DoNotDisturbSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
3079                encoder,
3080                offset,
3081                _depth,
3082            )
3083        }
3084    }
3085    unsafe impl<
3086        D: fidl::encoding::ResourceDialect,
3087        T0: fidl::encoding::Encode<DoNotDisturbSettings, D>,
3088    > fidl::encoding::Encode<DoNotDisturbWatchResponse, D> for (T0,)
3089    {
3090        #[inline]
3091        unsafe fn encode(
3092            self,
3093            encoder: &mut fidl::encoding::Encoder<'_, D>,
3094            offset: usize,
3095            depth: fidl::encoding::Depth,
3096        ) -> fidl::Result<()> {
3097            encoder.debug_check_bounds::<DoNotDisturbWatchResponse>(offset);
3098            // Zero out padding regions. There's no need to apply masks
3099            // because the unmasked parts will be overwritten by fields.
3100            // Write the fields.
3101            self.0.encode(encoder, offset + 0, depth)?;
3102            Ok(())
3103        }
3104    }
3105
3106    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3107        for DoNotDisturbWatchResponse
3108    {
3109        #[inline(always)]
3110        fn new_empty() -> Self {
3111            Self { settings: fidl::new_empty!(DoNotDisturbSettings, D) }
3112        }
3113
3114        #[inline]
3115        unsafe fn decode(
3116            &mut self,
3117            decoder: &mut fidl::encoding::Decoder<'_, D>,
3118            offset: usize,
3119            _depth: fidl::encoding::Depth,
3120        ) -> fidl::Result<()> {
3121            decoder.debug_check_bounds::<Self>(offset);
3122            // Verify that padding bytes are zero.
3123            fidl::decode!(
3124                DoNotDisturbSettings,
3125                D,
3126                &mut self.settings,
3127                decoder,
3128                offset + 0,
3129                _depth
3130            )?;
3131            Ok(())
3132        }
3133    }
3134
3135    impl fidl::encoding::ValueTypeMarker for FactoryResetSetRequest {
3136        type Borrowed<'a> = &'a Self;
3137        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3138            value
3139        }
3140    }
3141
3142    unsafe impl fidl::encoding::TypeMarker for FactoryResetSetRequest {
3143        type Owned = Self;
3144
3145        #[inline(always)]
3146        fn inline_align(_context: fidl::encoding::Context) -> usize {
3147            8
3148        }
3149
3150        #[inline(always)]
3151        fn inline_size(_context: fidl::encoding::Context) -> usize {
3152            16
3153        }
3154    }
3155
3156    unsafe impl<D: fidl::encoding::ResourceDialect>
3157        fidl::encoding::Encode<FactoryResetSetRequest, D> for &FactoryResetSetRequest
3158    {
3159        #[inline]
3160        unsafe fn encode(
3161            self,
3162            encoder: &mut fidl::encoding::Encoder<'_, D>,
3163            offset: usize,
3164            _depth: fidl::encoding::Depth,
3165        ) -> fidl::Result<()> {
3166            encoder.debug_check_bounds::<FactoryResetSetRequest>(offset);
3167            // Delegate to tuple encoding.
3168            fidl::encoding::Encode::<FactoryResetSetRequest, D>::encode(
3169                (<FactoryResetSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
3170                encoder,
3171                offset,
3172                _depth,
3173            )
3174        }
3175    }
3176    unsafe impl<
3177        D: fidl::encoding::ResourceDialect,
3178        T0: fidl::encoding::Encode<FactoryResetSettings, D>,
3179    > fidl::encoding::Encode<FactoryResetSetRequest, D> for (T0,)
3180    {
3181        #[inline]
3182        unsafe fn encode(
3183            self,
3184            encoder: &mut fidl::encoding::Encoder<'_, D>,
3185            offset: usize,
3186            depth: fidl::encoding::Depth,
3187        ) -> fidl::Result<()> {
3188            encoder.debug_check_bounds::<FactoryResetSetRequest>(offset);
3189            // Zero out padding regions. There's no need to apply masks
3190            // because the unmasked parts will be overwritten by fields.
3191            // Write the fields.
3192            self.0.encode(encoder, offset + 0, depth)?;
3193            Ok(())
3194        }
3195    }
3196
3197    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3198        for FactoryResetSetRequest
3199    {
3200        #[inline(always)]
3201        fn new_empty() -> Self {
3202            Self { settings: fidl::new_empty!(FactoryResetSettings, D) }
3203        }
3204
3205        #[inline]
3206        unsafe fn decode(
3207            &mut self,
3208            decoder: &mut fidl::encoding::Decoder<'_, D>,
3209            offset: usize,
3210            _depth: fidl::encoding::Depth,
3211        ) -> fidl::Result<()> {
3212            decoder.debug_check_bounds::<Self>(offset);
3213            // Verify that padding bytes are zero.
3214            fidl::decode!(
3215                FactoryResetSettings,
3216                D,
3217                &mut self.settings,
3218                decoder,
3219                offset + 0,
3220                _depth
3221            )?;
3222            Ok(())
3223        }
3224    }
3225
3226    impl fidl::encoding::ValueTypeMarker for FactoryResetWatchResponse {
3227        type Borrowed<'a> = &'a Self;
3228        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3229            value
3230        }
3231    }
3232
3233    unsafe impl fidl::encoding::TypeMarker for FactoryResetWatchResponse {
3234        type Owned = Self;
3235
3236        #[inline(always)]
3237        fn inline_align(_context: fidl::encoding::Context) -> usize {
3238            8
3239        }
3240
3241        #[inline(always)]
3242        fn inline_size(_context: fidl::encoding::Context) -> usize {
3243            16
3244        }
3245    }
3246
3247    unsafe impl<D: fidl::encoding::ResourceDialect>
3248        fidl::encoding::Encode<FactoryResetWatchResponse, D> for &FactoryResetWatchResponse
3249    {
3250        #[inline]
3251        unsafe fn encode(
3252            self,
3253            encoder: &mut fidl::encoding::Encoder<'_, D>,
3254            offset: usize,
3255            _depth: fidl::encoding::Depth,
3256        ) -> fidl::Result<()> {
3257            encoder.debug_check_bounds::<FactoryResetWatchResponse>(offset);
3258            // Delegate to tuple encoding.
3259            fidl::encoding::Encode::<FactoryResetWatchResponse, D>::encode(
3260                (<FactoryResetSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
3261                encoder,
3262                offset,
3263                _depth,
3264            )
3265        }
3266    }
3267    unsafe impl<
3268        D: fidl::encoding::ResourceDialect,
3269        T0: fidl::encoding::Encode<FactoryResetSettings, D>,
3270    > fidl::encoding::Encode<FactoryResetWatchResponse, D> for (T0,)
3271    {
3272        #[inline]
3273        unsafe fn encode(
3274            self,
3275            encoder: &mut fidl::encoding::Encoder<'_, D>,
3276            offset: usize,
3277            depth: fidl::encoding::Depth,
3278        ) -> fidl::Result<()> {
3279            encoder.debug_check_bounds::<FactoryResetWatchResponse>(offset);
3280            // Zero out padding regions. There's no need to apply masks
3281            // because the unmasked parts will be overwritten by fields.
3282            // Write the fields.
3283            self.0.encode(encoder, offset + 0, depth)?;
3284            Ok(())
3285        }
3286    }
3287
3288    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3289        for FactoryResetWatchResponse
3290    {
3291        #[inline(always)]
3292        fn new_empty() -> Self {
3293            Self { settings: fidl::new_empty!(FactoryResetSettings, D) }
3294        }
3295
3296        #[inline]
3297        unsafe fn decode(
3298            &mut self,
3299            decoder: &mut fidl::encoding::Decoder<'_, D>,
3300            offset: usize,
3301            _depth: fidl::encoding::Depth,
3302        ) -> fidl::Result<()> {
3303            decoder.debug_check_bounds::<Self>(offset);
3304            // Verify that padding bytes are zero.
3305            fidl::decode!(
3306                FactoryResetSettings,
3307                D,
3308                &mut self.settings,
3309                decoder,
3310                offset + 0,
3311                _depth
3312            )?;
3313            Ok(())
3314        }
3315    }
3316
3317    impl fidl::encoding::ValueTypeMarker for InputSetRequest {
3318        type Borrowed<'a> = &'a Self;
3319        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3320            value
3321        }
3322    }
3323
3324    unsafe impl fidl::encoding::TypeMarker for InputSetRequest {
3325        type Owned = Self;
3326
3327        #[inline(always)]
3328        fn inline_align(_context: fidl::encoding::Context) -> usize {
3329            8
3330        }
3331
3332        #[inline(always)]
3333        fn inline_size(_context: fidl::encoding::Context) -> usize {
3334            16
3335        }
3336    }
3337
3338    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InputSetRequest, D>
3339        for &InputSetRequest
3340    {
3341        #[inline]
3342        unsafe fn encode(
3343            self,
3344            encoder: &mut fidl::encoding::Encoder<'_, D>,
3345            offset: usize,
3346            _depth: fidl::encoding::Depth,
3347        ) -> fidl::Result<()> {
3348            encoder.debug_check_bounds::<InputSetRequest>(offset);
3349            // Delegate to tuple encoding.
3350            fidl::encoding::Encode::<InputSetRequest, D>::encode(
3351                (
3352                    <fidl::encoding::UnboundedVector<InputState> as fidl::encoding::ValueTypeMarker>::borrow(&self.input_states),
3353                ),
3354                encoder, offset, _depth
3355            )
3356        }
3357    }
3358    unsafe impl<
3359        D: fidl::encoding::ResourceDialect,
3360        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<InputState>, D>,
3361    > fidl::encoding::Encode<InputSetRequest, D> for (T0,)
3362    {
3363        #[inline]
3364        unsafe fn encode(
3365            self,
3366            encoder: &mut fidl::encoding::Encoder<'_, D>,
3367            offset: usize,
3368            depth: fidl::encoding::Depth,
3369        ) -> fidl::Result<()> {
3370            encoder.debug_check_bounds::<InputSetRequest>(offset);
3371            // Zero out padding regions. There's no need to apply masks
3372            // because the unmasked parts will be overwritten by fields.
3373            // Write the fields.
3374            self.0.encode(encoder, offset + 0, depth)?;
3375            Ok(())
3376        }
3377    }
3378
3379    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InputSetRequest {
3380        #[inline(always)]
3381        fn new_empty() -> Self {
3382            Self { input_states: fidl::new_empty!(fidl::encoding::UnboundedVector<InputState>, D) }
3383        }
3384
3385        #[inline]
3386        unsafe fn decode(
3387            &mut self,
3388            decoder: &mut fidl::encoding::Decoder<'_, D>,
3389            offset: usize,
3390            _depth: fidl::encoding::Depth,
3391        ) -> fidl::Result<()> {
3392            decoder.debug_check_bounds::<Self>(offset);
3393            // Verify that padding bytes are zero.
3394            fidl::decode!(
3395                fidl::encoding::UnboundedVector<InputState>,
3396                D,
3397                &mut self.input_states,
3398                decoder,
3399                offset + 0,
3400                _depth
3401            )?;
3402            Ok(())
3403        }
3404    }
3405
3406    impl fidl::encoding::ValueTypeMarker for InputWatchResponse {
3407        type Borrowed<'a> = &'a Self;
3408        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3409            value
3410        }
3411    }
3412
3413    unsafe impl fidl::encoding::TypeMarker for InputWatchResponse {
3414        type Owned = Self;
3415
3416        #[inline(always)]
3417        fn inline_align(_context: fidl::encoding::Context) -> usize {
3418            8
3419        }
3420
3421        #[inline(always)]
3422        fn inline_size(_context: fidl::encoding::Context) -> usize {
3423            16
3424        }
3425    }
3426
3427    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InputWatchResponse, D>
3428        for &InputWatchResponse
3429    {
3430        #[inline]
3431        unsafe fn encode(
3432            self,
3433            encoder: &mut fidl::encoding::Encoder<'_, D>,
3434            offset: usize,
3435            _depth: fidl::encoding::Depth,
3436        ) -> fidl::Result<()> {
3437            encoder.debug_check_bounds::<InputWatchResponse>(offset);
3438            // Delegate to tuple encoding.
3439            fidl::encoding::Encode::<InputWatchResponse, D>::encode(
3440                (<InputSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
3441                encoder,
3442                offset,
3443                _depth,
3444            )
3445        }
3446    }
3447    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<InputSettings, D>>
3448        fidl::encoding::Encode<InputWatchResponse, D> for (T0,)
3449    {
3450        #[inline]
3451        unsafe fn encode(
3452            self,
3453            encoder: &mut fidl::encoding::Encoder<'_, D>,
3454            offset: usize,
3455            depth: fidl::encoding::Depth,
3456        ) -> fidl::Result<()> {
3457            encoder.debug_check_bounds::<InputWatchResponse>(offset);
3458            // Zero out padding regions. There's no need to apply masks
3459            // because the unmasked parts will be overwritten by fields.
3460            // Write the fields.
3461            self.0.encode(encoder, offset + 0, depth)?;
3462            Ok(())
3463        }
3464    }
3465
3466    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InputWatchResponse {
3467        #[inline(always)]
3468        fn new_empty() -> Self {
3469            Self { settings: fidl::new_empty!(InputSettings, D) }
3470        }
3471
3472        #[inline]
3473        unsafe fn decode(
3474            &mut self,
3475            decoder: &mut fidl::encoding::Decoder<'_, D>,
3476            offset: usize,
3477            _depth: fidl::encoding::Depth,
3478        ) -> fidl::Result<()> {
3479            decoder.debug_check_bounds::<Self>(offset);
3480            // Verify that padding bytes are zero.
3481            fidl::decode!(InputSettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
3482            Ok(())
3483        }
3484    }
3485
3486    impl fidl::encoding::ValueTypeMarker for IntlSetRequest {
3487        type Borrowed<'a> = &'a Self;
3488        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3489            value
3490        }
3491    }
3492
3493    unsafe impl fidl::encoding::TypeMarker for IntlSetRequest {
3494        type Owned = Self;
3495
3496        #[inline(always)]
3497        fn inline_align(_context: fidl::encoding::Context) -> usize {
3498            8
3499        }
3500
3501        #[inline(always)]
3502        fn inline_size(_context: fidl::encoding::Context) -> usize {
3503            16
3504        }
3505    }
3506
3507    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IntlSetRequest, D>
3508        for &IntlSetRequest
3509    {
3510        #[inline]
3511        unsafe fn encode(
3512            self,
3513            encoder: &mut fidl::encoding::Encoder<'_, D>,
3514            offset: usize,
3515            _depth: fidl::encoding::Depth,
3516        ) -> fidl::Result<()> {
3517            encoder.debug_check_bounds::<IntlSetRequest>(offset);
3518            // Delegate to tuple encoding.
3519            fidl::encoding::Encode::<IntlSetRequest, D>::encode(
3520                (<IntlSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
3521                encoder,
3522                offset,
3523                _depth,
3524            )
3525        }
3526    }
3527    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<IntlSettings, D>>
3528        fidl::encoding::Encode<IntlSetRequest, D> for (T0,)
3529    {
3530        #[inline]
3531        unsafe fn encode(
3532            self,
3533            encoder: &mut fidl::encoding::Encoder<'_, D>,
3534            offset: usize,
3535            depth: fidl::encoding::Depth,
3536        ) -> fidl::Result<()> {
3537            encoder.debug_check_bounds::<IntlSetRequest>(offset);
3538            // Zero out padding regions. There's no need to apply masks
3539            // because the unmasked parts will be overwritten by fields.
3540            // Write the fields.
3541            self.0.encode(encoder, offset + 0, depth)?;
3542            Ok(())
3543        }
3544    }
3545
3546    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IntlSetRequest {
3547        #[inline(always)]
3548        fn new_empty() -> Self {
3549            Self { settings: fidl::new_empty!(IntlSettings, D) }
3550        }
3551
3552        #[inline]
3553        unsafe fn decode(
3554            &mut self,
3555            decoder: &mut fidl::encoding::Decoder<'_, D>,
3556            offset: usize,
3557            _depth: fidl::encoding::Depth,
3558        ) -> fidl::Result<()> {
3559            decoder.debug_check_bounds::<Self>(offset);
3560            // Verify that padding bytes are zero.
3561            fidl::decode!(IntlSettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
3562            Ok(())
3563        }
3564    }
3565
3566    impl fidl::encoding::ValueTypeMarker for IntlWatchResponse {
3567        type Borrowed<'a> = &'a Self;
3568        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3569            value
3570        }
3571    }
3572
3573    unsafe impl fidl::encoding::TypeMarker for IntlWatchResponse {
3574        type Owned = Self;
3575
3576        #[inline(always)]
3577        fn inline_align(_context: fidl::encoding::Context) -> usize {
3578            8
3579        }
3580
3581        #[inline(always)]
3582        fn inline_size(_context: fidl::encoding::Context) -> usize {
3583            16
3584        }
3585    }
3586
3587    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IntlWatchResponse, D>
3588        for &IntlWatchResponse
3589    {
3590        #[inline]
3591        unsafe fn encode(
3592            self,
3593            encoder: &mut fidl::encoding::Encoder<'_, D>,
3594            offset: usize,
3595            _depth: fidl::encoding::Depth,
3596        ) -> fidl::Result<()> {
3597            encoder.debug_check_bounds::<IntlWatchResponse>(offset);
3598            // Delegate to tuple encoding.
3599            fidl::encoding::Encode::<IntlWatchResponse, D>::encode(
3600                (<IntlSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
3601                encoder,
3602                offset,
3603                _depth,
3604            )
3605        }
3606    }
3607    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<IntlSettings, D>>
3608        fidl::encoding::Encode<IntlWatchResponse, D> for (T0,)
3609    {
3610        #[inline]
3611        unsafe fn encode(
3612            self,
3613            encoder: &mut fidl::encoding::Encoder<'_, D>,
3614            offset: usize,
3615            depth: fidl::encoding::Depth,
3616        ) -> fidl::Result<()> {
3617            encoder.debug_check_bounds::<IntlWatchResponse>(offset);
3618            // Zero out padding regions. There's no need to apply masks
3619            // because the unmasked parts will be overwritten by fields.
3620            // Write the fields.
3621            self.0.encode(encoder, offset + 0, depth)?;
3622            Ok(())
3623        }
3624    }
3625
3626    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IntlWatchResponse {
3627        #[inline(always)]
3628        fn new_empty() -> Self {
3629            Self { settings: fidl::new_empty!(IntlSettings, D) }
3630        }
3631
3632        #[inline]
3633        unsafe fn decode(
3634            &mut self,
3635            decoder: &mut fidl::encoding::Decoder<'_, D>,
3636            offset: usize,
3637            _depth: fidl::encoding::Depth,
3638        ) -> fidl::Result<()> {
3639            decoder.debug_check_bounds::<Self>(offset);
3640            // Verify that padding bytes are zero.
3641            fidl::decode!(IntlSettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
3642            Ok(())
3643        }
3644    }
3645
3646    impl fidl::encoding::ValueTypeMarker for KeyboardSetSetRequest {
3647        type Borrowed<'a> = &'a Self;
3648        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3649            value
3650        }
3651    }
3652
3653    unsafe impl fidl::encoding::TypeMarker for KeyboardSetSetRequest {
3654        type Owned = Self;
3655
3656        #[inline(always)]
3657        fn inline_align(_context: fidl::encoding::Context) -> usize {
3658            8
3659        }
3660
3661        #[inline(always)]
3662        fn inline_size(_context: fidl::encoding::Context) -> usize {
3663            16
3664        }
3665    }
3666
3667    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<KeyboardSetSetRequest, D>
3668        for &KeyboardSetSetRequest
3669    {
3670        #[inline]
3671        unsafe fn encode(
3672            self,
3673            encoder: &mut fidl::encoding::Encoder<'_, D>,
3674            offset: usize,
3675            _depth: fidl::encoding::Depth,
3676        ) -> fidl::Result<()> {
3677            encoder.debug_check_bounds::<KeyboardSetSetRequest>(offset);
3678            // Delegate to tuple encoding.
3679            fidl::encoding::Encode::<KeyboardSetSetRequest, D>::encode(
3680                (<KeyboardSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
3681                encoder,
3682                offset,
3683                _depth,
3684            )
3685        }
3686    }
3687    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<KeyboardSettings, D>>
3688        fidl::encoding::Encode<KeyboardSetSetRequest, D> for (T0,)
3689    {
3690        #[inline]
3691        unsafe fn encode(
3692            self,
3693            encoder: &mut fidl::encoding::Encoder<'_, D>,
3694            offset: usize,
3695            depth: fidl::encoding::Depth,
3696        ) -> fidl::Result<()> {
3697            encoder.debug_check_bounds::<KeyboardSetSetRequest>(offset);
3698            // Zero out padding regions. There's no need to apply masks
3699            // because the unmasked parts will be overwritten by fields.
3700            // Write the fields.
3701            self.0.encode(encoder, offset + 0, depth)?;
3702            Ok(())
3703        }
3704    }
3705
3706    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for KeyboardSetSetRequest {
3707        #[inline(always)]
3708        fn new_empty() -> Self {
3709            Self { settings: fidl::new_empty!(KeyboardSettings, D) }
3710        }
3711
3712        #[inline]
3713        unsafe fn decode(
3714            &mut self,
3715            decoder: &mut fidl::encoding::Decoder<'_, D>,
3716            offset: usize,
3717            _depth: fidl::encoding::Depth,
3718        ) -> fidl::Result<()> {
3719            decoder.debug_check_bounds::<Self>(offset);
3720            // Verify that padding bytes are zero.
3721            fidl::decode!(KeyboardSettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
3722            Ok(())
3723        }
3724    }
3725
3726    impl fidl::encoding::ValueTypeMarker for KeyboardWatchWatchResponse {
3727        type Borrowed<'a> = &'a Self;
3728        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3729            value
3730        }
3731    }
3732
3733    unsafe impl fidl::encoding::TypeMarker for KeyboardWatchWatchResponse {
3734        type Owned = Self;
3735
3736        #[inline(always)]
3737        fn inline_align(_context: fidl::encoding::Context) -> usize {
3738            8
3739        }
3740
3741        #[inline(always)]
3742        fn inline_size(_context: fidl::encoding::Context) -> usize {
3743            16
3744        }
3745    }
3746
3747    unsafe impl<D: fidl::encoding::ResourceDialect>
3748        fidl::encoding::Encode<KeyboardWatchWatchResponse, D> for &KeyboardWatchWatchResponse
3749    {
3750        #[inline]
3751        unsafe fn encode(
3752            self,
3753            encoder: &mut fidl::encoding::Encoder<'_, D>,
3754            offset: usize,
3755            _depth: fidl::encoding::Depth,
3756        ) -> fidl::Result<()> {
3757            encoder.debug_check_bounds::<KeyboardWatchWatchResponse>(offset);
3758            // Delegate to tuple encoding.
3759            fidl::encoding::Encode::<KeyboardWatchWatchResponse, D>::encode(
3760                (<KeyboardSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
3761                encoder,
3762                offset,
3763                _depth,
3764            )
3765        }
3766    }
3767    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<KeyboardSettings, D>>
3768        fidl::encoding::Encode<KeyboardWatchWatchResponse, D> for (T0,)
3769    {
3770        #[inline]
3771        unsafe fn encode(
3772            self,
3773            encoder: &mut fidl::encoding::Encoder<'_, D>,
3774            offset: usize,
3775            depth: fidl::encoding::Depth,
3776        ) -> fidl::Result<()> {
3777            encoder.debug_check_bounds::<KeyboardWatchWatchResponse>(offset);
3778            // Zero out padding regions. There's no need to apply masks
3779            // because the unmasked parts will be overwritten by fields.
3780            // Write the fields.
3781            self.0.encode(encoder, offset + 0, depth)?;
3782            Ok(())
3783        }
3784    }
3785
3786    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3787        for KeyboardWatchWatchResponse
3788    {
3789        #[inline(always)]
3790        fn new_empty() -> Self {
3791            Self { settings: fidl::new_empty!(KeyboardSettings, D) }
3792        }
3793
3794        #[inline]
3795        unsafe fn decode(
3796            &mut self,
3797            decoder: &mut fidl::encoding::Decoder<'_, D>,
3798            offset: usize,
3799            _depth: fidl::encoding::Depth,
3800        ) -> fidl::Result<()> {
3801            decoder.debug_check_bounds::<Self>(offset);
3802            // Verify that padding bytes are zero.
3803            fidl::decode!(KeyboardSettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
3804            Ok(())
3805        }
3806    }
3807
3808    impl fidl::encoding::ValueTypeMarker for LightSetLightGroupValuesRequest {
3809        type Borrowed<'a> = &'a Self;
3810        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3811            value
3812        }
3813    }
3814
3815    unsafe impl fidl::encoding::TypeMarker for LightSetLightGroupValuesRequest {
3816        type Owned = Self;
3817
3818        #[inline(always)]
3819        fn inline_align(_context: fidl::encoding::Context) -> usize {
3820            8
3821        }
3822
3823        #[inline(always)]
3824        fn inline_size(_context: fidl::encoding::Context) -> usize {
3825            32
3826        }
3827    }
3828
3829    unsafe impl<D: fidl::encoding::ResourceDialect>
3830        fidl::encoding::Encode<LightSetLightGroupValuesRequest, D>
3831        for &LightSetLightGroupValuesRequest
3832    {
3833        #[inline]
3834        unsafe fn encode(
3835            self,
3836            encoder: &mut fidl::encoding::Encoder<'_, D>,
3837            offset: usize,
3838            _depth: fidl::encoding::Depth,
3839        ) -> fidl::Result<()> {
3840            encoder.debug_check_bounds::<LightSetLightGroupValuesRequest>(offset);
3841            // Delegate to tuple encoding.
3842            fidl::encoding::Encode::<LightSetLightGroupValuesRequest, D>::encode(
3843                (
3844                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
3845                    <fidl::encoding::UnboundedVector<LightState> as fidl::encoding::ValueTypeMarker>::borrow(&self.state),
3846                ),
3847                encoder, offset, _depth
3848            )
3849        }
3850    }
3851    unsafe impl<
3852        D: fidl::encoding::ResourceDialect,
3853        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
3854        T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<LightState>, D>,
3855    > fidl::encoding::Encode<LightSetLightGroupValuesRequest, D> for (T0, T1)
3856    {
3857        #[inline]
3858        unsafe fn encode(
3859            self,
3860            encoder: &mut fidl::encoding::Encoder<'_, D>,
3861            offset: usize,
3862            depth: fidl::encoding::Depth,
3863        ) -> fidl::Result<()> {
3864            encoder.debug_check_bounds::<LightSetLightGroupValuesRequest>(offset);
3865            // Zero out padding regions. There's no need to apply masks
3866            // because the unmasked parts will be overwritten by fields.
3867            // Write the fields.
3868            self.0.encode(encoder, offset + 0, depth)?;
3869            self.1.encode(encoder, offset + 16, depth)?;
3870            Ok(())
3871        }
3872    }
3873
3874    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3875        for LightSetLightGroupValuesRequest
3876    {
3877        #[inline(always)]
3878        fn new_empty() -> Self {
3879            Self {
3880                name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D),
3881                state: fidl::new_empty!(fidl::encoding::UnboundedVector<LightState>, D),
3882            }
3883        }
3884
3885        #[inline]
3886        unsafe fn decode(
3887            &mut self,
3888            decoder: &mut fidl::encoding::Decoder<'_, D>,
3889            offset: usize,
3890            _depth: fidl::encoding::Depth,
3891        ) -> fidl::Result<()> {
3892            decoder.debug_check_bounds::<Self>(offset);
3893            // Verify that padding bytes are zero.
3894            fidl::decode!(
3895                fidl::encoding::BoundedString<32>,
3896                D,
3897                &mut self.name,
3898                decoder,
3899                offset + 0,
3900                _depth
3901            )?;
3902            fidl::decode!(
3903                fidl::encoding::UnboundedVector<LightState>,
3904                D,
3905                &mut self.state,
3906                decoder,
3907                offset + 16,
3908                _depth
3909            )?;
3910            Ok(())
3911        }
3912    }
3913
3914    impl fidl::encoding::ValueTypeMarker for LightWatchLightGroupRequest {
3915        type Borrowed<'a> = &'a Self;
3916        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3917            value
3918        }
3919    }
3920
3921    unsafe impl fidl::encoding::TypeMarker for LightWatchLightGroupRequest {
3922        type Owned = Self;
3923
3924        #[inline(always)]
3925        fn inline_align(_context: fidl::encoding::Context) -> usize {
3926            8
3927        }
3928
3929        #[inline(always)]
3930        fn inline_size(_context: fidl::encoding::Context) -> usize {
3931            16
3932        }
3933    }
3934
3935    unsafe impl<D: fidl::encoding::ResourceDialect>
3936        fidl::encoding::Encode<LightWatchLightGroupRequest, D> for &LightWatchLightGroupRequest
3937    {
3938        #[inline]
3939        unsafe fn encode(
3940            self,
3941            encoder: &mut fidl::encoding::Encoder<'_, D>,
3942            offset: usize,
3943            _depth: fidl::encoding::Depth,
3944        ) -> fidl::Result<()> {
3945            encoder.debug_check_bounds::<LightWatchLightGroupRequest>(offset);
3946            // Delegate to tuple encoding.
3947            fidl::encoding::Encode::<LightWatchLightGroupRequest, D>::encode(
3948                (<fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
3949                    &self.name,
3950                ),),
3951                encoder,
3952                offset,
3953                _depth,
3954            )
3955        }
3956    }
3957    unsafe impl<
3958        D: fidl::encoding::ResourceDialect,
3959        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
3960    > fidl::encoding::Encode<LightWatchLightGroupRequest, D> for (T0,)
3961    {
3962        #[inline]
3963        unsafe fn encode(
3964            self,
3965            encoder: &mut fidl::encoding::Encoder<'_, D>,
3966            offset: usize,
3967            depth: fidl::encoding::Depth,
3968        ) -> fidl::Result<()> {
3969            encoder.debug_check_bounds::<LightWatchLightGroupRequest>(offset);
3970            // Zero out padding regions. There's no need to apply masks
3971            // because the unmasked parts will be overwritten by fields.
3972            // Write the fields.
3973            self.0.encode(encoder, offset + 0, depth)?;
3974            Ok(())
3975        }
3976    }
3977
3978    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3979        for LightWatchLightGroupRequest
3980    {
3981        #[inline(always)]
3982        fn new_empty() -> Self {
3983            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D) }
3984        }
3985
3986        #[inline]
3987        unsafe fn decode(
3988            &mut self,
3989            decoder: &mut fidl::encoding::Decoder<'_, D>,
3990            offset: usize,
3991            _depth: fidl::encoding::Depth,
3992        ) -> fidl::Result<()> {
3993            decoder.debug_check_bounds::<Self>(offset);
3994            // Verify that padding bytes are zero.
3995            fidl::decode!(
3996                fidl::encoding::BoundedString<32>,
3997                D,
3998                &mut self.name,
3999                decoder,
4000                offset + 0,
4001                _depth
4002            )?;
4003            Ok(())
4004        }
4005    }
4006
4007    impl fidl::encoding::ValueTypeMarker for LightWatchLightGroupResponse {
4008        type Borrowed<'a> = &'a Self;
4009        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4010            value
4011        }
4012    }
4013
4014    unsafe impl fidl::encoding::TypeMarker for LightWatchLightGroupResponse {
4015        type Owned = Self;
4016
4017        #[inline(always)]
4018        fn inline_align(_context: fidl::encoding::Context) -> usize {
4019            8
4020        }
4021
4022        #[inline(always)]
4023        fn inline_size(_context: fidl::encoding::Context) -> usize {
4024            16
4025        }
4026    }
4027
4028    unsafe impl<D: fidl::encoding::ResourceDialect>
4029        fidl::encoding::Encode<LightWatchLightGroupResponse, D> for &LightWatchLightGroupResponse
4030    {
4031        #[inline]
4032        unsafe fn encode(
4033            self,
4034            encoder: &mut fidl::encoding::Encoder<'_, D>,
4035            offset: usize,
4036            _depth: fidl::encoding::Depth,
4037        ) -> fidl::Result<()> {
4038            encoder.debug_check_bounds::<LightWatchLightGroupResponse>(offset);
4039            // Delegate to tuple encoding.
4040            fidl::encoding::Encode::<LightWatchLightGroupResponse, D>::encode(
4041                (<LightGroup as fidl::encoding::ValueTypeMarker>::borrow(&self.group),),
4042                encoder,
4043                offset,
4044                _depth,
4045            )
4046        }
4047    }
4048    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LightGroup, D>>
4049        fidl::encoding::Encode<LightWatchLightGroupResponse, D> for (T0,)
4050    {
4051        #[inline]
4052        unsafe fn encode(
4053            self,
4054            encoder: &mut fidl::encoding::Encoder<'_, D>,
4055            offset: usize,
4056            depth: fidl::encoding::Depth,
4057        ) -> fidl::Result<()> {
4058            encoder.debug_check_bounds::<LightWatchLightGroupResponse>(offset);
4059            // Zero out padding regions. There's no need to apply masks
4060            // because the unmasked parts will be overwritten by fields.
4061            // Write the fields.
4062            self.0.encode(encoder, offset + 0, depth)?;
4063            Ok(())
4064        }
4065    }
4066
4067    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4068        for LightWatchLightGroupResponse
4069    {
4070        #[inline(always)]
4071        fn new_empty() -> Self {
4072            Self { group: fidl::new_empty!(LightGroup, D) }
4073        }
4074
4075        #[inline]
4076        unsafe fn decode(
4077            &mut self,
4078            decoder: &mut fidl::encoding::Decoder<'_, D>,
4079            offset: usize,
4080            _depth: fidl::encoding::Depth,
4081        ) -> fidl::Result<()> {
4082            decoder.debug_check_bounds::<Self>(offset);
4083            // Verify that padding bytes are zero.
4084            fidl::decode!(LightGroup, D, &mut self.group, decoder, offset + 0, _depth)?;
4085            Ok(())
4086        }
4087    }
4088
4089    impl fidl::encoding::ValueTypeMarker for LightWatchLightGroupsResponse {
4090        type Borrowed<'a> = &'a Self;
4091        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4092            value
4093        }
4094    }
4095
4096    unsafe impl fidl::encoding::TypeMarker for LightWatchLightGroupsResponse {
4097        type Owned = Self;
4098
4099        #[inline(always)]
4100        fn inline_align(_context: fidl::encoding::Context) -> usize {
4101            8
4102        }
4103
4104        #[inline(always)]
4105        fn inline_size(_context: fidl::encoding::Context) -> usize {
4106            16
4107        }
4108    }
4109
4110    unsafe impl<D: fidl::encoding::ResourceDialect>
4111        fidl::encoding::Encode<LightWatchLightGroupsResponse, D>
4112        for &LightWatchLightGroupsResponse
4113    {
4114        #[inline]
4115        unsafe fn encode(
4116            self,
4117            encoder: &mut fidl::encoding::Encoder<'_, D>,
4118            offset: usize,
4119            _depth: fidl::encoding::Depth,
4120        ) -> fidl::Result<()> {
4121            encoder.debug_check_bounds::<LightWatchLightGroupsResponse>(offset);
4122            // Delegate to tuple encoding.
4123            fidl::encoding::Encode::<LightWatchLightGroupsResponse, D>::encode(
4124                (
4125                    <fidl::encoding::UnboundedVector<LightGroup> as fidl::encoding::ValueTypeMarker>::borrow(&self.groups),
4126                ),
4127                encoder, offset, _depth
4128            )
4129        }
4130    }
4131    unsafe impl<
4132        D: fidl::encoding::ResourceDialect,
4133        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<LightGroup>, D>,
4134    > fidl::encoding::Encode<LightWatchLightGroupsResponse, D> for (T0,)
4135    {
4136        #[inline]
4137        unsafe fn encode(
4138            self,
4139            encoder: &mut fidl::encoding::Encoder<'_, D>,
4140            offset: usize,
4141            depth: fidl::encoding::Depth,
4142        ) -> fidl::Result<()> {
4143            encoder.debug_check_bounds::<LightWatchLightGroupsResponse>(offset);
4144            // Zero out padding regions. There's no need to apply masks
4145            // because the unmasked parts will be overwritten by fields.
4146            // Write the fields.
4147            self.0.encode(encoder, offset + 0, depth)?;
4148            Ok(())
4149        }
4150    }
4151
4152    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4153        for LightWatchLightGroupsResponse
4154    {
4155        #[inline(always)]
4156        fn new_empty() -> Self {
4157            Self { groups: fidl::new_empty!(fidl::encoding::UnboundedVector<LightGroup>, D) }
4158        }
4159
4160        #[inline]
4161        unsafe fn decode(
4162            &mut self,
4163            decoder: &mut fidl::encoding::Decoder<'_, D>,
4164            offset: usize,
4165            _depth: fidl::encoding::Depth,
4166        ) -> fidl::Result<()> {
4167            decoder.debug_check_bounds::<Self>(offset);
4168            // Verify that padding bytes are zero.
4169            fidl::decode!(
4170                fidl::encoding::UnboundedVector<LightGroup>,
4171                D,
4172                &mut self.groups,
4173                decoder,
4174                offset + 0,
4175                _depth
4176            )?;
4177            Ok(())
4178        }
4179    }
4180
4181    impl fidl::encoding::ValueTypeMarker for NightModeSetRequest {
4182        type Borrowed<'a> = &'a Self;
4183        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4184            value
4185        }
4186    }
4187
4188    unsafe impl fidl::encoding::TypeMarker for NightModeSetRequest {
4189        type Owned = Self;
4190
4191        #[inline(always)]
4192        fn inline_align(_context: fidl::encoding::Context) -> usize {
4193            8
4194        }
4195
4196        #[inline(always)]
4197        fn inline_size(_context: fidl::encoding::Context) -> usize {
4198            16
4199        }
4200    }
4201
4202    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NightModeSetRequest, D>
4203        for &NightModeSetRequest
4204    {
4205        #[inline]
4206        unsafe fn encode(
4207            self,
4208            encoder: &mut fidl::encoding::Encoder<'_, D>,
4209            offset: usize,
4210            _depth: fidl::encoding::Depth,
4211        ) -> fidl::Result<()> {
4212            encoder.debug_check_bounds::<NightModeSetRequest>(offset);
4213            // Delegate to tuple encoding.
4214            fidl::encoding::Encode::<NightModeSetRequest, D>::encode(
4215                (<NightModeSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
4216                encoder,
4217                offset,
4218                _depth,
4219            )
4220        }
4221    }
4222    unsafe impl<
4223        D: fidl::encoding::ResourceDialect,
4224        T0: fidl::encoding::Encode<NightModeSettings, D>,
4225    > fidl::encoding::Encode<NightModeSetRequest, D> for (T0,)
4226    {
4227        #[inline]
4228        unsafe fn encode(
4229            self,
4230            encoder: &mut fidl::encoding::Encoder<'_, D>,
4231            offset: usize,
4232            depth: fidl::encoding::Depth,
4233        ) -> fidl::Result<()> {
4234            encoder.debug_check_bounds::<NightModeSetRequest>(offset);
4235            // Zero out padding regions. There's no need to apply masks
4236            // because the unmasked parts will be overwritten by fields.
4237            // Write the fields.
4238            self.0.encode(encoder, offset + 0, depth)?;
4239            Ok(())
4240        }
4241    }
4242
4243    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NightModeSetRequest {
4244        #[inline(always)]
4245        fn new_empty() -> Self {
4246            Self { settings: fidl::new_empty!(NightModeSettings, D) }
4247        }
4248
4249        #[inline]
4250        unsafe fn decode(
4251            &mut self,
4252            decoder: &mut fidl::encoding::Decoder<'_, D>,
4253            offset: usize,
4254            _depth: fidl::encoding::Depth,
4255        ) -> fidl::Result<()> {
4256            decoder.debug_check_bounds::<Self>(offset);
4257            // Verify that padding bytes are zero.
4258            fidl::decode!(NightModeSettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
4259            Ok(())
4260        }
4261    }
4262
4263    impl fidl::encoding::ValueTypeMarker for NightModeWatchResponse {
4264        type Borrowed<'a> = &'a Self;
4265        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4266            value
4267        }
4268    }
4269
4270    unsafe impl fidl::encoding::TypeMarker for NightModeWatchResponse {
4271        type Owned = Self;
4272
4273        #[inline(always)]
4274        fn inline_align(_context: fidl::encoding::Context) -> usize {
4275            8
4276        }
4277
4278        #[inline(always)]
4279        fn inline_size(_context: fidl::encoding::Context) -> usize {
4280            16
4281        }
4282    }
4283
4284    unsafe impl<D: fidl::encoding::ResourceDialect>
4285        fidl::encoding::Encode<NightModeWatchResponse, D> for &NightModeWatchResponse
4286    {
4287        #[inline]
4288        unsafe fn encode(
4289            self,
4290            encoder: &mut fidl::encoding::Encoder<'_, D>,
4291            offset: usize,
4292            _depth: fidl::encoding::Depth,
4293        ) -> fidl::Result<()> {
4294            encoder.debug_check_bounds::<NightModeWatchResponse>(offset);
4295            // Delegate to tuple encoding.
4296            fidl::encoding::Encode::<NightModeWatchResponse, D>::encode(
4297                (<NightModeSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
4298                encoder,
4299                offset,
4300                _depth,
4301            )
4302        }
4303    }
4304    unsafe impl<
4305        D: fidl::encoding::ResourceDialect,
4306        T0: fidl::encoding::Encode<NightModeSettings, D>,
4307    > fidl::encoding::Encode<NightModeWatchResponse, D> for (T0,)
4308    {
4309        #[inline]
4310        unsafe fn encode(
4311            self,
4312            encoder: &mut fidl::encoding::Encoder<'_, D>,
4313            offset: usize,
4314            depth: fidl::encoding::Depth,
4315        ) -> fidl::Result<()> {
4316            encoder.debug_check_bounds::<NightModeWatchResponse>(offset);
4317            // Zero out padding regions. There's no need to apply masks
4318            // because the unmasked parts will be overwritten by fields.
4319            // Write the fields.
4320            self.0.encode(encoder, offset + 0, depth)?;
4321            Ok(())
4322        }
4323    }
4324
4325    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4326        for NightModeWatchResponse
4327    {
4328        #[inline(always)]
4329        fn new_empty() -> Self {
4330            Self { settings: fidl::new_empty!(NightModeSettings, D) }
4331        }
4332
4333        #[inline]
4334        unsafe fn decode(
4335            &mut self,
4336            decoder: &mut fidl::encoding::Decoder<'_, D>,
4337            offset: usize,
4338            _depth: fidl::encoding::Depth,
4339        ) -> fidl::Result<()> {
4340            decoder.debug_check_bounds::<Self>(offset);
4341            // Verify that padding bytes are zero.
4342            fidl::decode!(NightModeSettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
4343            Ok(())
4344        }
4345    }
4346
4347    impl fidl::encoding::ValueTypeMarker for PrivacySetRequest {
4348        type Borrowed<'a> = &'a Self;
4349        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4350            value
4351        }
4352    }
4353
4354    unsafe impl fidl::encoding::TypeMarker for PrivacySetRequest {
4355        type Owned = Self;
4356
4357        #[inline(always)]
4358        fn inline_align(_context: fidl::encoding::Context) -> usize {
4359            8
4360        }
4361
4362        #[inline(always)]
4363        fn inline_size(_context: fidl::encoding::Context) -> usize {
4364            16
4365        }
4366    }
4367
4368    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PrivacySetRequest, D>
4369        for &PrivacySetRequest
4370    {
4371        #[inline]
4372        unsafe fn encode(
4373            self,
4374            encoder: &mut fidl::encoding::Encoder<'_, D>,
4375            offset: usize,
4376            _depth: fidl::encoding::Depth,
4377        ) -> fidl::Result<()> {
4378            encoder.debug_check_bounds::<PrivacySetRequest>(offset);
4379            // Delegate to tuple encoding.
4380            fidl::encoding::Encode::<PrivacySetRequest, D>::encode(
4381                (<PrivacySettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
4382                encoder,
4383                offset,
4384                _depth,
4385            )
4386        }
4387    }
4388    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PrivacySettings, D>>
4389        fidl::encoding::Encode<PrivacySetRequest, D> for (T0,)
4390    {
4391        #[inline]
4392        unsafe fn encode(
4393            self,
4394            encoder: &mut fidl::encoding::Encoder<'_, D>,
4395            offset: usize,
4396            depth: fidl::encoding::Depth,
4397        ) -> fidl::Result<()> {
4398            encoder.debug_check_bounds::<PrivacySetRequest>(offset);
4399            // Zero out padding regions. There's no need to apply masks
4400            // because the unmasked parts will be overwritten by fields.
4401            // Write the fields.
4402            self.0.encode(encoder, offset + 0, depth)?;
4403            Ok(())
4404        }
4405    }
4406
4407    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PrivacySetRequest {
4408        #[inline(always)]
4409        fn new_empty() -> Self {
4410            Self { settings: fidl::new_empty!(PrivacySettings, D) }
4411        }
4412
4413        #[inline]
4414        unsafe fn decode(
4415            &mut self,
4416            decoder: &mut fidl::encoding::Decoder<'_, D>,
4417            offset: usize,
4418            _depth: fidl::encoding::Depth,
4419        ) -> fidl::Result<()> {
4420            decoder.debug_check_bounds::<Self>(offset);
4421            // Verify that padding bytes are zero.
4422            fidl::decode!(PrivacySettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
4423            Ok(())
4424        }
4425    }
4426
4427    impl fidl::encoding::ValueTypeMarker for PrivacyWatchResponse {
4428        type Borrowed<'a> = &'a Self;
4429        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4430            value
4431        }
4432    }
4433
4434    unsafe impl fidl::encoding::TypeMarker for PrivacyWatchResponse {
4435        type Owned = Self;
4436
4437        #[inline(always)]
4438        fn inline_align(_context: fidl::encoding::Context) -> usize {
4439            8
4440        }
4441
4442        #[inline(always)]
4443        fn inline_size(_context: fidl::encoding::Context) -> usize {
4444            16
4445        }
4446    }
4447
4448    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PrivacyWatchResponse, D>
4449        for &PrivacyWatchResponse
4450    {
4451        #[inline]
4452        unsafe fn encode(
4453            self,
4454            encoder: &mut fidl::encoding::Encoder<'_, D>,
4455            offset: usize,
4456            _depth: fidl::encoding::Depth,
4457        ) -> fidl::Result<()> {
4458            encoder.debug_check_bounds::<PrivacyWatchResponse>(offset);
4459            // Delegate to tuple encoding.
4460            fidl::encoding::Encode::<PrivacyWatchResponse, D>::encode(
4461                (<PrivacySettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
4462                encoder,
4463                offset,
4464                _depth,
4465            )
4466        }
4467    }
4468    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PrivacySettings, D>>
4469        fidl::encoding::Encode<PrivacyWatchResponse, D> for (T0,)
4470    {
4471        #[inline]
4472        unsafe fn encode(
4473            self,
4474            encoder: &mut fidl::encoding::Encoder<'_, D>,
4475            offset: usize,
4476            depth: fidl::encoding::Depth,
4477        ) -> fidl::Result<()> {
4478            encoder.debug_check_bounds::<PrivacyWatchResponse>(offset);
4479            // Zero out padding regions. There's no need to apply masks
4480            // because the unmasked parts will be overwritten by fields.
4481            // Write the fields.
4482            self.0.encode(encoder, offset + 0, depth)?;
4483            Ok(())
4484        }
4485    }
4486
4487    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PrivacyWatchResponse {
4488        #[inline(always)]
4489        fn new_empty() -> Self {
4490            Self { settings: fidl::new_empty!(PrivacySettings, D) }
4491        }
4492
4493        #[inline]
4494        unsafe fn decode(
4495            &mut self,
4496            decoder: &mut fidl::encoding::Decoder<'_, D>,
4497            offset: usize,
4498            _depth: fidl::encoding::Depth,
4499        ) -> fidl::Result<()> {
4500            decoder.debug_check_bounds::<Self>(offset);
4501            // Verify that padding bytes are zero.
4502            fidl::decode!(PrivacySettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
4503            Ok(())
4504        }
4505    }
4506
4507    impl fidl::encoding::ValueTypeMarker for SetupSetRequest {
4508        type Borrowed<'a> = &'a Self;
4509        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4510            value
4511        }
4512    }
4513
4514    unsafe impl fidl::encoding::TypeMarker for SetupSetRequest {
4515        type Owned = Self;
4516
4517        #[inline(always)]
4518        fn inline_align(_context: fidl::encoding::Context) -> usize {
4519            8
4520        }
4521
4522        #[inline(always)]
4523        fn inline_size(_context: fidl::encoding::Context) -> usize {
4524            24
4525        }
4526    }
4527
4528    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetupSetRequest, D>
4529        for &SetupSetRequest
4530    {
4531        #[inline]
4532        unsafe fn encode(
4533            self,
4534            encoder: &mut fidl::encoding::Encoder<'_, D>,
4535            offset: usize,
4536            _depth: fidl::encoding::Depth,
4537        ) -> fidl::Result<()> {
4538            encoder.debug_check_bounds::<SetupSetRequest>(offset);
4539            // Delegate to tuple encoding.
4540            fidl::encoding::Encode::<SetupSetRequest, D>::encode(
4541                (
4542                    <SetupSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),
4543                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.reboot_device),
4544                ),
4545                encoder,
4546                offset,
4547                _depth,
4548            )
4549        }
4550    }
4551    unsafe impl<
4552        D: fidl::encoding::ResourceDialect,
4553        T0: fidl::encoding::Encode<SetupSettings, D>,
4554        T1: fidl::encoding::Encode<bool, D>,
4555    > fidl::encoding::Encode<SetupSetRequest, D> for (T0, T1)
4556    {
4557        #[inline]
4558        unsafe fn encode(
4559            self,
4560            encoder: &mut fidl::encoding::Encoder<'_, D>,
4561            offset: usize,
4562            depth: fidl::encoding::Depth,
4563        ) -> fidl::Result<()> {
4564            encoder.debug_check_bounds::<SetupSetRequest>(offset);
4565            // Zero out padding regions. There's no need to apply masks
4566            // because the unmasked parts will be overwritten by fields.
4567            unsafe {
4568                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4569                (ptr as *mut u64).write_unaligned(0);
4570            }
4571            // Write the fields.
4572            self.0.encode(encoder, offset + 0, depth)?;
4573            self.1.encode(encoder, offset + 16, depth)?;
4574            Ok(())
4575        }
4576    }
4577
4578    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetupSetRequest {
4579        #[inline(always)]
4580        fn new_empty() -> Self {
4581            Self {
4582                settings: fidl::new_empty!(SetupSettings, D),
4583                reboot_device: fidl::new_empty!(bool, D),
4584            }
4585        }
4586
4587        #[inline]
4588        unsafe fn decode(
4589            &mut self,
4590            decoder: &mut fidl::encoding::Decoder<'_, D>,
4591            offset: usize,
4592            _depth: fidl::encoding::Depth,
4593        ) -> fidl::Result<()> {
4594            decoder.debug_check_bounds::<Self>(offset);
4595            // Verify that padding bytes are zero.
4596            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4597            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4598            let mask = 0xffffffffffffff00u64;
4599            let maskedval = padval & mask;
4600            if maskedval != 0 {
4601                return Err(fidl::Error::NonZeroPadding {
4602                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4603                });
4604            }
4605            fidl::decode!(SetupSettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
4606            fidl::decode!(bool, D, &mut self.reboot_device, decoder, offset + 16, _depth)?;
4607            Ok(())
4608        }
4609    }
4610
4611    impl fidl::encoding::ValueTypeMarker for SetupWatchResponse {
4612        type Borrowed<'a> = &'a Self;
4613        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4614            value
4615        }
4616    }
4617
4618    unsafe impl fidl::encoding::TypeMarker for SetupWatchResponse {
4619        type Owned = Self;
4620
4621        #[inline(always)]
4622        fn inline_align(_context: fidl::encoding::Context) -> usize {
4623            8
4624        }
4625
4626        #[inline(always)]
4627        fn inline_size(_context: fidl::encoding::Context) -> usize {
4628            16
4629        }
4630    }
4631
4632    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetupWatchResponse, D>
4633        for &SetupWatchResponse
4634    {
4635        #[inline]
4636        unsafe fn encode(
4637            self,
4638            encoder: &mut fidl::encoding::Encoder<'_, D>,
4639            offset: usize,
4640            _depth: fidl::encoding::Depth,
4641        ) -> fidl::Result<()> {
4642            encoder.debug_check_bounds::<SetupWatchResponse>(offset);
4643            // Delegate to tuple encoding.
4644            fidl::encoding::Encode::<SetupWatchResponse, D>::encode(
4645                (<SetupSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
4646                encoder,
4647                offset,
4648                _depth,
4649            )
4650        }
4651    }
4652    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetupSettings, D>>
4653        fidl::encoding::Encode<SetupWatchResponse, D> for (T0,)
4654    {
4655        #[inline]
4656        unsafe fn encode(
4657            self,
4658            encoder: &mut fidl::encoding::Encoder<'_, D>,
4659            offset: usize,
4660            depth: fidl::encoding::Depth,
4661        ) -> fidl::Result<()> {
4662            encoder.debug_check_bounds::<SetupWatchResponse>(offset);
4663            // Zero out padding regions. There's no need to apply masks
4664            // because the unmasked parts will be overwritten by fields.
4665            // Write the fields.
4666            self.0.encode(encoder, offset + 0, depth)?;
4667            Ok(())
4668        }
4669    }
4670
4671    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetupWatchResponse {
4672        #[inline(always)]
4673        fn new_empty() -> Self {
4674            Self { settings: fidl::new_empty!(SetupSettings, D) }
4675        }
4676
4677        #[inline]
4678        unsafe fn decode(
4679            &mut self,
4680            decoder: &mut fidl::encoding::Decoder<'_, D>,
4681            offset: usize,
4682            _depth: fidl::encoding::Depth,
4683        ) -> fidl::Result<()> {
4684            decoder.debug_check_bounds::<Self>(offset);
4685            // Verify that padding bytes are zero.
4686            fidl::decode!(SetupSettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
4687            Ok(())
4688        }
4689    }
4690
4691    impl AccessibilitySettings {
4692        #[inline(always)]
4693        fn max_ordinal_present(&self) -> u64 {
4694            if let Some(_) = self.captions_settings {
4695                return 6;
4696            }
4697            if let Some(_) = self.color_correction {
4698                return 5;
4699            }
4700            if let Some(_) = self.enable_magnification {
4701                return 4;
4702            }
4703            if let Some(_) = self.color_inversion {
4704                return 3;
4705            }
4706            if let Some(_) = self.screen_reader {
4707                return 2;
4708            }
4709            if let Some(_) = self.audio_description {
4710                return 1;
4711            }
4712            0
4713        }
4714    }
4715
4716    impl fidl::encoding::ValueTypeMarker for AccessibilitySettings {
4717        type Borrowed<'a> = &'a Self;
4718        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4719            value
4720        }
4721    }
4722
4723    unsafe impl fidl::encoding::TypeMarker for AccessibilitySettings {
4724        type Owned = Self;
4725
4726        #[inline(always)]
4727        fn inline_align(_context: fidl::encoding::Context) -> usize {
4728            8
4729        }
4730
4731        #[inline(always)]
4732        fn inline_size(_context: fidl::encoding::Context) -> usize {
4733            16
4734        }
4735    }
4736
4737    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AccessibilitySettings, D>
4738        for &AccessibilitySettings
4739    {
4740        unsafe fn encode(
4741            self,
4742            encoder: &mut fidl::encoding::Encoder<'_, D>,
4743            offset: usize,
4744            mut depth: fidl::encoding::Depth,
4745        ) -> fidl::Result<()> {
4746            encoder.debug_check_bounds::<AccessibilitySettings>(offset);
4747            // Vector header
4748            let max_ordinal: u64 = self.max_ordinal_present();
4749            encoder.write_num(max_ordinal, offset);
4750            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4751            // Calling encoder.out_of_line_offset(0) is not allowed.
4752            if max_ordinal == 0 {
4753                return Ok(());
4754            }
4755            depth.increment()?;
4756            let envelope_size = 8;
4757            let bytes_len = max_ordinal as usize * envelope_size;
4758            #[allow(unused_variables)]
4759            let offset = encoder.out_of_line_offset(bytes_len);
4760            let mut _prev_end_offset: usize = 0;
4761            if 1 > max_ordinal {
4762                return Ok(());
4763            }
4764
4765            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4766            // are envelope_size bytes.
4767            let cur_offset: usize = (1 - 1) * envelope_size;
4768
4769            // Zero reserved fields.
4770            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4771
4772            // Safety:
4773            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4774            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4775            //   envelope_size bytes, there is always sufficient room.
4776            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4777                self.audio_description
4778                    .as_ref()
4779                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4780                encoder,
4781                offset + cur_offset,
4782                depth,
4783            )?;
4784
4785            _prev_end_offset = cur_offset + envelope_size;
4786            if 2 > max_ordinal {
4787                return Ok(());
4788            }
4789
4790            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4791            // are envelope_size bytes.
4792            let cur_offset: usize = (2 - 1) * envelope_size;
4793
4794            // Zero reserved fields.
4795            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4796
4797            // Safety:
4798            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4799            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4800            //   envelope_size bytes, there is always sufficient room.
4801            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4802                self.screen_reader.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4803                encoder,
4804                offset + cur_offset,
4805                depth,
4806            )?;
4807
4808            _prev_end_offset = cur_offset + envelope_size;
4809            if 3 > max_ordinal {
4810                return Ok(());
4811            }
4812
4813            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4814            // are envelope_size bytes.
4815            let cur_offset: usize = (3 - 1) * envelope_size;
4816
4817            // Zero reserved fields.
4818            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4819
4820            // Safety:
4821            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4822            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4823            //   envelope_size bytes, there is always sufficient room.
4824            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4825                self.color_inversion
4826                    .as_ref()
4827                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4828                encoder,
4829                offset + cur_offset,
4830                depth,
4831            )?;
4832
4833            _prev_end_offset = cur_offset + envelope_size;
4834            if 4 > max_ordinal {
4835                return Ok(());
4836            }
4837
4838            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4839            // are envelope_size bytes.
4840            let cur_offset: usize = (4 - 1) * envelope_size;
4841
4842            // Zero reserved fields.
4843            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4844
4845            // Safety:
4846            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4847            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4848            //   envelope_size bytes, there is always sufficient room.
4849            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4850                self.enable_magnification
4851                    .as_ref()
4852                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4853                encoder,
4854                offset + cur_offset,
4855                depth,
4856            )?;
4857
4858            _prev_end_offset = cur_offset + envelope_size;
4859            if 5 > max_ordinal {
4860                return Ok(());
4861            }
4862
4863            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4864            // are envelope_size bytes.
4865            let cur_offset: usize = (5 - 1) * envelope_size;
4866
4867            // Zero reserved fields.
4868            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4869
4870            // Safety:
4871            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4872            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4873            //   envelope_size bytes, there is always sufficient room.
4874            fidl::encoding::encode_in_envelope_optional::<ColorBlindnessType, D>(
4875                self.color_correction
4876                    .as_ref()
4877                    .map(<ColorBlindnessType as fidl::encoding::ValueTypeMarker>::borrow),
4878                encoder,
4879                offset + cur_offset,
4880                depth,
4881            )?;
4882
4883            _prev_end_offset = cur_offset + envelope_size;
4884            if 6 > max_ordinal {
4885                return Ok(());
4886            }
4887
4888            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4889            // are envelope_size bytes.
4890            let cur_offset: usize = (6 - 1) * envelope_size;
4891
4892            // Zero reserved fields.
4893            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4894
4895            // Safety:
4896            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4897            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4898            //   envelope_size bytes, there is always sufficient room.
4899            fidl::encoding::encode_in_envelope_optional::<CaptionsSettings, D>(
4900                self.captions_settings
4901                    .as_ref()
4902                    .map(<CaptionsSettings as fidl::encoding::ValueTypeMarker>::borrow),
4903                encoder,
4904                offset + cur_offset,
4905                depth,
4906            )?;
4907
4908            _prev_end_offset = cur_offset + envelope_size;
4909
4910            Ok(())
4911        }
4912    }
4913
4914    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AccessibilitySettings {
4915        #[inline(always)]
4916        fn new_empty() -> Self {
4917            Self::default()
4918        }
4919
4920        unsafe fn decode(
4921            &mut self,
4922            decoder: &mut fidl::encoding::Decoder<'_, D>,
4923            offset: usize,
4924            mut depth: fidl::encoding::Depth,
4925        ) -> fidl::Result<()> {
4926            decoder.debug_check_bounds::<Self>(offset);
4927            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4928                None => return Err(fidl::Error::NotNullable),
4929                Some(len) => len,
4930            };
4931            // Calling decoder.out_of_line_offset(0) is not allowed.
4932            if len == 0 {
4933                return Ok(());
4934            };
4935            depth.increment()?;
4936            let envelope_size = 8;
4937            let bytes_len = len * envelope_size;
4938            let offset = decoder.out_of_line_offset(bytes_len)?;
4939            // Decode the envelope for each type.
4940            let mut _next_ordinal_to_read = 0;
4941            let mut next_offset = offset;
4942            let end_offset = offset + bytes_len;
4943            _next_ordinal_to_read += 1;
4944            if next_offset >= end_offset {
4945                return Ok(());
4946            }
4947
4948            // Decode unknown envelopes for gaps in ordinals.
4949            while _next_ordinal_to_read < 1 {
4950                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4951                _next_ordinal_to_read += 1;
4952                next_offset += envelope_size;
4953            }
4954
4955            let next_out_of_line = decoder.next_out_of_line();
4956            let handles_before = decoder.remaining_handles();
4957            if let Some((inlined, num_bytes, num_handles)) =
4958                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4959            {
4960                let member_inline_size =
4961                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4962                if inlined != (member_inline_size <= 4) {
4963                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4964                }
4965                let inner_offset;
4966                let mut inner_depth = depth.clone();
4967                if inlined {
4968                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4969                    inner_offset = next_offset;
4970                } else {
4971                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4972                    inner_depth.increment()?;
4973                }
4974                let val_ref =
4975                    self.audio_description.get_or_insert_with(|| fidl::new_empty!(bool, D));
4976                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4977                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4978                {
4979                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4980                }
4981                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4982                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4983                }
4984            }
4985
4986            next_offset += envelope_size;
4987            _next_ordinal_to_read += 1;
4988            if next_offset >= end_offset {
4989                return Ok(());
4990            }
4991
4992            // Decode unknown envelopes for gaps in ordinals.
4993            while _next_ordinal_to_read < 2 {
4994                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4995                _next_ordinal_to_read += 1;
4996                next_offset += envelope_size;
4997            }
4998
4999            let next_out_of_line = decoder.next_out_of_line();
5000            let handles_before = decoder.remaining_handles();
5001            if let Some((inlined, num_bytes, num_handles)) =
5002                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5003            {
5004                let member_inline_size =
5005                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5006                if inlined != (member_inline_size <= 4) {
5007                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5008                }
5009                let inner_offset;
5010                let mut inner_depth = depth.clone();
5011                if inlined {
5012                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5013                    inner_offset = next_offset;
5014                } else {
5015                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5016                    inner_depth.increment()?;
5017                }
5018                let val_ref = self.screen_reader.get_or_insert_with(|| fidl::new_empty!(bool, D));
5019                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5020                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5021                {
5022                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5023                }
5024                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5025                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5026                }
5027            }
5028
5029            next_offset += envelope_size;
5030            _next_ordinal_to_read += 1;
5031            if next_offset >= end_offset {
5032                return Ok(());
5033            }
5034
5035            // Decode unknown envelopes for gaps in ordinals.
5036            while _next_ordinal_to_read < 3 {
5037                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5038                _next_ordinal_to_read += 1;
5039                next_offset += envelope_size;
5040            }
5041
5042            let next_out_of_line = decoder.next_out_of_line();
5043            let handles_before = decoder.remaining_handles();
5044            if let Some((inlined, num_bytes, num_handles)) =
5045                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5046            {
5047                let member_inline_size =
5048                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5049                if inlined != (member_inline_size <= 4) {
5050                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5051                }
5052                let inner_offset;
5053                let mut inner_depth = depth.clone();
5054                if inlined {
5055                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5056                    inner_offset = next_offset;
5057                } else {
5058                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5059                    inner_depth.increment()?;
5060                }
5061                let val_ref = self.color_inversion.get_or_insert_with(|| fidl::new_empty!(bool, D));
5062                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5063                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5064                {
5065                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5066                }
5067                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5068                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5069                }
5070            }
5071
5072            next_offset += envelope_size;
5073            _next_ordinal_to_read += 1;
5074            if next_offset >= end_offset {
5075                return Ok(());
5076            }
5077
5078            // Decode unknown envelopes for gaps in ordinals.
5079            while _next_ordinal_to_read < 4 {
5080                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5081                _next_ordinal_to_read += 1;
5082                next_offset += envelope_size;
5083            }
5084
5085            let next_out_of_line = decoder.next_out_of_line();
5086            let handles_before = decoder.remaining_handles();
5087            if let Some((inlined, num_bytes, num_handles)) =
5088                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5089            {
5090                let member_inline_size =
5091                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5092                if inlined != (member_inline_size <= 4) {
5093                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5094                }
5095                let inner_offset;
5096                let mut inner_depth = depth.clone();
5097                if inlined {
5098                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5099                    inner_offset = next_offset;
5100                } else {
5101                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5102                    inner_depth.increment()?;
5103                }
5104                let val_ref =
5105                    self.enable_magnification.get_or_insert_with(|| fidl::new_empty!(bool, D));
5106                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5107                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5108                {
5109                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5110                }
5111                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5112                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5113                }
5114            }
5115
5116            next_offset += envelope_size;
5117            _next_ordinal_to_read += 1;
5118            if next_offset >= end_offset {
5119                return Ok(());
5120            }
5121
5122            // Decode unknown envelopes for gaps in ordinals.
5123            while _next_ordinal_to_read < 5 {
5124                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5125                _next_ordinal_to_read += 1;
5126                next_offset += envelope_size;
5127            }
5128
5129            let next_out_of_line = decoder.next_out_of_line();
5130            let handles_before = decoder.remaining_handles();
5131            if let Some((inlined, num_bytes, num_handles)) =
5132                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5133            {
5134                let member_inline_size =
5135                    <ColorBlindnessType as fidl::encoding::TypeMarker>::inline_size(
5136                        decoder.context,
5137                    );
5138                if inlined != (member_inline_size <= 4) {
5139                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5140                }
5141                let inner_offset;
5142                let mut inner_depth = depth.clone();
5143                if inlined {
5144                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5145                    inner_offset = next_offset;
5146                } else {
5147                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5148                    inner_depth.increment()?;
5149                }
5150                let val_ref = self
5151                    .color_correction
5152                    .get_or_insert_with(|| fidl::new_empty!(ColorBlindnessType, D));
5153                fidl::decode!(ColorBlindnessType, D, val_ref, decoder, inner_offset, inner_depth)?;
5154                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5155                {
5156                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5157                }
5158                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5159                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5160                }
5161            }
5162
5163            next_offset += envelope_size;
5164            _next_ordinal_to_read += 1;
5165            if next_offset >= end_offset {
5166                return Ok(());
5167            }
5168
5169            // Decode unknown envelopes for gaps in ordinals.
5170            while _next_ordinal_to_read < 6 {
5171                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5172                _next_ordinal_to_read += 1;
5173                next_offset += envelope_size;
5174            }
5175
5176            let next_out_of_line = decoder.next_out_of_line();
5177            let handles_before = decoder.remaining_handles();
5178            if let Some((inlined, num_bytes, num_handles)) =
5179                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5180            {
5181                let member_inline_size =
5182                    <CaptionsSettings as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5183                if inlined != (member_inline_size <= 4) {
5184                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5185                }
5186                let inner_offset;
5187                let mut inner_depth = depth.clone();
5188                if inlined {
5189                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5190                    inner_offset = next_offset;
5191                } else {
5192                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5193                    inner_depth.increment()?;
5194                }
5195                let val_ref = self
5196                    .captions_settings
5197                    .get_or_insert_with(|| fidl::new_empty!(CaptionsSettings, D));
5198                fidl::decode!(CaptionsSettings, D, val_ref, decoder, inner_offset, inner_depth)?;
5199                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5200                {
5201                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5202                }
5203                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5204                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5205                }
5206            }
5207
5208            next_offset += envelope_size;
5209
5210            // Decode the remaining unknown envelopes.
5211            while next_offset < end_offset {
5212                _next_ordinal_to_read += 1;
5213                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5214                next_offset += envelope_size;
5215            }
5216
5217            Ok(())
5218        }
5219    }
5220
5221    impl AudioSettings {
5222        #[inline(always)]
5223        fn max_ordinal_present(&self) -> u64 {
5224            if let Some(_) = self.streams {
5225                return 1;
5226            }
5227            0
5228        }
5229    }
5230
5231    impl fidl::encoding::ValueTypeMarker for AudioSettings {
5232        type Borrowed<'a> = &'a Self;
5233        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5234            value
5235        }
5236    }
5237
5238    unsafe impl fidl::encoding::TypeMarker for AudioSettings {
5239        type Owned = Self;
5240
5241        #[inline(always)]
5242        fn inline_align(_context: fidl::encoding::Context) -> usize {
5243            8
5244        }
5245
5246        #[inline(always)]
5247        fn inline_size(_context: fidl::encoding::Context) -> usize {
5248            16
5249        }
5250    }
5251
5252    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioSettings, D>
5253        for &AudioSettings
5254    {
5255        unsafe fn encode(
5256            self,
5257            encoder: &mut fidl::encoding::Encoder<'_, D>,
5258            offset: usize,
5259            mut depth: fidl::encoding::Depth,
5260        ) -> fidl::Result<()> {
5261            encoder.debug_check_bounds::<AudioSettings>(offset);
5262            // Vector header
5263            let max_ordinal: u64 = self.max_ordinal_present();
5264            encoder.write_num(max_ordinal, offset);
5265            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5266            // Calling encoder.out_of_line_offset(0) is not allowed.
5267            if max_ordinal == 0 {
5268                return Ok(());
5269            }
5270            depth.increment()?;
5271            let envelope_size = 8;
5272            let bytes_len = max_ordinal as usize * envelope_size;
5273            #[allow(unused_variables)]
5274            let offset = encoder.out_of_line_offset(bytes_len);
5275            let mut _prev_end_offset: usize = 0;
5276            if 1 > max_ordinal {
5277                return Ok(());
5278            }
5279
5280            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5281            // are envelope_size bytes.
5282            let cur_offset: usize = (1 - 1) * envelope_size;
5283
5284            // Zero reserved fields.
5285            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5286
5287            // Safety:
5288            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5289            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5290            //   envelope_size bytes, there is always sufficient room.
5291            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<AudioStreamSettings, 5>, D>(
5292            self.streams.as_ref().map(<fidl::encoding::Vector<AudioStreamSettings, 5> as fidl::encoding::ValueTypeMarker>::borrow),
5293            encoder, offset + cur_offset, depth
5294        )?;
5295
5296            _prev_end_offset = cur_offset + envelope_size;
5297
5298            Ok(())
5299        }
5300    }
5301
5302    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioSettings {
5303        #[inline(always)]
5304        fn new_empty() -> Self {
5305            Self::default()
5306        }
5307
5308        unsafe fn decode(
5309            &mut self,
5310            decoder: &mut fidl::encoding::Decoder<'_, D>,
5311            offset: usize,
5312            mut depth: fidl::encoding::Depth,
5313        ) -> fidl::Result<()> {
5314            decoder.debug_check_bounds::<Self>(offset);
5315            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5316                None => return Err(fidl::Error::NotNullable),
5317                Some(len) => len,
5318            };
5319            // Calling decoder.out_of_line_offset(0) is not allowed.
5320            if len == 0 {
5321                return Ok(());
5322            };
5323            depth.increment()?;
5324            let envelope_size = 8;
5325            let bytes_len = len * envelope_size;
5326            let offset = decoder.out_of_line_offset(bytes_len)?;
5327            // Decode the envelope for each type.
5328            let mut _next_ordinal_to_read = 0;
5329            let mut next_offset = offset;
5330            let end_offset = offset + bytes_len;
5331            _next_ordinal_to_read += 1;
5332            if next_offset >= end_offset {
5333                return Ok(());
5334            }
5335
5336            // Decode unknown envelopes for gaps in ordinals.
5337            while _next_ordinal_to_read < 1 {
5338                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5339                _next_ordinal_to_read += 1;
5340                next_offset += envelope_size;
5341            }
5342
5343            let next_out_of_line = decoder.next_out_of_line();
5344            let handles_before = decoder.remaining_handles();
5345            if let Some((inlined, num_bytes, num_handles)) =
5346                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5347            {
5348                let member_inline_size = <fidl::encoding::Vector<AudioStreamSettings, 5> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5349                if inlined != (member_inline_size <= 4) {
5350                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5351                }
5352                let inner_offset;
5353                let mut inner_depth = depth.clone();
5354                if inlined {
5355                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5356                    inner_offset = next_offset;
5357                } else {
5358                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5359                    inner_depth.increment()?;
5360                }
5361                let val_ref = self.streams.get_or_insert_with(
5362                    || fidl::new_empty!(fidl::encoding::Vector<AudioStreamSettings, 5>, D),
5363                );
5364                fidl::decode!(fidl::encoding::Vector<AudioStreamSettings, 5>, D, val_ref, decoder, inner_offset, inner_depth)?;
5365                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5366                {
5367                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5368                }
5369                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5370                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5371                }
5372            }
5373
5374            next_offset += envelope_size;
5375
5376            // Decode the remaining unknown envelopes.
5377            while next_offset < end_offset {
5378                _next_ordinal_to_read += 1;
5379                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5380                next_offset += envelope_size;
5381            }
5382
5383            Ok(())
5384        }
5385    }
5386
5387    impl AudioSettings2 {
5388        #[inline(always)]
5389        fn max_ordinal_present(&self) -> u64 {
5390            if let Some(_) = self.streams {
5391                return 1;
5392            }
5393            0
5394        }
5395    }
5396
5397    impl fidl::encoding::ValueTypeMarker for AudioSettings2 {
5398        type Borrowed<'a> = &'a Self;
5399        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5400            value
5401        }
5402    }
5403
5404    unsafe impl fidl::encoding::TypeMarker for AudioSettings2 {
5405        type Owned = Self;
5406
5407        #[inline(always)]
5408        fn inline_align(_context: fidl::encoding::Context) -> usize {
5409            8
5410        }
5411
5412        #[inline(always)]
5413        fn inline_size(_context: fidl::encoding::Context) -> usize {
5414            16
5415        }
5416    }
5417
5418    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioSettings2, D>
5419        for &AudioSettings2
5420    {
5421        unsafe fn encode(
5422            self,
5423            encoder: &mut fidl::encoding::Encoder<'_, D>,
5424            offset: usize,
5425            mut depth: fidl::encoding::Depth,
5426        ) -> fidl::Result<()> {
5427            encoder.debug_check_bounds::<AudioSettings2>(offset);
5428            // Vector header
5429            let max_ordinal: u64 = self.max_ordinal_present();
5430            encoder.write_num(max_ordinal, offset);
5431            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5432            // Calling encoder.out_of_line_offset(0) is not allowed.
5433            if max_ordinal == 0 {
5434                return Ok(());
5435            }
5436            depth.increment()?;
5437            let envelope_size = 8;
5438            let bytes_len = max_ordinal as usize * envelope_size;
5439            #[allow(unused_variables)]
5440            let offset = encoder.out_of_line_offset(bytes_len);
5441            let mut _prev_end_offset: usize = 0;
5442            if 1 > max_ordinal {
5443                return Ok(());
5444            }
5445
5446            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5447            // are envelope_size bytes.
5448            let cur_offset: usize = (1 - 1) * envelope_size;
5449
5450            // Zero reserved fields.
5451            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5452
5453            // Safety:
5454            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5455            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5456            //   envelope_size bytes, there is always sufficient room.
5457            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<AudioStreamSettings2, 8>, D>(
5458            self.streams.as_ref().map(<fidl::encoding::Vector<AudioStreamSettings2, 8> as fidl::encoding::ValueTypeMarker>::borrow),
5459            encoder, offset + cur_offset, depth
5460        )?;
5461
5462            _prev_end_offset = cur_offset + envelope_size;
5463
5464            Ok(())
5465        }
5466    }
5467
5468    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioSettings2 {
5469        #[inline(always)]
5470        fn new_empty() -> Self {
5471            Self::default()
5472        }
5473
5474        unsafe fn decode(
5475            &mut self,
5476            decoder: &mut fidl::encoding::Decoder<'_, D>,
5477            offset: usize,
5478            mut depth: fidl::encoding::Depth,
5479        ) -> fidl::Result<()> {
5480            decoder.debug_check_bounds::<Self>(offset);
5481            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5482                None => return Err(fidl::Error::NotNullable),
5483                Some(len) => len,
5484            };
5485            // Calling decoder.out_of_line_offset(0) is not allowed.
5486            if len == 0 {
5487                return Ok(());
5488            };
5489            depth.increment()?;
5490            let envelope_size = 8;
5491            let bytes_len = len * envelope_size;
5492            let offset = decoder.out_of_line_offset(bytes_len)?;
5493            // Decode the envelope for each type.
5494            let mut _next_ordinal_to_read = 0;
5495            let mut next_offset = offset;
5496            let end_offset = offset + bytes_len;
5497            _next_ordinal_to_read += 1;
5498            if next_offset >= end_offset {
5499                return Ok(());
5500            }
5501
5502            // Decode unknown envelopes for gaps in ordinals.
5503            while _next_ordinal_to_read < 1 {
5504                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5505                _next_ordinal_to_read += 1;
5506                next_offset += envelope_size;
5507            }
5508
5509            let next_out_of_line = decoder.next_out_of_line();
5510            let handles_before = decoder.remaining_handles();
5511            if let Some((inlined, num_bytes, num_handles)) =
5512                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5513            {
5514                let member_inline_size = <fidl::encoding::Vector<AudioStreamSettings2, 8> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5515                if inlined != (member_inline_size <= 4) {
5516                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5517                }
5518                let inner_offset;
5519                let mut inner_depth = depth.clone();
5520                if inlined {
5521                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5522                    inner_offset = next_offset;
5523                } else {
5524                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5525                    inner_depth.increment()?;
5526                }
5527                let val_ref = self.streams.get_or_insert_with(
5528                    || fidl::new_empty!(fidl::encoding::Vector<AudioStreamSettings2, 8>, D),
5529                );
5530                fidl::decode!(fidl::encoding::Vector<AudioStreamSettings2, 8>, D, val_ref, decoder, inner_offset, inner_depth)?;
5531                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5532                {
5533                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5534                }
5535                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5536                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5537                }
5538            }
5539
5540            next_offset += envelope_size;
5541
5542            // Decode the remaining unknown envelopes.
5543            while next_offset < end_offset {
5544                _next_ordinal_to_read += 1;
5545                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5546                next_offset += envelope_size;
5547            }
5548
5549            Ok(())
5550        }
5551    }
5552
5553    impl AudioStreamSettings {
5554        #[inline(always)]
5555        fn max_ordinal_present(&self) -> u64 {
5556            if let Some(_) = self.user_volume {
5557                return 3;
5558            }
5559            if let Some(_) = self.source {
5560                return 2;
5561            }
5562            if let Some(_) = self.stream {
5563                return 1;
5564            }
5565            0
5566        }
5567    }
5568
5569    impl fidl::encoding::ValueTypeMarker for AudioStreamSettings {
5570        type Borrowed<'a> = &'a Self;
5571        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5572            value
5573        }
5574    }
5575
5576    unsafe impl fidl::encoding::TypeMarker for AudioStreamSettings {
5577        type Owned = Self;
5578
5579        #[inline(always)]
5580        fn inline_align(_context: fidl::encoding::Context) -> usize {
5581            8
5582        }
5583
5584        #[inline(always)]
5585        fn inline_size(_context: fidl::encoding::Context) -> usize {
5586            16
5587        }
5588    }
5589
5590    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioStreamSettings, D>
5591        for &AudioStreamSettings
5592    {
5593        unsafe fn encode(
5594            self,
5595            encoder: &mut fidl::encoding::Encoder<'_, D>,
5596            offset: usize,
5597            mut depth: fidl::encoding::Depth,
5598        ) -> fidl::Result<()> {
5599            encoder.debug_check_bounds::<AudioStreamSettings>(offset);
5600            // Vector header
5601            let max_ordinal: u64 = self.max_ordinal_present();
5602            encoder.write_num(max_ordinal, offset);
5603            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5604            // Calling encoder.out_of_line_offset(0) is not allowed.
5605            if max_ordinal == 0 {
5606                return Ok(());
5607            }
5608            depth.increment()?;
5609            let envelope_size = 8;
5610            let bytes_len = max_ordinal as usize * envelope_size;
5611            #[allow(unused_variables)]
5612            let offset = encoder.out_of_line_offset(bytes_len);
5613            let mut _prev_end_offset: usize = 0;
5614            if 1 > max_ordinal {
5615                return Ok(());
5616            }
5617
5618            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5619            // are envelope_size bytes.
5620            let cur_offset: usize = (1 - 1) * envelope_size;
5621
5622            // Zero reserved fields.
5623            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5624
5625            // Safety:
5626            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5627            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5628            //   envelope_size bytes, there is always sufficient room.
5629            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_media__common::AudioRenderUsage, D>(
5630            self.stream.as_ref().map(<fidl_fuchsia_media__common::AudioRenderUsage as fidl::encoding::ValueTypeMarker>::borrow),
5631            encoder, offset + cur_offset, depth
5632        )?;
5633
5634            _prev_end_offset = cur_offset + envelope_size;
5635            if 2 > max_ordinal {
5636                return Ok(());
5637            }
5638
5639            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5640            // are envelope_size bytes.
5641            let cur_offset: usize = (2 - 1) * envelope_size;
5642
5643            // Zero reserved fields.
5644            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5645
5646            // Safety:
5647            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5648            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5649            //   envelope_size bytes, there is always sufficient room.
5650            fidl::encoding::encode_in_envelope_optional::<AudioStreamSettingSource, D>(
5651                self.source
5652                    .as_ref()
5653                    .map(<AudioStreamSettingSource as fidl::encoding::ValueTypeMarker>::borrow),
5654                encoder,
5655                offset + cur_offset,
5656                depth,
5657            )?;
5658
5659            _prev_end_offset = cur_offset + envelope_size;
5660            if 3 > max_ordinal {
5661                return Ok(());
5662            }
5663
5664            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5665            // are envelope_size bytes.
5666            let cur_offset: usize = (3 - 1) * envelope_size;
5667
5668            // Zero reserved fields.
5669            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5670
5671            // Safety:
5672            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5673            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5674            //   envelope_size bytes, there is always sufficient room.
5675            fidl::encoding::encode_in_envelope_optional::<Volume, D>(
5676                self.user_volume.as_ref().map(<Volume as fidl::encoding::ValueTypeMarker>::borrow),
5677                encoder,
5678                offset + cur_offset,
5679                depth,
5680            )?;
5681
5682            _prev_end_offset = cur_offset + envelope_size;
5683
5684            Ok(())
5685        }
5686    }
5687
5688    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioStreamSettings {
5689        #[inline(always)]
5690        fn new_empty() -> Self {
5691            Self::default()
5692        }
5693
5694        unsafe fn decode(
5695            &mut self,
5696            decoder: &mut fidl::encoding::Decoder<'_, D>,
5697            offset: usize,
5698            mut depth: fidl::encoding::Depth,
5699        ) -> fidl::Result<()> {
5700            decoder.debug_check_bounds::<Self>(offset);
5701            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5702                None => return Err(fidl::Error::NotNullable),
5703                Some(len) => len,
5704            };
5705            // Calling decoder.out_of_line_offset(0) is not allowed.
5706            if len == 0 {
5707                return Ok(());
5708            };
5709            depth.increment()?;
5710            let envelope_size = 8;
5711            let bytes_len = len * envelope_size;
5712            let offset = decoder.out_of_line_offset(bytes_len)?;
5713            // Decode the envelope for each type.
5714            let mut _next_ordinal_to_read = 0;
5715            let mut next_offset = offset;
5716            let end_offset = offset + bytes_len;
5717            _next_ordinal_to_read += 1;
5718            if next_offset >= end_offset {
5719                return Ok(());
5720            }
5721
5722            // Decode unknown envelopes for gaps in ordinals.
5723            while _next_ordinal_to_read < 1 {
5724                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5725                _next_ordinal_to_read += 1;
5726                next_offset += envelope_size;
5727            }
5728
5729            let next_out_of_line = decoder.next_out_of_line();
5730            let handles_before = decoder.remaining_handles();
5731            if let Some((inlined, num_bytes, num_handles)) =
5732                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5733            {
5734                let member_inline_size = <fidl_fuchsia_media__common::AudioRenderUsage as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5735                if inlined != (member_inline_size <= 4) {
5736                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5737                }
5738                let inner_offset;
5739                let mut inner_depth = depth.clone();
5740                if inlined {
5741                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5742                    inner_offset = next_offset;
5743                } else {
5744                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5745                    inner_depth.increment()?;
5746                }
5747                let val_ref = self.stream.get_or_insert_with(|| {
5748                    fidl::new_empty!(fidl_fuchsia_media__common::AudioRenderUsage, D)
5749                });
5750                fidl::decode!(
5751                    fidl_fuchsia_media__common::AudioRenderUsage,
5752                    D,
5753                    val_ref,
5754                    decoder,
5755                    inner_offset,
5756                    inner_depth
5757                )?;
5758                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5759                {
5760                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5761                }
5762                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5763                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5764                }
5765            }
5766
5767            next_offset += envelope_size;
5768            _next_ordinal_to_read += 1;
5769            if next_offset >= end_offset {
5770                return Ok(());
5771            }
5772
5773            // Decode unknown envelopes for gaps in ordinals.
5774            while _next_ordinal_to_read < 2 {
5775                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5776                _next_ordinal_to_read += 1;
5777                next_offset += envelope_size;
5778            }
5779
5780            let next_out_of_line = decoder.next_out_of_line();
5781            let handles_before = decoder.remaining_handles();
5782            if let Some((inlined, num_bytes, num_handles)) =
5783                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5784            {
5785                let member_inline_size =
5786                    <AudioStreamSettingSource as fidl::encoding::TypeMarker>::inline_size(
5787                        decoder.context,
5788                    );
5789                if inlined != (member_inline_size <= 4) {
5790                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5791                }
5792                let inner_offset;
5793                let mut inner_depth = depth.clone();
5794                if inlined {
5795                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5796                    inner_offset = next_offset;
5797                } else {
5798                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5799                    inner_depth.increment()?;
5800                }
5801                let val_ref = self
5802                    .source
5803                    .get_or_insert_with(|| fidl::new_empty!(AudioStreamSettingSource, D));
5804                fidl::decode!(
5805                    AudioStreamSettingSource,
5806                    D,
5807                    val_ref,
5808                    decoder,
5809                    inner_offset,
5810                    inner_depth
5811                )?;
5812                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5813                {
5814                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5815                }
5816                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5817                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5818                }
5819            }
5820
5821            next_offset += envelope_size;
5822            _next_ordinal_to_read += 1;
5823            if next_offset >= end_offset {
5824                return Ok(());
5825            }
5826
5827            // Decode unknown envelopes for gaps in ordinals.
5828            while _next_ordinal_to_read < 3 {
5829                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5830                _next_ordinal_to_read += 1;
5831                next_offset += envelope_size;
5832            }
5833
5834            let next_out_of_line = decoder.next_out_of_line();
5835            let handles_before = decoder.remaining_handles();
5836            if let Some((inlined, num_bytes, num_handles)) =
5837                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5838            {
5839                let member_inline_size =
5840                    <Volume as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5841                if inlined != (member_inline_size <= 4) {
5842                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5843                }
5844                let inner_offset;
5845                let mut inner_depth = depth.clone();
5846                if inlined {
5847                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5848                    inner_offset = next_offset;
5849                } else {
5850                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5851                    inner_depth.increment()?;
5852                }
5853                let val_ref = self.user_volume.get_or_insert_with(|| fidl::new_empty!(Volume, D));
5854                fidl::decode!(Volume, D, val_ref, decoder, inner_offset, inner_depth)?;
5855                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5856                {
5857                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5858                }
5859                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5860                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5861                }
5862            }
5863
5864            next_offset += envelope_size;
5865
5866            // Decode the remaining unknown envelopes.
5867            while next_offset < end_offset {
5868                _next_ordinal_to_read += 1;
5869                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5870                next_offset += envelope_size;
5871            }
5872
5873            Ok(())
5874        }
5875    }
5876
5877    impl AudioStreamSettings2 {
5878        #[inline(always)]
5879        fn max_ordinal_present(&self) -> u64 {
5880            if let Some(_) = self.user_volume {
5881                return 3;
5882            }
5883            if let Some(_) = self.source {
5884                return 2;
5885            }
5886            if let Some(_) = self.stream {
5887                return 1;
5888            }
5889            0
5890        }
5891    }
5892
5893    impl fidl::encoding::ValueTypeMarker for AudioStreamSettings2 {
5894        type Borrowed<'a> = &'a Self;
5895        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5896            value
5897        }
5898    }
5899
5900    unsafe impl fidl::encoding::TypeMarker for AudioStreamSettings2 {
5901        type Owned = Self;
5902
5903        #[inline(always)]
5904        fn inline_align(_context: fidl::encoding::Context) -> usize {
5905            8
5906        }
5907
5908        #[inline(always)]
5909        fn inline_size(_context: fidl::encoding::Context) -> usize {
5910            16
5911        }
5912    }
5913
5914    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioStreamSettings2, D>
5915        for &AudioStreamSettings2
5916    {
5917        unsafe fn encode(
5918            self,
5919            encoder: &mut fidl::encoding::Encoder<'_, D>,
5920            offset: usize,
5921            mut depth: fidl::encoding::Depth,
5922        ) -> fidl::Result<()> {
5923            encoder.debug_check_bounds::<AudioStreamSettings2>(offset);
5924            // Vector header
5925            let max_ordinal: u64 = self.max_ordinal_present();
5926            encoder.write_num(max_ordinal, offset);
5927            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5928            // Calling encoder.out_of_line_offset(0) is not allowed.
5929            if max_ordinal == 0 {
5930                return Ok(());
5931            }
5932            depth.increment()?;
5933            let envelope_size = 8;
5934            let bytes_len = max_ordinal as usize * envelope_size;
5935            #[allow(unused_variables)]
5936            let offset = encoder.out_of_line_offset(bytes_len);
5937            let mut _prev_end_offset: usize = 0;
5938            if 1 > max_ordinal {
5939                return Ok(());
5940            }
5941
5942            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5943            // are envelope_size bytes.
5944            let cur_offset: usize = (1 - 1) * envelope_size;
5945
5946            // Zero reserved fields.
5947            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5948
5949            // Safety:
5950            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5951            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5952            //   envelope_size bytes, there is always sufficient room.
5953            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_media__common::AudioRenderUsage2, D>(
5954            self.stream.as_ref().map(<fidl_fuchsia_media__common::AudioRenderUsage2 as fidl::encoding::ValueTypeMarker>::borrow),
5955            encoder, offset + cur_offset, depth
5956        )?;
5957
5958            _prev_end_offset = cur_offset + envelope_size;
5959            if 2 > max_ordinal {
5960                return Ok(());
5961            }
5962
5963            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5964            // are envelope_size bytes.
5965            let cur_offset: usize = (2 - 1) * envelope_size;
5966
5967            // Zero reserved fields.
5968            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5969
5970            // Safety:
5971            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5972            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5973            //   envelope_size bytes, there is always sufficient room.
5974            fidl::encoding::encode_in_envelope_optional::<AudioStreamSettingSource, D>(
5975                self.source
5976                    .as_ref()
5977                    .map(<AudioStreamSettingSource as fidl::encoding::ValueTypeMarker>::borrow),
5978                encoder,
5979                offset + cur_offset,
5980                depth,
5981            )?;
5982
5983            _prev_end_offset = cur_offset + envelope_size;
5984            if 3 > max_ordinal {
5985                return Ok(());
5986            }
5987
5988            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5989            // are envelope_size bytes.
5990            let cur_offset: usize = (3 - 1) * envelope_size;
5991
5992            // Zero reserved fields.
5993            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5994
5995            // Safety:
5996            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5997            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5998            //   envelope_size bytes, there is always sufficient room.
5999            fidl::encoding::encode_in_envelope_optional::<Volume, D>(
6000                self.user_volume.as_ref().map(<Volume as fidl::encoding::ValueTypeMarker>::borrow),
6001                encoder,
6002                offset + cur_offset,
6003                depth,
6004            )?;
6005
6006            _prev_end_offset = cur_offset + envelope_size;
6007
6008            Ok(())
6009        }
6010    }
6011
6012    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioStreamSettings2 {
6013        #[inline(always)]
6014        fn new_empty() -> Self {
6015            Self::default()
6016        }
6017
6018        unsafe fn decode(
6019            &mut self,
6020            decoder: &mut fidl::encoding::Decoder<'_, D>,
6021            offset: usize,
6022            mut depth: fidl::encoding::Depth,
6023        ) -> fidl::Result<()> {
6024            decoder.debug_check_bounds::<Self>(offset);
6025            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6026                None => return Err(fidl::Error::NotNullable),
6027                Some(len) => len,
6028            };
6029            // Calling decoder.out_of_line_offset(0) is not allowed.
6030            if len == 0 {
6031                return Ok(());
6032            };
6033            depth.increment()?;
6034            let envelope_size = 8;
6035            let bytes_len = len * envelope_size;
6036            let offset = decoder.out_of_line_offset(bytes_len)?;
6037            // Decode the envelope for each type.
6038            let mut _next_ordinal_to_read = 0;
6039            let mut next_offset = offset;
6040            let end_offset = offset + bytes_len;
6041            _next_ordinal_to_read += 1;
6042            if next_offset >= end_offset {
6043                return Ok(());
6044            }
6045
6046            // Decode unknown envelopes for gaps in ordinals.
6047            while _next_ordinal_to_read < 1 {
6048                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6049                _next_ordinal_to_read += 1;
6050                next_offset += envelope_size;
6051            }
6052
6053            let next_out_of_line = decoder.next_out_of_line();
6054            let handles_before = decoder.remaining_handles();
6055            if let Some((inlined, num_bytes, num_handles)) =
6056                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6057            {
6058                let member_inline_size = <fidl_fuchsia_media__common::AudioRenderUsage2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6059                if inlined != (member_inline_size <= 4) {
6060                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6061                }
6062                let inner_offset;
6063                let mut inner_depth = depth.clone();
6064                if inlined {
6065                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6066                    inner_offset = next_offset;
6067                } else {
6068                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6069                    inner_depth.increment()?;
6070                }
6071                let val_ref = self.stream.get_or_insert_with(|| {
6072                    fidl::new_empty!(fidl_fuchsia_media__common::AudioRenderUsage2, D)
6073                });
6074                fidl::decode!(
6075                    fidl_fuchsia_media__common::AudioRenderUsage2,
6076                    D,
6077                    val_ref,
6078                    decoder,
6079                    inner_offset,
6080                    inner_depth
6081                )?;
6082                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6083                {
6084                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6085                }
6086                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6087                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6088                }
6089            }
6090
6091            next_offset += envelope_size;
6092            _next_ordinal_to_read += 1;
6093            if next_offset >= end_offset {
6094                return Ok(());
6095            }
6096
6097            // Decode unknown envelopes for gaps in ordinals.
6098            while _next_ordinal_to_read < 2 {
6099                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6100                _next_ordinal_to_read += 1;
6101                next_offset += envelope_size;
6102            }
6103
6104            let next_out_of_line = decoder.next_out_of_line();
6105            let handles_before = decoder.remaining_handles();
6106            if let Some((inlined, num_bytes, num_handles)) =
6107                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6108            {
6109                let member_inline_size =
6110                    <AudioStreamSettingSource as fidl::encoding::TypeMarker>::inline_size(
6111                        decoder.context,
6112                    );
6113                if inlined != (member_inline_size <= 4) {
6114                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6115                }
6116                let inner_offset;
6117                let mut inner_depth = depth.clone();
6118                if inlined {
6119                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6120                    inner_offset = next_offset;
6121                } else {
6122                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6123                    inner_depth.increment()?;
6124                }
6125                let val_ref = self
6126                    .source
6127                    .get_or_insert_with(|| fidl::new_empty!(AudioStreamSettingSource, D));
6128                fidl::decode!(
6129                    AudioStreamSettingSource,
6130                    D,
6131                    val_ref,
6132                    decoder,
6133                    inner_offset,
6134                    inner_depth
6135                )?;
6136                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6137                {
6138                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6139                }
6140                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6141                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6142                }
6143            }
6144
6145            next_offset += envelope_size;
6146            _next_ordinal_to_read += 1;
6147            if next_offset >= end_offset {
6148                return Ok(());
6149            }
6150
6151            // Decode unknown envelopes for gaps in ordinals.
6152            while _next_ordinal_to_read < 3 {
6153                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6154                _next_ordinal_to_read += 1;
6155                next_offset += envelope_size;
6156            }
6157
6158            let next_out_of_line = decoder.next_out_of_line();
6159            let handles_before = decoder.remaining_handles();
6160            if let Some((inlined, num_bytes, num_handles)) =
6161                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6162            {
6163                let member_inline_size =
6164                    <Volume as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6165                if inlined != (member_inline_size <= 4) {
6166                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6167                }
6168                let inner_offset;
6169                let mut inner_depth = depth.clone();
6170                if inlined {
6171                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6172                    inner_offset = next_offset;
6173                } else {
6174                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6175                    inner_depth.increment()?;
6176                }
6177                let val_ref = self.user_volume.get_or_insert_with(|| fidl::new_empty!(Volume, D));
6178                fidl::decode!(Volume, D, val_ref, decoder, inner_offset, inner_depth)?;
6179                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6180                {
6181                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6182                }
6183                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6184                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6185                }
6186            }
6187
6188            next_offset += envelope_size;
6189
6190            // Decode the remaining unknown envelopes.
6191            while next_offset < end_offset {
6192                _next_ordinal_to_read += 1;
6193                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6194                next_offset += envelope_size;
6195            }
6196
6197            Ok(())
6198        }
6199    }
6200
6201    impl CaptionFontStyle {
6202        #[inline(always)]
6203        fn max_ordinal_present(&self) -> u64 {
6204            if let Some(_) = self.char_edge_style {
6205                return 4;
6206            }
6207            if let Some(_) = self.relative_size {
6208                return 3;
6209            }
6210            if let Some(_) = self.color {
6211                return 2;
6212            }
6213            if let Some(_) = self.family {
6214                return 1;
6215            }
6216            0
6217        }
6218    }
6219
6220    impl fidl::encoding::ValueTypeMarker for CaptionFontStyle {
6221        type Borrowed<'a> = &'a Self;
6222        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6223            value
6224        }
6225    }
6226
6227    unsafe impl fidl::encoding::TypeMarker for CaptionFontStyle {
6228        type Owned = Self;
6229
6230        #[inline(always)]
6231        fn inline_align(_context: fidl::encoding::Context) -> usize {
6232            8
6233        }
6234
6235        #[inline(always)]
6236        fn inline_size(_context: fidl::encoding::Context) -> usize {
6237            16
6238        }
6239    }
6240
6241    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CaptionFontStyle, D>
6242        for &CaptionFontStyle
6243    {
6244        unsafe fn encode(
6245            self,
6246            encoder: &mut fidl::encoding::Encoder<'_, D>,
6247            offset: usize,
6248            mut depth: fidl::encoding::Depth,
6249        ) -> fidl::Result<()> {
6250            encoder.debug_check_bounds::<CaptionFontStyle>(offset);
6251            // Vector header
6252            let max_ordinal: u64 = self.max_ordinal_present();
6253            encoder.write_num(max_ordinal, offset);
6254            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6255            // Calling encoder.out_of_line_offset(0) is not allowed.
6256            if max_ordinal == 0 {
6257                return Ok(());
6258            }
6259            depth.increment()?;
6260            let envelope_size = 8;
6261            let bytes_len = max_ordinal as usize * envelope_size;
6262            #[allow(unused_variables)]
6263            let offset = encoder.out_of_line_offset(bytes_len);
6264            let mut _prev_end_offset: usize = 0;
6265            if 1 > max_ordinal {
6266                return Ok(());
6267            }
6268
6269            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6270            // are envelope_size bytes.
6271            let cur_offset: usize = (1 - 1) * envelope_size;
6272
6273            // Zero reserved fields.
6274            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6275
6276            // Safety:
6277            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6278            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6279            //   envelope_size bytes, there is always sufficient room.
6280            fidl::encoding::encode_in_envelope_optional::<CaptionFontFamily, D>(
6281                self.family
6282                    .as_ref()
6283                    .map(<CaptionFontFamily as fidl::encoding::ValueTypeMarker>::borrow),
6284                encoder,
6285                offset + cur_offset,
6286                depth,
6287            )?;
6288
6289            _prev_end_offset = cur_offset + envelope_size;
6290            if 2 > max_ordinal {
6291                return Ok(());
6292            }
6293
6294            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6295            // are envelope_size bytes.
6296            let cur_offset: usize = (2 - 1) * envelope_size;
6297
6298            // Zero reserved fields.
6299            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6300
6301            // Safety:
6302            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6303            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6304            //   envelope_size bytes, there is always sufficient room.
6305            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_ui_types__common::ColorRgba, D>(
6306            self.color.as_ref().map(<fidl_fuchsia_ui_types__common::ColorRgba as fidl::encoding::ValueTypeMarker>::borrow),
6307            encoder, offset + cur_offset, depth
6308        )?;
6309
6310            _prev_end_offset = cur_offset + envelope_size;
6311            if 3 > max_ordinal {
6312                return Ok(());
6313            }
6314
6315            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6316            // are envelope_size bytes.
6317            let cur_offset: usize = (3 - 1) * envelope_size;
6318
6319            // Zero reserved fields.
6320            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6321
6322            // Safety:
6323            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6324            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6325            //   envelope_size bytes, there is always sufficient room.
6326            fidl::encoding::encode_in_envelope_optional::<f32, D>(
6327                self.relative_size.as_ref().map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
6328                encoder,
6329                offset + cur_offset,
6330                depth,
6331            )?;
6332
6333            _prev_end_offset = cur_offset + envelope_size;
6334            if 4 > max_ordinal {
6335                return Ok(());
6336            }
6337
6338            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6339            // are envelope_size bytes.
6340            let cur_offset: usize = (4 - 1) * envelope_size;
6341
6342            // Zero reserved fields.
6343            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6344
6345            // Safety:
6346            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6347            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6348            //   envelope_size bytes, there is always sufficient room.
6349            fidl::encoding::encode_in_envelope_optional::<EdgeStyle, D>(
6350                self.char_edge_style
6351                    .as_ref()
6352                    .map(<EdgeStyle as fidl::encoding::ValueTypeMarker>::borrow),
6353                encoder,
6354                offset + cur_offset,
6355                depth,
6356            )?;
6357
6358            _prev_end_offset = cur_offset + envelope_size;
6359
6360            Ok(())
6361        }
6362    }
6363
6364    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CaptionFontStyle {
6365        #[inline(always)]
6366        fn new_empty() -> Self {
6367            Self::default()
6368        }
6369
6370        unsafe fn decode(
6371            &mut self,
6372            decoder: &mut fidl::encoding::Decoder<'_, D>,
6373            offset: usize,
6374            mut depth: fidl::encoding::Depth,
6375        ) -> fidl::Result<()> {
6376            decoder.debug_check_bounds::<Self>(offset);
6377            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6378                None => return Err(fidl::Error::NotNullable),
6379                Some(len) => len,
6380            };
6381            // Calling decoder.out_of_line_offset(0) is not allowed.
6382            if len == 0 {
6383                return Ok(());
6384            };
6385            depth.increment()?;
6386            let envelope_size = 8;
6387            let bytes_len = len * envelope_size;
6388            let offset = decoder.out_of_line_offset(bytes_len)?;
6389            // Decode the envelope for each type.
6390            let mut _next_ordinal_to_read = 0;
6391            let mut next_offset = offset;
6392            let end_offset = offset + bytes_len;
6393            _next_ordinal_to_read += 1;
6394            if next_offset >= end_offset {
6395                return Ok(());
6396            }
6397
6398            // Decode unknown envelopes for gaps in ordinals.
6399            while _next_ordinal_to_read < 1 {
6400                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6401                _next_ordinal_to_read += 1;
6402                next_offset += envelope_size;
6403            }
6404
6405            let next_out_of_line = decoder.next_out_of_line();
6406            let handles_before = decoder.remaining_handles();
6407            if let Some((inlined, num_bytes, num_handles)) =
6408                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6409            {
6410                let member_inline_size =
6411                    <CaptionFontFamily as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6412                if inlined != (member_inline_size <= 4) {
6413                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6414                }
6415                let inner_offset;
6416                let mut inner_depth = depth.clone();
6417                if inlined {
6418                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6419                    inner_offset = next_offset;
6420                } else {
6421                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6422                    inner_depth.increment()?;
6423                }
6424                let val_ref =
6425                    self.family.get_or_insert_with(|| fidl::new_empty!(CaptionFontFamily, D));
6426                fidl::decode!(CaptionFontFamily, D, val_ref, decoder, inner_offset, inner_depth)?;
6427                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6428                {
6429                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6430                }
6431                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6432                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6433                }
6434            }
6435
6436            next_offset += envelope_size;
6437            _next_ordinal_to_read += 1;
6438            if next_offset >= end_offset {
6439                return Ok(());
6440            }
6441
6442            // Decode unknown envelopes for gaps in ordinals.
6443            while _next_ordinal_to_read < 2 {
6444                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6445                _next_ordinal_to_read += 1;
6446                next_offset += envelope_size;
6447            }
6448
6449            let next_out_of_line = decoder.next_out_of_line();
6450            let handles_before = decoder.remaining_handles();
6451            if let Some((inlined, num_bytes, num_handles)) =
6452                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6453            {
6454                let member_inline_size = <fidl_fuchsia_ui_types__common::ColorRgba as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6455                if inlined != (member_inline_size <= 4) {
6456                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6457                }
6458                let inner_offset;
6459                let mut inner_depth = depth.clone();
6460                if inlined {
6461                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6462                    inner_offset = next_offset;
6463                } else {
6464                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6465                    inner_depth.increment()?;
6466                }
6467                let val_ref = self.color.get_or_insert_with(|| {
6468                    fidl::new_empty!(fidl_fuchsia_ui_types__common::ColorRgba, D)
6469                });
6470                fidl::decode!(
6471                    fidl_fuchsia_ui_types__common::ColorRgba,
6472                    D,
6473                    val_ref,
6474                    decoder,
6475                    inner_offset,
6476                    inner_depth
6477                )?;
6478                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6479                {
6480                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6481                }
6482                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6483                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6484                }
6485            }
6486
6487            next_offset += envelope_size;
6488            _next_ordinal_to_read += 1;
6489            if next_offset >= end_offset {
6490                return Ok(());
6491            }
6492
6493            // Decode unknown envelopes for gaps in ordinals.
6494            while _next_ordinal_to_read < 3 {
6495                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6496                _next_ordinal_to_read += 1;
6497                next_offset += envelope_size;
6498            }
6499
6500            let next_out_of_line = decoder.next_out_of_line();
6501            let handles_before = decoder.remaining_handles();
6502            if let Some((inlined, num_bytes, num_handles)) =
6503                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6504            {
6505                let member_inline_size =
6506                    <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6507                if inlined != (member_inline_size <= 4) {
6508                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6509                }
6510                let inner_offset;
6511                let mut inner_depth = depth.clone();
6512                if inlined {
6513                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6514                    inner_offset = next_offset;
6515                } else {
6516                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6517                    inner_depth.increment()?;
6518                }
6519                let val_ref = self.relative_size.get_or_insert_with(|| fidl::new_empty!(f32, D));
6520                fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
6521                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6522                {
6523                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6524                }
6525                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6526                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6527                }
6528            }
6529
6530            next_offset += envelope_size;
6531            _next_ordinal_to_read += 1;
6532            if next_offset >= end_offset {
6533                return Ok(());
6534            }
6535
6536            // Decode unknown envelopes for gaps in ordinals.
6537            while _next_ordinal_to_read < 4 {
6538                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6539                _next_ordinal_to_read += 1;
6540                next_offset += envelope_size;
6541            }
6542
6543            let next_out_of_line = decoder.next_out_of_line();
6544            let handles_before = decoder.remaining_handles();
6545            if let Some((inlined, num_bytes, num_handles)) =
6546                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6547            {
6548                let member_inline_size =
6549                    <EdgeStyle as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6550                if inlined != (member_inline_size <= 4) {
6551                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6552                }
6553                let inner_offset;
6554                let mut inner_depth = depth.clone();
6555                if inlined {
6556                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6557                    inner_offset = next_offset;
6558                } else {
6559                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6560                    inner_depth.increment()?;
6561                }
6562                let val_ref =
6563                    self.char_edge_style.get_or_insert_with(|| fidl::new_empty!(EdgeStyle, D));
6564                fidl::decode!(EdgeStyle, D, val_ref, decoder, inner_offset, inner_depth)?;
6565                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6566                {
6567                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6568                }
6569                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6570                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6571                }
6572            }
6573
6574            next_offset += envelope_size;
6575
6576            // Decode the remaining unknown envelopes.
6577            while next_offset < end_offset {
6578                _next_ordinal_to_read += 1;
6579                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6580                next_offset += envelope_size;
6581            }
6582
6583            Ok(())
6584        }
6585    }
6586
6587    impl CaptionsSettings {
6588        #[inline(always)]
6589        fn max_ordinal_present(&self) -> u64 {
6590            if let Some(_) = self.background_color {
6591                return 5;
6592            }
6593            if let Some(_) = self.window_color {
6594                return 4;
6595            }
6596            if let Some(_) = self.font_style {
6597                return 3;
6598            }
6599            if let Some(_) = self.for_tts {
6600                return 2;
6601            }
6602            if let Some(_) = self.for_media {
6603                return 1;
6604            }
6605            0
6606        }
6607    }
6608
6609    impl fidl::encoding::ValueTypeMarker for CaptionsSettings {
6610        type Borrowed<'a> = &'a Self;
6611        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6612            value
6613        }
6614    }
6615
6616    unsafe impl fidl::encoding::TypeMarker for CaptionsSettings {
6617        type Owned = Self;
6618
6619        #[inline(always)]
6620        fn inline_align(_context: fidl::encoding::Context) -> usize {
6621            8
6622        }
6623
6624        #[inline(always)]
6625        fn inline_size(_context: fidl::encoding::Context) -> usize {
6626            16
6627        }
6628    }
6629
6630    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CaptionsSettings, D>
6631        for &CaptionsSettings
6632    {
6633        unsafe fn encode(
6634            self,
6635            encoder: &mut fidl::encoding::Encoder<'_, D>,
6636            offset: usize,
6637            mut depth: fidl::encoding::Depth,
6638        ) -> fidl::Result<()> {
6639            encoder.debug_check_bounds::<CaptionsSettings>(offset);
6640            // Vector header
6641            let max_ordinal: u64 = self.max_ordinal_present();
6642            encoder.write_num(max_ordinal, offset);
6643            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6644            // Calling encoder.out_of_line_offset(0) is not allowed.
6645            if max_ordinal == 0 {
6646                return Ok(());
6647            }
6648            depth.increment()?;
6649            let envelope_size = 8;
6650            let bytes_len = max_ordinal as usize * envelope_size;
6651            #[allow(unused_variables)]
6652            let offset = encoder.out_of_line_offset(bytes_len);
6653            let mut _prev_end_offset: usize = 0;
6654            if 1 > max_ordinal {
6655                return Ok(());
6656            }
6657
6658            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6659            // are envelope_size bytes.
6660            let cur_offset: usize = (1 - 1) * envelope_size;
6661
6662            // Zero reserved fields.
6663            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6664
6665            // Safety:
6666            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6667            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6668            //   envelope_size bytes, there is always sufficient room.
6669            fidl::encoding::encode_in_envelope_optional::<bool, D>(
6670                self.for_media.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6671                encoder,
6672                offset + cur_offset,
6673                depth,
6674            )?;
6675
6676            _prev_end_offset = cur_offset + envelope_size;
6677            if 2 > max_ordinal {
6678                return Ok(());
6679            }
6680
6681            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6682            // are envelope_size bytes.
6683            let cur_offset: usize = (2 - 1) * envelope_size;
6684
6685            // Zero reserved fields.
6686            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6687
6688            // Safety:
6689            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6690            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6691            //   envelope_size bytes, there is always sufficient room.
6692            fidl::encoding::encode_in_envelope_optional::<bool, D>(
6693                self.for_tts.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6694                encoder,
6695                offset + cur_offset,
6696                depth,
6697            )?;
6698
6699            _prev_end_offset = cur_offset + envelope_size;
6700            if 3 > max_ordinal {
6701                return Ok(());
6702            }
6703
6704            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6705            // are envelope_size bytes.
6706            let cur_offset: usize = (3 - 1) * envelope_size;
6707
6708            // Zero reserved fields.
6709            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6710
6711            // Safety:
6712            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6713            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6714            //   envelope_size bytes, there is always sufficient room.
6715            fidl::encoding::encode_in_envelope_optional::<CaptionFontStyle, D>(
6716                self.font_style
6717                    .as_ref()
6718                    .map(<CaptionFontStyle as fidl::encoding::ValueTypeMarker>::borrow),
6719                encoder,
6720                offset + cur_offset,
6721                depth,
6722            )?;
6723
6724            _prev_end_offset = cur_offset + envelope_size;
6725            if 4 > max_ordinal {
6726                return Ok(());
6727            }
6728
6729            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6730            // are envelope_size bytes.
6731            let cur_offset: usize = (4 - 1) * envelope_size;
6732
6733            // Zero reserved fields.
6734            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6735
6736            // Safety:
6737            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6738            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6739            //   envelope_size bytes, there is always sufficient room.
6740            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_ui_types__common::ColorRgba, D>(
6741            self.window_color.as_ref().map(<fidl_fuchsia_ui_types__common::ColorRgba as fidl::encoding::ValueTypeMarker>::borrow),
6742            encoder, offset + cur_offset, depth
6743        )?;
6744
6745            _prev_end_offset = cur_offset + envelope_size;
6746            if 5 > max_ordinal {
6747                return Ok(());
6748            }
6749
6750            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6751            // are envelope_size bytes.
6752            let cur_offset: usize = (5 - 1) * envelope_size;
6753
6754            // Zero reserved fields.
6755            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6756
6757            // Safety:
6758            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6759            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6760            //   envelope_size bytes, there is always sufficient room.
6761            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_ui_types__common::ColorRgba, D>(
6762            self.background_color.as_ref().map(<fidl_fuchsia_ui_types__common::ColorRgba as fidl::encoding::ValueTypeMarker>::borrow),
6763            encoder, offset + cur_offset, depth
6764        )?;
6765
6766            _prev_end_offset = cur_offset + envelope_size;
6767
6768            Ok(())
6769        }
6770    }
6771
6772    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CaptionsSettings {
6773        #[inline(always)]
6774        fn new_empty() -> Self {
6775            Self::default()
6776        }
6777
6778        unsafe fn decode(
6779            &mut self,
6780            decoder: &mut fidl::encoding::Decoder<'_, D>,
6781            offset: usize,
6782            mut depth: fidl::encoding::Depth,
6783        ) -> fidl::Result<()> {
6784            decoder.debug_check_bounds::<Self>(offset);
6785            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6786                None => return Err(fidl::Error::NotNullable),
6787                Some(len) => len,
6788            };
6789            // Calling decoder.out_of_line_offset(0) is not allowed.
6790            if len == 0 {
6791                return Ok(());
6792            };
6793            depth.increment()?;
6794            let envelope_size = 8;
6795            let bytes_len = len * envelope_size;
6796            let offset = decoder.out_of_line_offset(bytes_len)?;
6797            // Decode the envelope for each type.
6798            let mut _next_ordinal_to_read = 0;
6799            let mut next_offset = offset;
6800            let end_offset = offset + bytes_len;
6801            _next_ordinal_to_read += 1;
6802            if next_offset >= end_offset {
6803                return Ok(());
6804            }
6805
6806            // Decode unknown envelopes for gaps in ordinals.
6807            while _next_ordinal_to_read < 1 {
6808                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6809                _next_ordinal_to_read += 1;
6810                next_offset += envelope_size;
6811            }
6812
6813            let next_out_of_line = decoder.next_out_of_line();
6814            let handles_before = decoder.remaining_handles();
6815            if let Some((inlined, num_bytes, num_handles)) =
6816                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6817            {
6818                let member_inline_size =
6819                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6820                if inlined != (member_inline_size <= 4) {
6821                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6822                }
6823                let inner_offset;
6824                let mut inner_depth = depth.clone();
6825                if inlined {
6826                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6827                    inner_offset = next_offset;
6828                } else {
6829                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6830                    inner_depth.increment()?;
6831                }
6832                let val_ref = self.for_media.get_or_insert_with(|| fidl::new_empty!(bool, D));
6833                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6834                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6835                {
6836                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6837                }
6838                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6839                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6840                }
6841            }
6842
6843            next_offset += envelope_size;
6844            _next_ordinal_to_read += 1;
6845            if next_offset >= end_offset {
6846                return Ok(());
6847            }
6848
6849            // Decode unknown envelopes for gaps in ordinals.
6850            while _next_ordinal_to_read < 2 {
6851                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6852                _next_ordinal_to_read += 1;
6853                next_offset += envelope_size;
6854            }
6855
6856            let next_out_of_line = decoder.next_out_of_line();
6857            let handles_before = decoder.remaining_handles();
6858            if let Some((inlined, num_bytes, num_handles)) =
6859                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6860            {
6861                let member_inline_size =
6862                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6863                if inlined != (member_inline_size <= 4) {
6864                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6865                }
6866                let inner_offset;
6867                let mut inner_depth = depth.clone();
6868                if inlined {
6869                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6870                    inner_offset = next_offset;
6871                } else {
6872                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6873                    inner_depth.increment()?;
6874                }
6875                let val_ref = self.for_tts.get_or_insert_with(|| fidl::new_empty!(bool, D));
6876                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6877                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6878                {
6879                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6880                }
6881                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6882                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6883                }
6884            }
6885
6886            next_offset += envelope_size;
6887            _next_ordinal_to_read += 1;
6888            if next_offset >= end_offset {
6889                return Ok(());
6890            }
6891
6892            // Decode unknown envelopes for gaps in ordinals.
6893            while _next_ordinal_to_read < 3 {
6894                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6895                _next_ordinal_to_read += 1;
6896                next_offset += envelope_size;
6897            }
6898
6899            let next_out_of_line = decoder.next_out_of_line();
6900            let handles_before = decoder.remaining_handles();
6901            if let Some((inlined, num_bytes, num_handles)) =
6902                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6903            {
6904                let member_inline_size =
6905                    <CaptionFontStyle as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6906                if inlined != (member_inline_size <= 4) {
6907                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6908                }
6909                let inner_offset;
6910                let mut inner_depth = depth.clone();
6911                if inlined {
6912                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6913                    inner_offset = next_offset;
6914                } else {
6915                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6916                    inner_depth.increment()?;
6917                }
6918                let val_ref =
6919                    self.font_style.get_or_insert_with(|| fidl::new_empty!(CaptionFontStyle, D));
6920                fidl::decode!(CaptionFontStyle, D, val_ref, decoder, inner_offset, inner_depth)?;
6921                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6922                {
6923                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6924                }
6925                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6926                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6927                }
6928            }
6929
6930            next_offset += envelope_size;
6931            _next_ordinal_to_read += 1;
6932            if next_offset >= end_offset {
6933                return Ok(());
6934            }
6935
6936            // Decode unknown envelopes for gaps in ordinals.
6937            while _next_ordinal_to_read < 4 {
6938                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6939                _next_ordinal_to_read += 1;
6940                next_offset += envelope_size;
6941            }
6942
6943            let next_out_of_line = decoder.next_out_of_line();
6944            let handles_before = decoder.remaining_handles();
6945            if let Some((inlined, num_bytes, num_handles)) =
6946                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6947            {
6948                let member_inline_size = <fidl_fuchsia_ui_types__common::ColorRgba as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6949                if inlined != (member_inline_size <= 4) {
6950                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6951                }
6952                let inner_offset;
6953                let mut inner_depth = depth.clone();
6954                if inlined {
6955                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6956                    inner_offset = next_offset;
6957                } else {
6958                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6959                    inner_depth.increment()?;
6960                }
6961                let val_ref = self.window_color.get_or_insert_with(|| {
6962                    fidl::new_empty!(fidl_fuchsia_ui_types__common::ColorRgba, D)
6963                });
6964                fidl::decode!(
6965                    fidl_fuchsia_ui_types__common::ColorRgba,
6966                    D,
6967                    val_ref,
6968                    decoder,
6969                    inner_offset,
6970                    inner_depth
6971                )?;
6972                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6973                {
6974                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6975                }
6976                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6977                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6978                }
6979            }
6980
6981            next_offset += envelope_size;
6982            _next_ordinal_to_read += 1;
6983            if next_offset >= end_offset {
6984                return Ok(());
6985            }
6986
6987            // Decode unknown envelopes for gaps in ordinals.
6988            while _next_ordinal_to_read < 5 {
6989                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6990                _next_ordinal_to_read += 1;
6991                next_offset += envelope_size;
6992            }
6993
6994            let next_out_of_line = decoder.next_out_of_line();
6995            let handles_before = decoder.remaining_handles();
6996            if let Some((inlined, num_bytes, num_handles)) =
6997                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6998            {
6999                let member_inline_size = <fidl_fuchsia_ui_types__common::ColorRgba as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7000                if inlined != (member_inline_size <= 4) {
7001                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7002                }
7003                let inner_offset;
7004                let mut inner_depth = depth.clone();
7005                if inlined {
7006                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7007                    inner_offset = next_offset;
7008                } else {
7009                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7010                    inner_depth.increment()?;
7011                }
7012                let val_ref = self.background_color.get_or_insert_with(|| {
7013                    fidl::new_empty!(fidl_fuchsia_ui_types__common::ColorRgba, D)
7014                });
7015                fidl::decode!(
7016                    fidl_fuchsia_ui_types__common::ColorRgba,
7017                    D,
7018                    val_ref,
7019                    decoder,
7020                    inner_offset,
7021                    inner_depth
7022                )?;
7023                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7024                {
7025                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7026                }
7027                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7028                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7029                }
7030            }
7031
7032            next_offset += envelope_size;
7033
7034            // Decode the remaining unknown envelopes.
7035            while next_offset < end_offset {
7036                _next_ordinal_to_read += 1;
7037                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7038                next_offset += envelope_size;
7039            }
7040
7041            Ok(())
7042        }
7043    }
7044
7045    impl DeviceState {
7046        #[inline(always)]
7047        fn max_ordinal_present(&self) -> u64 {
7048            if let Some(_) = self.toggle_flags {
7049                return 1;
7050            }
7051            0
7052        }
7053    }
7054
7055    impl fidl::encoding::ValueTypeMarker for DeviceState {
7056        type Borrowed<'a> = &'a Self;
7057        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7058            value
7059        }
7060    }
7061
7062    unsafe impl fidl::encoding::TypeMarker for DeviceState {
7063        type Owned = Self;
7064
7065        #[inline(always)]
7066        fn inline_align(_context: fidl::encoding::Context) -> usize {
7067            8
7068        }
7069
7070        #[inline(always)]
7071        fn inline_size(_context: fidl::encoding::Context) -> usize {
7072            16
7073        }
7074    }
7075
7076    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DeviceState, D>
7077        for &DeviceState
7078    {
7079        unsafe fn encode(
7080            self,
7081            encoder: &mut fidl::encoding::Encoder<'_, D>,
7082            offset: usize,
7083            mut depth: fidl::encoding::Depth,
7084        ) -> fidl::Result<()> {
7085            encoder.debug_check_bounds::<DeviceState>(offset);
7086            // Vector header
7087            let max_ordinal: u64 = self.max_ordinal_present();
7088            encoder.write_num(max_ordinal, offset);
7089            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7090            // Calling encoder.out_of_line_offset(0) is not allowed.
7091            if max_ordinal == 0 {
7092                return Ok(());
7093            }
7094            depth.increment()?;
7095            let envelope_size = 8;
7096            let bytes_len = max_ordinal as usize * envelope_size;
7097            #[allow(unused_variables)]
7098            let offset = encoder.out_of_line_offset(bytes_len);
7099            let mut _prev_end_offset: usize = 0;
7100            if 1 > max_ordinal {
7101                return Ok(());
7102            }
7103
7104            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7105            // are envelope_size bytes.
7106            let cur_offset: usize = (1 - 1) * envelope_size;
7107
7108            // Zero reserved fields.
7109            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7110
7111            // Safety:
7112            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7113            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7114            //   envelope_size bytes, there is always sufficient room.
7115            fidl::encoding::encode_in_envelope_optional::<ToggleStateFlags, D>(
7116                self.toggle_flags
7117                    .as_ref()
7118                    .map(<ToggleStateFlags as fidl::encoding::ValueTypeMarker>::borrow),
7119                encoder,
7120                offset + cur_offset,
7121                depth,
7122            )?;
7123
7124            _prev_end_offset = cur_offset + envelope_size;
7125
7126            Ok(())
7127        }
7128    }
7129
7130    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceState {
7131        #[inline(always)]
7132        fn new_empty() -> Self {
7133            Self::default()
7134        }
7135
7136        unsafe fn decode(
7137            &mut self,
7138            decoder: &mut fidl::encoding::Decoder<'_, D>,
7139            offset: usize,
7140            mut depth: fidl::encoding::Depth,
7141        ) -> fidl::Result<()> {
7142            decoder.debug_check_bounds::<Self>(offset);
7143            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7144                None => return Err(fidl::Error::NotNullable),
7145                Some(len) => len,
7146            };
7147            // Calling decoder.out_of_line_offset(0) is not allowed.
7148            if len == 0 {
7149                return Ok(());
7150            };
7151            depth.increment()?;
7152            let envelope_size = 8;
7153            let bytes_len = len * envelope_size;
7154            let offset = decoder.out_of_line_offset(bytes_len)?;
7155            // Decode the envelope for each type.
7156            let mut _next_ordinal_to_read = 0;
7157            let mut next_offset = offset;
7158            let end_offset = offset + bytes_len;
7159            _next_ordinal_to_read += 1;
7160            if next_offset >= end_offset {
7161                return Ok(());
7162            }
7163
7164            // Decode unknown envelopes for gaps in ordinals.
7165            while _next_ordinal_to_read < 1 {
7166                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7167                _next_ordinal_to_read += 1;
7168                next_offset += envelope_size;
7169            }
7170
7171            let next_out_of_line = decoder.next_out_of_line();
7172            let handles_before = decoder.remaining_handles();
7173            if let Some((inlined, num_bytes, num_handles)) =
7174                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7175            {
7176                let member_inline_size =
7177                    <ToggleStateFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7178                if inlined != (member_inline_size <= 4) {
7179                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7180                }
7181                let inner_offset;
7182                let mut inner_depth = depth.clone();
7183                if inlined {
7184                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7185                    inner_offset = next_offset;
7186                } else {
7187                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7188                    inner_depth.increment()?;
7189                }
7190                let val_ref =
7191                    self.toggle_flags.get_or_insert_with(|| fidl::new_empty!(ToggleStateFlags, D));
7192                fidl::decode!(ToggleStateFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
7193                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7194                {
7195                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7196                }
7197                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7198                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7199                }
7200            }
7201
7202            next_offset += envelope_size;
7203
7204            // Decode the remaining unknown envelopes.
7205            while next_offset < end_offset {
7206                _next_ordinal_to_read += 1;
7207                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7208                next_offset += envelope_size;
7209            }
7210
7211            Ok(())
7212        }
7213    }
7214
7215    impl DisplaySettings {
7216        #[inline(always)]
7217        fn max_ordinal_present(&self) -> u64 {
7218            if let Some(_) = self.adjusted_auto_brightness {
7219                return 7;
7220            }
7221            if let Some(_) = self.theme {
7222                return 6;
7223            }
7224            if let Some(_) = self.screen_enabled {
7225                return 5;
7226            }
7227            if let Some(_) = self.low_light_mode {
7228                return 4;
7229            }
7230            if let Some(_) = self.brightness_value {
7231                return 2;
7232            }
7233            if let Some(_) = self.auto_brightness {
7234                return 1;
7235            }
7236            0
7237        }
7238    }
7239
7240    impl fidl::encoding::ValueTypeMarker for DisplaySettings {
7241        type Borrowed<'a> = &'a Self;
7242        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7243            value
7244        }
7245    }
7246
7247    unsafe impl fidl::encoding::TypeMarker for DisplaySettings {
7248        type Owned = Self;
7249
7250        #[inline(always)]
7251        fn inline_align(_context: fidl::encoding::Context) -> usize {
7252            8
7253        }
7254
7255        #[inline(always)]
7256        fn inline_size(_context: fidl::encoding::Context) -> usize {
7257            16
7258        }
7259    }
7260
7261    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DisplaySettings, D>
7262        for &DisplaySettings
7263    {
7264        unsafe fn encode(
7265            self,
7266            encoder: &mut fidl::encoding::Encoder<'_, D>,
7267            offset: usize,
7268            mut depth: fidl::encoding::Depth,
7269        ) -> fidl::Result<()> {
7270            encoder.debug_check_bounds::<DisplaySettings>(offset);
7271            // Vector header
7272            let max_ordinal: u64 = self.max_ordinal_present();
7273            encoder.write_num(max_ordinal, offset);
7274            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7275            // Calling encoder.out_of_line_offset(0) is not allowed.
7276            if max_ordinal == 0 {
7277                return Ok(());
7278            }
7279            depth.increment()?;
7280            let envelope_size = 8;
7281            let bytes_len = max_ordinal as usize * envelope_size;
7282            #[allow(unused_variables)]
7283            let offset = encoder.out_of_line_offset(bytes_len);
7284            let mut _prev_end_offset: usize = 0;
7285            if 1 > max_ordinal {
7286                return Ok(());
7287            }
7288
7289            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7290            // are envelope_size bytes.
7291            let cur_offset: usize = (1 - 1) * envelope_size;
7292
7293            // Zero reserved fields.
7294            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7295
7296            // Safety:
7297            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7298            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7299            //   envelope_size bytes, there is always sufficient room.
7300            fidl::encoding::encode_in_envelope_optional::<bool, D>(
7301                self.auto_brightness
7302                    .as_ref()
7303                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7304                encoder,
7305                offset + cur_offset,
7306                depth,
7307            )?;
7308
7309            _prev_end_offset = cur_offset + envelope_size;
7310            if 2 > max_ordinal {
7311                return Ok(());
7312            }
7313
7314            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7315            // are envelope_size bytes.
7316            let cur_offset: usize = (2 - 1) * envelope_size;
7317
7318            // Zero reserved fields.
7319            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7320
7321            // Safety:
7322            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7323            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7324            //   envelope_size bytes, there is always sufficient room.
7325            fidl::encoding::encode_in_envelope_optional::<f32, D>(
7326                self.brightness_value
7327                    .as_ref()
7328                    .map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
7329                encoder,
7330                offset + cur_offset,
7331                depth,
7332            )?;
7333
7334            _prev_end_offset = cur_offset + envelope_size;
7335            if 4 > max_ordinal {
7336                return Ok(());
7337            }
7338
7339            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7340            // are envelope_size bytes.
7341            let cur_offset: usize = (4 - 1) * envelope_size;
7342
7343            // Zero reserved fields.
7344            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7345
7346            // Safety:
7347            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7348            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7349            //   envelope_size bytes, there is always sufficient room.
7350            fidl::encoding::encode_in_envelope_optional::<LowLightMode, D>(
7351                self.low_light_mode
7352                    .as_ref()
7353                    .map(<LowLightMode as fidl::encoding::ValueTypeMarker>::borrow),
7354                encoder,
7355                offset + cur_offset,
7356                depth,
7357            )?;
7358
7359            _prev_end_offset = cur_offset + envelope_size;
7360            if 5 > max_ordinal {
7361                return Ok(());
7362            }
7363
7364            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7365            // are envelope_size bytes.
7366            let cur_offset: usize = (5 - 1) * envelope_size;
7367
7368            // Zero reserved fields.
7369            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7370
7371            // Safety:
7372            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7373            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7374            //   envelope_size bytes, there is always sufficient room.
7375            fidl::encoding::encode_in_envelope_optional::<bool, D>(
7376                self.screen_enabled.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7377                encoder,
7378                offset + cur_offset,
7379                depth,
7380            )?;
7381
7382            _prev_end_offset = cur_offset + envelope_size;
7383            if 6 > max_ordinal {
7384                return Ok(());
7385            }
7386
7387            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7388            // are envelope_size bytes.
7389            let cur_offset: usize = (6 - 1) * envelope_size;
7390
7391            // Zero reserved fields.
7392            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7393
7394            // Safety:
7395            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7396            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7397            //   envelope_size bytes, there is always sufficient room.
7398            fidl::encoding::encode_in_envelope_optional::<Theme, D>(
7399                self.theme.as_ref().map(<Theme as fidl::encoding::ValueTypeMarker>::borrow),
7400                encoder,
7401                offset + cur_offset,
7402                depth,
7403            )?;
7404
7405            _prev_end_offset = cur_offset + envelope_size;
7406            if 7 > max_ordinal {
7407                return Ok(());
7408            }
7409
7410            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7411            // are envelope_size bytes.
7412            let cur_offset: usize = (7 - 1) * envelope_size;
7413
7414            // Zero reserved fields.
7415            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7416
7417            // Safety:
7418            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7419            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7420            //   envelope_size bytes, there is always sufficient room.
7421            fidl::encoding::encode_in_envelope_optional::<f32, D>(
7422                self.adjusted_auto_brightness
7423                    .as_ref()
7424                    .map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
7425                encoder,
7426                offset + cur_offset,
7427                depth,
7428            )?;
7429
7430            _prev_end_offset = cur_offset + envelope_size;
7431
7432            Ok(())
7433        }
7434    }
7435
7436    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DisplaySettings {
7437        #[inline(always)]
7438        fn new_empty() -> Self {
7439            Self::default()
7440        }
7441
7442        unsafe fn decode(
7443            &mut self,
7444            decoder: &mut fidl::encoding::Decoder<'_, D>,
7445            offset: usize,
7446            mut depth: fidl::encoding::Depth,
7447        ) -> fidl::Result<()> {
7448            decoder.debug_check_bounds::<Self>(offset);
7449            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7450                None => return Err(fidl::Error::NotNullable),
7451                Some(len) => len,
7452            };
7453            // Calling decoder.out_of_line_offset(0) is not allowed.
7454            if len == 0 {
7455                return Ok(());
7456            };
7457            depth.increment()?;
7458            let envelope_size = 8;
7459            let bytes_len = len * envelope_size;
7460            let offset = decoder.out_of_line_offset(bytes_len)?;
7461            // Decode the envelope for each type.
7462            let mut _next_ordinal_to_read = 0;
7463            let mut next_offset = offset;
7464            let end_offset = offset + bytes_len;
7465            _next_ordinal_to_read += 1;
7466            if next_offset >= end_offset {
7467                return Ok(());
7468            }
7469
7470            // Decode unknown envelopes for gaps in ordinals.
7471            while _next_ordinal_to_read < 1 {
7472                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7473                _next_ordinal_to_read += 1;
7474                next_offset += envelope_size;
7475            }
7476
7477            let next_out_of_line = decoder.next_out_of_line();
7478            let handles_before = decoder.remaining_handles();
7479            if let Some((inlined, num_bytes, num_handles)) =
7480                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7481            {
7482                let member_inline_size =
7483                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7484                if inlined != (member_inline_size <= 4) {
7485                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7486                }
7487                let inner_offset;
7488                let mut inner_depth = depth.clone();
7489                if inlined {
7490                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7491                    inner_offset = next_offset;
7492                } else {
7493                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7494                    inner_depth.increment()?;
7495                }
7496                let val_ref = self.auto_brightness.get_or_insert_with(|| fidl::new_empty!(bool, D));
7497                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7498                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7499                {
7500                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7501                }
7502                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7503                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7504                }
7505            }
7506
7507            next_offset += envelope_size;
7508            _next_ordinal_to_read += 1;
7509            if next_offset >= end_offset {
7510                return Ok(());
7511            }
7512
7513            // Decode unknown envelopes for gaps in ordinals.
7514            while _next_ordinal_to_read < 2 {
7515                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7516                _next_ordinal_to_read += 1;
7517                next_offset += envelope_size;
7518            }
7519
7520            let next_out_of_line = decoder.next_out_of_line();
7521            let handles_before = decoder.remaining_handles();
7522            if let Some((inlined, num_bytes, num_handles)) =
7523                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7524            {
7525                let member_inline_size =
7526                    <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7527                if inlined != (member_inline_size <= 4) {
7528                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7529                }
7530                let inner_offset;
7531                let mut inner_depth = depth.clone();
7532                if inlined {
7533                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7534                    inner_offset = next_offset;
7535                } else {
7536                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7537                    inner_depth.increment()?;
7538                }
7539                let val_ref = self.brightness_value.get_or_insert_with(|| fidl::new_empty!(f32, D));
7540                fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
7541                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7542                {
7543                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7544                }
7545                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7546                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7547                }
7548            }
7549
7550            next_offset += envelope_size;
7551            _next_ordinal_to_read += 1;
7552            if next_offset >= end_offset {
7553                return Ok(());
7554            }
7555
7556            // Decode unknown envelopes for gaps in ordinals.
7557            while _next_ordinal_to_read < 4 {
7558                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7559                _next_ordinal_to_read += 1;
7560                next_offset += envelope_size;
7561            }
7562
7563            let next_out_of_line = decoder.next_out_of_line();
7564            let handles_before = decoder.remaining_handles();
7565            if let Some((inlined, num_bytes, num_handles)) =
7566                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7567            {
7568                let member_inline_size =
7569                    <LowLightMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7570                if inlined != (member_inline_size <= 4) {
7571                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7572                }
7573                let inner_offset;
7574                let mut inner_depth = depth.clone();
7575                if inlined {
7576                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7577                    inner_offset = next_offset;
7578                } else {
7579                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7580                    inner_depth.increment()?;
7581                }
7582                let val_ref =
7583                    self.low_light_mode.get_or_insert_with(|| fidl::new_empty!(LowLightMode, D));
7584                fidl::decode!(LowLightMode, D, val_ref, decoder, inner_offset, inner_depth)?;
7585                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7586                {
7587                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7588                }
7589                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7590                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7591                }
7592            }
7593
7594            next_offset += envelope_size;
7595            _next_ordinal_to_read += 1;
7596            if next_offset >= end_offset {
7597                return Ok(());
7598            }
7599
7600            // Decode unknown envelopes for gaps in ordinals.
7601            while _next_ordinal_to_read < 5 {
7602                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7603                _next_ordinal_to_read += 1;
7604                next_offset += envelope_size;
7605            }
7606
7607            let next_out_of_line = decoder.next_out_of_line();
7608            let handles_before = decoder.remaining_handles();
7609            if let Some((inlined, num_bytes, num_handles)) =
7610                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7611            {
7612                let member_inline_size =
7613                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7614                if inlined != (member_inline_size <= 4) {
7615                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7616                }
7617                let inner_offset;
7618                let mut inner_depth = depth.clone();
7619                if inlined {
7620                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7621                    inner_offset = next_offset;
7622                } else {
7623                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7624                    inner_depth.increment()?;
7625                }
7626                let val_ref = self.screen_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
7627                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7628                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7629                {
7630                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7631                }
7632                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7633                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7634                }
7635            }
7636
7637            next_offset += envelope_size;
7638            _next_ordinal_to_read += 1;
7639            if next_offset >= end_offset {
7640                return Ok(());
7641            }
7642
7643            // Decode unknown envelopes for gaps in ordinals.
7644            while _next_ordinal_to_read < 6 {
7645                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7646                _next_ordinal_to_read += 1;
7647                next_offset += envelope_size;
7648            }
7649
7650            let next_out_of_line = decoder.next_out_of_line();
7651            let handles_before = decoder.remaining_handles();
7652            if let Some((inlined, num_bytes, num_handles)) =
7653                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7654            {
7655                let member_inline_size =
7656                    <Theme as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7657                if inlined != (member_inline_size <= 4) {
7658                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7659                }
7660                let inner_offset;
7661                let mut inner_depth = depth.clone();
7662                if inlined {
7663                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7664                    inner_offset = next_offset;
7665                } else {
7666                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7667                    inner_depth.increment()?;
7668                }
7669                let val_ref = self.theme.get_or_insert_with(|| fidl::new_empty!(Theme, D));
7670                fidl::decode!(Theme, D, val_ref, decoder, inner_offset, inner_depth)?;
7671                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7672                {
7673                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7674                }
7675                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7676                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7677                }
7678            }
7679
7680            next_offset += envelope_size;
7681            _next_ordinal_to_read += 1;
7682            if next_offset >= end_offset {
7683                return Ok(());
7684            }
7685
7686            // Decode unknown envelopes for gaps in ordinals.
7687            while _next_ordinal_to_read < 7 {
7688                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7689                _next_ordinal_to_read += 1;
7690                next_offset += envelope_size;
7691            }
7692
7693            let next_out_of_line = decoder.next_out_of_line();
7694            let handles_before = decoder.remaining_handles();
7695            if let Some((inlined, num_bytes, num_handles)) =
7696                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7697            {
7698                let member_inline_size =
7699                    <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7700                if inlined != (member_inline_size <= 4) {
7701                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7702                }
7703                let inner_offset;
7704                let mut inner_depth = depth.clone();
7705                if inlined {
7706                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7707                    inner_offset = next_offset;
7708                } else {
7709                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7710                    inner_depth.increment()?;
7711                }
7712                let val_ref =
7713                    self.adjusted_auto_brightness.get_or_insert_with(|| fidl::new_empty!(f32, D));
7714                fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
7715                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7716                {
7717                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7718                }
7719                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7720                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7721                }
7722            }
7723
7724            next_offset += envelope_size;
7725
7726            // Decode the remaining unknown envelopes.
7727            while next_offset < end_offset {
7728                _next_ordinal_to_read += 1;
7729                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7730                next_offset += envelope_size;
7731            }
7732
7733            Ok(())
7734        }
7735    }
7736
7737    impl DoNotDisturbSettings {
7738        #[inline(always)]
7739        fn max_ordinal_present(&self) -> u64 {
7740            if let Some(_) = self.night_mode_initiated_do_not_disturb {
7741                return 2;
7742            }
7743            if let Some(_) = self.user_initiated_do_not_disturb {
7744                return 1;
7745            }
7746            0
7747        }
7748    }
7749
7750    impl fidl::encoding::ValueTypeMarker for DoNotDisturbSettings {
7751        type Borrowed<'a> = &'a Self;
7752        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7753            value
7754        }
7755    }
7756
7757    unsafe impl fidl::encoding::TypeMarker for DoNotDisturbSettings {
7758        type Owned = Self;
7759
7760        #[inline(always)]
7761        fn inline_align(_context: fidl::encoding::Context) -> usize {
7762            8
7763        }
7764
7765        #[inline(always)]
7766        fn inline_size(_context: fidl::encoding::Context) -> usize {
7767            16
7768        }
7769    }
7770
7771    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DoNotDisturbSettings, D>
7772        for &DoNotDisturbSettings
7773    {
7774        unsafe fn encode(
7775            self,
7776            encoder: &mut fidl::encoding::Encoder<'_, D>,
7777            offset: usize,
7778            mut depth: fidl::encoding::Depth,
7779        ) -> fidl::Result<()> {
7780            encoder.debug_check_bounds::<DoNotDisturbSettings>(offset);
7781            // Vector header
7782            let max_ordinal: u64 = self.max_ordinal_present();
7783            encoder.write_num(max_ordinal, offset);
7784            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7785            // Calling encoder.out_of_line_offset(0) is not allowed.
7786            if max_ordinal == 0 {
7787                return Ok(());
7788            }
7789            depth.increment()?;
7790            let envelope_size = 8;
7791            let bytes_len = max_ordinal as usize * envelope_size;
7792            #[allow(unused_variables)]
7793            let offset = encoder.out_of_line_offset(bytes_len);
7794            let mut _prev_end_offset: usize = 0;
7795            if 1 > max_ordinal {
7796                return Ok(());
7797            }
7798
7799            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7800            // are envelope_size bytes.
7801            let cur_offset: usize = (1 - 1) * envelope_size;
7802
7803            // Zero reserved fields.
7804            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7805
7806            // Safety:
7807            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7808            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7809            //   envelope_size bytes, there is always sufficient room.
7810            fidl::encoding::encode_in_envelope_optional::<bool, D>(
7811                self.user_initiated_do_not_disturb
7812                    .as_ref()
7813                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7814                encoder,
7815                offset + cur_offset,
7816                depth,
7817            )?;
7818
7819            _prev_end_offset = cur_offset + envelope_size;
7820            if 2 > max_ordinal {
7821                return Ok(());
7822            }
7823
7824            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7825            // are envelope_size bytes.
7826            let cur_offset: usize = (2 - 1) * envelope_size;
7827
7828            // Zero reserved fields.
7829            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7830
7831            // Safety:
7832            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7833            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7834            //   envelope_size bytes, there is always sufficient room.
7835            fidl::encoding::encode_in_envelope_optional::<bool, D>(
7836                self.night_mode_initiated_do_not_disturb
7837                    .as_ref()
7838                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7839                encoder,
7840                offset + cur_offset,
7841                depth,
7842            )?;
7843
7844            _prev_end_offset = cur_offset + envelope_size;
7845
7846            Ok(())
7847        }
7848    }
7849
7850    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DoNotDisturbSettings {
7851        #[inline(always)]
7852        fn new_empty() -> Self {
7853            Self::default()
7854        }
7855
7856        unsafe fn decode(
7857            &mut self,
7858            decoder: &mut fidl::encoding::Decoder<'_, D>,
7859            offset: usize,
7860            mut depth: fidl::encoding::Depth,
7861        ) -> fidl::Result<()> {
7862            decoder.debug_check_bounds::<Self>(offset);
7863            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7864                None => return Err(fidl::Error::NotNullable),
7865                Some(len) => len,
7866            };
7867            // Calling decoder.out_of_line_offset(0) is not allowed.
7868            if len == 0 {
7869                return Ok(());
7870            };
7871            depth.increment()?;
7872            let envelope_size = 8;
7873            let bytes_len = len * envelope_size;
7874            let offset = decoder.out_of_line_offset(bytes_len)?;
7875            // Decode the envelope for each type.
7876            let mut _next_ordinal_to_read = 0;
7877            let mut next_offset = offset;
7878            let end_offset = offset + bytes_len;
7879            _next_ordinal_to_read += 1;
7880            if next_offset >= end_offset {
7881                return Ok(());
7882            }
7883
7884            // Decode unknown envelopes for gaps in ordinals.
7885            while _next_ordinal_to_read < 1 {
7886                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7887                _next_ordinal_to_read += 1;
7888                next_offset += envelope_size;
7889            }
7890
7891            let next_out_of_line = decoder.next_out_of_line();
7892            let handles_before = decoder.remaining_handles();
7893            if let Some((inlined, num_bytes, num_handles)) =
7894                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7895            {
7896                let member_inline_size =
7897                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7898                if inlined != (member_inline_size <= 4) {
7899                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7900                }
7901                let inner_offset;
7902                let mut inner_depth = depth.clone();
7903                if inlined {
7904                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7905                    inner_offset = next_offset;
7906                } else {
7907                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7908                    inner_depth.increment()?;
7909                }
7910                let val_ref = self
7911                    .user_initiated_do_not_disturb
7912                    .get_or_insert_with(|| fidl::new_empty!(bool, D));
7913                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7914                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7915                {
7916                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7917                }
7918                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7919                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7920                }
7921            }
7922
7923            next_offset += envelope_size;
7924            _next_ordinal_to_read += 1;
7925            if next_offset >= end_offset {
7926                return Ok(());
7927            }
7928
7929            // Decode unknown envelopes for gaps in ordinals.
7930            while _next_ordinal_to_read < 2 {
7931                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7932                _next_ordinal_to_read += 1;
7933                next_offset += envelope_size;
7934            }
7935
7936            let next_out_of_line = decoder.next_out_of_line();
7937            let handles_before = decoder.remaining_handles();
7938            if let Some((inlined, num_bytes, num_handles)) =
7939                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7940            {
7941                let member_inline_size =
7942                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7943                if inlined != (member_inline_size <= 4) {
7944                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7945                }
7946                let inner_offset;
7947                let mut inner_depth = depth.clone();
7948                if inlined {
7949                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7950                    inner_offset = next_offset;
7951                } else {
7952                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7953                    inner_depth.increment()?;
7954                }
7955                let val_ref = self
7956                    .night_mode_initiated_do_not_disturb
7957                    .get_or_insert_with(|| fidl::new_empty!(bool, D));
7958                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7959                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7960                {
7961                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7962                }
7963                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7964                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7965                }
7966            }
7967
7968            next_offset += envelope_size;
7969
7970            // Decode the remaining unknown envelopes.
7971            while next_offset < end_offset {
7972                _next_ordinal_to_read += 1;
7973                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7974                next_offset += envelope_size;
7975            }
7976
7977            Ok(())
7978        }
7979    }
7980
7981    impl FactoryResetSettings {
7982        #[inline(always)]
7983        fn max_ordinal_present(&self) -> u64 {
7984            if let Some(_) = self.is_local_reset_allowed {
7985                return 1;
7986            }
7987            0
7988        }
7989    }
7990
7991    impl fidl::encoding::ValueTypeMarker for FactoryResetSettings {
7992        type Borrowed<'a> = &'a Self;
7993        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7994            value
7995        }
7996    }
7997
7998    unsafe impl fidl::encoding::TypeMarker for FactoryResetSettings {
7999        type Owned = Self;
8000
8001        #[inline(always)]
8002        fn inline_align(_context: fidl::encoding::Context) -> usize {
8003            8
8004        }
8005
8006        #[inline(always)]
8007        fn inline_size(_context: fidl::encoding::Context) -> usize {
8008            16
8009        }
8010    }
8011
8012    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FactoryResetSettings, D>
8013        for &FactoryResetSettings
8014    {
8015        unsafe fn encode(
8016            self,
8017            encoder: &mut fidl::encoding::Encoder<'_, D>,
8018            offset: usize,
8019            mut depth: fidl::encoding::Depth,
8020        ) -> fidl::Result<()> {
8021            encoder.debug_check_bounds::<FactoryResetSettings>(offset);
8022            // Vector header
8023            let max_ordinal: u64 = self.max_ordinal_present();
8024            encoder.write_num(max_ordinal, offset);
8025            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8026            // Calling encoder.out_of_line_offset(0) is not allowed.
8027            if max_ordinal == 0 {
8028                return Ok(());
8029            }
8030            depth.increment()?;
8031            let envelope_size = 8;
8032            let bytes_len = max_ordinal as usize * envelope_size;
8033            #[allow(unused_variables)]
8034            let offset = encoder.out_of_line_offset(bytes_len);
8035            let mut _prev_end_offset: usize = 0;
8036            if 1 > max_ordinal {
8037                return Ok(());
8038            }
8039
8040            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8041            // are envelope_size bytes.
8042            let cur_offset: usize = (1 - 1) * envelope_size;
8043
8044            // Zero reserved fields.
8045            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8046
8047            // Safety:
8048            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8049            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8050            //   envelope_size bytes, there is always sufficient room.
8051            fidl::encoding::encode_in_envelope_optional::<bool, D>(
8052                self.is_local_reset_allowed
8053                    .as_ref()
8054                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
8055                encoder,
8056                offset + cur_offset,
8057                depth,
8058            )?;
8059
8060            _prev_end_offset = cur_offset + envelope_size;
8061
8062            Ok(())
8063        }
8064    }
8065
8066    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FactoryResetSettings {
8067        #[inline(always)]
8068        fn new_empty() -> Self {
8069            Self::default()
8070        }
8071
8072        unsafe fn decode(
8073            &mut self,
8074            decoder: &mut fidl::encoding::Decoder<'_, D>,
8075            offset: usize,
8076            mut depth: fidl::encoding::Depth,
8077        ) -> fidl::Result<()> {
8078            decoder.debug_check_bounds::<Self>(offset);
8079            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8080                None => return Err(fidl::Error::NotNullable),
8081                Some(len) => len,
8082            };
8083            // Calling decoder.out_of_line_offset(0) is not allowed.
8084            if len == 0 {
8085                return Ok(());
8086            };
8087            depth.increment()?;
8088            let envelope_size = 8;
8089            let bytes_len = len * envelope_size;
8090            let offset = decoder.out_of_line_offset(bytes_len)?;
8091            // Decode the envelope for each type.
8092            let mut _next_ordinal_to_read = 0;
8093            let mut next_offset = offset;
8094            let end_offset = offset + bytes_len;
8095            _next_ordinal_to_read += 1;
8096            if next_offset >= end_offset {
8097                return Ok(());
8098            }
8099
8100            // Decode unknown envelopes for gaps in ordinals.
8101            while _next_ordinal_to_read < 1 {
8102                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8103                _next_ordinal_to_read += 1;
8104                next_offset += envelope_size;
8105            }
8106
8107            let next_out_of_line = decoder.next_out_of_line();
8108            let handles_before = decoder.remaining_handles();
8109            if let Some((inlined, num_bytes, num_handles)) =
8110                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8111            {
8112                let member_inline_size =
8113                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8114                if inlined != (member_inline_size <= 4) {
8115                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8116                }
8117                let inner_offset;
8118                let mut inner_depth = depth.clone();
8119                if inlined {
8120                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8121                    inner_offset = next_offset;
8122                } else {
8123                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8124                    inner_depth.increment()?;
8125                }
8126                let val_ref =
8127                    self.is_local_reset_allowed.get_or_insert_with(|| fidl::new_empty!(bool, D));
8128                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8129                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8130                {
8131                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8132                }
8133                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8134                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8135                }
8136            }
8137
8138            next_offset += envelope_size;
8139
8140            // Decode the remaining unknown envelopes.
8141            while next_offset < end_offset {
8142                _next_ordinal_to_read += 1;
8143                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8144                next_offset += envelope_size;
8145            }
8146
8147            Ok(())
8148        }
8149    }
8150
8151    impl InputDevice {
8152        #[inline(always)]
8153        fn max_ordinal_present(&self) -> u64 {
8154            if let Some(_) = self.state {
8155                return 5;
8156            }
8157            if let Some(_) = self.mutable_toggle_state {
8158                return 4;
8159            }
8160            if let Some(_) = self.source_states {
8161                return 3;
8162            }
8163            if let Some(_) = self.device_type {
8164                return 2;
8165            }
8166            if let Some(_) = self.device_name {
8167                return 1;
8168            }
8169            0
8170        }
8171    }
8172
8173    impl fidl::encoding::ValueTypeMarker for InputDevice {
8174        type Borrowed<'a> = &'a Self;
8175        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8176            value
8177        }
8178    }
8179
8180    unsafe impl fidl::encoding::TypeMarker for InputDevice {
8181        type Owned = Self;
8182
8183        #[inline(always)]
8184        fn inline_align(_context: fidl::encoding::Context) -> usize {
8185            8
8186        }
8187
8188        #[inline(always)]
8189        fn inline_size(_context: fidl::encoding::Context) -> usize {
8190            16
8191        }
8192    }
8193
8194    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InputDevice, D>
8195        for &InputDevice
8196    {
8197        unsafe fn encode(
8198            self,
8199            encoder: &mut fidl::encoding::Encoder<'_, D>,
8200            offset: usize,
8201            mut depth: fidl::encoding::Depth,
8202        ) -> fidl::Result<()> {
8203            encoder.debug_check_bounds::<InputDevice>(offset);
8204            // Vector header
8205            let max_ordinal: u64 = self.max_ordinal_present();
8206            encoder.write_num(max_ordinal, offset);
8207            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8208            // Calling encoder.out_of_line_offset(0) is not allowed.
8209            if max_ordinal == 0 {
8210                return Ok(());
8211            }
8212            depth.increment()?;
8213            let envelope_size = 8;
8214            let bytes_len = max_ordinal as usize * envelope_size;
8215            #[allow(unused_variables)]
8216            let offset = encoder.out_of_line_offset(bytes_len);
8217            let mut _prev_end_offset: usize = 0;
8218            if 1 > max_ordinal {
8219                return Ok(());
8220            }
8221
8222            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8223            // are envelope_size bytes.
8224            let cur_offset: usize = (1 - 1) * envelope_size;
8225
8226            // Zero reserved fields.
8227            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8228
8229            // Safety:
8230            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8231            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8232            //   envelope_size bytes, there is always sufficient room.
8233            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
8234                self.device_name.as_ref().map(
8235                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
8236                ),
8237                encoder,
8238                offset + cur_offset,
8239                depth,
8240            )?;
8241
8242            _prev_end_offset = cur_offset + envelope_size;
8243            if 2 > max_ordinal {
8244                return Ok(());
8245            }
8246
8247            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8248            // are envelope_size bytes.
8249            let cur_offset: usize = (2 - 1) * envelope_size;
8250
8251            // Zero reserved fields.
8252            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8253
8254            // Safety:
8255            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8256            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8257            //   envelope_size bytes, there is always sufficient room.
8258            fidl::encoding::encode_in_envelope_optional::<DeviceType, D>(
8259                self.device_type
8260                    .as_ref()
8261                    .map(<DeviceType as fidl::encoding::ValueTypeMarker>::borrow),
8262                encoder,
8263                offset + cur_offset,
8264                depth,
8265            )?;
8266
8267            _prev_end_offset = cur_offset + envelope_size;
8268            if 3 > max_ordinal {
8269                return Ok(());
8270            }
8271
8272            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8273            // are envelope_size bytes.
8274            let cur_offset: usize = (3 - 1) * envelope_size;
8275
8276            // Zero reserved fields.
8277            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8278
8279            // Safety:
8280            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8281            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8282            //   envelope_size bytes, there is always sufficient room.
8283            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<SourceState>, D>(
8284            self.source_states.as_ref().map(<fidl::encoding::UnboundedVector<SourceState> as fidl::encoding::ValueTypeMarker>::borrow),
8285            encoder, offset + cur_offset, depth
8286        )?;
8287
8288            _prev_end_offset = cur_offset + envelope_size;
8289            if 4 > max_ordinal {
8290                return Ok(());
8291            }
8292
8293            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8294            // are envelope_size bytes.
8295            let cur_offset: usize = (4 - 1) * envelope_size;
8296
8297            // Zero reserved fields.
8298            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8299
8300            // Safety:
8301            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8302            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8303            //   envelope_size bytes, there is always sufficient room.
8304            fidl::encoding::encode_in_envelope_optional::<ToggleStateFlags, D>(
8305                self.mutable_toggle_state
8306                    .as_ref()
8307                    .map(<ToggleStateFlags as fidl::encoding::ValueTypeMarker>::borrow),
8308                encoder,
8309                offset + cur_offset,
8310                depth,
8311            )?;
8312
8313            _prev_end_offset = cur_offset + envelope_size;
8314            if 5 > max_ordinal {
8315                return Ok(());
8316            }
8317
8318            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8319            // are envelope_size bytes.
8320            let cur_offset: usize = (5 - 1) * envelope_size;
8321
8322            // Zero reserved fields.
8323            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8324
8325            // Safety:
8326            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8327            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8328            //   envelope_size bytes, there is always sufficient room.
8329            fidl::encoding::encode_in_envelope_optional::<DeviceState, D>(
8330                self.state.as_ref().map(<DeviceState as fidl::encoding::ValueTypeMarker>::borrow),
8331                encoder,
8332                offset + cur_offset,
8333                depth,
8334            )?;
8335
8336            _prev_end_offset = cur_offset + envelope_size;
8337
8338            Ok(())
8339        }
8340    }
8341
8342    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InputDevice {
8343        #[inline(always)]
8344        fn new_empty() -> Self {
8345            Self::default()
8346        }
8347
8348        unsafe fn decode(
8349            &mut self,
8350            decoder: &mut fidl::encoding::Decoder<'_, D>,
8351            offset: usize,
8352            mut depth: fidl::encoding::Depth,
8353        ) -> fidl::Result<()> {
8354            decoder.debug_check_bounds::<Self>(offset);
8355            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8356                None => return Err(fidl::Error::NotNullable),
8357                Some(len) => len,
8358            };
8359            // Calling decoder.out_of_line_offset(0) is not allowed.
8360            if len == 0 {
8361                return Ok(());
8362            };
8363            depth.increment()?;
8364            let envelope_size = 8;
8365            let bytes_len = len * envelope_size;
8366            let offset = decoder.out_of_line_offset(bytes_len)?;
8367            // Decode the envelope for each type.
8368            let mut _next_ordinal_to_read = 0;
8369            let mut next_offset = offset;
8370            let end_offset = offset + bytes_len;
8371            _next_ordinal_to_read += 1;
8372            if next_offset >= end_offset {
8373                return Ok(());
8374            }
8375
8376            // Decode unknown envelopes for gaps in ordinals.
8377            while _next_ordinal_to_read < 1 {
8378                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8379                _next_ordinal_to_read += 1;
8380                next_offset += envelope_size;
8381            }
8382
8383            let next_out_of_line = decoder.next_out_of_line();
8384            let handles_before = decoder.remaining_handles();
8385            if let Some((inlined, num_bytes, num_handles)) =
8386                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8387            {
8388                let member_inline_size =
8389                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
8390                        decoder.context,
8391                    );
8392                if inlined != (member_inline_size <= 4) {
8393                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8394                }
8395                let inner_offset;
8396                let mut inner_depth = depth.clone();
8397                if inlined {
8398                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8399                    inner_offset = next_offset;
8400                } else {
8401                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8402                    inner_depth.increment()?;
8403                }
8404                let val_ref = self
8405                    .device_name
8406                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
8407                fidl::decode!(
8408                    fidl::encoding::UnboundedString,
8409                    D,
8410                    val_ref,
8411                    decoder,
8412                    inner_offset,
8413                    inner_depth
8414                )?;
8415                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8416                {
8417                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8418                }
8419                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8420                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8421                }
8422            }
8423
8424            next_offset += envelope_size;
8425            _next_ordinal_to_read += 1;
8426            if next_offset >= end_offset {
8427                return Ok(());
8428            }
8429
8430            // Decode unknown envelopes for gaps in ordinals.
8431            while _next_ordinal_to_read < 2 {
8432                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8433                _next_ordinal_to_read += 1;
8434                next_offset += envelope_size;
8435            }
8436
8437            let next_out_of_line = decoder.next_out_of_line();
8438            let handles_before = decoder.remaining_handles();
8439            if let Some((inlined, num_bytes, num_handles)) =
8440                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8441            {
8442                let member_inline_size =
8443                    <DeviceType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8444                if inlined != (member_inline_size <= 4) {
8445                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8446                }
8447                let inner_offset;
8448                let mut inner_depth = depth.clone();
8449                if inlined {
8450                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8451                    inner_offset = next_offset;
8452                } else {
8453                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8454                    inner_depth.increment()?;
8455                }
8456                let val_ref =
8457                    self.device_type.get_or_insert_with(|| fidl::new_empty!(DeviceType, D));
8458                fidl::decode!(DeviceType, D, val_ref, decoder, inner_offset, inner_depth)?;
8459                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8460                {
8461                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8462                }
8463                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8464                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8465                }
8466            }
8467
8468            next_offset += envelope_size;
8469            _next_ordinal_to_read += 1;
8470            if next_offset >= end_offset {
8471                return Ok(());
8472            }
8473
8474            // Decode unknown envelopes for gaps in ordinals.
8475            while _next_ordinal_to_read < 3 {
8476                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8477                _next_ordinal_to_read += 1;
8478                next_offset += envelope_size;
8479            }
8480
8481            let next_out_of_line = decoder.next_out_of_line();
8482            let handles_before = decoder.remaining_handles();
8483            if let Some((inlined, num_bytes, num_handles)) =
8484                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8485            {
8486                let member_inline_size = <fidl::encoding::UnboundedVector<SourceState> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8487                if inlined != (member_inline_size <= 4) {
8488                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8489                }
8490                let inner_offset;
8491                let mut inner_depth = depth.clone();
8492                if inlined {
8493                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8494                    inner_offset = next_offset;
8495                } else {
8496                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8497                    inner_depth.increment()?;
8498                }
8499                let val_ref = self.source_states.get_or_insert_with(|| {
8500                    fidl::new_empty!(fidl::encoding::UnboundedVector<SourceState>, D)
8501                });
8502                fidl::decode!(
8503                    fidl::encoding::UnboundedVector<SourceState>,
8504                    D,
8505                    val_ref,
8506                    decoder,
8507                    inner_offset,
8508                    inner_depth
8509                )?;
8510                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8511                {
8512                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8513                }
8514                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8515                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8516                }
8517            }
8518
8519            next_offset += envelope_size;
8520            _next_ordinal_to_read += 1;
8521            if next_offset >= end_offset {
8522                return Ok(());
8523            }
8524
8525            // Decode unknown envelopes for gaps in ordinals.
8526            while _next_ordinal_to_read < 4 {
8527                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8528                _next_ordinal_to_read += 1;
8529                next_offset += envelope_size;
8530            }
8531
8532            let next_out_of_line = decoder.next_out_of_line();
8533            let handles_before = decoder.remaining_handles();
8534            if let Some((inlined, num_bytes, num_handles)) =
8535                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8536            {
8537                let member_inline_size =
8538                    <ToggleStateFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8539                if inlined != (member_inline_size <= 4) {
8540                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8541                }
8542                let inner_offset;
8543                let mut inner_depth = depth.clone();
8544                if inlined {
8545                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8546                    inner_offset = next_offset;
8547                } else {
8548                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8549                    inner_depth.increment()?;
8550                }
8551                let val_ref = self
8552                    .mutable_toggle_state
8553                    .get_or_insert_with(|| fidl::new_empty!(ToggleStateFlags, D));
8554                fidl::decode!(ToggleStateFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
8555                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8556                {
8557                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8558                }
8559                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8560                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8561                }
8562            }
8563
8564            next_offset += envelope_size;
8565            _next_ordinal_to_read += 1;
8566            if next_offset >= end_offset {
8567                return Ok(());
8568            }
8569
8570            // Decode unknown envelopes for gaps in ordinals.
8571            while _next_ordinal_to_read < 5 {
8572                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8573                _next_ordinal_to_read += 1;
8574                next_offset += envelope_size;
8575            }
8576
8577            let next_out_of_line = decoder.next_out_of_line();
8578            let handles_before = decoder.remaining_handles();
8579            if let Some((inlined, num_bytes, num_handles)) =
8580                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8581            {
8582                let member_inline_size =
8583                    <DeviceState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8584                if inlined != (member_inline_size <= 4) {
8585                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8586                }
8587                let inner_offset;
8588                let mut inner_depth = depth.clone();
8589                if inlined {
8590                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8591                    inner_offset = next_offset;
8592                } else {
8593                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8594                    inner_depth.increment()?;
8595                }
8596                let val_ref = self.state.get_or_insert_with(|| fidl::new_empty!(DeviceState, D));
8597                fidl::decode!(DeviceState, D, val_ref, decoder, inner_offset, inner_depth)?;
8598                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8599                {
8600                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8601                }
8602                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8603                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8604                }
8605            }
8606
8607            next_offset += envelope_size;
8608
8609            // Decode the remaining unknown envelopes.
8610            while next_offset < end_offset {
8611                _next_ordinal_to_read += 1;
8612                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8613                next_offset += envelope_size;
8614            }
8615
8616            Ok(())
8617        }
8618    }
8619
8620    impl InputSettings {
8621        #[inline(always)]
8622        fn max_ordinal_present(&self) -> u64 {
8623            if let Some(_) = self.devices {
8624                return 1;
8625            }
8626            0
8627        }
8628    }
8629
8630    impl fidl::encoding::ValueTypeMarker for InputSettings {
8631        type Borrowed<'a> = &'a Self;
8632        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8633            value
8634        }
8635    }
8636
8637    unsafe impl fidl::encoding::TypeMarker for InputSettings {
8638        type Owned = Self;
8639
8640        #[inline(always)]
8641        fn inline_align(_context: fidl::encoding::Context) -> usize {
8642            8
8643        }
8644
8645        #[inline(always)]
8646        fn inline_size(_context: fidl::encoding::Context) -> usize {
8647            16
8648        }
8649    }
8650
8651    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InputSettings, D>
8652        for &InputSettings
8653    {
8654        unsafe fn encode(
8655            self,
8656            encoder: &mut fidl::encoding::Encoder<'_, D>,
8657            offset: usize,
8658            mut depth: fidl::encoding::Depth,
8659        ) -> fidl::Result<()> {
8660            encoder.debug_check_bounds::<InputSettings>(offset);
8661            // Vector header
8662            let max_ordinal: u64 = self.max_ordinal_present();
8663            encoder.write_num(max_ordinal, offset);
8664            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8665            // Calling encoder.out_of_line_offset(0) is not allowed.
8666            if max_ordinal == 0 {
8667                return Ok(());
8668            }
8669            depth.increment()?;
8670            let envelope_size = 8;
8671            let bytes_len = max_ordinal as usize * envelope_size;
8672            #[allow(unused_variables)]
8673            let offset = encoder.out_of_line_offset(bytes_len);
8674            let mut _prev_end_offset: usize = 0;
8675            if 1 > max_ordinal {
8676                return Ok(());
8677            }
8678
8679            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8680            // are envelope_size bytes.
8681            let cur_offset: usize = (1 - 1) * envelope_size;
8682
8683            // Zero reserved fields.
8684            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8685
8686            // Safety:
8687            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8688            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8689            //   envelope_size bytes, there is always sufficient room.
8690            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<InputDevice>, D>(
8691            self.devices.as_ref().map(<fidl::encoding::UnboundedVector<InputDevice> as fidl::encoding::ValueTypeMarker>::borrow),
8692            encoder, offset + cur_offset, depth
8693        )?;
8694
8695            _prev_end_offset = cur_offset + envelope_size;
8696
8697            Ok(())
8698        }
8699    }
8700
8701    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InputSettings {
8702        #[inline(always)]
8703        fn new_empty() -> Self {
8704            Self::default()
8705        }
8706
8707        unsafe fn decode(
8708            &mut self,
8709            decoder: &mut fidl::encoding::Decoder<'_, D>,
8710            offset: usize,
8711            mut depth: fidl::encoding::Depth,
8712        ) -> fidl::Result<()> {
8713            decoder.debug_check_bounds::<Self>(offset);
8714            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8715                None => return Err(fidl::Error::NotNullable),
8716                Some(len) => len,
8717            };
8718            // Calling decoder.out_of_line_offset(0) is not allowed.
8719            if len == 0 {
8720                return Ok(());
8721            };
8722            depth.increment()?;
8723            let envelope_size = 8;
8724            let bytes_len = len * envelope_size;
8725            let offset = decoder.out_of_line_offset(bytes_len)?;
8726            // Decode the envelope for each type.
8727            let mut _next_ordinal_to_read = 0;
8728            let mut next_offset = offset;
8729            let end_offset = offset + bytes_len;
8730            _next_ordinal_to_read += 1;
8731            if next_offset >= end_offset {
8732                return Ok(());
8733            }
8734
8735            // Decode unknown envelopes for gaps in ordinals.
8736            while _next_ordinal_to_read < 1 {
8737                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8738                _next_ordinal_to_read += 1;
8739                next_offset += envelope_size;
8740            }
8741
8742            let next_out_of_line = decoder.next_out_of_line();
8743            let handles_before = decoder.remaining_handles();
8744            if let Some((inlined, num_bytes, num_handles)) =
8745                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8746            {
8747                let member_inline_size = <fidl::encoding::UnboundedVector<InputDevice> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8748                if inlined != (member_inline_size <= 4) {
8749                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8750                }
8751                let inner_offset;
8752                let mut inner_depth = depth.clone();
8753                if inlined {
8754                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8755                    inner_offset = next_offset;
8756                } else {
8757                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8758                    inner_depth.increment()?;
8759                }
8760                let val_ref = self.devices.get_or_insert_with(|| {
8761                    fidl::new_empty!(fidl::encoding::UnboundedVector<InputDevice>, D)
8762                });
8763                fidl::decode!(
8764                    fidl::encoding::UnboundedVector<InputDevice>,
8765                    D,
8766                    val_ref,
8767                    decoder,
8768                    inner_offset,
8769                    inner_depth
8770                )?;
8771                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8772                {
8773                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8774                }
8775                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8776                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8777                }
8778            }
8779
8780            next_offset += envelope_size;
8781
8782            // Decode the remaining unknown envelopes.
8783            while next_offset < end_offset {
8784                _next_ordinal_to_read += 1;
8785                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8786                next_offset += envelope_size;
8787            }
8788
8789            Ok(())
8790        }
8791    }
8792
8793    impl InputState {
8794        #[inline(always)]
8795        fn max_ordinal_present(&self) -> u64 {
8796            if let Some(_) = self.state {
8797                return 3;
8798            }
8799            if let Some(_) = self.device_type {
8800                return 2;
8801            }
8802            if let Some(_) = self.name {
8803                return 1;
8804            }
8805            0
8806        }
8807    }
8808
8809    impl fidl::encoding::ValueTypeMarker for InputState {
8810        type Borrowed<'a> = &'a Self;
8811        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8812            value
8813        }
8814    }
8815
8816    unsafe impl fidl::encoding::TypeMarker for InputState {
8817        type Owned = Self;
8818
8819        #[inline(always)]
8820        fn inline_align(_context: fidl::encoding::Context) -> usize {
8821            8
8822        }
8823
8824        #[inline(always)]
8825        fn inline_size(_context: fidl::encoding::Context) -> usize {
8826            16
8827        }
8828    }
8829
8830    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InputState, D>
8831        for &InputState
8832    {
8833        unsafe fn encode(
8834            self,
8835            encoder: &mut fidl::encoding::Encoder<'_, D>,
8836            offset: usize,
8837            mut depth: fidl::encoding::Depth,
8838        ) -> fidl::Result<()> {
8839            encoder.debug_check_bounds::<InputState>(offset);
8840            // Vector header
8841            let max_ordinal: u64 = self.max_ordinal_present();
8842            encoder.write_num(max_ordinal, offset);
8843            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8844            // Calling encoder.out_of_line_offset(0) is not allowed.
8845            if max_ordinal == 0 {
8846                return Ok(());
8847            }
8848            depth.increment()?;
8849            let envelope_size = 8;
8850            let bytes_len = max_ordinal as usize * envelope_size;
8851            #[allow(unused_variables)]
8852            let offset = encoder.out_of_line_offset(bytes_len);
8853            let mut _prev_end_offset: usize = 0;
8854            if 1 > max_ordinal {
8855                return Ok(());
8856            }
8857
8858            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8859            // are envelope_size bytes.
8860            let cur_offset: usize = (1 - 1) * envelope_size;
8861
8862            // Zero reserved fields.
8863            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8864
8865            // Safety:
8866            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8867            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8868            //   envelope_size bytes, there is always sufficient room.
8869            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
8870                self.name.as_ref().map(
8871                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
8872                ),
8873                encoder,
8874                offset + cur_offset,
8875                depth,
8876            )?;
8877
8878            _prev_end_offset = cur_offset + envelope_size;
8879            if 2 > max_ordinal {
8880                return Ok(());
8881            }
8882
8883            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8884            // are envelope_size bytes.
8885            let cur_offset: usize = (2 - 1) * envelope_size;
8886
8887            // Zero reserved fields.
8888            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8889
8890            // Safety:
8891            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8892            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8893            //   envelope_size bytes, there is always sufficient room.
8894            fidl::encoding::encode_in_envelope_optional::<DeviceType, D>(
8895                self.device_type
8896                    .as_ref()
8897                    .map(<DeviceType as fidl::encoding::ValueTypeMarker>::borrow),
8898                encoder,
8899                offset + cur_offset,
8900                depth,
8901            )?;
8902
8903            _prev_end_offset = cur_offset + envelope_size;
8904            if 3 > max_ordinal {
8905                return Ok(());
8906            }
8907
8908            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8909            // are envelope_size bytes.
8910            let cur_offset: usize = (3 - 1) * envelope_size;
8911
8912            // Zero reserved fields.
8913            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8914
8915            // Safety:
8916            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8917            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8918            //   envelope_size bytes, there is always sufficient room.
8919            fidl::encoding::encode_in_envelope_optional::<DeviceState, D>(
8920                self.state.as_ref().map(<DeviceState as fidl::encoding::ValueTypeMarker>::borrow),
8921                encoder,
8922                offset + cur_offset,
8923                depth,
8924            )?;
8925
8926            _prev_end_offset = cur_offset + envelope_size;
8927
8928            Ok(())
8929        }
8930    }
8931
8932    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InputState {
8933        #[inline(always)]
8934        fn new_empty() -> Self {
8935            Self::default()
8936        }
8937
8938        unsafe fn decode(
8939            &mut self,
8940            decoder: &mut fidl::encoding::Decoder<'_, D>,
8941            offset: usize,
8942            mut depth: fidl::encoding::Depth,
8943        ) -> fidl::Result<()> {
8944            decoder.debug_check_bounds::<Self>(offset);
8945            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8946                None => return Err(fidl::Error::NotNullable),
8947                Some(len) => len,
8948            };
8949            // Calling decoder.out_of_line_offset(0) is not allowed.
8950            if len == 0 {
8951                return Ok(());
8952            };
8953            depth.increment()?;
8954            let envelope_size = 8;
8955            let bytes_len = len * envelope_size;
8956            let offset = decoder.out_of_line_offset(bytes_len)?;
8957            // Decode the envelope for each type.
8958            let mut _next_ordinal_to_read = 0;
8959            let mut next_offset = offset;
8960            let end_offset = offset + bytes_len;
8961            _next_ordinal_to_read += 1;
8962            if next_offset >= end_offset {
8963                return Ok(());
8964            }
8965
8966            // Decode unknown envelopes for gaps in ordinals.
8967            while _next_ordinal_to_read < 1 {
8968                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8969                _next_ordinal_to_read += 1;
8970                next_offset += envelope_size;
8971            }
8972
8973            let next_out_of_line = decoder.next_out_of_line();
8974            let handles_before = decoder.remaining_handles();
8975            if let Some((inlined, num_bytes, num_handles)) =
8976                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8977            {
8978                let member_inline_size =
8979                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
8980                        decoder.context,
8981                    );
8982                if inlined != (member_inline_size <= 4) {
8983                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8984                }
8985                let inner_offset;
8986                let mut inner_depth = depth.clone();
8987                if inlined {
8988                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8989                    inner_offset = next_offset;
8990                } else {
8991                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8992                    inner_depth.increment()?;
8993                }
8994                let val_ref = self
8995                    .name
8996                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
8997                fidl::decode!(
8998                    fidl::encoding::UnboundedString,
8999                    D,
9000                    val_ref,
9001                    decoder,
9002                    inner_offset,
9003                    inner_depth
9004                )?;
9005                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9006                {
9007                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9008                }
9009                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9010                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9011                }
9012            }
9013
9014            next_offset += envelope_size;
9015            _next_ordinal_to_read += 1;
9016            if next_offset >= end_offset {
9017                return Ok(());
9018            }
9019
9020            // Decode unknown envelopes for gaps in ordinals.
9021            while _next_ordinal_to_read < 2 {
9022                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9023                _next_ordinal_to_read += 1;
9024                next_offset += envelope_size;
9025            }
9026
9027            let next_out_of_line = decoder.next_out_of_line();
9028            let handles_before = decoder.remaining_handles();
9029            if let Some((inlined, num_bytes, num_handles)) =
9030                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9031            {
9032                let member_inline_size =
9033                    <DeviceType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9034                if inlined != (member_inline_size <= 4) {
9035                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9036                }
9037                let inner_offset;
9038                let mut inner_depth = depth.clone();
9039                if inlined {
9040                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9041                    inner_offset = next_offset;
9042                } else {
9043                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9044                    inner_depth.increment()?;
9045                }
9046                let val_ref =
9047                    self.device_type.get_or_insert_with(|| fidl::new_empty!(DeviceType, D));
9048                fidl::decode!(DeviceType, D, val_ref, decoder, inner_offset, inner_depth)?;
9049                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9050                {
9051                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9052                }
9053                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9054                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9055                }
9056            }
9057
9058            next_offset += envelope_size;
9059            _next_ordinal_to_read += 1;
9060            if next_offset >= end_offset {
9061                return Ok(());
9062            }
9063
9064            // Decode unknown envelopes for gaps in ordinals.
9065            while _next_ordinal_to_read < 3 {
9066                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9067                _next_ordinal_to_read += 1;
9068                next_offset += envelope_size;
9069            }
9070
9071            let next_out_of_line = decoder.next_out_of_line();
9072            let handles_before = decoder.remaining_handles();
9073            if let Some((inlined, num_bytes, num_handles)) =
9074                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9075            {
9076                let member_inline_size =
9077                    <DeviceState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9078                if inlined != (member_inline_size <= 4) {
9079                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9080                }
9081                let inner_offset;
9082                let mut inner_depth = depth.clone();
9083                if inlined {
9084                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9085                    inner_offset = next_offset;
9086                } else {
9087                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9088                    inner_depth.increment()?;
9089                }
9090                let val_ref = self.state.get_or_insert_with(|| fidl::new_empty!(DeviceState, D));
9091                fidl::decode!(DeviceState, D, val_ref, decoder, inner_offset, inner_depth)?;
9092                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9093                {
9094                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9095                }
9096                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9097                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9098                }
9099            }
9100
9101            next_offset += envelope_size;
9102
9103            // Decode the remaining unknown envelopes.
9104            while next_offset < end_offset {
9105                _next_ordinal_to_read += 1;
9106                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9107                next_offset += envelope_size;
9108            }
9109
9110            Ok(())
9111        }
9112    }
9113
9114    impl IntlSettings {
9115        #[inline(always)]
9116        fn max_ordinal_present(&self) -> u64 {
9117            if let Some(_) = self.hour_cycle {
9118                return 4;
9119            }
9120            if let Some(_) = self.time_zone_id {
9121                return 3;
9122            }
9123            if let Some(_) = self.temperature_unit {
9124                return 2;
9125            }
9126            if let Some(_) = self.locales {
9127                return 1;
9128            }
9129            0
9130        }
9131    }
9132
9133    impl fidl::encoding::ValueTypeMarker for IntlSettings {
9134        type Borrowed<'a> = &'a Self;
9135        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9136            value
9137        }
9138    }
9139
9140    unsafe impl fidl::encoding::TypeMarker for IntlSettings {
9141        type Owned = Self;
9142
9143        #[inline(always)]
9144        fn inline_align(_context: fidl::encoding::Context) -> usize {
9145            8
9146        }
9147
9148        #[inline(always)]
9149        fn inline_size(_context: fidl::encoding::Context) -> usize {
9150            16
9151        }
9152    }
9153
9154    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IntlSettings, D>
9155        for &IntlSettings
9156    {
9157        unsafe fn encode(
9158            self,
9159            encoder: &mut fidl::encoding::Encoder<'_, D>,
9160            offset: usize,
9161            mut depth: fidl::encoding::Depth,
9162        ) -> fidl::Result<()> {
9163            encoder.debug_check_bounds::<IntlSettings>(offset);
9164            // Vector header
9165            let max_ordinal: u64 = self.max_ordinal_present();
9166            encoder.write_num(max_ordinal, offset);
9167            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9168            // Calling encoder.out_of_line_offset(0) is not allowed.
9169            if max_ordinal == 0 {
9170                return Ok(());
9171            }
9172            depth.increment()?;
9173            let envelope_size = 8;
9174            let bytes_len = max_ordinal as usize * envelope_size;
9175            #[allow(unused_variables)]
9176            let offset = encoder.out_of_line_offset(bytes_len);
9177            let mut _prev_end_offset: usize = 0;
9178            if 1 > max_ordinal {
9179                return Ok(());
9180            }
9181
9182            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9183            // are envelope_size bytes.
9184            let cur_offset: usize = (1 - 1) * envelope_size;
9185
9186            // Zero reserved fields.
9187            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9188
9189            // Safety:
9190            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9191            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9192            //   envelope_size bytes, there is always sufficient room.
9193            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_intl__common::LocaleId, 10>, D>(
9194            self.locales.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_intl__common::LocaleId, 10> as fidl::encoding::ValueTypeMarker>::borrow),
9195            encoder, offset + cur_offset, depth
9196        )?;
9197
9198            _prev_end_offset = cur_offset + envelope_size;
9199            if 2 > max_ordinal {
9200                return Ok(());
9201            }
9202
9203            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9204            // are envelope_size bytes.
9205            let cur_offset: usize = (2 - 1) * envelope_size;
9206
9207            // Zero reserved fields.
9208            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9209
9210            // Safety:
9211            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9212            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9213            //   envelope_size bytes, there is always sufficient room.
9214            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_intl__common::TemperatureUnit, D>(
9215            self.temperature_unit.as_ref().map(<fidl_fuchsia_intl__common::TemperatureUnit as fidl::encoding::ValueTypeMarker>::borrow),
9216            encoder, offset + cur_offset, depth
9217        )?;
9218
9219            _prev_end_offset = cur_offset + envelope_size;
9220            if 3 > max_ordinal {
9221                return Ok(());
9222            }
9223
9224            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9225            // are envelope_size bytes.
9226            let cur_offset: usize = (3 - 1) * envelope_size;
9227
9228            // Zero reserved fields.
9229            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9230
9231            // Safety:
9232            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9233            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9234            //   envelope_size bytes, there is always sufficient room.
9235            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_intl__common::TimeZoneId, D>(
9236            self.time_zone_id.as_ref().map(<fidl_fuchsia_intl__common::TimeZoneId as fidl::encoding::ValueTypeMarker>::borrow),
9237            encoder, offset + cur_offset, depth
9238        )?;
9239
9240            _prev_end_offset = cur_offset + envelope_size;
9241            if 4 > max_ordinal {
9242                return Ok(());
9243            }
9244
9245            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9246            // are envelope_size bytes.
9247            let cur_offset: usize = (4 - 1) * envelope_size;
9248
9249            // Zero reserved fields.
9250            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9251
9252            // Safety:
9253            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9254            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9255            //   envelope_size bytes, there is always sufficient room.
9256            fidl::encoding::encode_in_envelope_optional::<HourCycle, D>(
9257                self.hour_cycle
9258                    .as_ref()
9259                    .map(<HourCycle as fidl::encoding::ValueTypeMarker>::borrow),
9260                encoder,
9261                offset + cur_offset,
9262                depth,
9263            )?;
9264
9265            _prev_end_offset = cur_offset + envelope_size;
9266
9267            Ok(())
9268        }
9269    }
9270
9271    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IntlSettings {
9272        #[inline(always)]
9273        fn new_empty() -> Self {
9274            Self::default()
9275        }
9276
9277        unsafe fn decode(
9278            &mut self,
9279            decoder: &mut fidl::encoding::Decoder<'_, D>,
9280            offset: usize,
9281            mut depth: fidl::encoding::Depth,
9282        ) -> fidl::Result<()> {
9283            decoder.debug_check_bounds::<Self>(offset);
9284            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9285                None => return Err(fidl::Error::NotNullable),
9286                Some(len) => len,
9287            };
9288            // Calling decoder.out_of_line_offset(0) is not allowed.
9289            if len == 0 {
9290                return Ok(());
9291            };
9292            depth.increment()?;
9293            let envelope_size = 8;
9294            let bytes_len = len * envelope_size;
9295            let offset = decoder.out_of_line_offset(bytes_len)?;
9296            // Decode the envelope for each type.
9297            let mut _next_ordinal_to_read = 0;
9298            let mut next_offset = offset;
9299            let end_offset = offset + bytes_len;
9300            _next_ordinal_to_read += 1;
9301            if next_offset >= end_offset {
9302                return Ok(());
9303            }
9304
9305            // Decode unknown envelopes for gaps in ordinals.
9306            while _next_ordinal_to_read < 1 {
9307                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9308                _next_ordinal_to_read += 1;
9309                next_offset += envelope_size;
9310            }
9311
9312            let next_out_of_line = decoder.next_out_of_line();
9313            let handles_before = decoder.remaining_handles();
9314            if let Some((inlined, num_bytes, num_handles)) =
9315                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9316            {
9317                let member_inline_size = <fidl::encoding::Vector<
9318                    fidl_fuchsia_intl__common::LocaleId,
9319                    10,
9320                > as fidl::encoding::TypeMarker>::inline_size(
9321                    decoder.context
9322                );
9323                if inlined != (member_inline_size <= 4) {
9324                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9325                }
9326                let inner_offset;
9327                let mut inner_depth = depth.clone();
9328                if inlined {
9329                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9330                    inner_offset = next_offset;
9331                } else {
9332                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9333                    inner_depth.increment()?;
9334                }
9335                let val_ref =
9336                self.locales.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_intl__common::LocaleId, 10>, D));
9337                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_intl__common::LocaleId, 10>, D, val_ref, decoder, inner_offset, inner_depth)?;
9338                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9339                {
9340                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9341                }
9342                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9343                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9344                }
9345            }
9346
9347            next_offset += envelope_size;
9348            _next_ordinal_to_read += 1;
9349            if next_offset >= end_offset {
9350                return Ok(());
9351            }
9352
9353            // Decode unknown envelopes for gaps in ordinals.
9354            while _next_ordinal_to_read < 2 {
9355                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9356                _next_ordinal_to_read += 1;
9357                next_offset += envelope_size;
9358            }
9359
9360            let next_out_of_line = decoder.next_out_of_line();
9361            let handles_before = decoder.remaining_handles();
9362            if let Some((inlined, num_bytes, num_handles)) =
9363                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9364            {
9365                let member_inline_size = <fidl_fuchsia_intl__common::TemperatureUnit as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9366                if inlined != (member_inline_size <= 4) {
9367                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9368                }
9369                let inner_offset;
9370                let mut inner_depth = depth.clone();
9371                if inlined {
9372                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9373                    inner_offset = next_offset;
9374                } else {
9375                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9376                    inner_depth.increment()?;
9377                }
9378                let val_ref = self.temperature_unit.get_or_insert_with(|| {
9379                    fidl::new_empty!(fidl_fuchsia_intl__common::TemperatureUnit, D)
9380                });
9381                fidl::decode!(
9382                    fidl_fuchsia_intl__common::TemperatureUnit,
9383                    D,
9384                    val_ref,
9385                    decoder,
9386                    inner_offset,
9387                    inner_depth
9388                )?;
9389                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9390                {
9391                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9392                }
9393                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9394                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9395                }
9396            }
9397
9398            next_offset += envelope_size;
9399            _next_ordinal_to_read += 1;
9400            if next_offset >= end_offset {
9401                return Ok(());
9402            }
9403
9404            // Decode unknown envelopes for gaps in ordinals.
9405            while _next_ordinal_to_read < 3 {
9406                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9407                _next_ordinal_to_read += 1;
9408                next_offset += envelope_size;
9409            }
9410
9411            let next_out_of_line = decoder.next_out_of_line();
9412            let handles_before = decoder.remaining_handles();
9413            if let Some((inlined, num_bytes, num_handles)) =
9414                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9415            {
9416                let member_inline_size = <fidl_fuchsia_intl__common::TimeZoneId as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9417                if inlined != (member_inline_size <= 4) {
9418                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9419                }
9420                let inner_offset;
9421                let mut inner_depth = depth.clone();
9422                if inlined {
9423                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9424                    inner_offset = next_offset;
9425                } else {
9426                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9427                    inner_depth.increment()?;
9428                }
9429                let val_ref = self.time_zone_id.get_or_insert_with(|| {
9430                    fidl::new_empty!(fidl_fuchsia_intl__common::TimeZoneId, D)
9431                });
9432                fidl::decode!(
9433                    fidl_fuchsia_intl__common::TimeZoneId,
9434                    D,
9435                    val_ref,
9436                    decoder,
9437                    inner_offset,
9438                    inner_depth
9439                )?;
9440                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9441                {
9442                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9443                }
9444                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9445                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9446                }
9447            }
9448
9449            next_offset += envelope_size;
9450            _next_ordinal_to_read += 1;
9451            if next_offset >= end_offset {
9452                return Ok(());
9453            }
9454
9455            // Decode unknown envelopes for gaps in ordinals.
9456            while _next_ordinal_to_read < 4 {
9457                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9458                _next_ordinal_to_read += 1;
9459                next_offset += envelope_size;
9460            }
9461
9462            let next_out_of_line = decoder.next_out_of_line();
9463            let handles_before = decoder.remaining_handles();
9464            if let Some((inlined, num_bytes, num_handles)) =
9465                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9466            {
9467                let member_inline_size =
9468                    <HourCycle as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9469                if inlined != (member_inline_size <= 4) {
9470                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9471                }
9472                let inner_offset;
9473                let mut inner_depth = depth.clone();
9474                if inlined {
9475                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9476                    inner_offset = next_offset;
9477                } else {
9478                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9479                    inner_depth.increment()?;
9480                }
9481                let val_ref = self.hour_cycle.get_or_insert_with(|| fidl::new_empty!(HourCycle, D));
9482                fidl::decode!(HourCycle, D, val_ref, decoder, inner_offset, inner_depth)?;
9483                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9484                {
9485                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9486                }
9487                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9488                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9489                }
9490            }
9491
9492            next_offset += envelope_size;
9493
9494            // Decode the remaining unknown envelopes.
9495            while next_offset < end_offset {
9496                _next_ordinal_to_read += 1;
9497                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9498                next_offset += envelope_size;
9499            }
9500
9501            Ok(())
9502        }
9503    }
9504
9505    impl KeyboardSettings {
9506        #[inline(always)]
9507        fn max_ordinal_present(&self) -> u64 {
9508            if let Some(_) = self.autorepeat {
9509                return 2;
9510            }
9511            if let Some(_) = self.keymap {
9512                return 1;
9513            }
9514            0
9515        }
9516    }
9517
9518    impl fidl::encoding::ValueTypeMarker for KeyboardSettings {
9519        type Borrowed<'a> = &'a Self;
9520        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9521            value
9522        }
9523    }
9524
9525    unsafe impl fidl::encoding::TypeMarker for KeyboardSettings {
9526        type Owned = Self;
9527
9528        #[inline(always)]
9529        fn inline_align(_context: fidl::encoding::Context) -> usize {
9530            8
9531        }
9532
9533        #[inline(always)]
9534        fn inline_size(_context: fidl::encoding::Context) -> usize {
9535            16
9536        }
9537    }
9538
9539    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<KeyboardSettings, D>
9540        for &KeyboardSettings
9541    {
9542        unsafe fn encode(
9543            self,
9544            encoder: &mut fidl::encoding::Encoder<'_, D>,
9545            offset: usize,
9546            mut depth: fidl::encoding::Depth,
9547        ) -> fidl::Result<()> {
9548            encoder.debug_check_bounds::<KeyboardSettings>(offset);
9549            // Vector header
9550            let max_ordinal: u64 = self.max_ordinal_present();
9551            encoder.write_num(max_ordinal, offset);
9552            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9553            // Calling encoder.out_of_line_offset(0) is not allowed.
9554            if max_ordinal == 0 {
9555                return Ok(());
9556            }
9557            depth.increment()?;
9558            let envelope_size = 8;
9559            let bytes_len = max_ordinal as usize * envelope_size;
9560            #[allow(unused_variables)]
9561            let offset = encoder.out_of_line_offset(bytes_len);
9562            let mut _prev_end_offset: usize = 0;
9563            if 1 > max_ordinal {
9564                return Ok(());
9565            }
9566
9567            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9568            // are envelope_size bytes.
9569            let cur_offset: usize = (1 - 1) * envelope_size;
9570
9571            // Zero reserved fields.
9572            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9573
9574            // Safety:
9575            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9576            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9577            //   envelope_size bytes, there is always sufficient room.
9578            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_input__common::KeymapId, D>(
9579            self.keymap.as_ref().map(<fidl_fuchsia_input__common::KeymapId as fidl::encoding::ValueTypeMarker>::borrow),
9580            encoder, offset + cur_offset, depth
9581        )?;
9582
9583            _prev_end_offset = cur_offset + envelope_size;
9584            if 2 > max_ordinal {
9585                return Ok(());
9586            }
9587
9588            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9589            // are envelope_size bytes.
9590            let cur_offset: usize = (2 - 1) * envelope_size;
9591
9592            // Zero reserved fields.
9593            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9594
9595            // Safety:
9596            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9597            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9598            //   envelope_size bytes, there is always sufficient room.
9599            fidl::encoding::encode_in_envelope_optional::<Autorepeat, D>(
9600                self.autorepeat
9601                    .as_ref()
9602                    .map(<Autorepeat as fidl::encoding::ValueTypeMarker>::borrow),
9603                encoder,
9604                offset + cur_offset,
9605                depth,
9606            )?;
9607
9608            _prev_end_offset = cur_offset + envelope_size;
9609
9610            Ok(())
9611        }
9612    }
9613
9614    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for KeyboardSettings {
9615        #[inline(always)]
9616        fn new_empty() -> Self {
9617            Self::default()
9618        }
9619
9620        unsafe fn decode(
9621            &mut self,
9622            decoder: &mut fidl::encoding::Decoder<'_, D>,
9623            offset: usize,
9624            mut depth: fidl::encoding::Depth,
9625        ) -> fidl::Result<()> {
9626            decoder.debug_check_bounds::<Self>(offset);
9627            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9628                None => return Err(fidl::Error::NotNullable),
9629                Some(len) => len,
9630            };
9631            // Calling decoder.out_of_line_offset(0) is not allowed.
9632            if len == 0 {
9633                return Ok(());
9634            };
9635            depth.increment()?;
9636            let envelope_size = 8;
9637            let bytes_len = len * envelope_size;
9638            let offset = decoder.out_of_line_offset(bytes_len)?;
9639            // Decode the envelope for each type.
9640            let mut _next_ordinal_to_read = 0;
9641            let mut next_offset = offset;
9642            let end_offset = offset + bytes_len;
9643            _next_ordinal_to_read += 1;
9644            if next_offset >= end_offset {
9645                return Ok(());
9646            }
9647
9648            // Decode unknown envelopes for gaps in ordinals.
9649            while _next_ordinal_to_read < 1 {
9650                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9651                _next_ordinal_to_read += 1;
9652                next_offset += envelope_size;
9653            }
9654
9655            let next_out_of_line = decoder.next_out_of_line();
9656            let handles_before = decoder.remaining_handles();
9657            if let Some((inlined, num_bytes, num_handles)) =
9658                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9659            {
9660                let member_inline_size = <fidl_fuchsia_input__common::KeymapId as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9661                if inlined != (member_inline_size <= 4) {
9662                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9663                }
9664                let inner_offset;
9665                let mut inner_depth = depth.clone();
9666                if inlined {
9667                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9668                    inner_offset = next_offset;
9669                } else {
9670                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9671                    inner_depth.increment()?;
9672                }
9673                let val_ref = self.keymap.get_or_insert_with(|| {
9674                    fidl::new_empty!(fidl_fuchsia_input__common::KeymapId, D)
9675                });
9676                fidl::decode!(
9677                    fidl_fuchsia_input__common::KeymapId,
9678                    D,
9679                    val_ref,
9680                    decoder,
9681                    inner_offset,
9682                    inner_depth
9683                )?;
9684                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9685                {
9686                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9687                }
9688                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9689                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9690                }
9691            }
9692
9693            next_offset += envelope_size;
9694            _next_ordinal_to_read += 1;
9695            if next_offset >= end_offset {
9696                return Ok(());
9697            }
9698
9699            // Decode unknown envelopes for gaps in ordinals.
9700            while _next_ordinal_to_read < 2 {
9701                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9702                _next_ordinal_to_read += 1;
9703                next_offset += envelope_size;
9704            }
9705
9706            let next_out_of_line = decoder.next_out_of_line();
9707            let handles_before = decoder.remaining_handles();
9708            if let Some((inlined, num_bytes, num_handles)) =
9709                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9710            {
9711                let member_inline_size =
9712                    <Autorepeat as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9713                if inlined != (member_inline_size <= 4) {
9714                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9715                }
9716                let inner_offset;
9717                let mut inner_depth = depth.clone();
9718                if inlined {
9719                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9720                    inner_offset = next_offset;
9721                } else {
9722                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9723                    inner_depth.increment()?;
9724                }
9725                let val_ref =
9726                    self.autorepeat.get_or_insert_with(|| fidl::new_empty!(Autorepeat, D));
9727                fidl::decode!(Autorepeat, D, val_ref, decoder, inner_offset, inner_depth)?;
9728                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9729                {
9730                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9731                }
9732                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9733                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9734                }
9735            }
9736
9737            next_offset += envelope_size;
9738
9739            // Decode the remaining unknown envelopes.
9740            while next_offset < end_offset {
9741                _next_ordinal_to_read += 1;
9742                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9743                next_offset += envelope_size;
9744            }
9745
9746            Ok(())
9747        }
9748    }
9749
9750    impl LightGroup {
9751        #[inline(always)]
9752        fn max_ordinal_present(&self) -> u64 {
9753            if let Some(_) = self.lights {
9754                return 4;
9755            }
9756            if let Some(_) = self.type_ {
9757                return 3;
9758            }
9759            if let Some(_) = self.enabled {
9760                return 2;
9761            }
9762            if let Some(_) = self.name {
9763                return 1;
9764            }
9765            0
9766        }
9767    }
9768
9769    impl fidl::encoding::ValueTypeMarker for LightGroup {
9770        type Borrowed<'a> = &'a Self;
9771        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9772            value
9773        }
9774    }
9775
9776    unsafe impl fidl::encoding::TypeMarker for LightGroup {
9777        type Owned = Self;
9778
9779        #[inline(always)]
9780        fn inline_align(_context: fidl::encoding::Context) -> usize {
9781            8
9782        }
9783
9784        #[inline(always)]
9785        fn inline_size(_context: fidl::encoding::Context) -> usize {
9786            16
9787        }
9788    }
9789
9790    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightGroup, D>
9791        for &LightGroup
9792    {
9793        unsafe fn encode(
9794            self,
9795            encoder: &mut fidl::encoding::Encoder<'_, D>,
9796            offset: usize,
9797            mut depth: fidl::encoding::Depth,
9798        ) -> fidl::Result<()> {
9799            encoder.debug_check_bounds::<LightGroup>(offset);
9800            // Vector header
9801            let max_ordinal: u64 = self.max_ordinal_present();
9802            encoder.write_num(max_ordinal, offset);
9803            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9804            // Calling encoder.out_of_line_offset(0) is not allowed.
9805            if max_ordinal == 0 {
9806                return Ok(());
9807            }
9808            depth.increment()?;
9809            let envelope_size = 8;
9810            let bytes_len = max_ordinal as usize * envelope_size;
9811            #[allow(unused_variables)]
9812            let offset = encoder.out_of_line_offset(bytes_len);
9813            let mut _prev_end_offset: usize = 0;
9814            if 1 > max_ordinal {
9815                return Ok(());
9816            }
9817
9818            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9819            // are envelope_size bytes.
9820            let cur_offset: usize = (1 - 1) * envelope_size;
9821
9822            // Zero reserved fields.
9823            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9824
9825            // Safety:
9826            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9827            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9828            //   envelope_size bytes, there is always sufficient room.
9829            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<32>, D>(
9830                self.name.as_ref().map(
9831                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
9832                ),
9833                encoder,
9834                offset + cur_offset,
9835                depth,
9836            )?;
9837
9838            _prev_end_offset = cur_offset + envelope_size;
9839            if 2 > max_ordinal {
9840                return Ok(());
9841            }
9842
9843            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9844            // are envelope_size bytes.
9845            let cur_offset: usize = (2 - 1) * envelope_size;
9846
9847            // Zero reserved fields.
9848            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9849
9850            // Safety:
9851            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9852            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9853            //   envelope_size bytes, there is always sufficient room.
9854            fidl::encoding::encode_in_envelope_optional::<bool, D>(
9855                self.enabled.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9856                encoder,
9857                offset + cur_offset,
9858                depth,
9859            )?;
9860
9861            _prev_end_offset = cur_offset + envelope_size;
9862            if 3 > max_ordinal {
9863                return Ok(());
9864            }
9865
9866            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9867            // are envelope_size bytes.
9868            let cur_offset: usize = (3 - 1) * envelope_size;
9869
9870            // Zero reserved fields.
9871            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9872
9873            // Safety:
9874            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9875            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9876            //   envelope_size bytes, there is always sufficient room.
9877            fidl::encoding::encode_in_envelope_optional::<LightType, D>(
9878                self.type_.as_ref().map(<LightType as fidl::encoding::ValueTypeMarker>::borrow),
9879                encoder,
9880                offset + cur_offset,
9881                depth,
9882            )?;
9883
9884            _prev_end_offset = cur_offset + envelope_size;
9885            if 4 > max_ordinal {
9886                return Ok(());
9887            }
9888
9889            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9890            // are envelope_size bytes.
9891            let cur_offset: usize = (4 - 1) * envelope_size;
9892
9893            // Zero reserved fields.
9894            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9895
9896            // Safety:
9897            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9898            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9899            //   envelope_size bytes, there is always sufficient room.
9900            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<LightState>, D>(
9901            self.lights.as_ref().map(<fidl::encoding::UnboundedVector<LightState> as fidl::encoding::ValueTypeMarker>::borrow),
9902            encoder, offset + cur_offset, depth
9903        )?;
9904
9905            _prev_end_offset = cur_offset + envelope_size;
9906
9907            Ok(())
9908        }
9909    }
9910
9911    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightGroup {
9912        #[inline(always)]
9913        fn new_empty() -> Self {
9914            Self::default()
9915        }
9916
9917        unsafe fn decode(
9918            &mut self,
9919            decoder: &mut fidl::encoding::Decoder<'_, D>,
9920            offset: usize,
9921            mut depth: fidl::encoding::Depth,
9922        ) -> fidl::Result<()> {
9923            decoder.debug_check_bounds::<Self>(offset);
9924            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9925                None => return Err(fidl::Error::NotNullable),
9926                Some(len) => len,
9927            };
9928            // Calling decoder.out_of_line_offset(0) is not allowed.
9929            if len == 0 {
9930                return Ok(());
9931            };
9932            depth.increment()?;
9933            let envelope_size = 8;
9934            let bytes_len = len * envelope_size;
9935            let offset = decoder.out_of_line_offset(bytes_len)?;
9936            // Decode the envelope for each type.
9937            let mut _next_ordinal_to_read = 0;
9938            let mut next_offset = offset;
9939            let end_offset = offset + bytes_len;
9940            _next_ordinal_to_read += 1;
9941            if next_offset >= end_offset {
9942                return Ok(());
9943            }
9944
9945            // Decode unknown envelopes for gaps in ordinals.
9946            while _next_ordinal_to_read < 1 {
9947                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9948                _next_ordinal_to_read += 1;
9949                next_offset += envelope_size;
9950            }
9951
9952            let next_out_of_line = decoder.next_out_of_line();
9953            let handles_before = decoder.remaining_handles();
9954            if let Some((inlined, num_bytes, num_handles)) =
9955                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9956            {
9957                let member_inline_size =
9958                    <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
9959                        decoder.context,
9960                    );
9961                if inlined != (member_inline_size <= 4) {
9962                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9963                }
9964                let inner_offset;
9965                let mut inner_depth = depth.clone();
9966                if inlined {
9967                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9968                    inner_offset = next_offset;
9969                } else {
9970                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9971                    inner_depth.increment()?;
9972                }
9973                let val_ref = self
9974                    .name
9975                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<32>, D));
9976                fidl::decode!(
9977                    fidl::encoding::BoundedString<32>,
9978                    D,
9979                    val_ref,
9980                    decoder,
9981                    inner_offset,
9982                    inner_depth
9983                )?;
9984                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9985                {
9986                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9987                }
9988                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9989                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9990                }
9991            }
9992
9993            next_offset += envelope_size;
9994            _next_ordinal_to_read += 1;
9995            if next_offset >= end_offset {
9996                return Ok(());
9997            }
9998
9999            // Decode unknown envelopes for gaps in ordinals.
10000            while _next_ordinal_to_read < 2 {
10001                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10002                _next_ordinal_to_read += 1;
10003                next_offset += envelope_size;
10004            }
10005
10006            let next_out_of_line = decoder.next_out_of_line();
10007            let handles_before = decoder.remaining_handles();
10008            if let Some((inlined, num_bytes, num_handles)) =
10009                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10010            {
10011                let member_inline_size =
10012                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10013                if inlined != (member_inline_size <= 4) {
10014                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10015                }
10016                let inner_offset;
10017                let mut inner_depth = depth.clone();
10018                if inlined {
10019                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10020                    inner_offset = next_offset;
10021                } else {
10022                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10023                    inner_depth.increment()?;
10024                }
10025                let val_ref = self.enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
10026                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
10027                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10028                {
10029                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10030                }
10031                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10032                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10033                }
10034            }
10035
10036            next_offset += envelope_size;
10037            _next_ordinal_to_read += 1;
10038            if next_offset >= end_offset {
10039                return Ok(());
10040            }
10041
10042            // Decode unknown envelopes for gaps in ordinals.
10043            while _next_ordinal_to_read < 3 {
10044                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10045                _next_ordinal_to_read += 1;
10046                next_offset += envelope_size;
10047            }
10048
10049            let next_out_of_line = decoder.next_out_of_line();
10050            let handles_before = decoder.remaining_handles();
10051            if let Some((inlined, num_bytes, num_handles)) =
10052                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10053            {
10054                let member_inline_size =
10055                    <LightType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10056                if inlined != (member_inline_size <= 4) {
10057                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10058                }
10059                let inner_offset;
10060                let mut inner_depth = depth.clone();
10061                if inlined {
10062                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10063                    inner_offset = next_offset;
10064                } else {
10065                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10066                    inner_depth.increment()?;
10067                }
10068                let val_ref = self.type_.get_or_insert_with(|| fidl::new_empty!(LightType, D));
10069                fidl::decode!(LightType, D, val_ref, decoder, inner_offset, inner_depth)?;
10070                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10071                {
10072                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10073                }
10074                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10075                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10076                }
10077            }
10078
10079            next_offset += envelope_size;
10080            _next_ordinal_to_read += 1;
10081            if next_offset >= end_offset {
10082                return Ok(());
10083            }
10084
10085            // Decode unknown envelopes for gaps in ordinals.
10086            while _next_ordinal_to_read < 4 {
10087                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10088                _next_ordinal_to_read += 1;
10089                next_offset += envelope_size;
10090            }
10091
10092            let next_out_of_line = decoder.next_out_of_line();
10093            let handles_before = decoder.remaining_handles();
10094            if let Some((inlined, num_bytes, num_handles)) =
10095                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10096            {
10097                let member_inline_size = <fidl::encoding::UnboundedVector<LightState> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10098                if inlined != (member_inline_size <= 4) {
10099                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10100                }
10101                let inner_offset;
10102                let mut inner_depth = depth.clone();
10103                if inlined {
10104                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10105                    inner_offset = next_offset;
10106                } else {
10107                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10108                    inner_depth.increment()?;
10109                }
10110                let val_ref = self.lights.get_or_insert_with(|| {
10111                    fidl::new_empty!(fidl::encoding::UnboundedVector<LightState>, D)
10112                });
10113                fidl::decode!(
10114                    fidl::encoding::UnboundedVector<LightState>,
10115                    D,
10116                    val_ref,
10117                    decoder,
10118                    inner_offset,
10119                    inner_depth
10120                )?;
10121                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10122                {
10123                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10124                }
10125                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10126                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10127                }
10128            }
10129
10130            next_offset += envelope_size;
10131
10132            // Decode the remaining unknown envelopes.
10133            while next_offset < end_offset {
10134                _next_ordinal_to_read += 1;
10135                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10136                next_offset += envelope_size;
10137            }
10138
10139            Ok(())
10140        }
10141    }
10142
10143    impl LightState {
10144        #[inline(always)]
10145        fn max_ordinal_present(&self) -> u64 {
10146            if let Some(_) = self.value {
10147                return 1;
10148            }
10149            0
10150        }
10151    }
10152
10153    impl fidl::encoding::ValueTypeMarker for LightState {
10154        type Borrowed<'a> = &'a Self;
10155        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10156            value
10157        }
10158    }
10159
10160    unsafe impl fidl::encoding::TypeMarker for LightState {
10161        type Owned = Self;
10162
10163        #[inline(always)]
10164        fn inline_align(_context: fidl::encoding::Context) -> usize {
10165            8
10166        }
10167
10168        #[inline(always)]
10169        fn inline_size(_context: fidl::encoding::Context) -> usize {
10170            16
10171        }
10172    }
10173
10174    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightState, D>
10175        for &LightState
10176    {
10177        unsafe fn encode(
10178            self,
10179            encoder: &mut fidl::encoding::Encoder<'_, D>,
10180            offset: usize,
10181            mut depth: fidl::encoding::Depth,
10182        ) -> fidl::Result<()> {
10183            encoder.debug_check_bounds::<LightState>(offset);
10184            // Vector header
10185            let max_ordinal: u64 = self.max_ordinal_present();
10186            encoder.write_num(max_ordinal, offset);
10187            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10188            // Calling encoder.out_of_line_offset(0) is not allowed.
10189            if max_ordinal == 0 {
10190                return Ok(());
10191            }
10192            depth.increment()?;
10193            let envelope_size = 8;
10194            let bytes_len = max_ordinal as usize * envelope_size;
10195            #[allow(unused_variables)]
10196            let offset = encoder.out_of_line_offset(bytes_len);
10197            let mut _prev_end_offset: usize = 0;
10198            if 1 > max_ordinal {
10199                return Ok(());
10200            }
10201
10202            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10203            // are envelope_size bytes.
10204            let cur_offset: usize = (1 - 1) * envelope_size;
10205
10206            // Zero reserved fields.
10207            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10208
10209            // Safety:
10210            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10211            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10212            //   envelope_size bytes, there is always sufficient room.
10213            fidl::encoding::encode_in_envelope_optional::<LightValue, D>(
10214                self.value.as_ref().map(<LightValue as fidl::encoding::ValueTypeMarker>::borrow),
10215                encoder,
10216                offset + cur_offset,
10217                depth,
10218            )?;
10219
10220            _prev_end_offset = cur_offset + envelope_size;
10221
10222            Ok(())
10223        }
10224    }
10225
10226    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightState {
10227        #[inline(always)]
10228        fn new_empty() -> Self {
10229            Self::default()
10230        }
10231
10232        unsafe fn decode(
10233            &mut self,
10234            decoder: &mut fidl::encoding::Decoder<'_, D>,
10235            offset: usize,
10236            mut depth: fidl::encoding::Depth,
10237        ) -> fidl::Result<()> {
10238            decoder.debug_check_bounds::<Self>(offset);
10239            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10240                None => return Err(fidl::Error::NotNullable),
10241                Some(len) => len,
10242            };
10243            // Calling decoder.out_of_line_offset(0) is not allowed.
10244            if len == 0 {
10245                return Ok(());
10246            };
10247            depth.increment()?;
10248            let envelope_size = 8;
10249            let bytes_len = len * envelope_size;
10250            let offset = decoder.out_of_line_offset(bytes_len)?;
10251            // Decode the envelope for each type.
10252            let mut _next_ordinal_to_read = 0;
10253            let mut next_offset = offset;
10254            let end_offset = offset + bytes_len;
10255            _next_ordinal_to_read += 1;
10256            if next_offset >= end_offset {
10257                return Ok(());
10258            }
10259
10260            // Decode unknown envelopes for gaps in ordinals.
10261            while _next_ordinal_to_read < 1 {
10262                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10263                _next_ordinal_to_read += 1;
10264                next_offset += envelope_size;
10265            }
10266
10267            let next_out_of_line = decoder.next_out_of_line();
10268            let handles_before = decoder.remaining_handles();
10269            if let Some((inlined, num_bytes, num_handles)) =
10270                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10271            {
10272                let member_inline_size =
10273                    <LightValue as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10274                if inlined != (member_inline_size <= 4) {
10275                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10276                }
10277                let inner_offset;
10278                let mut inner_depth = depth.clone();
10279                if inlined {
10280                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10281                    inner_offset = next_offset;
10282                } else {
10283                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10284                    inner_depth.increment()?;
10285                }
10286                let val_ref = self.value.get_or_insert_with(|| fidl::new_empty!(LightValue, D));
10287                fidl::decode!(LightValue, D, val_ref, decoder, inner_offset, inner_depth)?;
10288                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10289                {
10290                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10291                }
10292                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10293                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10294                }
10295            }
10296
10297            next_offset += envelope_size;
10298
10299            // Decode the remaining unknown envelopes.
10300            while next_offset < end_offset {
10301                _next_ordinal_to_read += 1;
10302                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10303                next_offset += envelope_size;
10304            }
10305
10306            Ok(())
10307        }
10308    }
10309
10310    impl NightModeSettings {
10311        #[inline(always)]
10312        fn max_ordinal_present(&self) -> u64 {
10313            if let Some(_) = self.night_mode_enabled {
10314                return 1;
10315            }
10316            0
10317        }
10318    }
10319
10320    impl fidl::encoding::ValueTypeMarker for NightModeSettings {
10321        type Borrowed<'a> = &'a Self;
10322        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10323            value
10324        }
10325    }
10326
10327    unsafe impl fidl::encoding::TypeMarker for NightModeSettings {
10328        type Owned = Self;
10329
10330        #[inline(always)]
10331        fn inline_align(_context: fidl::encoding::Context) -> usize {
10332            8
10333        }
10334
10335        #[inline(always)]
10336        fn inline_size(_context: fidl::encoding::Context) -> usize {
10337            16
10338        }
10339    }
10340
10341    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NightModeSettings, D>
10342        for &NightModeSettings
10343    {
10344        unsafe fn encode(
10345            self,
10346            encoder: &mut fidl::encoding::Encoder<'_, D>,
10347            offset: usize,
10348            mut depth: fidl::encoding::Depth,
10349        ) -> fidl::Result<()> {
10350            encoder.debug_check_bounds::<NightModeSettings>(offset);
10351            // Vector header
10352            let max_ordinal: u64 = self.max_ordinal_present();
10353            encoder.write_num(max_ordinal, offset);
10354            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10355            // Calling encoder.out_of_line_offset(0) is not allowed.
10356            if max_ordinal == 0 {
10357                return Ok(());
10358            }
10359            depth.increment()?;
10360            let envelope_size = 8;
10361            let bytes_len = max_ordinal as usize * envelope_size;
10362            #[allow(unused_variables)]
10363            let offset = encoder.out_of_line_offset(bytes_len);
10364            let mut _prev_end_offset: usize = 0;
10365            if 1 > max_ordinal {
10366                return Ok(());
10367            }
10368
10369            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10370            // are envelope_size bytes.
10371            let cur_offset: usize = (1 - 1) * envelope_size;
10372
10373            // Zero reserved fields.
10374            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10375
10376            // Safety:
10377            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10378            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10379            //   envelope_size bytes, there is always sufficient room.
10380            fidl::encoding::encode_in_envelope_optional::<bool, D>(
10381                self.night_mode_enabled
10382                    .as_ref()
10383                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10384                encoder,
10385                offset + cur_offset,
10386                depth,
10387            )?;
10388
10389            _prev_end_offset = cur_offset + envelope_size;
10390
10391            Ok(())
10392        }
10393    }
10394
10395    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NightModeSettings {
10396        #[inline(always)]
10397        fn new_empty() -> Self {
10398            Self::default()
10399        }
10400
10401        unsafe fn decode(
10402            &mut self,
10403            decoder: &mut fidl::encoding::Decoder<'_, D>,
10404            offset: usize,
10405            mut depth: fidl::encoding::Depth,
10406        ) -> fidl::Result<()> {
10407            decoder.debug_check_bounds::<Self>(offset);
10408            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10409                None => return Err(fidl::Error::NotNullable),
10410                Some(len) => len,
10411            };
10412            // Calling decoder.out_of_line_offset(0) is not allowed.
10413            if len == 0 {
10414                return Ok(());
10415            };
10416            depth.increment()?;
10417            let envelope_size = 8;
10418            let bytes_len = len * envelope_size;
10419            let offset = decoder.out_of_line_offset(bytes_len)?;
10420            // Decode the envelope for each type.
10421            let mut _next_ordinal_to_read = 0;
10422            let mut next_offset = offset;
10423            let end_offset = offset + bytes_len;
10424            _next_ordinal_to_read += 1;
10425            if next_offset >= end_offset {
10426                return Ok(());
10427            }
10428
10429            // Decode unknown envelopes for gaps in ordinals.
10430            while _next_ordinal_to_read < 1 {
10431                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10432                _next_ordinal_to_read += 1;
10433                next_offset += envelope_size;
10434            }
10435
10436            let next_out_of_line = decoder.next_out_of_line();
10437            let handles_before = decoder.remaining_handles();
10438            if let Some((inlined, num_bytes, num_handles)) =
10439                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10440            {
10441                let member_inline_size =
10442                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10443                if inlined != (member_inline_size <= 4) {
10444                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10445                }
10446                let inner_offset;
10447                let mut inner_depth = depth.clone();
10448                if inlined {
10449                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10450                    inner_offset = next_offset;
10451                } else {
10452                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10453                    inner_depth.increment()?;
10454                }
10455                let val_ref =
10456                    self.night_mode_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
10457                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
10458                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10459                {
10460                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10461                }
10462                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10463                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10464                }
10465            }
10466
10467            next_offset += envelope_size;
10468
10469            // Decode the remaining unknown envelopes.
10470            while next_offset < end_offset {
10471                _next_ordinal_to_read += 1;
10472                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10473                next_offset += envelope_size;
10474            }
10475
10476            Ok(())
10477        }
10478    }
10479
10480    impl PrivacySettings {
10481        #[inline(always)]
10482        fn max_ordinal_present(&self) -> u64 {
10483            if let Some(_) = self.user_data_sharing_consent {
10484                return 1;
10485            }
10486            0
10487        }
10488    }
10489
10490    impl fidl::encoding::ValueTypeMarker for PrivacySettings {
10491        type Borrowed<'a> = &'a Self;
10492        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10493            value
10494        }
10495    }
10496
10497    unsafe impl fidl::encoding::TypeMarker for PrivacySettings {
10498        type Owned = Self;
10499
10500        #[inline(always)]
10501        fn inline_align(_context: fidl::encoding::Context) -> usize {
10502            8
10503        }
10504
10505        #[inline(always)]
10506        fn inline_size(_context: fidl::encoding::Context) -> usize {
10507            16
10508        }
10509    }
10510
10511    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PrivacySettings, D>
10512        for &PrivacySettings
10513    {
10514        unsafe fn encode(
10515            self,
10516            encoder: &mut fidl::encoding::Encoder<'_, D>,
10517            offset: usize,
10518            mut depth: fidl::encoding::Depth,
10519        ) -> fidl::Result<()> {
10520            encoder.debug_check_bounds::<PrivacySettings>(offset);
10521            // Vector header
10522            let max_ordinal: u64 = self.max_ordinal_present();
10523            encoder.write_num(max_ordinal, offset);
10524            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10525            // Calling encoder.out_of_line_offset(0) is not allowed.
10526            if max_ordinal == 0 {
10527                return Ok(());
10528            }
10529            depth.increment()?;
10530            let envelope_size = 8;
10531            let bytes_len = max_ordinal as usize * envelope_size;
10532            #[allow(unused_variables)]
10533            let offset = encoder.out_of_line_offset(bytes_len);
10534            let mut _prev_end_offset: usize = 0;
10535            if 1 > max_ordinal {
10536                return Ok(());
10537            }
10538
10539            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10540            // are envelope_size bytes.
10541            let cur_offset: usize = (1 - 1) * envelope_size;
10542
10543            // Zero reserved fields.
10544            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10545
10546            // Safety:
10547            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10548            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10549            //   envelope_size bytes, there is always sufficient room.
10550            fidl::encoding::encode_in_envelope_optional::<bool, D>(
10551                self.user_data_sharing_consent
10552                    .as_ref()
10553                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10554                encoder,
10555                offset + cur_offset,
10556                depth,
10557            )?;
10558
10559            _prev_end_offset = cur_offset + envelope_size;
10560
10561            Ok(())
10562        }
10563    }
10564
10565    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PrivacySettings {
10566        #[inline(always)]
10567        fn new_empty() -> Self {
10568            Self::default()
10569        }
10570
10571        unsafe fn decode(
10572            &mut self,
10573            decoder: &mut fidl::encoding::Decoder<'_, D>,
10574            offset: usize,
10575            mut depth: fidl::encoding::Depth,
10576        ) -> fidl::Result<()> {
10577            decoder.debug_check_bounds::<Self>(offset);
10578            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10579                None => return Err(fidl::Error::NotNullable),
10580                Some(len) => len,
10581            };
10582            // Calling decoder.out_of_line_offset(0) is not allowed.
10583            if len == 0 {
10584                return Ok(());
10585            };
10586            depth.increment()?;
10587            let envelope_size = 8;
10588            let bytes_len = len * envelope_size;
10589            let offset = decoder.out_of_line_offset(bytes_len)?;
10590            // Decode the envelope for each type.
10591            let mut _next_ordinal_to_read = 0;
10592            let mut next_offset = offset;
10593            let end_offset = offset + bytes_len;
10594            _next_ordinal_to_read += 1;
10595            if next_offset >= end_offset {
10596                return Ok(());
10597            }
10598
10599            // Decode unknown envelopes for gaps in ordinals.
10600            while _next_ordinal_to_read < 1 {
10601                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10602                _next_ordinal_to_read += 1;
10603                next_offset += envelope_size;
10604            }
10605
10606            let next_out_of_line = decoder.next_out_of_line();
10607            let handles_before = decoder.remaining_handles();
10608            if let Some((inlined, num_bytes, num_handles)) =
10609                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10610            {
10611                let member_inline_size =
10612                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10613                if inlined != (member_inline_size <= 4) {
10614                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10615                }
10616                let inner_offset;
10617                let mut inner_depth = depth.clone();
10618                if inlined {
10619                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10620                    inner_offset = next_offset;
10621                } else {
10622                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10623                    inner_depth.increment()?;
10624                }
10625                let val_ref =
10626                    self.user_data_sharing_consent.get_or_insert_with(|| fidl::new_empty!(bool, D));
10627                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
10628                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10629                {
10630                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10631                }
10632                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10633                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10634                }
10635            }
10636
10637            next_offset += envelope_size;
10638
10639            // Decode the remaining unknown envelopes.
10640            while next_offset < end_offset {
10641                _next_ordinal_to_read += 1;
10642                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10643                next_offset += envelope_size;
10644            }
10645
10646            Ok(())
10647        }
10648    }
10649
10650    impl SetupSettings {
10651        #[inline(always)]
10652        fn max_ordinal_present(&self) -> u64 {
10653            if let Some(_) = self.enabled_configuration_interfaces {
10654                return 1;
10655            }
10656            0
10657        }
10658    }
10659
10660    impl fidl::encoding::ValueTypeMarker for SetupSettings {
10661        type Borrowed<'a> = &'a Self;
10662        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10663            value
10664        }
10665    }
10666
10667    unsafe impl fidl::encoding::TypeMarker for SetupSettings {
10668        type Owned = Self;
10669
10670        #[inline(always)]
10671        fn inline_align(_context: fidl::encoding::Context) -> usize {
10672            8
10673        }
10674
10675        #[inline(always)]
10676        fn inline_size(_context: fidl::encoding::Context) -> usize {
10677            16
10678        }
10679    }
10680
10681    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetupSettings, D>
10682        for &SetupSettings
10683    {
10684        unsafe fn encode(
10685            self,
10686            encoder: &mut fidl::encoding::Encoder<'_, D>,
10687            offset: usize,
10688            mut depth: fidl::encoding::Depth,
10689        ) -> fidl::Result<()> {
10690            encoder.debug_check_bounds::<SetupSettings>(offset);
10691            // Vector header
10692            let max_ordinal: u64 = self.max_ordinal_present();
10693            encoder.write_num(max_ordinal, offset);
10694            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10695            // Calling encoder.out_of_line_offset(0) is not allowed.
10696            if max_ordinal == 0 {
10697                return Ok(());
10698            }
10699            depth.increment()?;
10700            let envelope_size = 8;
10701            let bytes_len = max_ordinal as usize * envelope_size;
10702            #[allow(unused_variables)]
10703            let offset = encoder.out_of_line_offset(bytes_len);
10704            let mut _prev_end_offset: usize = 0;
10705            if 1 > max_ordinal {
10706                return Ok(());
10707            }
10708
10709            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10710            // are envelope_size bytes.
10711            let cur_offset: usize = (1 - 1) * envelope_size;
10712
10713            // Zero reserved fields.
10714            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10715
10716            // Safety:
10717            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10718            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10719            //   envelope_size bytes, there is always sufficient room.
10720            fidl::encoding::encode_in_envelope_optional::<ConfigurationInterfaces, D>(
10721                self.enabled_configuration_interfaces
10722                    .as_ref()
10723                    .map(<ConfigurationInterfaces as fidl::encoding::ValueTypeMarker>::borrow),
10724                encoder,
10725                offset + cur_offset,
10726                depth,
10727            )?;
10728
10729            _prev_end_offset = cur_offset + envelope_size;
10730
10731            Ok(())
10732        }
10733    }
10734
10735    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetupSettings {
10736        #[inline(always)]
10737        fn new_empty() -> Self {
10738            Self::default()
10739        }
10740
10741        unsafe fn decode(
10742            &mut self,
10743            decoder: &mut fidl::encoding::Decoder<'_, D>,
10744            offset: usize,
10745            mut depth: fidl::encoding::Depth,
10746        ) -> fidl::Result<()> {
10747            decoder.debug_check_bounds::<Self>(offset);
10748            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10749                None => return Err(fidl::Error::NotNullable),
10750                Some(len) => len,
10751            };
10752            // Calling decoder.out_of_line_offset(0) is not allowed.
10753            if len == 0 {
10754                return Ok(());
10755            };
10756            depth.increment()?;
10757            let envelope_size = 8;
10758            let bytes_len = len * envelope_size;
10759            let offset = decoder.out_of_line_offset(bytes_len)?;
10760            // Decode the envelope for each type.
10761            let mut _next_ordinal_to_read = 0;
10762            let mut next_offset = offset;
10763            let end_offset = offset + bytes_len;
10764            _next_ordinal_to_read += 1;
10765            if next_offset >= end_offset {
10766                return Ok(());
10767            }
10768
10769            // Decode unknown envelopes for gaps in ordinals.
10770            while _next_ordinal_to_read < 1 {
10771                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10772                _next_ordinal_to_read += 1;
10773                next_offset += envelope_size;
10774            }
10775
10776            let next_out_of_line = decoder.next_out_of_line();
10777            let handles_before = decoder.remaining_handles();
10778            if let Some((inlined, num_bytes, num_handles)) =
10779                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10780            {
10781                let member_inline_size =
10782                    <ConfigurationInterfaces as fidl::encoding::TypeMarker>::inline_size(
10783                        decoder.context,
10784                    );
10785                if inlined != (member_inline_size <= 4) {
10786                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10787                }
10788                let inner_offset;
10789                let mut inner_depth = depth.clone();
10790                if inlined {
10791                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10792                    inner_offset = next_offset;
10793                } else {
10794                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10795                    inner_depth.increment()?;
10796                }
10797                let val_ref = self
10798                    .enabled_configuration_interfaces
10799                    .get_or_insert_with(|| fidl::new_empty!(ConfigurationInterfaces, D));
10800                fidl::decode!(
10801                    ConfigurationInterfaces,
10802                    D,
10803                    val_ref,
10804                    decoder,
10805                    inner_offset,
10806                    inner_depth
10807                )?;
10808                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10809                {
10810                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10811                }
10812                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10813                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10814                }
10815            }
10816
10817            next_offset += envelope_size;
10818
10819            // Decode the remaining unknown envelopes.
10820            while next_offset < end_offset {
10821                _next_ordinal_to_read += 1;
10822                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10823                next_offset += envelope_size;
10824            }
10825
10826            Ok(())
10827        }
10828    }
10829
10830    impl SourceState {
10831        #[inline(always)]
10832        fn max_ordinal_present(&self) -> u64 {
10833            if let Some(_) = self.state {
10834                return 2;
10835            }
10836            if let Some(_) = self.source {
10837                return 1;
10838            }
10839            0
10840        }
10841    }
10842
10843    impl fidl::encoding::ValueTypeMarker for SourceState {
10844        type Borrowed<'a> = &'a Self;
10845        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10846            value
10847        }
10848    }
10849
10850    unsafe impl fidl::encoding::TypeMarker for SourceState {
10851        type Owned = Self;
10852
10853        #[inline(always)]
10854        fn inline_align(_context: fidl::encoding::Context) -> usize {
10855            8
10856        }
10857
10858        #[inline(always)]
10859        fn inline_size(_context: fidl::encoding::Context) -> usize {
10860            16
10861        }
10862    }
10863
10864    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SourceState, D>
10865        for &SourceState
10866    {
10867        unsafe fn encode(
10868            self,
10869            encoder: &mut fidl::encoding::Encoder<'_, D>,
10870            offset: usize,
10871            mut depth: fidl::encoding::Depth,
10872        ) -> fidl::Result<()> {
10873            encoder.debug_check_bounds::<SourceState>(offset);
10874            // Vector header
10875            let max_ordinal: u64 = self.max_ordinal_present();
10876            encoder.write_num(max_ordinal, offset);
10877            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10878            // Calling encoder.out_of_line_offset(0) is not allowed.
10879            if max_ordinal == 0 {
10880                return Ok(());
10881            }
10882            depth.increment()?;
10883            let envelope_size = 8;
10884            let bytes_len = max_ordinal as usize * envelope_size;
10885            #[allow(unused_variables)]
10886            let offset = encoder.out_of_line_offset(bytes_len);
10887            let mut _prev_end_offset: usize = 0;
10888            if 1 > max_ordinal {
10889                return Ok(());
10890            }
10891
10892            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10893            // are envelope_size bytes.
10894            let cur_offset: usize = (1 - 1) * envelope_size;
10895
10896            // Zero reserved fields.
10897            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10898
10899            // Safety:
10900            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10901            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10902            //   envelope_size bytes, there is always sufficient room.
10903            fidl::encoding::encode_in_envelope_optional::<DeviceStateSource, D>(
10904                self.source
10905                    .as_ref()
10906                    .map(<DeviceStateSource as fidl::encoding::ValueTypeMarker>::borrow),
10907                encoder,
10908                offset + cur_offset,
10909                depth,
10910            )?;
10911
10912            _prev_end_offset = cur_offset + envelope_size;
10913            if 2 > max_ordinal {
10914                return Ok(());
10915            }
10916
10917            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10918            // are envelope_size bytes.
10919            let cur_offset: usize = (2 - 1) * envelope_size;
10920
10921            // Zero reserved fields.
10922            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10923
10924            // Safety:
10925            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10926            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10927            //   envelope_size bytes, there is always sufficient room.
10928            fidl::encoding::encode_in_envelope_optional::<DeviceState, D>(
10929                self.state.as_ref().map(<DeviceState as fidl::encoding::ValueTypeMarker>::borrow),
10930                encoder,
10931                offset + cur_offset,
10932                depth,
10933            )?;
10934
10935            _prev_end_offset = cur_offset + envelope_size;
10936
10937            Ok(())
10938        }
10939    }
10940
10941    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SourceState {
10942        #[inline(always)]
10943        fn new_empty() -> Self {
10944            Self::default()
10945        }
10946
10947        unsafe fn decode(
10948            &mut self,
10949            decoder: &mut fidl::encoding::Decoder<'_, D>,
10950            offset: usize,
10951            mut depth: fidl::encoding::Depth,
10952        ) -> fidl::Result<()> {
10953            decoder.debug_check_bounds::<Self>(offset);
10954            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10955                None => return Err(fidl::Error::NotNullable),
10956                Some(len) => len,
10957            };
10958            // Calling decoder.out_of_line_offset(0) is not allowed.
10959            if len == 0 {
10960                return Ok(());
10961            };
10962            depth.increment()?;
10963            let envelope_size = 8;
10964            let bytes_len = len * envelope_size;
10965            let offset = decoder.out_of_line_offset(bytes_len)?;
10966            // Decode the envelope for each type.
10967            let mut _next_ordinal_to_read = 0;
10968            let mut next_offset = offset;
10969            let end_offset = offset + bytes_len;
10970            _next_ordinal_to_read += 1;
10971            if next_offset >= end_offset {
10972                return Ok(());
10973            }
10974
10975            // Decode unknown envelopes for gaps in ordinals.
10976            while _next_ordinal_to_read < 1 {
10977                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10978                _next_ordinal_to_read += 1;
10979                next_offset += envelope_size;
10980            }
10981
10982            let next_out_of_line = decoder.next_out_of_line();
10983            let handles_before = decoder.remaining_handles();
10984            if let Some((inlined, num_bytes, num_handles)) =
10985                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10986            {
10987                let member_inline_size =
10988                    <DeviceStateSource as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10989                if inlined != (member_inline_size <= 4) {
10990                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10991                }
10992                let inner_offset;
10993                let mut inner_depth = depth.clone();
10994                if inlined {
10995                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10996                    inner_offset = next_offset;
10997                } else {
10998                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10999                    inner_depth.increment()?;
11000                }
11001                let val_ref =
11002                    self.source.get_or_insert_with(|| fidl::new_empty!(DeviceStateSource, D));
11003                fidl::decode!(DeviceStateSource, D, val_ref, decoder, inner_offset, inner_depth)?;
11004                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11005                {
11006                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11007                }
11008                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11009                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11010                }
11011            }
11012
11013            next_offset += envelope_size;
11014            _next_ordinal_to_read += 1;
11015            if next_offset >= end_offset {
11016                return Ok(());
11017            }
11018
11019            // Decode unknown envelopes for gaps in ordinals.
11020            while _next_ordinal_to_read < 2 {
11021                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11022                _next_ordinal_to_read += 1;
11023                next_offset += envelope_size;
11024            }
11025
11026            let next_out_of_line = decoder.next_out_of_line();
11027            let handles_before = decoder.remaining_handles();
11028            if let Some((inlined, num_bytes, num_handles)) =
11029                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11030            {
11031                let member_inline_size =
11032                    <DeviceState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11033                if inlined != (member_inline_size <= 4) {
11034                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11035                }
11036                let inner_offset;
11037                let mut inner_depth = depth.clone();
11038                if inlined {
11039                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11040                    inner_offset = next_offset;
11041                } else {
11042                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11043                    inner_depth.increment()?;
11044                }
11045                let val_ref = self.state.get_or_insert_with(|| fidl::new_empty!(DeviceState, D));
11046                fidl::decode!(DeviceState, D, val_ref, decoder, inner_offset, inner_depth)?;
11047                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11048                {
11049                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11050                }
11051                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11052                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11053                }
11054            }
11055
11056            next_offset += envelope_size;
11057
11058            // Decode the remaining unknown envelopes.
11059            while next_offset < end_offset {
11060                _next_ordinal_to_read += 1;
11061                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11062                next_offset += envelope_size;
11063            }
11064
11065            Ok(())
11066        }
11067    }
11068
11069    impl Theme {
11070        #[inline(always)]
11071        fn max_ordinal_present(&self) -> u64 {
11072            if let Some(_) = self.theme_mode {
11073                return 2;
11074            }
11075            if let Some(_) = self.theme_type {
11076                return 1;
11077            }
11078            0
11079        }
11080    }
11081
11082    impl fidl::encoding::ValueTypeMarker for Theme {
11083        type Borrowed<'a> = &'a Self;
11084        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11085            value
11086        }
11087    }
11088
11089    unsafe impl fidl::encoding::TypeMarker for Theme {
11090        type Owned = Self;
11091
11092        #[inline(always)]
11093        fn inline_align(_context: fidl::encoding::Context) -> usize {
11094            8
11095        }
11096
11097        #[inline(always)]
11098        fn inline_size(_context: fidl::encoding::Context) -> usize {
11099            16
11100        }
11101    }
11102
11103    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Theme, D> for &Theme {
11104        unsafe fn encode(
11105            self,
11106            encoder: &mut fidl::encoding::Encoder<'_, D>,
11107            offset: usize,
11108            mut depth: fidl::encoding::Depth,
11109        ) -> fidl::Result<()> {
11110            encoder.debug_check_bounds::<Theme>(offset);
11111            // Vector header
11112            let max_ordinal: u64 = self.max_ordinal_present();
11113            encoder.write_num(max_ordinal, offset);
11114            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11115            // Calling encoder.out_of_line_offset(0) is not allowed.
11116            if max_ordinal == 0 {
11117                return Ok(());
11118            }
11119            depth.increment()?;
11120            let envelope_size = 8;
11121            let bytes_len = max_ordinal as usize * envelope_size;
11122            #[allow(unused_variables)]
11123            let offset = encoder.out_of_line_offset(bytes_len);
11124            let mut _prev_end_offset: usize = 0;
11125            if 1 > max_ordinal {
11126                return Ok(());
11127            }
11128
11129            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11130            // are envelope_size bytes.
11131            let cur_offset: usize = (1 - 1) * envelope_size;
11132
11133            // Zero reserved fields.
11134            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11135
11136            // Safety:
11137            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11138            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11139            //   envelope_size bytes, there is always sufficient room.
11140            fidl::encoding::encode_in_envelope_optional::<ThemeType, D>(
11141                self.theme_type
11142                    .as_ref()
11143                    .map(<ThemeType as fidl::encoding::ValueTypeMarker>::borrow),
11144                encoder,
11145                offset + cur_offset,
11146                depth,
11147            )?;
11148
11149            _prev_end_offset = cur_offset + envelope_size;
11150            if 2 > max_ordinal {
11151                return Ok(());
11152            }
11153
11154            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11155            // are envelope_size bytes.
11156            let cur_offset: usize = (2 - 1) * envelope_size;
11157
11158            // Zero reserved fields.
11159            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11160
11161            // Safety:
11162            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11163            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11164            //   envelope_size bytes, there is always sufficient room.
11165            fidl::encoding::encode_in_envelope_optional::<ThemeMode, D>(
11166                self.theme_mode
11167                    .as_ref()
11168                    .map(<ThemeMode as fidl::encoding::ValueTypeMarker>::borrow),
11169                encoder,
11170                offset + cur_offset,
11171                depth,
11172            )?;
11173
11174            _prev_end_offset = cur_offset + envelope_size;
11175
11176            Ok(())
11177        }
11178    }
11179
11180    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Theme {
11181        #[inline(always)]
11182        fn new_empty() -> Self {
11183            Self::default()
11184        }
11185
11186        unsafe fn decode(
11187            &mut self,
11188            decoder: &mut fidl::encoding::Decoder<'_, D>,
11189            offset: usize,
11190            mut depth: fidl::encoding::Depth,
11191        ) -> fidl::Result<()> {
11192            decoder.debug_check_bounds::<Self>(offset);
11193            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11194                None => return Err(fidl::Error::NotNullable),
11195                Some(len) => len,
11196            };
11197            // Calling decoder.out_of_line_offset(0) is not allowed.
11198            if len == 0 {
11199                return Ok(());
11200            };
11201            depth.increment()?;
11202            let envelope_size = 8;
11203            let bytes_len = len * envelope_size;
11204            let offset = decoder.out_of_line_offset(bytes_len)?;
11205            // Decode the envelope for each type.
11206            let mut _next_ordinal_to_read = 0;
11207            let mut next_offset = offset;
11208            let end_offset = offset + bytes_len;
11209            _next_ordinal_to_read += 1;
11210            if next_offset >= end_offset {
11211                return Ok(());
11212            }
11213
11214            // Decode unknown envelopes for gaps in ordinals.
11215            while _next_ordinal_to_read < 1 {
11216                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11217                _next_ordinal_to_read += 1;
11218                next_offset += envelope_size;
11219            }
11220
11221            let next_out_of_line = decoder.next_out_of_line();
11222            let handles_before = decoder.remaining_handles();
11223            if let Some((inlined, num_bytes, num_handles)) =
11224                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11225            {
11226                let member_inline_size =
11227                    <ThemeType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11228                if inlined != (member_inline_size <= 4) {
11229                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11230                }
11231                let inner_offset;
11232                let mut inner_depth = depth.clone();
11233                if inlined {
11234                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11235                    inner_offset = next_offset;
11236                } else {
11237                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11238                    inner_depth.increment()?;
11239                }
11240                let val_ref = self.theme_type.get_or_insert_with(|| fidl::new_empty!(ThemeType, D));
11241                fidl::decode!(ThemeType, D, val_ref, decoder, inner_offset, inner_depth)?;
11242                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11243                {
11244                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11245                }
11246                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11247                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11248                }
11249            }
11250
11251            next_offset += envelope_size;
11252            _next_ordinal_to_read += 1;
11253            if next_offset >= end_offset {
11254                return Ok(());
11255            }
11256
11257            // Decode unknown envelopes for gaps in ordinals.
11258            while _next_ordinal_to_read < 2 {
11259                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11260                _next_ordinal_to_read += 1;
11261                next_offset += envelope_size;
11262            }
11263
11264            let next_out_of_line = decoder.next_out_of_line();
11265            let handles_before = decoder.remaining_handles();
11266            if let Some((inlined, num_bytes, num_handles)) =
11267                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11268            {
11269                let member_inline_size =
11270                    <ThemeMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11271                if inlined != (member_inline_size <= 4) {
11272                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11273                }
11274                let inner_offset;
11275                let mut inner_depth = depth.clone();
11276                if inlined {
11277                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11278                    inner_offset = next_offset;
11279                } else {
11280                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11281                    inner_depth.increment()?;
11282                }
11283                let val_ref = self.theme_mode.get_or_insert_with(|| fidl::new_empty!(ThemeMode, D));
11284                fidl::decode!(ThemeMode, D, val_ref, decoder, inner_offset, inner_depth)?;
11285                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11286                {
11287                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11288                }
11289                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11290                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11291                }
11292            }
11293
11294            next_offset += envelope_size;
11295
11296            // Decode the remaining unknown envelopes.
11297            while next_offset < end_offset {
11298                _next_ordinal_to_read += 1;
11299                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11300                next_offset += envelope_size;
11301            }
11302
11303            Ok(())
11304        }
11305    }
11306
11307    impl Volume {
11308        #[inline(always)]
11309        fn max_ordinal_present(&self) -> u64 {
11310            if let Some(_) = self.muted {
11311                return 2;
11312            }
11313            if let Some(_) = self.level {
11314                return 1;
11315            }
11316            0
11317        }
11318    }
11319
11320    impl fidl::encoding::ValueTypeMarker for Volume {
11321        type Borrowed<'a> = &'a Self;
11322        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11323            value
11324        }
11325    }
11326
11327    unsafe impl fidl::encoding::TypeMarker for Volume {
11328        type Owned = Self;
11329
11330        #[inline(always)]
11331        fn inline_align(_context: fidl::encoding::Context) -> usize {
11332            8
11333        }
11334
11335        #[inline(always)]
11336        fn inline_size(_context: fidl::encoding::Context) -> usize {
11337            16
11338        }
11339    }
11340
11341    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Volume, D> for &Volume {
11342        unsafe fn encode(
11343            self,
11344            encoder: &mut fidl::encoding::Encoder<'_, D>,
11345            offset: usize,
11346            mut depth: fidl::encoding::Depth,
11347        ) -> fidl::Result<()> {
11348            encoder.debug_check_bounds::<Volume>(offset);
11349            // Vector header
11350            let max_ordinal: u64 = self.max_ordinal_present();
11351            encoder.write_num(max_ordinal, offset);
11352            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11353            // Calling encoder.out_of_line_offset(0) is not allowed.
11354            if max_ordinal == 0 {
11355                return Ok(());
11356            }
11357            depth.increment()?;
11358            let envelope_size = 8;
11359            let bytes_len = max_ordinal as usize * envelope_size;
11360            #[allow(unused_variables)]
11361            let offset = encoder.out_of_line_offset(bytes_len);
11362            let mut _prev_end_offset: usize = 0;
11363            if 1 > max_ordinal {
11364                return Ok(());
11365            }
11366
11367            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11368            // are envelope_size bytes.
11369            let cur_offset: usize = (1 - 1) * envelope_size;
11370
11371            // Zero reserved fields.
11372            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11373
11374            // Safety:
11375            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11376            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11377            //   envelope_size bytes, there is always sufficient room.
11378            fidl::encoding::encode_in_envelope_optional::<f32, D>(
11379                self.level.as_ref().map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
11380                encoder,
11381                offset + cur_offset,
11382                depth,
11383            )?;
11384
11385            _prev_end_offset = cur_offset + envelope_size;
11386            if 2 > max_ordinal {
11387                return Ok(());
11388            }
11389
11390            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11391            // are envelope_size bytes.
11392            let cur_offset: usize = (2 - 1) * envelope_size;
11393
11394            // Zero reserved fields.
11395            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11396
11397            // Safety:
11398            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11399            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11400            //   envelope_size bytes, there is always sufficient room.
11401            fidl::encoding::encode_in_envelope_optional::<bool, D>(
11402                self.muted.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11403                encoder,
11404                offset + cur_offset,
11405                depth,
11406            )?;
11407
11408            _prev_end_offset = cur_offset + envelope_size;
11409
11410            Ok(())
11411        }
11412    }
11413
11414    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Volume {
11415        #[inline(always)]
11416        fn new_empty() -> Self {
11417            Self::default()
11418        }
11419
11420        unsafe fn decode(
11421            &mut self,
11422            decoder: &mut fidl::encoding::Decoder<'_, D>,
11423            offset: usize,
11424            mut depth: fidl::encoding::Depth,
11425        ) -> fidl::Result<()> {
11426            decoder.debug_check_bounds::<Self>(offset);
11427            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11428                None => return Err(fidl::Error::NotNullable),
11429                Some(len) => len,
11430            };
11431            // Calling decoder.out_of_line_offset(0) is not allowed.
11432            if len == 0 {
11433                return Ok(());
11434            };
11435            depth.increment()?;
11436            let envelope_size = 8;
11437            let bytes_len = len * envelope_size;
11438            let offset = decoder.out_of_line_offset(bytes_len)?;
11439            // Decode the envelope for each type.
11440            let mut _next_ordinal_to_read = 0;
11441            let mut next_offset = offset;
11442            let end_offset = offset + bytes_len;
11443            _next_ordinal_to_read += 1;
11444            if next_offset >= end_offset {
11445                return Ok(());
11446            }
11447
11448            // Decode unknown envelopes for gaps in ordinals.
11449            while _next_ordinal_to_read < 1 {
11450                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11451                _next_ordinal_to_read += 1;
11452                next_offset += envelope_size;
11453            }
11454
11455            let next_out_of_line = decoder.next_out_of_line();
11456            let handles_before = decoder.remaining_handles();
11457            if let Some((inlined, num_bytes, num_handles)) =
11458                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11459            {
11460                let member_inline_size =
11461                    <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11462                if inlined != (member_inline_size <= 4) {
11463                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11464                }
11465                let inner_offset;
11466                let mut inner_depth = depth.clone();
11467                if inlined {
11468                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11469                    inner_offset = next_offset;
11470                } else {
11471                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11472                    inner_depth.increment()?;
11473                }
11474                let val_ref = self.level.get_or_insert_with(|| fidl::new_empty!(f32, D));
11475                fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
11476                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11477                {
11478                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11479                }
11480                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11481                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11482                }
11483            }
11484
11485            next_offset += envelope_size;
11486            _next_ordinal_to_read += 1;
11487            if next_offset >= end_offset {
11488                return Ok(());
11489            }
11490
11491            // Decode unknown envelopes for gaps in ordinals.
11492            while _next_ordinal_to_read < 2 {
11493                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11494                _next_ordinal_to_read += 1;
11495                next_offset += envelope_size;
11496            }
11497
11498            let next_out_of_line = decoder.next_out_of_line();
11499            let handles_before = decoder.remaining_handles();
11500            if let Some((inlined, num_bytes, num_handles)) =
11501                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11502            {
11503                let member_inline_size =
11504                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11505                if inlined != (member_inline_size <= 4) {
11506                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11507                }
11508                let inner_offset;
11509                let mut inner_depth = depth.clone();
11510                if inlined {
11511                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11512                    inner_offset = next_offset;
11513                } else {
11514                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11515                    inner_depth.increment()?;
11516                }
11517                let val_ref = self.muted.get_or_insert_with(|| fidl::new_empty!(bool, D));
11518                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
11519                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11520                {
11521                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11522                }
11523                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11524                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11525                }
11526            }
11527
11528            next_offset += envelope_size;
11529
11530            // Decode the remaining unknown envelopes.
11531            while next_offset < end_offset {
11532                _next_ordinal_to_read += 1;
11533                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11534                next_offset += envelope_size;
11535            }
11536
11537            Ok(())
11538        }
11539    }
11540
11541    impl fidl::encoding::ValueTypeMarker for LightValue {
11542        type Borrowed<'a> = &'a Self;
11543        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11544            value
11545        }
11546    }
11547
11548    unsafe impl fidl::encoding::TypeMarker for LightValue {
11549        type Owned = Self;
11550
11551        #[inline(always)]
11552        fn inline_align(_context: fidl::encoding::Context) -> usize {
11553            8
11554        }
11555
11556        #[inline(always)]
11557        fn inline_size(_context: fidl::encoding::Context) -> usize {
11558            16
11559        }
11560    }
11561
11562    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightValue, D>
11563        for &LightValue
11564    {
11565        #[inline]
11566        unsafe fn encode(
11567            self,
11568            encoder: &mut fidl::encoding::Encoder<'_, D>,
11569            offset: usize,
11570            _depth: fidl::encoding::Depth,
11571        ) -> fidl::Result<()> {
11572            encoder.debug_check_bounds::<LightValue>(offset);
11573            encoder.write_num::<u64>(self.ordinal(), offset);
11574            match self {
11575            LightValue::On(ref val) => {
11576                fidl::encoding::encode_in_envelope::<bool, D>(
11577                    <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
11578                    encoder, offset + 8, _depth
11579                )
11580            }
11581            LightValue::Brightness(ref val) => {
11582                fidl::encoding::encode_in_envelope::<f64, D>(
11583                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(val),
11584                    encoder, offset + 8, _depth
11585                )
11586            }
11587            LightValue::Color(ref val) => {
11588                fidl::encoding::encode_in_envelope::<fidl_fuchsia_ui_types__common::ColorRgb, D>(
11589                    <fidl_fuchsia_ui_types__common::ColorRgb as fidl::encoding::ValueTypeMarker>::borrow(val),
11590                    encoder, offset + 8, _depth
11591                )
11592            }
11593        }
11594        }
11595    }
11596
11597    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightValue {
11598        #[inline(always)]
11599        fn new_empty() -> Self {
11600            Self::On(fidl::new_empty!(bool, D))
11601        }
11602
11603        #[inline]
11604        unsafe fn decode(
11605            &mut self,
11606            decoder: &mut fidl::encoding::Decoder<'_, D>,
11607            offset: usize,
11608            mut depth: fidl::encoding::Depth,
11609        ) -> fidl::Result<()> {
11610            decoder.debug_check_bounds::<Self>(offset);
11611            #[allow(unused_variables)]
11612            let next_out_of_line = decoder.next_out_of_line();
11613            let handles_before = decoder.remaining_handles();
11614            let (ordinal, inlined, num_bytes, num_handles) =
11615                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
11616
11617            let member_inline_size = match ordinal {
11618            1 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11619            2 => <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11620            3 => <fidl_fuchsia_ui_types__common::ColorRgb as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11621            _ => return Err(fidl::Error::UnknownUnionTag),
11622        };
11623
11624            if inlined != (member_inline_size <= 4) {
11625                return Err(fidl::Error::InvalidInlineBitInEnvelope);
11626            }
11627            let _inner_offset;
11628            if inlined {
11629                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
11630                _inner_offset = offset + 8;
11631            } else {
11632                depth.increment()?;
11633                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11634            }
11635            match ordinal {
11636                1 => {
11637                    #[allow(irrefutable_let_patterns)]
11638                    if let LightValue::On(_) = self {
11639                        // Do nothing, read the value into the object
11640                    } else {
11641                        // Initialize `self` to the right variant
11642                        *self = LightValue::On(fidl::new_empty!(bool, D));
11643                    }
11644                    #[allow(irrefutable_let_patterns)]
11645                    if let LightValue::On(ref mut val) = self {
11646                        fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
11647                    } else {
11648                        unreachable!()
11649                    }
11650                }
11651                2 => {
11652                    #[allow(irrefutable_let_patterns)]
11653                    if let LightValue::Brightness(_) = self {
11654                        // Do nothing, read the value into the object
11655                    } else {
11656                        // Initialize `self` to the right variant
11657                        *self = LightValue::Brightness(fidl::new_empty!(f64, D));
11658                    }
11659                    #[allow(irrefutable_let_patterns)]
11660                    if let LightValue::Brightness(ref mut val) = self {
11661                        fidl::decode!(f64, D, val, decoder, _inner_offset, depth)?;
11662                    } else {
11663                        unreachable!()
11664                    }
11665                }
11666                3 => {
11667                    #[allow(irrefutable_let_patterns)]
11668                    if let LightValue::Color(_) = self {
11669                        // Do nothing, read the value into the object
11670                    } else {
11671                        // Initialize `self` to the right variant
11672                        *self = LightValue::Color(fidl::new_empty!(
11673                            fidl_fuchsia_ui_types__common::ColorRgb,
11674                            D
11675                        ));
11676                    }
11677                    #[allow(irrefutable_let_patterns)]
11678                    if let LightValue::Color(ref mut val) = self {
11679                        fidl::decode!(
11680                            fidl_fuchsia_ui_types__common::ColorRgb,
11681                            D,
11682                            val,
11683                            decoder,
11684                            _inner_offset,
11685                            depth
11686                        )?;
11687                    } else {
11688                        unreachable!()
11689                    }
11690                }
11691                ordinal => panic!("unexpected ordinal {:?}", ordinal),
11692            }
11693            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
11694                return Err(fidl::Error::InvalidNumBytesInEnvelope);
11695            }
11696            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11697                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11698            }
11699            Ok(())
11700        }
11701    }
11702}