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<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NightModeSettings, D>>
4223        fidl::encoding::Encode<NightModeSetRequest, D> for (T0,)
4224    {
4225        #[inline]
4226        unsafe fn encode(
4227            self,
4228            encoder: &mut fidl::encoding::Encoder<'_, D>,
4229            offset: usize,
4230            depth: fidl::encoding::Depth,
4231        ) -> fidl::Result<()> {
4232            encoder.debug_check_bounds::<NightModeSetRequest>(offset);
4233            // Zero out padding regions. There's no need to apply masks
4234            // because the unmasked parts will be overwritten by fields.
4235            // Write the fields.
4236            self.0.encode(encoder, offset + 0, depth)?;
4237            Ok(())
4238        }
4239    }
4240
4241    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NightModeSetRequest {
4242        #[inline(always)]
4243        fn new_empty() -> Self {
4244            Self { settings: fidl::new_empty!(NightModeSettings, D) }
4245        }
4246
4247        #[inline]
4248        unsafe fn decode(
4249            &mut self,
4250            decoder: &mut fidl::encoding::Decoder<'_, D>,
4251            offset: usize,
4252            _depth: fidl::encoding::Depth,
4253        ) -> fidl::Result<()> {
4254            decoder.debug_check_bounds::<Self>(offset);
4255            // Verify that padding bytes are zero.
4256            fidl::decode!(NightModeSettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
4257            Ok(())
4258        }
4259    }
4260
4261    impl fidl::encoding::ValueTypeMarker for NightModeWatchResponse {
4262        type Borrowed<'a> = &'a Self;
4263        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4264            value
4265        }
4266    }
4267
4268    unsafe impl fidl::encoding::TypeMarker for NightModeWatchResponse {
4269        type Owned = Self;
4270
4271        #[inline(always)]
4272        fn inline_align(_context: fidl::encoding::Context) -> usize {
4273            8
4274        }
4275
4276        #[inline(always)]
4277        fn inline_size(_context: fidl::encoding::Context) -> usize {
4278            16
4279        }
4280    }
4281
4282    unsafe impl<D: fidl::encoding::ResourceDialect>
4283        fidl::encoding::Encode<NightModeWatchResponse, D> for &NightModeWatchResponse
4284    {
4285        #[inline]
4286        unsafe fn encode(
4287            self,
4288            encoder: &mut fidl::encoding::Encoder<'_, D>,
4289            offset: usize,
4290            _depth: fidl::encoding::Depth,
4291        ) -> fidl::Result<()> {
4292            encoder.debug_check_bounds::<NightModeWatchResponse>(offset);
4293            // Delegate to tuple encoding.
4294            fidl::encoding::Encode::<NightModeWatchResponse, D>::encode(
4295                (<NightModeSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
4296                encoder,
4297                offset,
4298                _depth,
4299            )
4300        }
4301    }
4302    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NightModeSettings, D>>
4303        fidl::encoding::Encode<NightModeWatchResponse, D> for (T0,)
4304    {
4305        #[inline]
4306        unsafe fn encode(
4307            self,
4308            encoder: &mut fidl::encoding::Encoder<'_, D>,
4309            offset: usize,
4310            depth: fidl::encoding::Depth,
4311        ) -> fidl::Result<()> {
4312            encoder.debug_check_bounds::<NightModeWatchResponse>(offset);
4313            // Zero out padding regions. There's no need to apply masks
4314            // because the unmasked parts will be overwritten by fields.
4315            // Write the fields.
4316            self.0.encode(encoder, offset + 0, depth)?;
4317            Ok(())
4318        }
4319    }
4320
4321    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4322        for NightModeWatchResponse
4323    {
4324        #[inline(always)]
4325        fn new_empty() -> Self {
4326            Self { settings: fidl::new_empty!(NightModeSettings, D) }
4327        }
4328
4329        #[inline]
4330        unsafe fn decode(
4331            &mut self,
4332            decoder: &mut fidl::encoding::Decoder<'_, D>,
4333            offset: usize,
4334            _depth: fidl::encoding::Depth,
4335        ) -> fidl::Result<()> {
4336            decoder.debug_check_bounds::<Self>(offset);
4337            // Verify that padding bytes are zero.
4338            fidl::decode!(NightModeSettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
4339            Ok(())
4340        }
4341    }
4342
4343    impl fidl::encoding::ValueTypeMarker for PrivacySetRequest {
4344        type Borrowed<'a> = &'a Self;
4345        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4346            value
4347        }
4348    }
4349
4350    unsafe impl fidl::encoding::TypeMarker for PrivacySetRequest {
4351        type Owned = Self;
4352
4353        #[inline(always)]
4354        fn inline_align(_context: fidl::encoding::Context) -> usize {
4355            8
4356        }
4357
4358        #[inline(always)]
4359        fn inline_size(_context: fidl::encoding::Context) -> usize {
4360            16
4361        }
4362    }
4363
4364    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PrivacySetRequest, D>
4365        for &PrivacySetRequest
4366    {
4367        #[inline]
4368        unsafe fn encode(
4369            self,
4370            encoder: &mut fidl::encoding::Encoder<'_, D>,
4371            offset: usize,
4372            _depth: fidl::encoding::Depth,
4373        ) -> fidl::Result<()> {
4374            encoder.debug_check_bounds::<PrivacySetRequest>(offset);
4375            // Delegate to tuple encoding.
4376            fidl::encoding::Encode::<PrivacySetRequest, D>::encode(
4377                (<PrivacySettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
4378                encoder,
4379                offset,
4380                _depth,
4381            )
4382        }
4383    }
4384    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PrivacySettings, D>>
4385        fidl::encoding::Encode<PrivacySetRequest, D> for (T0,)
4386    {
4387        #[inline]
4388        unsafe fn encode(
4389            self,
4390            encoder: &mut fidl::encoding::Encoder<'_, D>,
4391            offset: usize,
4392            depth: fidl::encoding::Depth,
4393        ) -> fidl::Result<()> {
4394            encoder.debug_check_bounds::<PrivacySetRequest>(offset);
4395            // Zero out padding regions. There's no need to apply masks
4396            // because the unmasked parts will be overwritten by fields.
4397            // Write the fields.
4398            self.0.encode(encoder, offset + 0, depth)?;
4399            Ok(())
4400        }
4401    }
4402
4403    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PrivacySetRequest {
4404        #[inline(always)]
4405        fn new_empty() -> Self {
4406            Self { settings: fidl::new_empty!(PrivacySettings, D) }
4407        }
4408
4409        #[inline]
4410        unsafe fn decode(
4411            &mut self,
4412            decoder: &mut fidl::encoding::Decoder<'_, D>,
4413            offset: usize,
4414            _depth: fidl::encoding::Depth,
4415        ) -> fidl::Result<()> {
4416            decoder.debug_check_bounds::<Self>(offset);
4417            // Verify that padding bytes are zero.
4418            fidl::decode!(PrivacySettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
4419            Ok(())
4420        }
4421    }
4422
4423    impl fidl::encoding::ValueTypeMarker for PrivacyWatchResponse {
4424        type Borrowed<'a> = &'a Self;
4425        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4426            value
4427        }
4428    }
4429
4430    unsafe impl fidl::encoding::TypeMarker for PrivacyWatchResponse {
4431        type Owned = Self;
4432
4433        #[inline(always)]
4434        fn inline_align(_context: fidl::encoding::Context) -> usize {
4435            8
4436        }
4437
4438        #[inline(always)]
4439        fn inline_size(_context: fidl::encoding::Context) -> usize {
4440            16
4441        }
4442    }
4443
4444    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PrivacyWatchResponse, D>
4445        for &PrivacyWatchResponse
4446    {
4447        #[inline]
4448        unsafe fn encode(
4449            self,
4450            encoder: &mut fidl::encoding::Encoder<'_, D>,
4451            offset: usize,
4452            _depth: fidl::encoding::Depth,
4453        ) -> fidl::Result<()> {
4454            encoder.debug_check_bounds::<PrivacyWatchResponse>(offset);
4455            // Delegate to tuple encoding.
4456            fidl::encoding::Encode::<PrivacyWatchResponse, D>::encode(
4457                (<PrivacySettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
4458                encoder,
4459                offset,
4460                _depth,
4461            )
4462        }
4463    }
4464    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PrivacySettings, D>>
4465        fidl::encoding::Encode<PrivacyWatchResponse, D> for (T0,)
4466    {
4467        #[inline]
4468        unsafe fn encode(
4469            self,
4470            encoder: &mut fidl::encoding::Encoder<'_, D>,
4471            offset: usize,
4472            depth: fidl::encoding::Depth,
4473        ) -> fidl::Result<()> {
4474            encoder.debug_check_bounds::<PrivacyWatchResponse>(offset);
4475            // Zero out padding regions. There's no need to apply masks
4476            // because the unmasked parts will be overwritten by fields.
4477            // Write the fields.
4478            self.0.encode(encoder, offset + 0, depth)?;
4479            Ok(())
4480        }
4481    }
4482
4483    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PrivacyWatchResponse {
4484        #[inline(always)]
4485        fn new_empty() -> Self {
4486            Self { settings: fidl::new_empty!(PrivacySettings, D) }
4487        }
4488
4489        #[inline]
4490        unsafe fn decode(
4491            &mut self,
4492            decoder: &mut fidl::encoding::Decoder<'_, D>,
4493            offset: usize,
4494            _depth: fidl::encoding::Depth,
4495        ) -> fidl::Result<()> {
4496            decoder.debug_check_bounds::<Self>(offset);
4497            // Verify that padding bytes are zero.
4498            fidl::decode!(PrivacySettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
4499            Ok(())
4500        }
4501    }
4502
4503    impl fidl::encoding::ValueTypeMarker for SetupSetRequest {
4504        type Borrowed<'a> = &'a Self;
4505        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4506            value
4507        }
4508    }
4509
4510    unsafe impl fidl::encoding::TypeMarker for SetupSetRequest {
4511        type Owned = Self;
4512
4513        #[inline(always)]
4514        fn inline_align(_context: fidl::encoding::Context) -> usize {
4515            8
4516        }
4517
4518        #[inline(always)]
4519        fn inline_size(_context: fidl::encoding::Context) -> usize {
4520            24
4521        }
4522    }
4523
4524    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetupSetRequest, D>
4525        for &SetupSetRequest
4526    {
4527        #[inline]
4528        unsafe fn encode(
4529            self,
4530            encoder: &mut fidl::encoding::Encoder<'_, D>,
4531            offset: usize,
4532            _depth: fidl::encoding::Depth,
4533        ) -> fidl::Result<()> {
4534            encoder.debug_check_bounds::<SetupSetRequest>(offset);
4535            // Delegate to tuple encoding.
4536            fidl::encoding::Encode::<SetupSetRequest, D>::encode(
4537                (
4538                    <SetupSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),
4539                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.reboot_device),
4540                ),
4541                encoder,
4542                offset,
4543                _depth,
4544            )
4545        }
4546    }
4547    unsafe impl<
4548            D: fidl::encoding::ResourceDialect,
4549            T0: fidl::encoding::Encode<SetupSettings, D>,
4550            T1: fidl::encoding::Encode<bool, D>,
4551        > fidl::encoding::Encode<SetupSetRequest, D> for (T0, T1)
4552    {
4553        #[inline]
4554        unsafe fn encode(
4555            self,
4556            encoder: &mut fidl::encoding::Encoder<'_, D>,
4557            offset: usize,
4558            depth: fidl::encoding::Depth,
4559        ) -> fidl::Result<()> {
4560            encoder.debug_check_bounds::<SetupSetRequest>(offset);
4561            // Zero out padding regions. There's no need to apply masks
4562            // because the unmasked parts will be overwritten by fields.
4563            unsafe {
4564                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4565                (ptr as *mut u64).write_unaligned(0);
4566            }
4567            // Write the fields.
4568            self.0.encode(encoder, offset + 0, depth)?;
4569            self.1.encode(encoder, offset + 16, depth)?;
4570            Ok(())
4571        }
4572    }
4573
4574    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetupSetRequest {
4575        #[inline(always)]
4576        fn new_empty() -> Self {
4577            Self {
4578                settings: fidl::new_empty!(SetupSettings, D),
4579                reboot_device: fidl::new_empty!(bool, D),
4580            }
4581        }
4582
4583        #[inline]
4584        unsafe fn decode(
4585            &mut self,
4586            decoder: &mut fidl::encoding::Decoder<'_, D>,
4587            offset: usize,
4588            _depth: fidl::encoding::Depth,
4589        ) -> fidl::Result<()> {
4590            decoder.debug_check_bounds::<Self>(offset);
4591            // Verify that padding bytes are zero.
4592            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4593            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4594            let mask = 0xffffffffffffff00u64;
4595            let maskedval = padval & mask;
4596            if maskedval != 0 {
4597                return Err(fidl::Error::NonZeroPadding {
4598                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4599                });
4600            }
4601            fidl::decode!(SetupSettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
4602            fidl::decode!(bool, D, &mut self.reboot_device, decoder, offset + 16, _depth)?;
4603            Ok(())
4604        }
4605    }
4606
4607    impl fidl::encoding::ValueTypeMarker for SetupWatchResponse {
4608        type Borrowed<'a> = &'a Self;
4609        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4610            value
4611        }
4612    }
4613
4614    unsafe impl fidl::encoding::TypeMarker for SetupWatchResponse {
4615        type Owned = Self;
4616
4617        #[inline(always)]
4618        fn inline_align(_context: fidl::encoding::Context) -> usize {
4619            8
4620        }
4621
4622        #[inline(always)]
4623        fn inline_size(_context: fidl::encoding::Context) -> usize {
4624            16
4625        }
4626    }
4627
4628    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetupWatchResponse, D>
4629        for &SetupWatchResponse
4630    {
4631        #[inline]
4632        unsafe fn encode(
4633            self,
4634            encoder: &mut fidl::encoding::Encoder<'_, D>,
4635            offset: usize,
4636            _depth: fidl::encoding::Depth,
4637        ) -> fidl::Result<()> {
4638            encoder.debug_check_bounds::<SetupWatchResponse>(offset);
4639            // Delegate to tuple encoding.
4640            fidl::encoding::Encode::<SetupWatchResponse, D>::encode(
4641                (<SetupSettings as fidl::encoding::ValueTypeMarker>::borrow(&self.settings),),
4642                encoder,
4643                offset,
4644                _depth,
4645            )
4646        }
4647    }
4648    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetupSettings, D>>
4649        fidl::encoding::Encode<SetupWatchResponse, D> for (T0,)
4650    {
4651        #[inline]
4652        unsafe fn encode(
4653            self,
4654            encoder: &mut fidl::encoding::Encoder<'_, D>,
4655            offset: usize,
4656            depth: fidl::encoding::Depth,
4657        ) -> fidl::Result<()> {
4658            encoder.debug_check_bounds::<SetupWatchResponse>(offset);
4659            // Zero out padding regions. There's no need to apply masks
4660            // because the unmasked parts will be overwritten by fields.
4661            // Write the fields.
4662            self.0.encode(encoder, offset + 0, depth)?;
4663            Ok(())
4664        }
4665    }
4666
4667    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetupWatchResponse {
4668        #[inline(always)]
4669        fn new_empty() -> Self {
4670            Self { settings: fidl::new_empty!(SetupSettings, D) }
4671        }
4672
4673        #[inline]
4674        unsafe fn decode(
4675            &mut self,
4676            decoder: &mut fidl::encoding::Decoder<'_, D>,
4677            offset: usize,
4678            _depth: fidl::encoding::Depth,
4679        ) -> fidl::Result<()> {
4680            decoder.debug_check_bounds::<Self>(offset);
4681            // Verify that padding bytes are zero.
4682            fidl::decode!(SetupSettings, D, &mut self.settings, decoder, offset + 0, _depth)?;
4683            Ok(())
4684        }
4685    }
4686
4687    impl AccessibilitySettings {
4688        #[inline(always)]
4689        fn max_ordinal_present(&self) -> u64 {
4690            if let Some(_) = self.captions_settings {
4691                return 6;
4692            }
4693            if let Some(_) = self.color_correction {
4694                return 5;
4695            }
4696            if let Some(_) = self.enable_magnification {
4697                return 4;
4698            }
4699            if let Some(_) = self.color_inversion {
4700                return 3;
4701            }
4702            if let Some(_) = self.screen_reader {
4703                return 2;
4704            }
4705            if let Some(_) = self.audio_description {
4706                return 1;
4707            }
4708            0
4709        }
4710    }
4711
4712    impl fidl::encoding::ValueTypeMarker for AccessibilitySettings {
4713        type Borrowed<'a> = &'a Self;
4714        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4715            value
4716        }
4717    }
4718
4719    unsafe impl fidl::encoding::TypeMarker for AccessibilitySettings {
4720        type Owned = Self;
4721
4722        #[inline(always)]
4723        fn inline_align(_context: fidl::encoding::Context) -> usize {
4724            8
4725        }
4726
4727        #[inline(always)]
4728        fn inline_size(_context: fidl::encoding::Context) -> usize {
4729            16
4730        }
4731    }
4732
4733    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AccessibilitySettings, D>
4734        for &AccessibilitySettings
4735    {
4736        unsafe fn encode(
4737            self,
4738            encoder: &mut fidl::encoding::Encoder<'_, D>,
4739            offset: usize,
4740            mut depth: fidl::encoding::Depth,
4741        ) -> fidl::Result<()> {
4742            encoder.debug_check_bounds::<AccessibilitySettings>(offset);
4743            // Vector header
4744            let max_ordinal: u64 = self.max_ordinal_present();
4745            encoder.write_num(max_ordinal, offset);
4746            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4747            // Calling encoder.out_of_line_offset(0) is not allowed.
4748            if max_ordinal == 0 {
4749                return Ok(());
4750            }
4751            depth.increment()?;
4752            let envelope_size = 8;
4753            let bytes_len = max_ordinal as usize * envelope_size;
4754            #[allow(unused_variables)]
4755            let offset = encoder.out_of_line_offset(bytes_len);
4756            let mut _prev_end_offset: usize = 0;
4757            if 1 > max_ordinal {
4758                return Ok(());
4759            }
4760
4761            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4762            // are envelope_size bytes.
4763            let cur_offset: usize = (1 - 1) * envelope_size;
4764
4765            // Zero reserved fields.
4766            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4767
4768            // Safety:
4769            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4770            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4771            //   envelope_size bytes, there is always sufficient room.
4772            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4773                self.audio_description
4774                    .as_ref()
4775                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4776                encoder,
4777                offset + cur_offset,
4778                depth,
4779            )?;
4780
4781            _prev_end_offset = cur_offset + envelope_size;
4782            if 2 > max_ordinal {
4783                return Ok(());
4784            }
4785
4786            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4787            // are envelope_size bytes.
4788            let cur_offset: usize = (2 - 1) * envelope_size;
4789
4790            // Zero reserved fields.
4791            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4792
4793            // Safety:
4794            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4795            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4796            //   envelope_size bytes, there is always sufficient room.
4797            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4798                self.screen_reader.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4799                encoder,
4800                offset + cur_offset,
4801                depth,
4802            )?;
4803
4804            _prev_end_offset = cur_offset + envelope_size;
4805            if 3 > max_ordinal {
4806                return Ok(());
4807            }
4808
4809            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4810            // are envelope_size bytes.
4811            let cur_offset: usize = (3 - 1) * envelope_size;
4812
4813            // Zero reserved fields.
4814            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4815
4816            // Safety:
4817            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4818            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4819            //   envelope_size bytes, there is always sufficient room.
4820            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4821                self.color_inversion
4822                    .as_ref()
4823                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4824                encoder,
4825                offset + cur_offset,
4826                depth,
4827            )?;
4828
4829            _prev_end_offset = cur_offset + envelope_size;
4830            if 4 > max_ordinal {
4831                return Ok(());
4832            }
4833
4834            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4835            // are envelope_size bytes.
4836            let cur_offset: usize = (4 - 1) * envelope_size;
4837
4838            // Zero reserved fields.
4839            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4840
4841            // Safety:
4842            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4843            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4844            //   envelope_size bytes, there is always sufficient room.
4845            fidl::encoding::encode_in_envelope_optional::<bool, D>(
4846                self.enable_magnification
4847                    .as_ref()
4848                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4849                encoder,
4850                offset + cur_offset,
4851                depth,
4852            )?;
4853
4854            _prev_end_offset = cur_offset + envelope_size;
4855            if 5 > max_ordinal {
4856                return Ok(());
4857            }
4858
4859            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4860            // are envelope_size bytes.
4861            let cur_offset: usize = (5 - 1) * envelope_size;
4862
4863            // Zero reserved fields.
4864            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4865
4866            // Safety:
4867            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4868            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4869            //   envelope_size bytes, there is always sufficient room.
4870            fidl::encoding::encode_in_envelope_optional::<ColorBlindnessType, D>(
4871                self.color_correction
4872                    .as_ref()
4873                    .map(<ColorBlindnessType as fidl::encoding::ValueTypeMarker>::borrow),
4874                encoder,
4875                offset + cur_offset,
4876                depth,
4877            )?;
4878
4879            _prev_end_offset = cur_offset + envelope_size;
4880            if 6 > max_ordinal {
4881                return Ok(());
4882            }
4883
4884            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4885            // are envelope_size bytes.
4886            let cur_offset: usize = (6 - 1) * envelope_size;
4887
4888            // Zero reserved fields.
4889            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4890
4891            // Safety:
4892            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4893            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4894            //   envelope_size bytes, there is always sufficient room.
4895            fidl::encoding::encode_in_envelope_optional::<CaptionsSettings, D>(
4896                self.captions_settings
4897                    .as_ref()
4898                    .map(<CaptionsSettings as fidl::encoding::ValueTypeMarker>::borrow),
4899                encoder,
4900                offset + cur_offset,
4901                depth,
4902            )?;
4903
4904            _prev_end_offset = cur_offset + envelope_size;
4905
4906            Ok(())
4907        }
4908    }
4909
4910    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AccessibilitySettings {
4911        #[inline(always)]
4912        fn new_empty() -> Self {
4913            Self::default()
4914        }
4915
4916        unsafe fn decode(
4917            &mut self,
4918            decoder: &mut fidl::encoding::Decoder<'_, D>,
4919            offset: usize,
4920            mut depth: fidl::encoding::Depth,
4921        ) -> fidl::Result<()> {
4922            decoder.debug_check_bounds::<Self>(offset);
4923            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4924                None => return Err(fidl::Error::NotNullable),
4925                Some(len) => len,
4926            };
4927            // Calling decoder.out_of_line_offset(0) is not allowed.
4928            if len == 0 {
4929                return Ok(());
4930            };
4931            depth.increment()?;
4932            let envelope_size = 8;
4933            let bytes_len = len * envelope_size;
4934            let offset = decoder.out_of_line_offset(bytes_len)?;
4935            // Decode the envelope for each type.
4936            let mut _next_ordinal_to_read = 0;
4937            let mut next_offset = offset;
4938            let end_offset = offset + bytes_len;
4939            _next_ordinal_to_read += 1;
4940            if next_offset >= end_offset {
4941                return Ok(());
4942            }
4943
4944            // Decode unknown envelopes for gaps in ordinals.
4945            while _next_ordinal_to_read < 1 {
4946                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4947                _next_ordinal_to_read += 1;
4948                next_offset += envelope_size;
4949            }
4950
4951            let next_out_of_line = decoder.next_out_of_line();
4952            let handles_before = decoder.remaining_handles();
4953            if let Some((inlined, num_bytes, num_handles)) =
4954                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4955            {
4956                let member_inline_size =
4957                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4958                if inlined != (member_inline_size <= 4) {
4959                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4960                }
4961                let inner_offset;
4962                let mut inner_depth = depth.clone();
4963                if inlined {
4964                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4965                    inner_offset = next_offset;
4966                } else {
4967                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4968                    inner_depth.increment()?;
4969                }
4970                let val_ref =
4971                    self.audio_description.get_or_insert_with(|| fidl::new_empty!(bool, D));
4972                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4973                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4974                {
4975                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4976                }
4977                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4978                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4979                }
4980            }
4981
4982            next_offset += envelope_size;
4983            _next_ordinal_to_read += 1;
4984            if next_offset >= end_offset {
4985                return Ok(());
4986            }
4987
4988            // Decode unknown envelopes for gaps in ordinals.
4989            while _next_ordinal_to_read < 2 {
4990                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4991                _next_ordinal_to_read += 1;
4992                next_offset += envelope_size;
4993            }
4994
4995            let next_out_of_line = decoder.next_out_of_line();
4996            let handles_before = decoder.remaining_handles();
4997            if let Some((inlined, num_bytes, num_handles)) =
4998                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4999            {
5000                let member_inline_size =
5001                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5002                if inlined != (member_inline_size <= 4) {
5003                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5004                }
5005                let inner_offset;
5006                let mut inner_depth = depth.clone();
5007                if inlined {
5008                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5009                    inner_offset = next_offset;
5010                } else {
5011                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5012                    inner_depth.increment()?;
5013                }
5014                let val_ref = self.screen_reader.get_or_insert_with(|| fidl::new_empty!(bool, D));
5015                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5016                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5017                {
5018                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5019                }
5020                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5021                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5022                }
5023            }
5024
5025            next_offset += envelope_size;
5026            _next_ordinal_to_read += 1;
5027            if next_offset >= end_offset {
5028                return Ok(());
5029            }
5030
5031            // Decode unknown envelopes for gaps in ordinals.
5032            while _next_ordinal_to_read < 3 {
5033                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5034                _next_ordinal_to_read += 1;
5035                next_offset += envelope_size;
5036            }
5037
5038            let next_out_of_line = decoder.next_out_of_line();
5039            let handles_before = decoder.remaining_handles();
5040            if let Some((inlined, num_bytes, num_handles)) =
5041                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5042            {
5043                let member_inline_size =
5044                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5045                if inlined != (member_inline_size <= 4) {
5046                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5047                }
5048                let inner_offset;
5049                let mut inner_depth = depth.clone();
5050                if inlined {
5051                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5052                    inner_offset = next_offset;
5053                } else {
5054                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5055                    inner_depth.increment()?;
5056                }
5057                let val_ref = self.color_inversion.get_or_insert_with(|| fidl::new_empty!(bool, D));
5058                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5059                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5060                {
5061                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5062                }
5063                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5064                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5065                }
5066            }
5067
5068            next_offset += envelope_size;
5069            _next_ordinal_to_read += 1;
5070            if next_offset >= end_offset {
5071                return Ok(());
5072            }
5073
5074            // Decode unknown envelopes for gaps in ordinals.
5075            while _next_ordinal_to_read < 4 {
5076                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5077                _next_ordinal_to_read += 1;
5078                next_offset += envelope_size;
5079            }
5080
5081            let next_out_of_line = decoder.next_out_of_line();
5082            let handles_before = decoder.remaining_handles();
5083            if let Some((inlined, num_bytes, num_handles)) =
5084                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5085            {
5086                let member_inline_size =
5087                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5088                if inlined != (member_inline_size <= 4) {
5089                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5090                }
5091                let inner_offset;
5092                let mut inner_depth = depth.clone();
5093                if inlined {
5094                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5095                    inner_offset = next_offset;
5096                } else {
5097                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5098                    inner_depth.increment()?;
5099                }
5100                let val_ref =
5101                    self.enable_magnification.get_or_insert_with(|| fidl::new_empty!(bool, D));
5102                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5103                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5104                {
5105                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5106                }
5107                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5108                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5109                }
5110            }
5111
5112            next_offset += envelope_size;
5113            _next_ordinal_to_read += 1;
5114            if next_offset >= end_offset {
5115                return Ok(());
5116            }
5117
5118            // Decode unknown envelopes for gaps in ordinals.
5119            while _next_ordinal_to_read < 5 {
5120                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5121                _next_ordinal_to_read += 1;
5122                next_offset += envelope_size;
5123            }
5124
5125            let next_out_of_line = decoder.next_out_of_line();
5126            let handles_before = decoder.remaining_handles();
5127            if let Some((inlined, num_bytes, num_handles)) =
5128                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5129            {
5130                let member_inline_size =
5131                    <ColorBlindnessType as fidl::encoding::TypeMarker>::inline_size(
5132                        decoder.context,
5133                    );
5134                if inlined != (member_inline_size <= 4) {
5135                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5136                }
5137                let inner_offset;
5138                let mut inner_depth = depth.clone();
5139                if inlined {
5140                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5141                    inner_offset = next_offset;
5142                } else {
5143                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5144                    inner_depth.increment()?;
5145                }
5146                let val_ref = self
5147                    .color_correction
5148                    .get_or_insert_with(|| fidl::new_empty!(ColorBlindnessType, D));
5149                fidl::decode!(ColorBlindnessType, D, val_ref, decoder, inner_offset, inner_depth)?;
5150                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5151                {
5152                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5153                }
5154                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5155                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5156                }
5157            }
5158
5159            next_offset += envelope_size;
5160            _next_ordinal_to_read += 1;
5161            if next_offset >= end_offset {
5162                return Ok(());
5163            }
5164
5165            // Decode unknown envelopes for gaps in ordinals.
5166            while _next_ordinal_to_read < 6 {
5167                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5168                _next_ordinal_to_read += 1;
5169                next_offset += envelope_size;
5170            }
5171
5172            let next_out_of_line = decoder.next_out_of_line();
5173            let handles_before = decoder.remaining_handles();
5174            if let Some((inlined, num_bytes, num_handles)) =
5175                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5176            {
5177                let member_inline_size =
5178                    <CaptionsSettings as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5179                if inlined != (member_inline_size <= 4) {
5180                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5181                }
5182                let inner_offset;
5183                let mut inner_depth = depth.clone();
5184                if inlined {
5185                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5186                    inner_offset = next_offset;
5187                } else {
5188                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5189                    inner_depth.increment()?;
5190                }
5191                let val_ref = self
5192                    .captions_settings
5193                    .get_or_insert_with(|| fidl::new_empty!(CaptionsSettings, D));
5194                fidl::decode!(CaptionsSettings, D, val_ref, decoder, inner_offset, inner_depth)?;
5195                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5196                {
5197                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5198                }
5199                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5200                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5201                }
5202            }
5203
5204            next_offset += envelope_size;
5205
5206            // Decode the remaining unknown envelopes.
5207            while next_offset < end_offset {
5208                _next_ordinal_to_read += 1;
5209                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5210                next_offset += envelope_size;
5211            }
5212
5213            Ok(())
5214        }
5215    }
5216
5217    impl AudioSettings {
5218        #[inline(always)]
5219        fn max_ordinal_present(&self) -> u64 {
5220            if let Some(_) = self.streams {
5221                return 1;
5222            }
5223            0
5224        }
5225    }
5226
5227    impl fidl::encoding::ValueTypeMarker for AudioSettings {
5228        type Borrowed<'a> = &'a Self;
5229        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5230            value
5231        }
5232    }
5233
5234    unsafe impl fidl::encoding::TypeMarker for AudioSettings {
5235        type Owned = Self;
5236
5237        #[inline(always)]
5238        fn inline_align(_context: fidl::encoding::Context) -> usize {
5239            8
5240        }
5241
5242        #[inline(always)]
5243        fn inline_size(_context: fidl::encoding::Context) -> usize {
5244            16
5245        }
5246    }
5247
5248    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioSettings, D>
5249        for &AudioSettings
5250    {
5251        unsafe fn encode(
5252            self,
5253            encoder: &mut fidl::encoding::Encoder<'_, D>,
5254            offset: usize,
5255            mut depth: fidl::encoding::Depth,
5256        ) -> fidl::Result<()> {
5257            encoder.debug_check_bounds::<AudioSettings>(offset);
5258            // Vector header
5259            let max_ordinal: u64 = self.max_ordinal_present();
5260            encoder.write_num(max_ordinal, offset);
5261            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5262            // Calling encoder.out_of_line_offset(0) is not allowed.
5263            if max_ordinal == 0 {
5264                return Ok(());
5265            }
5266            depth.increment()?;
5267            let envelope_size = 8;
5268            let bytes_len = max_ordinal as usize * envelope_size;
5269            #[allow(unused_variables)]
5270            let offset = encoder.out_of_line_offset(bytes_len);
5271            let mut _prev_end_offset: usize = 0;
5272            if 1 > max_ordinal {
5273                return Ok(());
5274            }
5275
5276            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5277            // are envelope_size bytes.
5278            let cur_offset: usize = (1 - 1) * envelope_size;
5279
5280            // Zero reserved fields.
5281            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5282
5283            // Safety:
5284            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5285            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5286            //   envelope_size bytes, there is always sufficient room.
5287            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<AudioStreamSettings, 5>, D>(
5288            self.streams.as_ref().map(<fidl::encoding::Vector<AudioStreamSettings, 5> as fidl::encoding::ValueTypeMarker>::borrow),
5289            encoder, offset + cur_offset, depth
5290        )?;
5291
5292            _prev_end_offset = cur_offset + envelope_size;
5293
5294            Ok(())
5295        }
5296    }
5297
5298    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioSettings {
5299        #[inline(always)]
5300        fn new_empty() -> Self {
5301            Self::default()
5302        }
5303
5304        unsafe fn decode(
5305            &mut self,
5306            decoder: &mut fidl::encoding::Decoder<'_, D>,
5307            offset: usize,
5308            mut depth: fidl::encoding::Depth,
5309        ) -> fidl::Result<()> {
5310            decoder.debug_check_bounds::<Self>(offset);
5311            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5312                None => return Err(fidl::Error::NotNullable),
5313                Some(len) => len,
5314            };
5315            // Calling decoder.out_of_line_offset(0) is not allowed.
5316            if len == 0 {
5317                return Ok(());
5318            };
5319            depth.increment()?;
5320            let envelope_size = 8;
5321            let bytes_len = len * envelope_size;
5322            let offset = decoder.out_of_line_offset(bytes_len)?;
5323            // Decode the envelope for each type.
5324            let mut _next_ordinal_to_read = 0;
5325            let mut next_offset = offset;
5326            let end_offset = offset + bytes_len;
5327            _next_ordinal_to_read += 1;
5328            if next_offset >= end_offset {
5329                return Ok(());
5330            }
5331
5332            // Decode unknown envelopes for gaps in ordinals.
5333            while _next_ordinal_to_read < 1 {
5334                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5335                _next_ordinal_to_read += 1;
5336                next_offset += envelope_size;
5337            }
5338
5339            let next_out_of_line = decoder.next_out_of_line();
5340            let handles_before = decoder.remaining_handles();
5341            if let Some((inlined, num_bytes, num_handles)) =
5342                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5343            {
5344                let member_inline_size = <fidl::encoding::Vector<AudioStreamSettings, 5> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5345                if inlined != (member_inline_size <= 4) {
5346                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5347                }
5348                let inner_offset;
5349                let mut inner_depth = depth.clone();
5350                if inlined {
5351                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5352                    inner_offset = next_offset;
5353                } else {
5354                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5355                    inner_depth.increment()?;
5356                }
5357                let val_ref = self.streams.get_or_insert_with(
5358                    || fidl::new_empty!(fidl::encoding::Vector<AudioStreamSettings, 5>, D),
5359                );
5360                fidl::decode!(fidl::encoding::Vector<AudioStreamSettings, 5>, D, val_ref, decoder, inner_offset, inner_depth)?;
5361                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5362                {
5363                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5364                }
5365                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5366                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5367                }
5368            }
5369
5370            next_offset += envelope_size;
5371
5372            // Decode the remaining unknown envelopes.
5373            while next_offset < end_offset {
5374                _next_ordinal_to_read += 1;
5375                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5376                next_offset += envelope_size;
5377            }
5378
5379            Ok(())
5380        }
5381    }
5382
5383    impl AudioSettings2 {
5384        #[inline(always)]
5385        fn max_ordinal_present(&self) -> u64 {
5386            if let Some(_) = self.streams {
5387                return 1;
5388            }
5389            0
5390        }
5391    }
5392
5393    impl fidl::encoding::ValueTypeMarker for AudioSettings2 {
5394        type Borrowed<'a> = &'a Self;
5395        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5396            value
5397        }
5398    }
5399
5400    unsafe impl fidl::encoding::TypeMarker for AudioSettings2 {
5401        type Owned = Self;
5402
5403        #[inline(always)]
5404        fn inline_align(_context: fidl::encoding::Context) -> usize {
5405            8
5406        }
5407
5408        #[inline(always)]
5409        fn inline_size(_context: fidl::encoding::Context) -> usize {
5410            16
5411        }
5412    }
5413
5414    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioSettings2, D>
5415        for &AudioSettings2
5416    {
5417        unsafe fn encode(
5418            self,
5419            encoder: &mut fidl::encoding::Encoder<'_, D>,
5420            offset: usize,
5421            mut depth: fidl::encoding::Depth,
5422        ) -> fidl::Result<()> {
5423            encoder.debug_check_bounds::<AudioSettings2>(offset);
5424            // Vector header
5425            let max_ordinal: u64 = self.max_ordinal_present();
5426            encoder.write_num(max_ordinal, offset);
5427            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5428            // Calling encoder.out_of_line_offset(0) is not allowed.
5429            if max_ordinal == 0 {
5430                return Ok(());
5431            }
5432            depth.increment()?;
5433            let envelope_size = 8;
5434            let bytes_len = max_ordinal as usize * envelope_size;
5435            #[allow(unused_variables)]
5436            let offset = encoder.out_of_line_offset(bytes_len);
5437            let mut _prev_end_offset: usize = 0;
5438            if 1 > max_ordinal {
5439                return Ok(());
5440            }
5441
5442            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5443            // are envelope_size bytes.
5444            let cur_offset: usize = (1 - 1) * envelope_size;
5445
5446            // Zero reserved fields.
5447            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5448
5449            // Safety:
5450            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5451            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5452            //   envelope_size bytes, there is always sufficient room.
5453            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<AudioStreamSettings2, 8>, D>(
5454            self.streams.as_ref().map(<fidl::encoding::Vector<AudioStreamSettings2, 8> as fidl::encoding::ValueTypeMarker>::borrow),
5455            encoder, offset + cur_offset, depth
5456        )?;
5457
5458            _prev_end_offset = cur_offset + envelope_size;
5459
5460            Ok(())
5461        }
5462    }
5463
5464    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioSettings2 {
5465        #[inline(always)]
5466        fn new_empty() -> Self {
5467            Self::default()
5468        }
5469
5470        unsafe fn decode(
5471            &mut self,
5472            decoder: &mut fidl::encoding::Decoder<'_, D>,
5473            offset: usize,
5474            mut depth: fidl::encoding::Depth,
5475        ) -> fidl::Result<()> {
5476            decoder.debug_check_bounds::<Self>(offset);
5477            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5478                None => return Err(fidl::Error::NotNullable),
5479                Some(len) => len,
5480            };
5481            // Calling decoder.out_of_line_offset(0) is not allowed.
5482            if len == 0 {
5483                return Ok(());
5484            };
5485            depth.increment()?;
5486            let envelope_size = 8;
5487            let bytes_len = len * envelope_size;
5488            let offset = decoder.out_of_line_offset(bytes_len)?;
5489            // Decode the envelope for each type.
5490            let mut _next_ordinal_to_read = 0;
5491            let mut next_offset = offset;
5492            let end_offset = offset + bytes_len;
5493            _next_ordinal_to_read += 1;
5494            if next_offset >= end_offset {
5495                return Ok(());
5496            }
5497
5498            // Decode unknown envelopes for gaps in ordinals.
5499            while _next_ordinal_to_read < 1 {
5500                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5501                _next_ordinal_to_read += 1;
5502                next_offset += envelope_size;
5503            }
5504
5505            let next_out_of_line = decoder.next_out_of_line();
5506            let handles_before = decoder.remaining_handles();
5507            if let Some((inlined, num_bytes, num_handles)) =
5508                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5509            {
5510                let member_inline_size = <fidl::encoding::Vector<AudioStreamSettings2, 8> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5511                if inlined != (member_inline_size <= 4) {
5512                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5513                }
5514                let inner_offset;
5515                let mut inner_depth = depth.clone();
5516                if inlined {
5517                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5518                    inner_offset = next_offset;
5519                } else {
5520                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5521                    inner_depth.increment()?;
5522                }
5523                let val_ref = self.streams.get_or_insert_with(
5524                    || fidl::new_empty!(fidl::encoding::Vector<AudioStreamSettings2, 8>, D),
5525                );
5526                fidl::decode!(fidl::encoding::Vector<AudioStreamSettings2, 8>, D, val_ref, decoder, inner_offset, inner_depth)?;
5527                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5528                {
5529                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5530                }
5531                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5532                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5533                }
5534            }
5535
5536            next_offset += envelope_size;
5537
5538            // Decode the remaining unknown envelopes.
5539            while next_offset < end_offset {
5540                _next_ordinal_to_read += 1;
5541                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5542                next_offset += envelope_size;
5543            }
5544
5545            Ok(())
5546        }
5547    }
5548
5549    impl AudioStreamSettings {
5550        #[inline(always)]
5551        fn max_ordinal_present(&self) -> u64 {
5552            if let Some(_) = self.user_volume {
5553                return 3;
5554            }
5555            if let Some(_) = self.source {
5556                return 2;
5557            }
5558            if let Some(_) = self.stream {
5559                return 1;
5560            }
5561            0
5562        }
5563    }
5564
5565    impl fidl::encoding::ValueTypeMarker for AudioStreamSettings {
5566        type Borrowed<'a> = &'a Self;
5567        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5568            value
5569        }
5570    }
5571
5572    unsafe impl fidl::encoding::TypeMarker for AudioStreamSettings {
5573        type Owned = Self;
5574
5575        #[inline(always)]
5576        fn inline_align(_context: fidl::encoding::Context) -> usize {
5577            8
5578        }
5579
5580        #[inline(always)]
5581        fn inline_size(_context: fidl::encoding::Context) -> usize {
5582            16
5583        }
5584    }
5585
5586    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioStreamSettings, D>
5587        for &AudioStreamSettings
5588    {
5589        unsafe fn encode(
5590            self,
5591            encoder: &mut fidl::encoding::Encoder<'_, D>,
5592            offset: usize,
5593            mut depth: fidl::encoding::Depth,
5594        ) -> fidl::Result<()> {
5595            encoder.debug_check_bounds::<AudioStreamSettings>(offset);
5596            // Vector header
5597            let max_ordinal: u64 = self.max_ordinal_present();
5598            encoder.write_num(max_ordinal, offset);
5599            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5600            // Calling encoder.out_of_line_offset(0) is not allowed.
5601            if max_ordinal == 0 {
5602                return Ok(());
5603            }
5604            depth.increment()?;
5605            let envelope_size = 8;
5606            let bytes_len = max_ordinal as usize * envelope_size;
5607            #[allow(unused_variables)]
5608            let offset = encoder.out_of_line_offset(bytes_len);
5609            let mut _prev_end_offset: usize = 0;
5610            if 1 > max_ordinal {
5611                return Ok(());
5612            }
5613
5614            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5615            // are envelope_size bytes.
5616            let cur_offset: usize = (1 - 1) * envelope_size;
5617
5618            // Zero reserved fields.
5619            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5620
5621            // Safety:
5622            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5623            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5624            //   envelope_size bytes, there is always sufficient room.
5625            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_media__common::AudioRenderUsage, D>(
5626            self.stream.as_ref().map(<fidl_fuchsia_media__common::AudioRenderUsage as fidl::encoding::ValueTypeMarker>::borrow),
5627            encoder, offset + cur_offset, depth
5628        )?;
5629
5630            _prev_end_offset = cur_offset + envelope_size;
5631            if 2 > max_ordinal {
5632                return Ok(());
5633            }
5634
5635            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5636            // are envelope_size bytes.
5637            let cur_offset: usize = (2 - 1) * envelope_size;
5638
5639            // Zero reserved fields.
5640            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5641
5642            // Safety:
5643            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5644            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5645            //   envelope_size bytes, there is always sufficient room.
5646            fidl::encoding::encode_in_envelope_optional::<AudioStreamSettingSource, D>(
5647                self.source
5648                    .as_ref()
5649                    .map(<AudioStreamSettingSource as fidl::encoding::ValueTypeMarker>::borrow),
5650                encoder,
5651                offset + cur_offset,
5652                depth,
5653            )?;
5654
5655            _prev_end_offset = cur_offset + envelope_size;
5656            if 3 > max_ordinal {
5657                return Ok(());
5658            }
5659
5660            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5661            // are envelope_size bytes.
5662            let cur_offset: usize = (3 - 1) * envelope_size;
5663
5664            // Zero reserved fields.
5665            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5666
5667            // Safety:
5668            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5669            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5670            //   envelope_size bytes, there is always sufficient room.
5671            fidl::encoding::encode_in_envelope_optional::<Volume, D>(
5672                self.user_volume.as_ref().map(<Volume as fidl::encoding::ValueTypeMarker>::borrow),
5673                encoder,
5674                offset + cur_offset,
5675                depth,
5676            )?;
5677
5678            _prev_end_offset = cur_offset + envelope_size;
5679
5680            Ok(())
5681        }
5682    }
5683
5684    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioStreamSettings {
5685        #[inline(always)]
5686        fn new_empty() -> Self {
5687            Self::default()
5688        }
5689
5690        unsafe fn decode(
5691            &mut self,
5692            decoder: &mut fidl::encoding::Decoder<'_, D>,
5693            offset: usize,
5694            mut depth: fidl::encoding::Depth,
5695        ) -> fidl::Result<()> {
5696            decoder.debug_check_bounds::<Self>(offset);
5697            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5698                None => return Err(fidl::Error::NotNullable),
5699                Some(len) => len,
5700            };
5701            // Calling decoder.out_of_line_offset(0) is not allowed.
5702            if len == 0 {
5703                return Ok(());
5704            };
5705            depth.increment()?;
5706            let envelope_size = 8;
5707            let bytes_len = len * envelope_size;
5708            let offset = decoder.out_of_line_offset(bytes_len)?;
5709            // Decode the envelope for each type.
5710            let mut _next_ordinal_to_read = 0;
5711            let mut next_offset = offset;
5712            let end_offset = offset + bytes_len;
5713            _next_ordinal_to_read += 1;
5714            if next_offset >= end_offset {
5715                return Ok(());
5716            }
5717
5718            // Decode unknown envelopes for gaps in ordinals.
5719            while _next_ordinal_to_read < 1 {
5720                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5721                _next_ordinal_to_read += 1;
5722                next_offset += envelope_size;
5723            }
5724
5725            let next_out_of_line = decoder.next_out_of_line();
5726            let handles_before = decoder.remaining_handles();
5727            if let Some((inlined, num_bytes, num_handles)) =
5728                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5729            {
5730                let member_inline_size = <fidl_fuchsia_media__common::AudioRenderUsage as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5731                if inlined != (member_inline_size <= 4) {
5732                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5733                }
5734                let inner_offset;
5735                let mut inner_depth = depth.clone();
5736                if inlined {
5737                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5738                    inner_offset = next_offset;
5739                } else {
5740                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5741                    inner_depth.increment()?;
5742                }
5743                let val_ref = self.stream.get_or_insert_with(|| {
5744                    fidl::new_empty!(fidl_fuchsia_media__common::AudioRenderUsage, D)
5745                });
5746                fidl::decode!(
5747                    fidl_fuchsia_media__common::AudioRenderUsage,
5748                    D,
5749                    val_ref,
5750                    decoder,
5751                    inner_offset,
5752                    inner_depth
5753                )?;
5754                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5755                {
5756                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5757                }
5758                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5759                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5760                }
5761            }
5762
5763            next_offset += envelope_size;
5764            _next_ordinal_to_read += 1;
5765            if next_offset >= end_offset {
5766                return Ok(());
5767            }
5768
5769            // Decode unknown envelopes for gaps in ordinals.
5770            while _next_ordinal_to_read < 2 {
5771                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5772                _next_ordinal_to_read += 1;
5773                next_offset += envelope_size;
5774            }
5775
5776            let next_out_of_line = decoder.next_out_of_line();
5777            let handles_before = decoder.remaining_handles();
5778            if let Some((inlined, num_bytes, num_handles)) =
5779                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5780            {
5781                let member_inline_size =
5782                    <AudioStreamSettingSource as fidl::encoding::TypeMarker>::inline_size(
5783                        decoder.context,
5784                    );
5785                if inlined != (member_inline_size <= 4) {
5786                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5787                }
5788                let inner_offset;
5789                let mut inner_depth = depth.clone();
5790                if inlined {
5791                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5792                    inner_offset = next_offset;
5793                } else {
5794                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5795                    inner_depth.increment()?;
5796                }
5797                let val_ref = self
5798                    .source
5799                    .get_or_insert_with(|| fidl::new_empty!(AudioStreamSettingSource, D));
5800                fidl::decode!(
5801                    AudioStreamSettingSource,
5802                    D,
5803                    val_ref,
5804                    decoder,
5805                    inner_offset,
5806                    inner_depth
5807                )?;
5808                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5809                {
5810                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5811                }
5812                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5813                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5814                }
5815            }
5816
5817            next_offset += envelope_size;
5818            _next_ordinal_to_read += 1;
5819            if next_offset >= end_offset {
5820                return Ok(());
5821            }
5822
5823            // Decode unknown envelopes for gaps in ordinals.
5824            while _next_ordinal_to_read < 3 {
5825                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5826                _next_ordinal_to_read += 1;
5827                next_offset += envelope_size;
5828            }
5829
5830            let next_out_of_line = decoder.next_out_of_line();
5831            let handles_before = decoder.remaining_handles();
5832            if let Some((inlined, num_bytes, num_handles)) =
5833                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5834            {
5835                let member_inline_size =
5836                    <Volume as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5837                if inlined != (member_inline_size <= 4) {
5838                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5839                }
5840                let inner_offset;
5841                let mut inner_depth = depth.clone();
5842                if inlined {
5843                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5844                    inner_offset = next_offset;
5845                } else {
5846                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5847                    inner_depth.increment()?;
5848                }
5849                let val_ref = self.user_volume.get_or_insert_with(|| fidl::new_empty!(Volume, D));
5850                fidl::decode!(Volume, D, val_ref, decoder, inner_offset, inner_depth)?;
5851                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5852                {
5853                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5854                }
5855                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5856                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5857                }
5858            }
5859
5860            next_offset += envelope_size;
5861
5862            // Decode the remaining unknown envelopes.
5863            while next_offset < end_offset {
5864                _next_ordinal_to_read += 1;
5865                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5866                next_offset += envelope_size;
5867            }
5868
5869            Ok(())
5870        }
5871    }
5872
5873    impl AudioStreamSettings2 {
5874        #[inline(always)]
5875        fn max_ordinal_present(&self) -> u64 {
5876            if let Some(_) = self.user_volume {
5877                return 3;
5878            }
5879            if let Some(_) = self.source {
5880                return 2;
5881            }
5882            if let Some(_) = self.stream {
5883                return 1;
5884            }
5885            0
5886        }
5887    }
5888
5889    impl fidl::encoding::ValueTypeMarker for AudioStreamSettings2 {
5890        type Borrowed<'a> = &'a Self;
5891        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5892            value
5893        }
5894    }
5895
5896    unsafe impl fidl::encoding::TypeMarker for AudioStreamSettings2 {
5897        type Owned = Self;
5898
5899        #[inline(always)]
5900        fn inline_align(_context: fidl::encoding::Context) -> usize {
5901            8
5902        }
5903
5904        #[inline(always)]
5905        fn inline_size(_context: fidl::encoding::Context) -> usize {
5906            16
5907        }
5908    }
5909
5910    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioStreamSettings2, D>
5911        for &AudioStreamSettings2
5912    {
5913        unsafe fn encode(
5914            self,
5915            encoder: &mut fidl::encoding::Encoder<'_, D>,
5916            offset: usize,
5917            mut depth: fidl::encoding::Depth,
5918        ) -> fidl::Result<()> {
5919            encoder.debug_check_bounds::<AudioStreamSettings2>(offset);
5920            // Vector header
5921            let max_ordinal: u64 = self.max_ordinal_present();
5922            encoder.write_num(max_ordinal, offset);
5923            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5924            // Calling encoder.out_of_line_offset(0) is not allowed.
5925            if max_ordinal == 0 {
5926                return Ok(());
5927            }
5928            depth.increment()?;
5929            let envelope_size = 8;
5930            let bytes_len = max_ordinal as usize * envelope_size;
5931            #[allow(unused_variables)]
5932            let offset = encoder.out_of_line_offset(bytes_len);
5933            let mut _prev_end_offset: usize = 0;
5934            if 1 > max_ordinal {
5935                return Ok(());
5936            }
5937
5938            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5939            // are envelope_size bytes.
5940            let cur_offset: usize = (1 - 1) * envelope_size;
5941
5942            // Zero reserved fields.
5943            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5944
5945            // Safety:
5946            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5947            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5948            //   envelope_size bytes, there is always sufficient room.
5949            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_media__common::AudioRenderUsage2, D>(
5950            self.stream.as_ref().map(<fidl_fuchsia_media__common::AudioRenderUsage2 as fidl::encoding::ValueTypeMarker>::borrow),
5951            encoder, offset + cur_offset, depth
5952        )?;
5953
5954            _prev_end_offset = cur_offset + envelope_size;
5955            if 2 > max_ordinal {
5956                return Ok(());
5957            }
5958
5959            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5960            // are envelope_size bytes.
5961            let cur_offset: usize = (2 - 1) * envelope_size;
5962
5963            // Zero reserved fields.
5964            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5965
5966            // Safety:
5967            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5968            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5969            //   envelope_size bytes, there is always sufficient room.
5970            fidl::encoding::encode_in_envelope_optional::<AudioStreamSettingSource, D>(
5971                self.source
5972                    .as_ref()
5973                    .map(<AudioStreamSettingSource as fidl::encoding::ValueTypeMarker>::borrow),
5974                encoder,
5975                offset + cur_offset,
5976                depth,
5977            )?;
5978
5979            _prev_end_offset = cur_offset + envelope_size;
5980            if 3 > max_ordinal {
5981                return Ok(());
5982            }
5983
5984            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5985            // are envelope_size bytes.
5986            let cur_offset: usize = (3 - 1) * envelope_size;
5987
5988            // Zero reserved fields.
5989            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5990
5991            // Safety:
5992            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5993            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5994            //   envelope_size bytes, there is always sufficient room.
5995            fidl::encoding::encode_in_envelope_optional::<Volume, D>(
5996                self.user_volume.as_ref().map(<Volume as fidl::encoding::ValueTypeMarker>::borrow),
5997                encoder,
5998                offset + cur_offset,
5999                depth,
6000            )?;
6001
6002            _prev_end_offset = cur_offset + envelope_size;
6003
6004            Ok(())
6005        }
6006    }
6007
6008    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioStreamSettings2 {
6009        #[inline(always)]
6010        fn new_empty() -> Self {
6011            Self::default()
6012        }
6013
6014        unsafe fn decode(
6015            &mut self,
6016            decoder: &mut fidl::encoding::Decoder<'_, D>,
6017            offset: usize,
6018            mut depth: fidl::encoding::Depth,
6019        ) -> fidl::Result<()> {
6020            decoder.debug_check_bounds::<Self>(offset);
6021            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6022                None => return Err(fidl::Error::NotNullable),
6023                Some(len) => len,
6024            };
6025            // Calling decoder.out_of_line_offset(0) is not allowed.
6026            if len == 0 {
6027                return Ok(());
6028            };
6029            depth.increment()?;
6030            let envelope_size = 8;
6031            let bytes_len = len * envelope_size;
6032            let offset = decoder.out_of_line_offset(bytes_len)?;
6033            // Decode the envelope for each type.
6034            let mut _next_ordinal_to_read = 0;
6035            let mut next_offset = offset;
6036            let end_offset = offset + bytes_len;
6037            _next_ordinal_to_read += 1;
6038            if next_offset >= end_offset {
6039                return Ok(());
6040            }
6041
6042            // Decode unknown envelopes for gaps in ordinals.
6043            while _next_ordinal_to_read < 1 {
6044                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6045                _next_ordinal_to_read += 1;
6046                next_offset += envelope_size;
6047            }
6048
6049            let next_out_of_line = decoder.next_out_of_line();
6050            let handles_before = decoder.remaining_handles();
6051            if let Some((inlined, num_bytes, num_handles)) =
6052                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6053            {
6054                let member_inline_size = <fidl_fuchsia_media__common::AudioRenderUsage2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6055                if inlined != (member_inline_size <= 4) {
6056                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6057                }
6058                let inner_offset;
6059                let mut inner_depth = depth.clone();
6060                if inlined {
6061                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6062                    inner_offset = next_offset;
6063                } else {
6064                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6065                    inner_depth.increment()?;
6066                }
6067                let val_ref = self.stream.get_or_insert_with(|| {
6068                    fidl::new_empty!(fidl_fuchsia_media__common::AudioRenderUsage2, D)
6069                });
6070                fidl::decode!(
6071                    fidl_fuchsia_media__common::AudioRenderUsage2,
6072                    D,
6073                    val_ref,
6074                    decoder,
6075                    inner_offset,
6076                    inner_depth
6077                )?;
6078                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6079                {
6080                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6081                }
6082                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6083                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6084                }
6085            }
6086
6087            next_offset += envelope_size;
6088            _next_ordinal_to_read += 1;
6089            if next_offset >= end_offset {
6090                return Ok(());
6091            }
6092
6093            // Decode unknown envelopes for gaps in ordinals.
6094            while _next_ordinal_to_read < 2 {
6095                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6096                _next_ordinal_to_read += 1;
6097                next_offset += envelope_size;
6098            }
6099
6100            let next_out_of_line = decoder.next_out_of_line();
6101            let handles_before = decoder.remaining_handles();
6102            if let Some((inlined, num_bytes, num_handles)) =
6103                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6104            {
6105                let member_inline_size =
6106                    <AudioStreamSettingSource as fidl::encoding::TypeMarker>::inline_size(
6107                        decoder.context,
6108                    );
6109                if inlined != (member_inline_size <= 4) {
6110                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6111                }
6112                let inner_offset;
6113                let mut inner_depth = depth.clone();
6114                if inlined {
6115                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6116                    inner_offset = next_offset;
6117                } else {
6118                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6119                    inner_depth.increment()?;
6120                }
6121                let val_ref = self
6122                    .source
6123                    .get_or_insert_with(|| fidl::new_empty!(AudioStreamSettingSource, D));
6124                fidl::decode!(
6125                    AudioStreamSettingSource,
6126                    D,
6127                    val_ref,
6128                    decoder,
6129                    inner_offset,
6130                    inner_depth
6131                )?;
6132                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6133                {
6134                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6135                }
6136                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6137                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6138                }
6139            }
6140
6141            next_offset += envelope_size;
6142            _next_ordinal_to_read += 1;
6143            if next_offset >= end_offset {
6144                return Ok(());
6145            }
6146
6147            // Decode unknown envelopes for gaps in ordinals.
6148            while _next_ordinal_to_read < 3 {
6149                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6150                _next_ordinal_to_read += 1;
6151                next_offset += envelope_size;
6152            }
6153
6154            let next_out_of_line = decoder.next_out_of_line();
6155            let handles_before = decoder.remaining_handles();
6156            if let Some((inlined, num_bytes, num_handles)) =
6157                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6158            {
6159                let member_inline_size =
6160                    <Volume as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6161                if inlined != (member_inline_size <= 4) {
6162                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6163                }
6164                let inner_offset;
6165                let mut inner_depth = depth.clone();
6166                if inlined {
6167                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6168                    inner_offset = next_offset;
6169                } else {
6170                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6171                    inner_depth.increment()?;
6172                }
6173                let val_ref = self.user_volume.get_or_insert_with(|| fidl::new_empty!(Volume, D));
6174                fidl::decode!(Volume, D, val_ref, decoder, inner_offset, inner_depth)?;
6175                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6176                {
6177                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6178                }
6179                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6180                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6181                }
6182            }
6183
6184            next_offset += envelope_size;
6185
6186            // Decode the remaining unknown envelopes.
6187            while next_offset < end_offset {
6188                _next_ordinal_to_read += 1;
6189                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6190                next_offset += envelope_size;
6191            }
6192
6193            Ok(())
6194        }
6195    }
6196
6197    impl CaptionFontStyle {
6198        #[inline(always)]
6199        fn max_ordinal_present(&self) -> u64 {
6200            if let Some(_) = self.char_edge_style {
6201                return 4;
6202            }
6203            if let Some(_) = self.relative_size {
6204                return 3;
6205            }
6206            if let Some(_) = self.color {
6207                return 2;
6208            }
6209            if let Some(_) = self.family {
6210                return 1;
6211            }
6212            0
6213        }
6214    }
6215
6216    impl fidl::encoding::ValueTypeMarker for CaptionFontStyle {
6217        type Borrowed<'a> = &'a Self;
6218        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6219            value
6220        }
6221    }
6222
6223    unsafe impl fidl::encoding::TypeMarker for CaptionFontStyle {
6224        type Owned = Self;
6225
6226        #[inline(always)]
6227        fn inline_align(_context: fidl::encoding::Context) -> usize {
6228            8
6229        }
6230
6231        #[inline(always)]
6232        fn inline_size(_context: fidl::encoding::Context) -> usize {
6233            16
6234        }
6235    }
6236
6237    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CaptionFontStyle, D>
6238        for &CaptionFontStyle
6239    {
6240        unsafe fn encode(
6241            self,
6242            encoder: &mut fidl::encoding::Encoder<'_, D>,
6243            offset: usize,
6244            mut depth: fidl::encoding::Depth,
6245        ) -> fidl::Result<()> {
6246            encoder.debug_check_bounds::<CaptionFontStyle>(offset);
6247            // Vector header
6248            let max_ordinal: u64 = self.max_ordinal_present();
6249            encoder.write_num(max_ordinal, offset);
6250            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6251            // Calling encoder.out_of_line_offset(0) is not allowed.
6252            if max_ordinal == 0 {
6253                return Ok(());
6254            }
6255            depth.increment()?;
6256            let envelope_size = 8;
6257            let bytes_len = max_ordinal as usize * envelope_size;
6258            #[allow(unused_variables)]
6259            let offset = encoder.out_of_line_offset(bytes_len);
6260            let mut _prev_end_offset: usize = 0;
6261            if 1 > max_ordinal {
6262                return Ok(());
6263            }
6264
6265            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6266            // are envelope_size bytes.
6267            let cur_offset: usize = (1 - 1) * envelope_size;
6268
6269            // Zero reserved fields.
6270            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6271
6272            // Safety:
6273            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6274            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6275            //   envelope_size bytes, there is always sufficient room.
6276            fidl::encoding::encode_in_envelope_optional::<CaptionFontFamily, D>(
6277                self.family
6278                    .as_ref()
6279                    .map(<CaptionFontFamily as fidl::encoding::ValueTypeMarker>::borrow),
6280                encoder,
6281                offset + cur_offset,
6282                depth,
6283            )?;
6284
6285            _prev_end_offset = cur_offset + envelope_size;
6286            if 2 > max_ordinal {
6287                return Ok(());
6288            }
6289
6290            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6291            // are envelope_size bytes.
6292            let cur_offset: usize = (2 - 1) * envelope_size;
6293
6294            // Zero reserved fields.
6295            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6296
6297            // Safety:
6298            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6299            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6300            //   envelope_size bytes, there is always sufficient room.
6301            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_ui_types__common::ColorRgba, D>(
6302            self.color.as_ref().map(<fidl_fuchsia_ui_types__common::ColorRgba as fidl::encoding::ValueTypeMarker>::borrow),
6303            encoder, offset + cur_offset, depth
6304        )?;
6305
6306            _prev_end_offset = cur_offset + envelope_size;
6307            if 3 > max_ordinal {
6308                return Ok(());
6309            }
6310
6311            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6312            // are envelope_size bytes.
6313            let cur_offset: usize = (3 - 1) * envelope_size;
6314
6315            // Zero reserved fields.
6316            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6317
6318            // Safety:
6319            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6320            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6321            //   envelope_size bytes, there is always sufficient room.
6322            fidl::encoding::encode_in_envelope_optional::<f32, D>(
6323                self.relative_size.as_ref().map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
6324                encoder,
6325                offset + cur_offset,
6326                depth,
6327            )?;
6328
6329            _prev_end_offset = cur_offset + envelope_size;
6330            if 4 > max_ordinal {
6331                return Ok(());
6332            }
6333
6334            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6335            // are envelope_size bytes.
6336            let cur_offset: usize = (4 - 1) * envelope_size;
6337
6338            // Zero reserved fields.
6339            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6340
6341            // Safety:
6342            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6343            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6344            //   envelope_size bytes, there is always sufficient room.
6345            fidl::encoding::encode_in_envelope_optional::<EdgeStyle, D>(
6346                self.char_edge_style
6347                    .as_ref()
6348                    .map(<EdgeStyle as fidl::encoding::ValueTypeMarker>::borrow),
6349                encoder,
6350                offset + cur_offset,
6351                depth,
6352            )?;
6353
6354            _prev_end_offset = cur_offset + envelope_size;
6355
6356            Ok(())
6357        }
6358    }
6359
6360    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CaptionFontStyle {
6361        #[inline(always)]
6362        fn new_empty() -> Self {
6363            Self::default()
6364        }
6365
6366        unsafe fn decode(
6367            &mut self,
6368            decoder: &mut fidl::encoding::Decoder<'_, D>,
6369            offset: usize,
6370            mut depth: fidl::encoding::Depth,
6371        ) -> fidl::Result<()> {
6372            decoder.debug_check_bounds::<Self>(offset);
6373            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6374                None => return Err(fidl::Error::NotNullable),
6375                Some(len) => len,
6376            };
6377            // Calling decoder.out_of_line_offset(0) is not allowed.
6378            if len == 0 {
6379                return Ok(());
6380            };
6381            depth.increment()?;
6382            let envelope_size = 8;
6383            let bytes_len = len * envelope_size;
6384            let offset = decoder.out_of_line_offset(bytes_len)?;
6385            // Decode the envelope for each type.
6386            let mut _next_ordinal_to_read = 0;
6387            let mut next_offset = offset;
6388            let end_offset = offset + bytes_len;
6389            _next_ordinal_to_read += 1;
6390            if next_offset >= end_offset {
6391                return Ok(());
6392            }
6393
6394            // Decode unknown envelopes for gaps in ordinals.
6395            while _next_ordinal_to_read < 1 {
6396                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6397                _next_ordinal_to_read += 1;
6398                next_offset += envelope_size;
6399            }
6400
6401            let next_out_of_line = decoder.next_out_of_line();
6402            let handles_before = decoder.remaining_handles();
6403            if let Some((inlined, num_bytes, num_handles)) =
6404                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6405            {
6406                let member_inline_size =
6407                    <CaptionFontFamily as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6408                if inlined != (member_inline_size <= 4) {
6409                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6410                }
6411                let inner_offset;
6412                let mut inner_depth = depth.clone();
6413                if inlined {
6414                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6415                    inner_offset = next_offset;
6416                } else {
6417                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6418                    inner_depth.increment()?;
6419                }
6420                let val_ref =
6421                    self.family.get_or_insert_with(|| fidl::new_empty!(CaptionFontFamily, D));
6422                fidl::decode!(CaptionFontFamily, D, val_ref, decoder, inner_offset, inner_depth)?;
6423                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6424                {
6425                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6426                }
6427                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6428                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6429                }
6430            }
6431
6432            next_offset += envelope_size;
6433            _next_ordinal_to_read += 1;
6434            if next_offset >= end_offset {
6435                return Ok(());
6436            }
6437
6438            // Decode unknown envelopes for gaps in ordinals.
6439            while _next_ordinal_to_read < 2 {
6440                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6441                _next_ordinal_to_read += 1;
6442                next_offset += envelope_size;
6443            }
6444
6445            let next_out_of_line = decoder.next_out_of_line();
6446            let handles_before = decoder.remaining_handles();
6447            if let Some((inlined, num_bytes, num_handles)) =
6448                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6449            {
6450                let member_inline_size = <fidl_fuchsia_ui_types__common::ColorRgba as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6451                if inlined != (member_inline_size <= 4) {
6452                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6453                }
6454                let inner_offset;
6455                let mut inner_depth = depth.clone();
6456                if inlined {
6457                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6458                    inner_offset = next_offset;
6459                } else {
6460                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6461                    inner_depth.increment()?;
6462                }
6463                let val_ref = self.color.get_or_insert_with(|| {
6464                    fidl::new_empty!(fidl_fuchsia_ui_types__common::ColorRgba, D)
6465                });
6466                fidl::decode!(
6467                    fidl_fuchsia_ui_types__common::ColorRgba,
6468                    D,
6469                    val_ref,
6470                    decoder,
6471                    inner_offset,
6472                    inner_depth
6473                )?;
6474                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6475                {
6476                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6477                }
6478                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6479                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6480                }
6481            }
6482
6483            next_offset += envelope_size;
6484            _next_ordinal_to_read += 1;
6485            if next_offset >= end_offset {
6486                return Ok(());
6487            }
6488
6489            // Decode unknown envelopes for gaps in ordinals.
6490            while _next_ordinal_to_read < 3 {
6491                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6492                _next_ordinal_to_read += 1;
6493                next_offset += envelope_size;
6494            }
6495
6496            let next_out_of_line = decoder.next_out_of_line();
6497            let handles_before = decoder.remaining_handles();
6498            if let Some((inlined, num_bytes, num_handles)) =
6499                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6500            {
6501                let member_inline_size =
6502                    <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6503                if inlined != (member_inline_size <= 4) {
6504                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6505                }
6506                let inner_offset;
6507                let mut inner_depth = depth.clone();
6508                if inlined {
6509                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6510                    inner_offset = next_offset;
6511                } else {
6512                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6513                    inner_depth.increment()?;
6514                }
6515                let val_ref = self.relative_size.get_or_insert_with(|| fidl::new_empty!(f32, D));
6516                fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
6517                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6518                {
6519                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6520                }
6521                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6522                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6523                }
6524            }
6525
6526            next_offset += envelope_size;
6527            _next_ordinal_to_read += 1;
6528            if next_offset >= end_offset {
6529                return Ok(());
6530            }
6531
6532            // Decode unknown envelopes for gaps in ordinals.
6533            while _next_ordinal_to_read < 4 {
6534                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6535                _next_ordinal_to_read += 1;
6536                next_offset += envelope_size;
6537            }
6538
6539            let next_out_of_line = decoder.next_out_of_line();
6540            let handles_before = decoder.remaining_handles();
6541            if let Some((inlined, num_bytes, num_handles)) =
6542                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6543            {
6544                let member_inline_size =
6545                    <EdgeStyle as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6546                if inlined != (member_inline_size <= 4) {
6547                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6548                }
6549                let inner_offset;
6550                let mut inner_depth = depth.clone();
6551                if inlined {
6552                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6553                    inner_offset = next_offset;
6554                } else {
6555                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6556                    inner_depth.increment()?;
6557                }
6558                let val_ref =
6559                    self.char_edge_style.get_or_insert_with(|| fidl::new_empty!(EdgeStyle, D));
6560                fidl::decode!(EdgeStyle, D, val_ref, decoder, inner_offset, inner_depth)?;
6561                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6562                {
6563                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6564                }
6565                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6566                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6567                }
6568            }
6569
6570            next_offset += envelope_size;
6571
6572            // Decode the remaining unknown envelopes.
6573            while next_offset < end_offset {
6574                _next_ordinal_to_read += 1;
6575                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6576                next_offset += envelope_size;
6577            }
6578
6579            Ok(())
6580        }
6581    }
6582
6583    impl CaptionsSettings {
6584        #[inline(always)]
6585        fn max_ordinal_present(&self) -> u64 {
6586            if let Some(_) = self.background_color {
6587                return 5;
6588            }
6589            if let Some(_) = self.window_color {
6590                return 4;
6591            }
6592            if let Some(_) = self.font_style {
6593                return 3;
6594            }
6595            if let Some(_) = self.for_tts {
6596                return 2;
6597            }
6598            if let Some(_) = self.for_media {
6599                return 1;
6600            }
6601            0
6602        }
6603    }
6604
6605    impl fidl::encoding::ValueTypeMarker for CaptionsSettings {
6606        type Borrowed<'a> = &'a Self;
6607        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6608            value
6609        }
6610    }
6611
6612    unsafe impl fidl::encoding::TypeMarker for CaptionsSettings {
6613        type Owned = Self;
6614
6615        #[inline(always)]
6616        fn inline_align(_context: fidl::encoding::Context) -> usize {
6617            8
6618        }
6619
6620        #[inline(always)]
6621        fn inline_size(_context: fidl::encoding::Context) -> usize {
6622            16
6623        }
6624    }
6625
6626    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CaptionsSettings, D>
6627        for &CaptionsSettings
6628    {
6629        unsafe fn encode(
6630            self,
6631            encoder: &mut fidl::encoding::Encoder<'_, D>,
6632            offset: usize,
6633            mut depth: fidl::encoding::Depth,
6634        ) -> fidl::Result<()> {
6635            encoder.debug_check_bounds::<CaptionsSettings>(offset);
6636            // Vector header
6637            let max_ordinal: u64 = self.max_ordinal_present();
6638            encoder.write_num(max_ordinal, offset);
6639            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6640            // Calling encoder.out_of_line_offset(0) is not allowed.
6641            if max_ordinal == 0 {
6642                return Ok(());
6643            }
6644            depth.increment()?;
6645            let envelope_size = 8;
6646            let bytes_len = max_ordinal as usize * envelope_size;
6647            #[allow(unused_variables)]
6648            let offset = encoder.out_of_line_offset(bytes_len);
6649            let mut _prev_end_offset: usize = 0;
6650            if 1 > max_ordinal {
6651                return Ok(());
6652            }
6653
6654            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6655            // are envelope_size bytes.
6656            let cur_offset: usize = (1 - 1) * envelope_size;
6657
6658            // Zero reserved fields.
6659            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6660
6661            // Safety:
6662            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6663            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6664            //   envelope_size bytes, there is always sufficient room.
6665            fidl::encoding::encode_in_envelope_optional::<bool, D>(
6666                self.for_media.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6667                encoder,
6668                offset + cur_offset,
6669                depth,
6670            )?;
6671
6672            _prev_end_offset = cur_offset + envelope_size;
6673            if 2 > max_ordinal {
6674                return Ok(());
6675            }
6676
6677            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6678            // are envelope_size bytes.
6679            let cur_offset: usize = (2 - 1) * envelope_size;
6680
6681            // Zero reserved fields.
6682            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6683
6684            // Safety:
6685            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6686            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6687            //   envelope_size bytes, there is always sufficient room.
6688            fidl::encoding::encode_in_envelope_optional::<bool, D>(
6689                self.for_tts.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
6690                encoder,
6691                offset + cur_offset,
6692                depth,
6693            )?;
6694
6695            _prev_end_offset = cur_offset + envelope_size;
6696            if 3 > max_ordinal {
6697                return Ok(());
6698            }
6699
6700            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6701            // are envelope_size bytes.
6702            let cur_offset: usize = (3 - 1) * envelope_size;
6703
6704            // Zero reserved fields.
6705            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6706
6707            // Safety:
6708            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6709            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6710            //   envelope_size bytes, there is always sufficient room.
6711            fidl::encoding::encode_in_envelope_optional::<CaptionFontStyle, D>(
6712                self.font_style
6713                    .as_ref()
6714                    .map(<CaptionFontStyle as fidl::encoding::ValueTypeMarker>::borrow),
6715                encoder,
6716                offset + cur_offset,
6717                depth,
6718            )?;
6719
6720            _prev_end_offset = cur_offset + envelope_size;
6721            if 4 > max_ordinal {
6722                return Ok(());
6723            }
6724
6725            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6726            // are envelope_size bytes.
6727            let cur_offset: usize = (4 - 1) * envelope_size;
6728
6729            // Zero reserved fields.
6730            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6731
6732            // Safety:
6733            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6734            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6735            //   envelope_size bytes, there is always sufficient room.
6736            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_ui_types__common::ColorRgba, D>(
6737            self.window_color.as_ref().map(<fidl_fuchsia_ui_types__common::ColorRgba as fidl::encoding::ValueTypeMarker>::borrow),
6738            encoder, offset + cur_offset, depth
6739        )?;
6740
6741            _prev_end_offset = cur_offset + envelope_size;
6742            if 5 > max_ordinal {
6743                return Ok(());
6744            }
6745
6746            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6747            // are envelope_size bytes.
6748            let cur_offset: usize = (5 - 1) * envelope_size;
6749
6750            // Zero reserved fields.
6751            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6752
6753            // Safety:
6754            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6755            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6756            //   envelope_size bytes, there is always sufficient room.
6757            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_ui_types__common::ColorRgba, D>(
6758            self.background_color.as_ref().map(<fidl_fuchsia_ui_types__common::ColorRgba as fidl::encoding::ValueTypeMarker>::borrow),
6759            encoder, offset + cur_offset, depth
6760        )?;
6761
6762            _prev_end_offset = cur_offset + envelope_size;
6763
6764            Ok(())
6765        }
6766    }
6767
6768    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CaptionsSettings {
6769        #[inline(always)]
6770        fn new_empty() -> Self {
6771            Self::default()
6772        }
6773
6774        unsafe fn decode(
6775            &mut self,
6776            decoder: &mut fidl::encoding::Decoder<'_, D>,
6777            offset: usize,
6778            mut depth: fidl::encoding::Depth,
6779        ) -> fidl::Result<()> {
6780            decoder.debug_check_bounds::<Self>(offset);
6781            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6782                None => return Err(fidl::Error::NotNullable),
6783                Some(len) => len,
6784            };
6785            // Calling decoder.out_of_line_offset(0) is not allowed.
6786            if len == 0 {
6787                return Ok(());
6788            };
6789            depth.increment()?;
6790            let envelope_size = 8;
6791            let bytes_len = len * envelope_size;
6792            let offset = decoder.out_of_line_offset(bytes_len)?;
6793            // Decode the envelope for each type.
6794            let mut _next_ordinal_to_read = 0;
6795            let mut next_offset = offset;
6796            let end_offset = offset + bytes_len;
6797            _next_ordinal_to_read += 1;
6798            if next_offset >= end_offset {
6799                return Ok(());
6800            }
6801
6802            // Decode unknown envelopes for gaps in ordinals.
6803            while _next_ordinal_to_read < 1 {
6804                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6805                _next_ordinal_to_read += 1;
6806                next_offset += envelope_size;
6807            }
6808
6809            let next_out_of_line = decoder.next_out_of_line();
6810            let handles_before = decoder.remaining_handles();
6811            if let Some((inlined, num_bytes, num_handles)) =
6812                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6813            {
6814                let member_inline_size =
6815                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6816                if inlined != (member_inline_size <= 4) {
6817                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6818                }
6819                let inner_offset;
6820                let mut inner_depth = depth.clone();
6821                if inlined {
6822                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6823                    inner_offset = next_offset;
6824                } else {
6825                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6826                    inner_depth.increment()?;
6827                }
6828                let val_ref = self.for_media.get_or_insert_with(|| fidl::new_empty!(bool, D));
6829                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6830                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6831                {
6832                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6833                }
6834                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6835                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6836                }
6837            }
6838
6839            next_offset += envelope_size;
6840            _next_ordinal_to_read += 1;
6841            if next_offset >= end_offset {
6842                return Ok(());
6843            }
6844
6845            // Decode unknown envelopes for gaps in ordinals.
6846            while _next_ordinal_to_read < 2 {
6847                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6848                _next_ordinal_to_read += 1;
6849                next_offset += envelope_size;
6850            }
6851
6852            let next_out_of_line = decoder.next_out_of_line();
6853            let handles_before = decoder.remaining_handles();
6854            if let Some((inlined, num_bytes, num_handles)) =
6855                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6856            {
6857                let member_inline_size =
6858                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6859                if inlined != (member_inline_size <= 4) {
6860                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6861                }
6862                let inner_offset;
6863                let mut inner_depth = depth.clone();
6864                if inlined {
6865                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6866                    inner_offset = next_offset;
6867                } else {
6868                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6869                    inner_depth.increment()?;
6870                }
6871                let val_ref = self.for_tts.get_or_insert_with(|| fidl::new_empty!(bool, D));
6872                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6873                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6874                {
6875                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6876                }
6877                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6878                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6879                }
6880            }
6881
6882            next_offset += envelope_size;
6883            _next_ordinal_to_read += 1;
6884            if next_offset >= end_offset {
6885                return Ok(());
6886            }
6887
6888            // Decode unknown envelopes for gaps in ordinals.
6889            while _next_ordinal_to_read < 3 {
6890                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6891                _next_ordinal_to_read += 1;
6892                next_offset += envelope_size;
6893            }
6894
6895            let next_out_of_line = decoder.next_out_of_line();
6896            let handles_before = decoder.remaining_handles();
6897            if let Some((inlined, num_bytes, num_handles)) =
6898                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6899            {
6900                let member_inline_size =
6901                    <CaptionFontStyle as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6902                if inlined != (member_inline_size <= 4) {
6903                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6904                }
6905                let inner_offset;
6906                let mut inner_depth = depth.clone();
6907                if inlined {
6908                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6909                    inner_offset = next_offset;
6910                } else {
6911                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6912                    inner_depth.increment()?;
6913                }
6914                let val_ref =
6915                    self.font_style.get_or_insert_with(|| fidl::new_empty!(CaptionFontStyle, D));
6916                fidl::decode!(CaptionFontStyle, D, val_ref, decoder, inner_offset, inner_depth)?;
6917                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6918                {
6919                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6920                }
6921                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6922                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6923                }
6924            }
6925
6926            next_offset += envelope_size;
6927            _next_ordinal_to_read += 1;
6928            if next_offset >= end_offset {
6929                return Ok(());
6930            }
6931
6932            // Decode unknown envelopes for gaps in ordinals.
6933            while _next_ordinal_to_read < 4 {
6934                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6935                _next_ordinal_to_read += 1;
6936                next_offset += envelope_size;
6937            }
6938
6939            let next_out_of_line = decoder.next_out_of_line();
6940            let handles_before = decoder.remaining_handles();
6941            if let Some((inlined, num_bytes, num_handles)) =
6942                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6943            {
6944                let member_inline_size = <fidl_fuchsia_ui_types__common::ColorRgba as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6945                if inlined != (member_inline_size <= 4) {
6946                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6947                }
6948                let inner_offset;
6949                let mut inner_depth = depth.clone();
6950                if inlined {
6951                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6952                    inner_offset = next_offset;
6953                } else {
6954                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6955                    inner_depth.increment()?;
6956                }
6957                let val_ref = self.window_color.get_or_insert_with(|| {
6958                    fidl::new_empty!(fidl_fuchsia_ui_types__common::ColorRgba, D)
6959                });
6960                fidl::decode!(
6961                    fidl_fuchsia_ui_types__common::ColorRgba,
6962                    D,
6963                    val_ref,
6964                    decoder,
6965                    inner_offset,
6966                    inner_depth
6967                )?;
6968                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6969                {
6970                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6971                }
6972                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6973                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6974                }
6975            }
6976
6977            next_offset += envelope_size;
6978            _next_ordinal_to_read += 1;
6979            if next_offset >= end_offset {
6980                return Ok(());
6981            }
6982
6983            // Decode unknown envelopes for gaps in ordinals.
6984            while _next_ordinal_to_read < 5 {
6985                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6986                _next_ordinal_to_read += 1;
6987                next_offset += envelope_size;
6988            }
6989
6990            let next_out_of_line = decoder.next_out_of_line();
6991            let handles_before = decoder.remaining_handles();
6992            if let Some((inlined, num_bytes, num_handles)) =
6993                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6994            {
6995                let member_inline_size = <fidl_fuchsia_ui_types__common::ColorRgba as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6996                if inlined != (member_inline_size <= 4) {
6997                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6998                }
6999                let inner_offset;
7000                let mut inner_depth = depth.clone();
7001                if inlined {
7002                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7003                    inner_offset = next_offset;
7004                } else {
7005                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7006                    inner_depth.increment()?;
7007                }
7008                let val_ref = self.background_color.get_or_insert_with(|| {
7009                    fidl::new_empty!(fidl_fuchsia_ui_types__common::ColorRgba, D)
7010                });
7011                fidl::decode!(
7012                    fidl_fuchsia_ui_types__common::ColorRgba,
7013                    D,
7014                    val_ref,
7015                    decoder,
7016                    inner_offset,
7017                    inner_depth
7018                )?;
7019                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7020                {
7021                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7022                }
7023                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7024                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7025                }
7026            }
7027
7028            next_offset += envelope_size;
7029
7030            // Decode the remaining unknown envelopes.
7031            while next_offset < end_offset {
7032                _next_ordinal_to_read += 1;
7033                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7034                next_offset += envelope_size;
7035            }
7036
7037            Ok(())
7038        }
7039    }
7040
7041    impl DeviceState {
7042        #[inline(always)]
7043        fn max_ordinal_present(&self) -> u64 {
7044            if let Some(_) = self.toggle_flags {
7045                return 1;
7046            }
7047            0
7048        }
7049    }
7050
7051    impl fidl::encoding::ValueTypeMarker for DeviceState {
7052        type Borrowed<'a> = &'a Self;
7053        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7054            value
7055        }
7056    }
7057
7058    unsafe impl fidl::encoding::TypeMarker for DeviceState {
7059        type Owned = Self;
7060
7061        #[inline(always)]
7062        fn inline_align(_context: fidl::encoding::Context) -> usize {
7063            8
7064        }
7065
7066        #[inline(always)]
7067        fn inline_size(_context: fidl::encoding::Context) -> usize {
7068            16
7069        }
7070    }
7071
7072    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DeviceState, D>
7073        for &DeviceState
7074    {
7075        unsafe fn encode(
7076            self,
7077            encoder: &mut fidl::encoding::Encoder<'_, D>,
7078            offset: usize,
7079            mut depth: fidl::encoding::Depth,
7080        ) -> fidl::Result<()> {
7081            encoder.debug_check_bounds::<DeviceState>(offset);
7082            // Vector header
7083            let max_ordinal: u64 = self.max_ordinal_present();
7084            encoder.write_num(max_ordinal, offset);
7085            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7086            // Calling encoder.out_of_line_offset(0) is not allowed.
7087            if max_ordinal == 0 {
7088                return Ok(());
7089            }
7090            depth.increment()?;
7091            let envelope_size = 8;
7092            let bytes_len = max_ordinal as usize * envelope_size;
7093            #[allow(unused_variables)]
7094            let offset = encoder.out_of_line_offset(bytes_len);
7095            let mut _prev_end_offset: usize = 0;
7096            if 1 > max_ordinal {
7097                return Ok(());
7098            }
7099
7100            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7101            // are envelope_size bytes.
7102            let cur_offset: usize = (1 - 1) * envelope_size;
7103
7104            // Zero reserved fields.
7105            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7106
7107            // Safety:
7108            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7109            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7110            //   envelope_size bytes, there is always sufficient room.
7111            fidl::encoding::encode_in_envelope_optional::<ToggleStateFlags, D>(
7112                self.toggle_flags
7113                    .as_ref()
7114                    .map(<ToggleStateFlags as fidl::encoding::ValueTypeMarker>::borrow),
7115                encoder,
7116                offset + cur_offset,
7117                depth,
7118            )?;
7119
7120            _prev_end_offset = cur_offset + envelope_size;
7121
7122            Ok(())
7123        }
7124    }
7125
7126    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceState {
7127        #[inline(always)]
7128        fn new_empty() -> Self {
7129            Self::default()
7130        }
7131
7132        unsafe fn decode(
7133            &mut self,
7134            decoder: &mut fidl::encoding::Decoder<'_, D>,
7135            offset: usize,
7136            mut depth: fidl::encoding::Depth,
7137        ) -> fidl::Result<()> {
7138            decoder.debug_check_bounds::<Self>(offset);
7139            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7140                None => return Err(fidl::Error::NotNullable),
7141                Some(len) => len,
7142            };
7143            // Calling decoder.out_of_line_offset(0) is not allowed.
7144            if len == 0 {
7145                return Ok(());
7146            };
7147            depth.increment()?;
7148            let envelope_size = 8;
7149            let bytes_len = len * envelope_size;
7150            let offset = decoder.out_of_line_offset(bytes_len)?;
7151            // Decode the envelope for each type.
7152            let mut _next_ordinal_to_read = 0;
7153            let mut next_offset = offset;
7154            let end_offset = offset + bytes_len;
7155            _next_ordinal_to_read += 1;
7156            if next_offset >= end_offset {
7157                return Ok(());
7158            }
7159
7160            // Decode unknown envelopes for gaps in ordinals.
7161            while _next_ordinal_to_read < 1 {
7162                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7163                _next_ordinal_to_read += 1;
7164                next_offset += envelope_size;
7165            }
7166
7167            let next_out_of_line = decoder.next_out_of_line();
7168            let handles_before = decoder.remaining_handles();
7169            if let Some((inlined, num_bytes, num_handles)) =
7170                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7171            {
7172                let member_inline_size =
7173                    <ToggleStateFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7174                if inlined != (member_inline_size <= 4) {
7175                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7176                }
7177                let inner_offset;
7178                let mut inner_depth = depth.clone();
7179                if inlined {
7180                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7181                    inner_offset = next_offset;
7182                } else {
7183                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7184                    inner_depth.increment()?;
7185                }
7186                let val_ref =
7187                    self.toggle_flags.get_or_insert_with(|| fidl::new_empty!(ToggleStateFlags, D));
7188                fidl::decode!(ToggleStateFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
7189                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7190                {
7191                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7192                }
7193                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7194                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7195                }
7196            }
7197
7198            next_offset += envelope_size;
7199
7200            // Decode the remaining unknown envelopes.
7201            while next_offset < end_offset {
7202                _next_ordinal_to_read += 1;
7203                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7204                next_offset += envelope_size;
7205            }
7206
7207            Ok(())
7208        }
7209    }
7210
7211    impl DisplaySettings {
7212        #[inline(always)]
7213        fn max_ordinal_present(&self) -> u64 {
7214            if let Some(_) = self.adjusted_auto_brightness {
7215                return 7;
7216            }
7217            if let Some(_) = self.theme {
7218                return 6;
7219            }
7220            if let Some(_) = self.screen_enabled {
7221                return 5;
7222            }
7223            if let Some(_) = self.low_light_mode {
7224                return 4;
7225            }
7226            if let Some(_) = self.brightness_value {
7227                return 2;
7228            }
7229            if let Some(_) = self.auto_brightness {
7230                return 1;
7231            }
7232            0
7233        }
7234    }
7235
7236    impl fidl::encoding::ValueTypeMarker for DisplaySettings {
7237        type Borrowed<'a> = &'a Self;
7238        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7239            value
7240        }
7241    }
7242
7243    unsafe impl fidl::encoding::TypeMarker for DisplaySettings {
7244        type Owned = Self;
7245
7246        #[inline(always)]
7247        fn inline_align(_context: fidl::encoding::Context) -> usize {
7248            8
7249        }
7250
7251        #[inline(always)]
7252        fn inline_size(_context: fidl::encoding::Context) -> usize {
7253            16
7254        }
7255    }
7256
7257    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DisplaySettings, D>
7258        for &DisplaySettings
7259    {
7260        unsafe fn encode(
7261            self,
7262            encoder: &mut fidl::encoding::Encoder<'_, D>,
7263            offset: usize,
7264            mut depth: fidl::encoding::Depth,
7265        ) -> fidl::Result<()> {
7266            encoder.debug_check_bounds::<DisplaySettings>(offset);
7267            // Vector header
7268            let max_ordinal: u64 = self.max_ordinal_present();
7269            encoder.write_num(max_ordinal, offset);
7270            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7271            // Calling encoder.out_of_line_offset(0) is not allowed.
7272            if max_ordinal == 0 {
7273                return Ok(());
7274            }
7275            depth.increment()?;
7276            let envelope_size = 8;
7277            let bytes_len = max_ordinal as usize * envelope_size;
7278            #[allow(unused_variables)]
7279            let offset = encoder.out_of_line_offset(bytes_len);
7280            let mut _prev_end_offset: usize = 0;
7281            if 1 > max_ordinal {
7282                return Ok(());
7283            }
7284
7285            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7286            // are envelope_size bytes.
7287            let cur_offset: usize = (1 - 1) * envelope_size;
7288
7289            // Zero reserved fields.
7290            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7291
7292            // Safety:
7293            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7294            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7295            //   envelope_size bytes, there is always sufficient room.
7296            fidl::encoding::encode_in_envelope_optional::<bool, D>(
7297                self.auto_brightness
7298                    .as_ref()
7299                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7300                encoder,
7301                offset + cur_offset,
7302                depth,
7303            )?;
7304
7305            _prev_end_offset = cur_offset + envelope_size;
7306            if 2 > max_ordinal {
7307                return Ok(());
7308            }
7309
7310            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7311            // are envelope_size bytes.
7312            let cur_offset: usize = (2 - 1) * envelope_size;
7313
7314            // Zero reserved fields.
7315            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7316
7317            // Safety:
7318            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7319            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7320            //   envelope_size bytes, there is always sufficient room.
7321            fidl::encoding::encode_in_envelope_optional::<f32, D>(
7322                self.brightness_value
7323                    .as_ref()
7324                    .map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
7325                encoder,
7326                offset + cur_offset,
7327                depth,
7328            )?;
7329
7330            _prev_end_offset = cur_offset + envelope_size;
7331            if 4 > max_ordinal {
7332                return Ok(());
7333            }
7334
7335            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7336            // are envelope_size bytes.
7337            let cur_offset: usize = (4 - 1) * envelope_size;
7338
7339            // Zero reserved fields.
7340            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7341
7342            // Safety:
7343            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7344            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7345            //   envelope_size bytes, there is always sufficient room.
7346            fidl::encoding::encode_in_envelope_optional::<LowLightMode, D>(
7347                self.low_light_mode
7348                    .as_ref()
7349                    .map(<LowLightMode as fidl::encoding::ValueTypeMarker>::borrow),
7350                encoder,
7351                offset + cur_offset,
7352                depth,
7353            )?;
7354
7355            _prev_end_offset = cur_offset + envelope_size;
7356            if 5 > max_ordinal {
7357                return Ok(());
7358            }
7359
7360            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7361            // are envelope_size bytes.
7362            let cur_offset: usize = (5 - 1) * envelope_size;
7363
7364            // Zero reserved fields.
7365            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7366
7367            // Safety:
7368            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7369            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7370            //   envelope_size bytes, there is always sufficient room.
7371            fidl::encoding::encode_in_envelope_optional::<bool, D>(
7372                self.screen_enabled.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7373                encoder,
7374                offset + cur_offset,
7375                depth,
7376            )?;
7377
7378            _prev_end_offset = cur_offset + envelope_size;
7379            if 6 > max_ordinal {
7380                return Ok(());
7381            }
7382
7383            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7384            // are envelope_size bytes.
7385            let cur_offset: usize = (6 - 1) * envelope_size;
7386
7387            // Zero reserved fields.
7388            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7389
7390            // Safety:
7391            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7392            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7393            //   envelope_size bytes, there is always sufficient room.
7394            fidl::encoding::encode_in_envelope_optional::<Theme, D>(
7395                self.theme.as_ref().map(<Theme as fidl::encoding::ValueTypeMarker>::borrow),
7396                encoder,
7397                offset + cur_offset,
7398                depth,
7399            )?;
7400
7401            _prev_end_offset = cur_offset + envelope_size;
7402            if 7 > max_ordinal {
7403                return Ok(());
7404            }
7405
7406            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7407            // are envelope_size bytes.
7408            let cur_offset: usize = (7 - 1) * envelope_size;
7409
7410            // Zero reserved fields.
7411            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7412
7413            // Safety:
7414            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7415            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7416            //   envelope_size bytes, there is always sufficient room.
7417            fidl::encoding::encode_in_envelope_optional::<f32, D>(
7418                self.adjusted_auto_brightness
7419                    .as_ref()
7420                    .map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
7421                encoder,
7422                offset + cur_offset,
7423                depth,
7424            )?;
7425
7426            _prev_end_offset = cur_offset + envelope_size;
7427
7428            Ok(())
7429        }
7430    }
7431
7432    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DisplaySettings {
7433        #[inline(always)]
7434        fn new_empty() -> Self {
7435            Self::default()
7436        }
7437
7438        unsafe fn decode(
7439            &mut self,
7440            decoder: &mut fidl::encoding::Decoder<'_, D>,
7441            offset: usize,
7442            mut depth: fidl::encoding::Depth,
7443        ) -> fidl::Result<()> {
7444            decoder.debug_check_bounds::<Self>(offset);
7445            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7446                None => return Err(fidl::Error::NotNullable),
7447                Some(len) => len,
7448            };
7449            // Calling decoder.out_of_line_offset(0) is not allowed.
7450            if len == 0 {
7451                return Ok(());
7452            };
7453            depth.increment()?;
7454            let envelope_size = 8;
7455            let bytes_len = len * envelope_size;
7456            let offset = decoder.out_of_line_offset(bytes_len)?;
7457            // Decode the envelope for each type.
7458            let mut _next_ordinal_to_read = 0;
7459            let mut next_offset = offset;
7460            let end_offset = offset + bytes_len;
7461            _next_ordinal_to_read += 1;
7462            if next_offset >= end_offset {
7463                return Ok(());
7464            }
7465
7466            // Decode unknown envelopes for gaps in ordinals.
7467            while _next_ordinal_to_read < 1 {
7468                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7469                _next_ordinal_to_read += 1;
7470                next_offset += envelope_size;
7471            }
7472
7473            let next_out_of_line = decoder.next_out_of_line();
7474            let handles_before = decoder.remaining_handles();
7475            if let Some((inlined, num_bytes, num_handles)) =
7476                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7477            {
7478                let member_inline_size =
7479                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7480                if inlined != (member_inline_size <= 4) {
7481                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7482                }
7483                let inner_offset;
7484                let mut inner_depth = depth.clone();
7485                if inlined {
7486                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7487                    inner_offset = next_offset;
7488                } else {
7489                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7490                    inner_depth.increment()?;
7491                }
7492                let val_ref = self.auto_brightness.get_or_insert_with(|| fidl::new_empty!(bool, D));
7493                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7494                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7495                {
7496                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7497                }
7498                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7499                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7500                }
7501            }
7502
7503            next_offset += envelope_size;
7504            _next_ordinal_to_read += 1;
7505            if next_offset >= end_offset {
7506                return Ok(());
7507            }
7508
7509            // Decode unknown envelopes for gaps in ordinals.
7510            while _next_ordinal_to_read < 2 {
7511                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7512                _next_ordinal_to_read += 1;
7513                next_offset += envelope_size;
7514            }
7515
7516            let next_out_of_line = decoder.next_out_of_line();
7517            let handles_before = decoder.remaining_handles();
7518            if let Some((inlined, num_bytes, num_handles)) =
7519                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7520            {
7521                let member_inline_size =
7522                    <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7523                if inlined != (member_inline_size <= 4) {
7524                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7525                }
7526                let inner_offset;
7527                let mut inner_depth = depth.clone();
7528                if inlined {
7529                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7530                    inner_offset = next_offset;
7531                } else {
7532                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7533                    inner_depth.increment()?;
7534                }
7535                let val_ref = self.brightness_value.get_or_insert_with(|| fidl::new_empty!(f32, D));
7536                fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
7537                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7538                {
7539                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7540                }
7541                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7542                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7543                }
7544            }
7545
7546            next_offset += envelope_size;
7547            _next_ordinal_to_read += 1;
7548            if next_offset >= end_offset {
7549                return Ok(());
7550            }
7551
7552            // Decode unknown envelopes for gaps in ordinals.
7553            while _next_ordinal_to_read < 4 {
7554                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7555                _next_ordinal_to_read += 1;
7556                next_offset += envelope_size;
7557            }
7558
7559            let next_out_of_line = decoder.next_out_of_line();
7560            let handles_before = decoder.remaining_handles();
7561            if let Some((inlined, num_bytes, num_handles)) =
7562                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7563            {
7564                let member_inline_size =
7565                    <LowLightMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7566                if inlined != (member_inline_size <= 4) {
7567                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7568                }
7569                let inner_offset;
7570                let mut inner_depth = depth.clone();
7571                if inlined {
7572                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7573                    inner_offset = next_offset;
7574                } else {
7575                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7576                    inner_depth.increment()?;
7577                }
7578                let val_ref =
7579                    self.low_light_mode.get_or_insert_with(|| fidl::new_empty!(LowLightMode, D));
7580                fidl::decode!(LowLightMode, D, val_ref, decoder, inner_offset, inner_depth)?;
7581                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7582                {
7583                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7584                }
7585                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7586                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7587                }
7588            }
7589
7590            next_offset += envelope_size;
7591            _next_ordinal_to_read += 1;
7592            if next_offset >= end_offset {
7593                return Ok(());
7594            }
7595
7596            // Decode unknown envelopes for gaps in ordinals.
7597            while _next_ordinal_to_read < 5 {
7598                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7599                _next_ordinal_to_read += 1;
7600                next_offset += envelope_size;
7601            }
7602
7603            let next_out_of_line = decoder.next_out_of_line();
7604            let handles_before = decoder.remaining_handles();
7605            if let Some((inlined, num_bytes, num_handles)) =
7606                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7607            {
7608                let member_inline_size =
7609                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7610                if inlined != (member_inline_size <= 4) {
7611                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7612                }
7613                let inner_offset;
7614                let mut inner_depth = depth.clone();
7615                if inlined {
7616                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7617                    inner_offset = next_offset;
7618                } else {
7619                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7620                    inner_depth.increment()?;
7621                }
7622                let val_ref = self.screen_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
7623                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7624                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7625                {
7626                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7627                }
7628                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7629                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7630                }
7631            }
7632
7633            next_offset += envelope_size;
7634            _next_ordinal_to_read += 1;
7635            if next_offset >= end_offset {
7636                return Ok(());
7637            }
7638
7639            // Decode unknown envelopes for gaps in ordinals.
7640            while _next_ordinal_to_read < 6 {
7641                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7642                _next_ordinal_to_read += 1;
7643                next_offset += envelope_size;
7644            }
7645
7646            let next_out_of_line = decoder.next_out_of_line();
7647            let handles_before = decoder.remaining_handles();
7648            if let Some((inlined, num_bytes, num_handles)) =
7649                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7650            {
7651                let member_inline_size =
7652                    <Theme as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7653                if inlined != (member_inline_size <= 4) {
7654                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7655                }
7656                let inner_offset;
7657                let mut inner_depth = depth.clone();
7658                if inlined {
7659                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7660                    inner_offset = next_offset;
7661                } else {
7662                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7663                    inner_depth.increment()?;
7664                }
7665                let val_ref = self.theme.get_or_insert_with(|| fidl::new_empty!(Theme, D));
7666                fidl::decode!(Theme, D, val_ref, decoder, inner_offset, inner_depth)?;
7667                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7668                {
7669                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7670                }
7671                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7672                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7673                }
7674            }
7675
7676            next_offset += envelope_size;
7677            _next_ordinal_to_read += 1;
7678            if next_offset >= end_offset {
7679                return Ok(());
7680            }
7681
7682            // Decode unknown envelopes for gaps in ordinals.
7683            while _next_ordinal_to_read < 7 {
7684                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7685                _next_ordinal_to_read += 1;
7686                next_offset += envelope_size;
7687            }
7688
7689            let next_out_of_line = decoder.next_out_of_line();
7690            let handles_before = decoder.remaining_handles();
7691            if let Some((inlined, num_bytes, num_handles)) =
7692                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7693            {
7694                let member_inline_size =
7695                    <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7696                if inlined != (member_inline_size <= 4) {
7697                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7698                }
7699                let inner_offset;
7700                let mut inner_depth = depth.clone();
7701                if inlined {
7702                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7703                    inner_offset = next_offset;
7704                } else {
7705                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7706                    inner_depth.increment()?;
7707                }
7708                let val_ref =
7709                    self.adjusted_auto_brightness.get_or_insert_with(|| fidl::new_empty!(f32, D));
7710                fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
7711                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7712                {
7713                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7714                }
7715                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7716                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7717                }
7718            }
7719
7720            next_offset += envelope_size;
7721
7722            // Decode the remaining unknown envelopes.
7723            while next_offset < end_offset {
7724                _next_ordinal_to_read += 1;
7725                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7726                next_offset += envelope_size;
7727            }
7728
7729            Ok(())
7730        }
7731    }
7732
7733    impl DoNotDisturbSettings {
7734        #[inline(always)]
7735        fn max_ordinal_present(&self) -> u64 {
7736            if let Some(_) = self.night_mode_initiated_do_not_disturb {
7737                return 2;
7738            }
7739            if let Some(_) = self.user_initiated_do_not_disturb {
7740                return 1;
7741            }
7742            0
7743        }
7744    }
7745
7746    impl fidl::encoding::ValueTypeMarker for DoNotDisturbSettings {
7747        type Borrowed<'a> = &'a Self;
7748        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7749            value
7750        }
7751    }
7752
7753    unsafe impl fidl::encoding::TypeMarker for DoNotDisturbSettings {
7754        type Owned = Self;
7755
7756        #[inline(always)]
7757        fn inline_align(_context: fidl::encoding::Context) -> usize {
7758            8
7759        }
7760
7761        #[inline(always)]
7762        fn inline_size(_context: fidl::encoding::Context) -> usize {
7763            16
7764        }
7765    }
7766
7767    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DoNotDisturbSettings, D>
7768        for &DoNotDisturbSettings
7769    {
7770        unsafe fn encode(
7771            self,
7772            encoder: &mut fidl::encoding::Encoder<'_, D>,
7773            offset: usize,
7774            mut depth: fidl::encoding::Depth,
7775        ) -> fidl::Result<()> {
7776            encoder.debug_check_bounds::<DoNotDisturbSettings>(offset);
7777            // Vector header
7778            let max_ordinal: u64 = self.max_ordinal_present();
7779            encoder.write_num(max_ordinal, offset);
7780            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7781            // Calling encoder.out_of_line_offset(0) is not allowed.
7782            if max_ordinal == 0 {
7783                return Ok(());
7784            }
7785            depth.increment()?;
7786            let envelope_size = 8;
7787            let bytes_len = max_ordinal as usize * envelope_size;
7788            #[allow(unused_variables)]
7789            let offset = encoder.out_of_line_offset(bytes_len);
7790            let mut _prev_end_offset: usize = 0;
7791            if 1 > max_ordinal {
7792                return Ok(());
7793            }
7794
7795            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7796            // are envelope_size bytes.
7797            let cur_offset: usize = (1 - 1) * envelope_size;
7798
7799            // Zero reserved fields.
7800            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7801
7802            // Safety:
7803            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7804            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7805            //   envelope_size bytes, there is always sufficient room.
7806            fidl::encoding::encode_in_envelope_optional::<bool, D>(
7807                self.user_initiated_do_not_disturb
7808                    .as_ref()
7809                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7810                encoder,
7811                offset + cur_offset,
7812                depth,
7813            )?;
7814
7815            _prev_end_offset = cur_offset + envelope_size;
7816            if 2 > max_ordinal {
7817                return Ok(());
7818            }
7819
7820            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7821            // are envelope_size bytes.
7822            let cur_offset: usize = (2 - 1) * envelope_size;
7823
7824            // Zero reserved fields.
7825            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7826
7827            // Safety:
7828            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7829            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7830            //   envelope_size bytes, there is always sufficient room.
7831            fidl::encoding::encode_in_envelope_optional::<bool, D>(
7832                self.night_mode_initiated_do_not_disturb
7833                    .as_ref()
7834                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7835                encoder,
7836                offset + cur_offset,
7837                depth,
7838            )?;
7839
7840            _prev_end_offset = cur_offset + envelope_size;
7841
7842            Ok(())
7843        }
7844    }
7845
7846    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DoNotDisturbSettings {
7847        #[inline(always)]
7848        fn new_empty() -> Self {
7849            Self::default()
7850        }
7851
7852        unsafe fn decode(
7853            &mut self,
7854            decoder: &mut fidl::encoding::Decoder<'_, D>,
7855            offset: usize,
7856            mut depth: fidl::encoding::Depth,
7857        ) -> fidl::Result<()> {
7858            decoder.debug_check_bounds::<Self>(offset);
7859            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7860                None => return Err(fidl::Error::NotNullable),
7861                Some(len) => len,
7862            };
7863            // Calling decoder.out_of_line_offset(0) is not allowed.
7864            if len == 0 {
7865                return Ok(());
7866            };
7867            depth.increment()?;
7868            let envelope_size = 8;
7869            let bytes_len = len * envelope_size;
7870            let offset = decoder.out_of_line_offset(bytes_len)?;
7871            // Decode the envelope for each type.
7872            let mut _next_ordinal_to_read = 0;
7873            let mut next_offset = offset;
7874            let end_offset = offset + bytes_len;
7875            _next_ordinal_to_read += 1;
7876            if next_offset >= end_offset {
7877                return Ok(());
7878            }
7879
7880            // Decode unknown envelopes for gaps in ordinals.
7881            while _next_ordinal_to_read < 1 {
7882                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7883                _next_ordinal_to_read += 1;
7884                next_offset += envelope_size;
7885            }
7886
7887            let next_out_of_line = decoder.next_out_of_line();
7888            let handles_before = decoder.remaining_handles();
7889            if let Some((inlined, num_bytes, num_handles)) =
7890                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7891            {
7892                let member_inline_size =
7893                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7894                if inlined != (member_inline_size <= 4) {
7895                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7896                }
7897                let inner_offset;
7898                let mut inner_depth = depth.clone();
7899                if inlined {
7900                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7901                    inner_offset = next_offset;
7902                } else {
7903                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7904                    inner_depth.increment()?;
7905                }
7906                let val_ref = self
7907                    .user_initiated_do_not_disturb
7908                    .get_or_insert_with(|| fidl::new_empty!(bool, D));
7909                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7910                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7911                {
7912                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7913                }
7914                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7915                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7916                }
7917            }
7918
7919            next_offset += envelope_size;
7920            _next_ordinal_to_read += 1;
7921            if next_offset >= end_offset {
7922                return Ok(());
7923            }
7924
7925            // Decode unknown envelopes for gaps in ordinals.
7926            while _next_ordinal_to_read < 2 {
7927                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7928                _next_ordinal_to_read += 1;
7929                next_offset += envelope_size;
7930            }
7931
7932            let next_out_of_line = decoder.next_out_of_line();
7933            let handles_before = decoder.remaining_handles();
7934            if let Some((inlined, num_bytes, num_handles)) =
7935                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7936            {
7937                let member_inline_size =
7938                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7939                if inlined != (member_inline_size <= 4) {
7940                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7941                }
7942                let inner_offset;
7943                let mut inner_depth = depth.clone();
7944                if inlined {
7945                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7946                    inner_offset = next_offset;
7947                } else {
7948                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7949                    inner_depth.increment()?;
7950                }
7951                let val_ref = self
7952                    .night_mode_initiated_do_not_disturb
7953                    .get_or_insert_with(|| fidl::new_empty!(bool, D));
7954                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7955                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7956                {
7957                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7958                }
7959                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7960                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7961                }
7962            }
7963
7964            next_offset += envelope_size;
7965
7966            // Decode the remaining unknown envelopes.
7967            while next_offset < end_offset {
7968                _next_ordinal_to_read += 1;
7969                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7970                next_offset += envelope_size;
7971            }
7972
7973            Ok(())
7974        }
7975    }
7976
7977    impl FactoryResetSettings {
7978        #[inline(always)]
7979        fn max_ordinal_present(&self) -> u64 {
7980            if let Some(_) = self.is_local_reset_allowed {
7981                return 1;
7982            }
7983            0
7984        }
7985    }
7986
7987    impl fidl::encoding::ValueTypeMarker for FactoryResetSettings {
7988        type Borrowed<'a> = &'a Self;
7989        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7990            value
7991        }
7992    }
7993
7994    unsafe impl fidl::encoding::TypeMarker for FactoryResetSettings {
7995        type Owned = Self;
7996
7997        #[inline(always)]
7998        fn inline_align(_context: fidl::encoding::Context) -> usize {
7999            8
8000        }
8001
8002        #[inline(always)]
8003        fn inline_size(_context: fidl::encoding::Context) -> usize {
8004            16
8005        }
8006    }
8007
8008    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FactoryResetSettings, D>
8009        for &FactoryResetSettings
8010    {
8011        unsafe fn encode(
8012            self,
8013            encoder: &mut fidl::encoding::Encoder<'_, D>,
8014            offset: usize,
8015            mut depth: fidl::encoding::Depth,
8016        ) -> fidl::Result<()> {
8017            encoder.debug_check_bounds::<FactoryResetSettings>(offset);
8018            // Vector header
8019            let max_ordinal: u64 = self.max_ordinal_present();
8020            encoder.write_num(max_ordinal, offset);
8021            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8022            // Calling encoder.out_of_line_offset(0) is not allowed.
8023            if max_ordinal == 0 {
8024                return Ok(());
8025            }
8026            depth.increment()?;
8027            let envelope_size = 8;
8028            let bytes_len = max_ordinal as usize * envelope_size;
8029            #[allow(unused_variables)]
8030            let offset = encoder.out_of_line_offset(bytes_len);
8031            let mut _prev_end_offset: usize = 0;
8032            if 1 > max_ordinal {
8033                return Ok(());
8034            }
8035
8036            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8037            // are envelope_size bytes.
8038            let cur_offset: usize = (1 - 1) * envelope_size;
8039
8040            // Zero reserved fields.
8041            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8042
8043            // Safety:
8044            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8045            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8046            //   envelope_size bytes, there is always sufficient room.
8047            fidl::encoding::encode_in_envelope_optional::<bool, D>(
8048                self.is_local_reset_allowed
8049                    .as_ref()
8050                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
8051                encoder,
8052                offset + cur_offset,
8053                depth,
8054            )?;
8055
8056            _prev_end_offset = cur_offset + envelope_size;
8057
8058            Ok(())
8059        }
8060    }
8061
8062    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FactoryResetSettings {
8063        #[inline(always)]
8064        fn new_empty() -> Self {
8065            Self::default()
8066        }
8067
8068        unsafe fn decode(
8069            &mut self,
8070            decoder: &mut fidl::encoding::Decoder<'_, D>,
8071            offset: usize,
8072            mut depth: fidl::encoding::Depth,
8073        ) -> fidl::Result<()> {
8074            decoder.debug_check_bounds::<Self>(offset);
8075            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8076                None => return Err(fidl::Error::NotNullable),
8077                Some(len) => len,
8078            };
8079            // Calling decoder.out_of_line_offset(0) is not allowed.
8080            if len == 0 {
8081                return Ok(());
8082            };
8083            depth.increment()?;
8084            let envelope_size = 8;
8085            let bytes_len = len * envelope_size;
8086            let offset = decoder.out_of_line_offset(bytes_len)?;
8087            // Decode the envelope for each type.
8088            let mut _next_ordinal_to_read = 0;
8089            let mut next_offset = offset;
8090            let end_offset = offset + bytes_len;
8091            _next_ordinal_to_read += 1;
8092            if next_offset >= end_offset {
8093                return Ok(());
8094            }
8095
8096            // Decode unknown envelopes for gaps in ordinals.
8097            while _next_ordinal_to_read < 1 {
8098                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8099                _next_ordinal_to_read += 1;
8100                next_offset += envelope_size;
8101            }
8102
8103            let next_out_of_line = decoder.next_out_of_line();
8104            let handles_before = decoder.remaining_handles();
8105            if let Some((inlined, num_bytes, num_handles)) =
8106                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8107            {
8108                let member_inline_size =
8109                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8110                if inlined != (member_inline_size <= 4) {
8111                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8112                }
8113                let inner_offset;
8114                let mut inner_depth = depth.clone();
8115                if inlined {
8116                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8117                    inner_offset = next_offset;
8118                } else {
8119                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8120                    inner_depth.increment()?;
8121                }
8122                let val_ref =
8123                    self.is_local_reset_allowed.get_or_insert_with(|| fidl::new_empty!(bool, D));
8124                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8125                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8126                {
8127                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8128                }
8129                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8130                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8131                }
8132            }
8133
8134            next_offset += envelope_size;
8135
8136            // Decode the remaining unknown envelopes.
8137            while next_offset < end_offset {
8138                _next_ordinal_to_read += 1;
8139                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8140                next_offset += envelope_size;
8141            }
8142
8143            Ok(())
8144        }
8145    }
8146
8147    impl InputDevice {
8148        #[inline(always)]
8149        fn max_ordinal_present(&self) -> u64 {
8150            if let Some(_) = self.state {
8151                return 5;
8152            }
8153            if let Some(_) = self.mutable_toggle_state {
8154                return 4;
8155            }
8156            if let Some(_) = self.source_states {
8157                return 3;
8158            }
8159            if let Some(_) = self.device_type {
8160                return 2;
8161            }
8162            if let Some(_) = self.device_name {
8163                return 1;
8164            }
8165            0
8166        }
8167    }
8168
8169    impl fidl::encoding::ValueTypeMarker for InputDevice {
8170        type Borrowed<'a> = &'a Self;
8171        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8172            value
8173        }
8174    }
8175
8176    unsafe impl fidl::encoding::TypeMarker for InputDevice {
8177        type Owned = Self;
8178
8179        #[inline(always)]
8180        fn inline_align(_context: fidl::encoding::Context) -> usize {
8181            8
8182        }
8183
8184        #[inline(always)]
8185        fn inline_size(_context: fidl::encoding::Context) -> usize {
8186            16
8187        }
8188    }
8189
8190    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InputDevice, D>
8191        for &InputDevice
8192    {
8193        unsafe fn encode(
8194            self,
8195            encoder: &mut fidl::encoding::Encoder<'_, D>,
8196            offset: usize,
8197            mut depth: fidl::encoding::Depth,
8198        ) -> fidl::Result<()> {
8199            encoder.debug_check_bounds::<InputDevice>(offset);
8200            // Vector header
8201            let max_ordinal: u64 = self.max_ordinal_present();
8202            encoder.write_num(max_ordinal, offset);
8203            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8204            // Calling encoder.out_of_line_offset(0) is not allowed.
8205            if max_ordinal == 0 {
8206                return Ok(());
8207            }
8208            depth.increment()?;
8209            let envelope_size = 8;
8210            let bytes_len = max_ordinal as usize * envelope_size;
8211            #[allow(unused_variables)]
8212            let offset = encoder.out_of_line_offset(bytes_len);
8213            let mut _prev_end_offset: usize = 0;
8214            if 1 > max_ordinal {
8215                return Ok(());
8216            }
8217
8218            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8219            // are envelope_size bytes.
8220            let cur_offset: usize = (1 - 1) * envelope_size;
8221
8222            // Zero reserved fields.
8223            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8224
8225            // Safety:
8226            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8227            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8228            //   envelope_size bytes, there is always sufficient room.
8229            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
8230                self.device_name.as_ref().map(
8231                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
8232                ),
8233                encoder,
8234                offset + cur_offset,
8235                depth,
8236            )?;
8237
8238            _prev_end_offset = cur_offset + envelope_size;
8239            if 2 > max_ordinal {
8240                return Ok(());
8241            }
8242
8243            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8244            // are envelope_size bytes.
8245            let cur_offset: usize = (2 - 1) * envelope_size;
8246
8247            // Zero reserved fields.
8248            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8249
8250            // Safety:
8251            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8252            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8253            //   envelope_size bytes, there is always sufficient room.
8254            fidl::encoding::encode_in_envelope_optional::<DeviceType, D>(
8255                self.device_type
8256                    .as_ref()
8257                    .map(<DeviceType as fidl::encoding::ValueTypeMarker>::borrow),
8258                encoder,
8259                offset + cur_offset,
8260                depth,
8261            )?;
8262
8263            _prev_end_offset = cur_offset + envelope_size;
8264            if 3 > max_ordinal {
8265                return Ok(());
8266            }
8267
8268            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8269            // are envelope_size bytes.
8270            let cur_offset: usize = (3 - 1) * envelope_size;
8271
8272            // Zero reserved fields.
8273            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8274
8275            // Safety:
8276            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8277            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8278            //   envelope_size bytes, there is always sufficient room.
8279            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<SourceState>, D>(
8280            self.source_states.as_ref().map(<fidl::encoding::UnboundedVector<SourceState> as fidl::encoding::ValueTypeMarker>::borrow),
8281            encoder, offset + cur_offset, depth
8282        )?;
8283
8284            _prev_end_offset = cur_offset + envelope_size;
8285            if 4 > max_ordinal {
8286                return Ok(());
8287            }
8288
8289            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8290            // are envelope_size bytes.
8291            let cur_offset: usize = (4 - 1) * envelope_size;
8292
8293            // Zero reserved fields.
8294            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8295
8296            // Safety:
8297            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8298            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8299            //   envelope_size bytes, there is always sufficient room.
8300            fidl::encoding::encode_in_envelope_optional::<ToggleStateFlags, D>(
8301                self.mutable_toggle_state
8302                    .as_ref()
8303                    .map(<ToggleStateFlags as fidl::encoding::ValueTypeMarker>::borrow),
8304                encoder,
8305                offset + cur_offset,
8306                depth,
8307            )?;
8308
8309            _prev_end_offset = cur_offset + envelope_size;
8310            if 5 > max_ordinal {
8311                return Ok(());
8312            }
8313
8314            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8315            // are envelope_size bytes.
8316            let cur_offset: usize = (5 - 1) * envelope_size;
8317
8318            // Zero reserved fields.
8319            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8320
8321            // Safety:
8322            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8323            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8324            //   envelope_size bytes, there is always sufficient room.
8325            fidl::encoding::encode_in_envelope_optional::<DeviceState, D>(
8326                self.state.as_ref().map(<DeviceState as fidl::encoding::ValueTypeMarker>::borrow),
8327                encoder,
8328                offset + cur_offset,
8329                depth,
8330            )?;
8331
8332            _prev_end_offset = cur_offset + envelope_size;
8333
8334            Ok(())
8335        }
8336    }
8337
8338    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InputDevice {
8339        #[inline(always)]
8340        fn new_empty() -> Self {
8341            Self::default()
8342        }
8343
8344        unsafe fn decode(
8345            &mut self,
8346            decoder: &mut fidl::encoding::Decoder<'_, D>,
8347            offset: usize,
8348            mut depth: fidl::encoding::Depth,
8349        ) -> fidl::Result<()> {
8350            decoder.debug_check_bounds::<Self>(offset);
8351            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8352                None => return Err(fidl::Error::NotNullable),
8353                Some(len) => len,
8354            };
8355            // Calling decoder.out_of_line_offset(0) is not allowed.
8356            if len == 0 {
8357                return Ok(());
8358            };
8359            depth.increment()?;
8360            let envelope_size = 8;
8361            let bytes_len = len * envelope_size;
8362            let offset = decoder.out_of_line_offset(bytes_len)?;
8363            // Decode the envelope for each type.
8364            let mut _next_ordinal_to_read = 0;
8365            let mut next_offset = offset;
8366            let end_offset = offset + bytes_len;
8367            _next_ordinal_to_read += 1;
8368            if next_offset >= end_offset {
8369                return Ok(());
8370            }
8371
8372            // Decode unknown envelopes for gaps in ordinals.
8373            while _next_ordinal_to_read < 1 {
8374                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8375                _next_ordinal_to_read += 1;
8376                next_offset += envelope_size;
8377            }
8378
8379            let next_out_of_line = decoder.next_out_of_line();
8380            let handles_before = decoder.remaining_handles();
8381            if let Some((inlined, num_bytes, num_handles)) =
8382                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8383            {
8384                let member_inline_size =
8385                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
8386                        decoder.context,
8387                    );
8388                if inlined != (member_inline_size <= 4) {
8389                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8390                }
8391                let inner_offset;
8392                let mut inner_depth = depth.clone();
8393                if inlined {
8394                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8395                    inner_offset = next_offset;
8396                } else {
8397                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8398                    inner_depth.increment()?;
8399                }
8400                let val_ref = self
8401                    .device_name
8402                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
8403                fidl::decode!(
8404                    fidl::encoding::UnboundedString,
8405                    D,
8406                    val_ref,
8407                    decoder,
8408                    inner_offset,
8409                    inner_depth
8410                )?;
8411                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8412                {
8413                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8414                }
8415                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8416                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8417                }
8418            }
8419
8420            next_offset += envelope_size;
8421            _next_ordinal_to_read += 1;
8422            if next_offset >= end_offset {
8423                return Ok(());
8424            }
8425
8426            // Decode unknown envelopes for gaps in ordinals.
8427            while _next_ordinal_to_read < 2 {
8428                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8429                _next_ordinal_to_read += 1;
8430                next_offset += envelope_size;
8431            }
8432
8433            let next_out_of_line = decoder.next_out_of_line();
8434            let handles_before = decoder.remaining_handles();
8435            if let Some((inlined, num_bytes, num_handles)) =
8436                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8437            {
8438                let member_inline_size =
8439                    <DeviceType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8440                if inlined != (member_inline_size <= 4) {
8441                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8442                }
8443                let inner_offset;
8444                let mut inner_depth = depth.clone();
8445                if inlined {
8446                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8447                    inner_offset = next_offset;
8448                } else {
8449                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8450                    inner_depth.increment()?;
8451                }
8452                let val_ref =
8453                    self.device_type.get_or_insert_with(|| fidl::new_empty!(DeviceType, D));
8454                fidl::decode!(DeviceType, D, val_ref, decoder, inner_offset, inner_depth)?;
8455                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8456                {
8457                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8458                }
8459                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8460                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8461                }
8462            }
8463
8464            next_offset += envelope_size;
8465            _next_ordinal_to_read += 1;
8466            if next_offset >= end_offset {
8467                return Ok(());
8468            }
8469
8470            // Decode unknown envelopes for gaps in ordinals.
8471            while _next_ordinal_to_read < 3 {
8472                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8473                _next_ordinal_to_read += 1;
8474                next_offset += envelope_size;
8475            }
8476
8477            let next_out_of_line = decoder.next_out_of_line();
8478            let handles_before = decoder.remaining_handles();
8479            if let Some((inlined, num_bytes, num_handles)) =
8480                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8481            {
8482                let member_inline_size = <fidl::encoding::UnboundedVector<SourceState> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8483                if inlined != (member_inline_size <= 4) {
8484                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8485                }
8486                let inner_offset;
8487                let mut inner_depth = depth.clone();
8488                if inlined {
8489                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8490                    inner_offset = next_offset;
8491                } else {
8492                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8493                    inner_depth.increment()?;
8494                }
8495                let val_ref = self.source_states.get_or_insert_with(|| {
8496                    fidl::new_empty!(fidl::encoding::UnboundedVector<SourceState>, D)
8497                });
8498                fidl::decode!(
8499                    fidl::encoding::UnboundedVector<SourceState>,
8500                    D,
8501                    val_ref,
8502                    decoder,
8503                    inner_offset,
8504                    inner_depth
8505                )?;
8506                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8507                {
8508                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8509                }
8510                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8511                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8512                }
8513            }
8514
8515            next_offset += envelope_size;
8516            _next_ordinal_to_read += 1;
8517            if next_offset >= end_offset {
8518                return Ok(());
8519            }
8520
8521            // Decode unknown envelopes for gaps in ordinals.
8522            while _next_ordinal_to_read < 4 {
8523                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8524                _next_ordinal_to_read += 1;
8525                next_offset += envelope_size;
8526            }
8527
8528            let next_out_of_line = decoder.next_out_of_line();
8529            let handles_before = decoder.remaining_handles();
8530            if let Some((inlined, num_bytes, num_handles)) =
8531                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8532            {
8533                let member_inline_size =
8534                    <ToggleStateFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8535                if inlined != (member_inline_size <= 4) {
8536                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8537                }
8538                let inner_offset;
8539                let mut inner_depth = depth.clone();
8540                if inlined {
8541                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8542                    inner_offset = next_offset;
8543                } else {
8544                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8545                    inner_depth.increment()?;
8546                }
8547                let val_ref = self
8548                    .mutable_toggle_state
8549                    .get_or_insert_with(|| fidl::new_empty!(ToggleStateFlags, D));
8550                fidl::decode!(ToggleStateFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
8551                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8552                {
8553                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8554                }
8555                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8556                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8557                }
8558            }
8559
8560            next_offset += envelope_size;
8561            _next_ordinal_to_read += 1;
8562            if next_offset >= end_offset {
8563                return Ok(());
8564            }
8565
8566            // Decode unknown envelopes for gaps in ordinals.
8567            while _next_ordinal_to_read < 5 {
8568                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8569                _next_ordinal_to_read += 1;
8570                next_offset += envelope_size;
8571            }
8572
8573            let next_out_of_line = decoder.next_out_of_line();
8574            let handles_before = decoder.remaining_handles();
8575            if let Some((inlined, num_bytes, num_handles)) =
8576                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8577            {
8578                let member_inline_size =
8579                    <DeviceState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8580                if inlined != (member_inline_size <= 4) {
8581                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8582                }
8583                let inner_offset;
8584                let mut inner_depth = depth.clone();
8585                if inlined {
8586                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8587                    inner_offset = next_offset;
8588                } else {
8589                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8590                    inner_depth.increment()?;
8591                }
8592                let val_ref = self.state.get_or_insert_with(|| fidl::new_empty!(DeviceState, D));
8593                fidl::decode!(DeviceState, D, val_ref, decoder, inner_offset, inner_depth)?;
8594                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8595                {
8596                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8597                }
8598                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8599                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8600                }
8601            }
8602
8603            next_offset += envelope_size;
8604
8605            // Decode the remaining unknown envelopes.
8606            while next_offset < end_offset {
8607                _next_ordinal_to_read += 1;
8608                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8609                next_offset += envelope_size;
8610            }
8611
8612            Ok(())
8613        }
8614    }
8615
8616    impl InputSettings {
8617        #[inline(always)]
8618        fn max_ordinal_present(&self) -> u64 {
8619            if let Some(_) = self.devices {
8620                return 1;
8621            }
8622            0
8623        }
8624    }
8625
8626    impl fidl::encoding::ValueTypeMarker for InputSettings {
8627        type Borrowed<'a> = &'a Self;
8628        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8629            value
8630        }
8631    }
8632
8633    unsafe impl fidl::encoding::TypeMarker for InputSettings {
8634        type Owned = Self;
8635
8636        #[inline(always)]
8637        fn inline_align(_context: fidl::encoding::Context) -> usize {
8638            8
8639        }
8640
8641        #[inline(always)]
8642        fn inline_size(_context: fidl::encoding::Context) -> usize {
8643            16
8644        }
8645    }
8646
8647    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InputSettings, D>
8648        for &InputSettings
8649    {
8650        unsafe fn encode(
8651            self,
8652            encoder: &mut fidl::encoding::Encoder<'_, D>,
8653            offset: usize,
8654            mut depth: fidl::encoding::Depth,
8655        ) -> fidl::Result<()> {
8656            encoder.debug_check_bounds::<InputSettings>(offset);
8657            // Vector header
8658            let max_ordinal: u64 = self.max_ordinal_present();
8659            encoder.write_num(max_ordinal, offset);
8660            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8661            // Calling encoder.out_of_line_offset(0) is not allowed.
8662            if max_ordinal == 0 {
8663                return Ok(());
8664            }
8665            depth.increment()?;
8666            let envelope_size = 8;
8667            let bytes_len = max_ordinal as usize * envelope_size;
8668            #[allow(unused_variables)]
8669            let offset = encoder.out_of_line_offset(bytes_len);
8670            let mut _prev_end_offset: usize = 0;
8671            if 1 > max_ordinal {
8672                return Ok(());
8673            }
8674
8675            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8676            // are envelope_size bytes.
8677            let cur_offset: usize = (1 - 1) * envelope_size;
8678
8679            // Zero reserved fields.
8680            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8681
8682            // Safety:
8683            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8684            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8685            //   envelope_size bytes, there is always sufficient room.
8686            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<InputDevice>, D>(
8687            self.devices.as_ref().map(<fidl::encoding::UnboundedVector<InputDevice> as fidl::encoding::ValueTypeMarker>::borrow),
8688            encoder, offset + cur_offset, depth
8689        )?;
8690
8691            _prev_end_offset = cur_offset + envelope_size;
8692
8693            Ok(())
8694        }
8695    }
8696
8697    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InputSettings {
8698        #[inline(always)]
8699        fn new_empty() -> Self {
8700            Self::default()
8701        }
8702
8703        unsafe fn decode(
8704            &mut self,
8705            decoder: &mut fidl::encoding::Decoder<'_, D>,
8706            offset: usize,
8707            mut depth: fidl::encoding::Depth,
8708        ) -> fidl::Result<()> {
8709            decoder.debug_check_bounds::<Self>(offset);
8710            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8711                None => return Err(fidl::Error::NotNullable),
8712                Some(len) => len,
8713            };
8714            // Calling decoder.out_of_line_offset(0) is not allowed.
8715            if len == 0 {
8716                return Ok(());
8717            };
8718            depth.increment()?;
8719            let envelope_size = 8;
8720            let bytes_len = len * envelope_size;
8721            let offset = decoder.out_of_line_offset(bytes_len)?;
8722            // Decode the envelope for each type.
8723            let mut _next_ordinal_to_read = 0;
8724            let mut next_offset = offset;
8725            let end_offset = offset + bytes_len;
8726            _next_ordinal_to_read += 1;
8727            if next_offset >= end_offset {
8728                return Ok(());
8729            }
8730
8731            // Decode unknown envelopes for gaps in ordinals.
8732            while _next_ordinal_to_read < 1 {
8733                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8734                _next_ordinal_to_read += 1;
8735                next_offset += envelope_size;
8736            }
8737
8738            let next_out_of_line = decoder.next_out_of_line();
8739            let handles_before = decoder.remaining_handles();
8740            if let Some((inlined, num_bytes, num_handles)) =
8741                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8742            {
8743                let member_inline_size = <fidl::encoding::UnboundedVector<InputDevice> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8744                if inlined != (member_inline_size <= 4) {
8745                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8746                }
8747                let inner_offset;
8748                let mut inner_depth = depth.clone();
8749                if inlined {
8750                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8751                    inner_offset = next_offset;
8752                } else {
8753                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8754                    inner_depth.increment()?;
8755                }
8756                let val_ref = self.devices.get_or_insert_with(|| {
8757                    fidl::new_empty!(fidl::encoding::UnboundedVector<InputDevice>, D)
8758                });
8759                fidl::decode!(
8760                    fidl::encoding::UnboundedVector<InputDevice>,
8761                    D,
8762                    val_ref,
8763                    decoder,
8764                    inner_offset,
8765                    inner_depth
8766                )?;
8767                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8768                {
8769                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8770                }
8771                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8772                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8773                }
8774            }
8775
8776            next_offset += envelope_size;
8777
8778            // Decode the remaining unknown envelopes.
8779            while next_offset < end_offset {
8780                _next_ordinal_to_read += 1;
8781                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8782                next_offset += envelope_size;
8783            }
8784
8785            Ok(())
8786        }
8787    }
8788
8789    impl InputState {
8790        #[inline(always)]
8791        fn max_ordinal_present(&self) -> u64 {
8792            if let Some(_) = self.state {
8793                return 3;
8794            }
8795            if let Some(_) = self.device_type {
8796                return 2;
8797            }
8798            if let Some(_) = self.name {
8799                return 1;
8800            }
8801            0
8802        }
8803    }
8804
8805    impl fidl::encoding::ValueTypeMarker for InputState {
8806        type Borrowed<'a> = &'a Self;
8807        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8808            value
8809        }
8810    }
8811
8812    unsafe impl fidl::encoding::TypeMarker for InputState {
8813        type Owned = Self;
8814
8815        #[inline(always)]
8816        fn inline_align(_context: fidl::encoding::Context) -> usize {
8817            8
8818        }
8819
8820        #[inline(always)]
8821        fn inline_size(_context: fidl::encoding::Context) -> usize {
8822            16
8823        }
8824    }
8825
8826    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InputState, D>
8827        for &InputState
8828    {
8829        unsafe fn encode(
8830            self,
8831            encoder: &mut fidl::encoding::Encoder<'_, D>,
8832            offset: usize,
8833            mut depth: fidl::encoding::Depth,
8834        ) -> fidl::Result<()> {
8835            encoder.debug_check_bounds::<InputState>(offset);
8836            // Vector header
8837            let max_ordinal: u64 = self.max_ordinal_present();
8838            encoder.write_num(max_ordinal, offset);
8839            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8840            // Calling encoder.out_of_line_offset(0) is not allowed.
8841            if max_ordinal == 0 {
8842                return Ok(());
8843            }
8844            depth.increment()?;
8845            let envelope_size = 8;
8846            let bytes_len = max_ordinal as usize * envelope_size;
8847            #[allow(unused_variables)]
8848            let offset = encoder.out_of_line_offset(bytes_len);
8849            let mut _prev_end_offset: usize = 0;
8850            if 1 > max_ordinal {
8851                return Ok(());
8852            }
8853
8854            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8855            // are envelope_size bytes.
8856            let cur_offset: usize = (1 - 1) * envelope_size;
8857
8858            // Zero reserved fields.
8859            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8860
8861            // Safety:
8862            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8863            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8864            //   envelope_size bytes, there is always sufficient room.
8865            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
8866                self.name.as_ref().map(
8867                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
8868                ),
8869                encoder,
8870                offset + cur_offset,
8871                depth,
8872            )?;
8873
8874            _prev_end_offset = cur_offset + envelope_size;
8875            if 2 > max_ordinal {
8876                return Ok(());
8877            }
8878
8879            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8880            // are envelope_size bytes.
8881            let cur_offset: usize = (2 - 1) * envelope_size;
8882
8883            // Zero reserved fields.
8884            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8885
8886            // Safety:
8887            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8888            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8889            //   envelope_size bytes, there is always sufficient room.
8890            fidl::encoding::encode_in_envelope_optional::<DeviceType, D>(
8891                self.device_type
8892                    .as_ref()
8893                    .map(<DeviceType as fidl::encoding::ValueTypeMarker>::borrow),
8894                encoder,
8895                offset + cur_offset,
8896                depth,
8897            )?;
8898
8899            _prev_end_offset = cur_offset + envelope_size;
8900            if 3 > max_ordinal {
8901                return Ok(());
8902            }
8903
8904            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8905            // are envelope_size bytes.
8906            let cur_offset: usize = (3 - 1) * envelope_size;
8907
8908            // Zero reserved fields.
8909            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8910
8911            // Safety:
8912            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8913            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8914            //   envelope_size bytes, there is always sufficient room.
8915            fidl::encoding::encode_in_envelope_optional::<DeviceState, D>(
8916                self.state.as_ref().map(<DeviceState as fidl::encoding::ValueTypeMarker>::borrow),
8917                encoder,
8918                offset + cur_offset,
8919                depth,
8920            )?;
8921
8922            _prev_end_offset = cur_offset + envelope_size;
8923
8924            Ok(())
8925        }
8926    }
8927
8928    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InputState {
8929        #[inline(always)]
8930        fn new_empty() -> Self {
8931            Self::default()
8932        }
8933
8934        unsafe fn decode(
8935            &mut self,
8936            decoder: &mut fidl::encoding::Decoder<'_, D>,
8937            offset: usize,
8938            mut depth: fidl::encoding::Depth,
8939        ) -> fidl::Result<()> {
8940            decoder.debug_check_bounds::<Self>(offset);
8941            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8942                None => return Err(fidl::Error::NotNullable),
8943                Some(len) => len,
8944            };
8945            // Calling decoder.out_of_line_offset(0) is not allowed.
8946            if len == 0 {
8947                return Ok(());
8948            };
8949            depth.increment()?;
8950            let envelope_size = 8;
8951            let bytes_len = len * envelope_size;
8952            let offset = decoder.out_of_line_offset(bytes_len)?;
8953            // Decode the envelope for each type.
8954            let mut _next_ordinal_to_read = 0;
8955            let mut next_offset = offset;
8956            let end_offset = offset + bytes_len;
8957            _next_ordinal_to_read += 1;
8958            if next_offset >= end_offset {
8959                return Ok(());
8960            }
8961
8962            // Decode unknown envelopes for gaps in ordinals.
8963            while _next_ordinal_to_read < 1 {
8964                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8965                _next_ordinal_to_read += 1;
8966                next_offset += envelope_size;
8967            }
8968
8969            let next_out_of_line = decoder.next_out_of_line();
8970            let handles_before = decoder.remaining_handles();
8971            if let Some((inlined, num_bytes, num_handles)) =
8972                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8973            {
8974                let member_inline_size =
8975                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
8976                        decoder.context,
8977                    );
8978                if inlined != (member_inline_size <= 4) {
8979                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8980                }
8981                let inner_offset;
8982                let mut inner_depth = depth.clone();
8983                if inlined {
8984                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8985                    inner_offset = next_offset;
8986                } else {
8987                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8988                    inner_depth.increment()?;
8989                }
8990                let val_ref = self
8991                    .name
8992                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
8993                fidl::decode!(
8994                    fidl::encoding::UnboundedString,
8995                    D,
8996                    val_ref,
8997                    decoder,
8998                    inner_offset,
8999                    inner_depth
9000                )?;
9001                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9002                {
9003                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9004                }
9005                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9006                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9007                }
9008            }
9009
9010            next_offset += envelope_size;
9011            _next_ordinal_to_read += 1;
9012            if next_offset >= end_offset {
9013                return Ok(());
9014            }
9015
9016            // Decode unknown envelopes for gaps in ordinals.
9017            while _next_ordinal_to_read < 2 {
9018                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9019                _next_ordinal_to_read += 1;
9020                next_offset += envelope_size;
9021            }
9022
9023            let next_out_of_line = decoder.next_out_of_line();
9024            let handles_before = decoder.remaining_handles();
9025            if let Some((inlined, num_bytes, num_handles)) =
9026                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9027            {
9028                let member_inline_size =
9029                    <DeviceType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9030                if inlined != (member_inline_size <= 4) {
9031                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9032                }
9033                let inner_offset;
9034                let mut inner_depth = depth.clone();
9035                if inlined {
9036                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9037                    inner_offset = next_offset;
9038                } else {
9039                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9040                    inner_depth.increment()?;
9041                }
9042                let val_ref =
9043                    self.device_type.get_or_insert_with(|| fidl::new_empty!(DeviceType, D));
9044                fidl::decode!(DeviceType, D, val_ref, decoder, inner_offset, inner_depth)?;
9045                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9046                {
9047                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9048                }
9049                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9050                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9051                }
9052            }
9053
9054            next_offset += envelope_size;
9055            _next_ordinal_to_read += 1;
9056            if next_offset >= end_offset {
9057                return Ok(());
9058            }
9059
9060            // Decode unknown envelopes for gaps in ordinals.
9061            while _next_ordinal_to_read < 3 {
9062                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9063                _next_ordinal_to_read += 1;
9064                next_offset += envelope_size;
9065            }
9066
9067            let next_out_of_line = decoder.next_out_of_line();
9068            let handles_before = decoder.remaining_handles();
9069            if let Some((inlined, num_bytes, num_handles)) =
9070                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9071            {
9072                let member_inline_size =
9073                    <DeviceState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9074                if inlined != (member_inline_size <= 4) {
9075                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9076                }
9077                let inner_offset;
9078                let mut inner_depth = depth.clone();
9079                if inlined {
9080                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9081                    inner_offset = next_offset;
9082                } else {
9083                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9084                    inner_depth.increment()?;
9085                }
9086                let val_ref = self.state.get_or_insert_with(|| fidl::new_empty!(DeviceState, D));
9087                fidl::decode!(DeviceState, D, val_ref, decoder, inner_offset, inner_depth)?;
9088                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9089                {
9090                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9091                }
9092                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9093                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9094                }
9095            }
9096
9097            next_offset += envelope_size;
9098
9099            // Decode the remaining unknown envelopes.
9100            while next_offset < end_offset {
9101                _next_ordinal_to_read += 1;
9102                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9103                next_offset += envelope_size;
9104            }
9105
9106            Ok(())
9107        }
9108    }
9109
9110    impl IntlSettings {
9111        #[inline(always)]
9112        fn max_ordinal_present(&self) -> u64 {
9113            if let Some(_) = self.hour_cycle {
9114                return 4;
9115            }
9116            if let Some(_) = self.time_zone_id {
9117                return 3;
9118            }
9119            if let Some(_) = self.temperature_unit {
9120                return 2;
9121            }
9122            if let Some(_) = self.locales {
9123                return 1;
9124            }
9125            0
9126        }
9127    }
9128
9129    impl fidl::encoding::ValueTypeMarker for IntlSettings {
9130        type Borrowed<'a> = &'a Self;
9131        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9132            value
9133        }
9134    }
9135
9136    unsafe impl fidl::encoding::TypeMarker for IntlSettings {
9137        type Owned = Self;
9138
9139        #[inline(always)]
9140        fn inline_align(_context: fidl::encoding::Context) -> usize {
9141            8
9142        }
9143
9144        #[inline(always)]
9145        fn inline_size(_context: fidl::encoding::Context) -> usize {
9146            16
9147        }
9148    }
9149
9150    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IntlSettings, D>
9151        for &IntlSettings
9152    {
9153        unsafe fn encode(
9154            self,
9155            encoder: &mut fidl::encoding::Encoder<'_, D>,
9156            offset: usize,
9157            mut depth: fidl::encoding::Depth,
9158        ) -> fidl::Result<()> {
9159            encoder.debug_check_bounds::<IntlSettings>(offset);
9160            // Vector header
9161            let max_ordinal: u64 = self.max_ordinal_present();
9162            encoder.write_num(max_ordinal, offset);
9163            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9164            // Calling encoder.out_of_line_offset(0) is not allowed.
9165            if max_ordinal == 0 {
9166                return Ok(());
9167            }
9168            depth.increment()?;
9169            let envelope_size = 8;
9170            let bytes_len = max_ordinal as usize * envelope_size;
9171            #[allow(unused_variables)]
9172            let offset = encoder.out_of_line_offset(bytes_len);
9173            let mut _prev_end_offset: usize = 0;
9174            if 1 > max_ordinal {
9175                return Ok(());
9176            }
9177
9178            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9179            // are envelope_size bytes.
9180            let cur_offset: usize = (1 - 1) * envelope_size;
9181
9182            // Zero reserved fields.
9183            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9184
9185            // Safety:
9186            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9187            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9188            //   envelope_size bytes, there is always sufficient room.
9189            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_intl__common::LocaleId, 10>, D>(
9190            self.locales.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_intl__common::LocaleId, 10> as fidl::encoding::ValueTypeMarker>::borrow),
9191            encoder, offset + cur_offset, depth
9192        )?;
9193
9194            _prev_end_offset = cur_offset + envelope_size;
9195            if 2 > max_ordinal {
9196                return Ok(());
9197            }
9198
9199            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9200            // are envelope_size bytes.
9201            let cur_offset: usize = (2 - 1) * envelope_size;
9202
9203            // Zero reserved fields.
9204            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9205
9206            // Safety:
9207            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9208            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9209            //   envelope_size bytes, there is always sufficient room.
9210            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_intl__common::TemperatureUnit, D>(
9211            self.temperature_unit.as_ref().map(<fidl_fuchsia_intl__common::TemperatureUnit as fidl::encoding::ValueTypeMarker>::borrow),
9212            encoder, offset + cur_offset, depth
9213        )?;
9214
9215            _prev_end_offset = cur_offset + envelope_size;
9216            if 3 > max_ordinal {
9217                return Ok(());
9218            }
9219
9220            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9221            // are envelope_size bytes.
9222            let cur_offset: usize = (3 - 1) * envelope_size;
9223
9224            // Zero reserved fields.
9225            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9226
9227            // Safety:
9228            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9229            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9230            //   envelope_size bytes, there is always sufficient room.
9231            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_intl__common::TimeZoneId, D>(
9232            self.time_zone_id.as_ref().map(<fidl_fuchsia_intl__common::TimeZoneId as fidl::encoding::ValueTypeMarker>::borrow),
9233            encoder, offset + cur_offset, depth
9234        )?;
9235
9236            _prev_end_offset = cur_offset + envelope_size;
9237            if 4 > max_ordinal {
9238                return Ok(());
9239            }
9240
9241            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9242            // are envelope_size bytes.
9243            let cur_offset: usize = (4 - 1) * envelope_size;
9244
9245            // Zero reserved fields.
9246            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9247
9248            // Safety:
9249            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9250            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9251            //   envelope_size bytes, there is always sufficient room.
9252            fidl::encoding::encode_in_envelope_optional::<HourCycle, D>(
9253                self.hour_cycle
9254                    .as_ref()
9255                    .map(<HourCycle as fidl::encoding::ValueTypeMarker>::borrow),
9256                encoder,
9257                offset + cur_offset,
9258                depth,
9259            )?;
9260
9261            _prev_end_offset = cur_offset + envelope_size;
9262
9263            Ok(())
9264        }
9265    }
9266
9267    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IntlSettings {
9268        #[inline(always)]
9269        fn new_empty() -> Self {
9270            Self::default()
9271        }
9272
9273        unsafe fn decode(
9274            &mut self,
9275            decoder: &mut fidl::encoding::Decoder<'_, D>,
9276            offset: usize,
9277            mut depth: fidl::encoding::Depth,
9278        ) -> fidl::Result<()> {
9279            decoder.debug_check_bounds::<Self>(offset);
9280            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9281                None => return Err(fidl::Error::NotNullable),
9282                Some(len) => len,
9283            };
9284            // Calling decoder.out_of_line_offset(0) is not allowed.
9285            if len == 0 {
9286                return Ok(());
9287            };
9288            depth.increment()?;
9289            let envelope_size = 8;
9290            let bytes_len = len * envelope_size;
9291            let offset = decoder.out_of_line_offset(bytes_len)?;
9292            // Decode the envelope for each type.
9293            let mut _next_ordinal_to_read = 0;
9294            let mut next_offset = offset;
9295            let end_offset = offset + bytes_len;
9296            _next_ordinal_to_read += 1;
9297            if next_offset >= end_offset {
9298                return Ok(());
9299            }
9300
9301            // Decode unknown envelopes for gaps in ordinals.
9302            while _next_ordinal_to_read < 1 {
9303                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9304                _next_ordinal_to_read += 1;
9305                next_offset += envelope_size;
9306            }
9307
9308            let next_out_of_line = decoder.next_out_of_line();
9309            let handles_before = decoder.remaining_handles();
9310            if let Some((inlined, num_bytes, num_handles)) =
9311                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9312            {
9313                let member_inline_size = <fidl::encoding::Vector<
9314                    fidl_fuchsia_intl__common::LocaleId,
9315                    10,
9316                > as fidl::encoding::TypeMarker>::inline_size(
9317                    decoder.context
9318                );
9319                if inlined != (member_inline_size <= 4) {
9320                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9321                }
9322                let inner_offset;
9323                let mut inner_depth = depth.clone();
9324                if inlined {
9325                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9326                    inner_offset = next_offset;
9327                } else {
9328                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9329                    inner_depth.increment()?;
9330                }
9331                let val_ref =
9332                self.locales.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_intl__common::LocaleId, 10>, D));
9333                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_intl__common::LocaleId, 10>, D, val_ref, decoder, inner_offset, inner_depth)?;
9334                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9335                {
9336                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9337                }
9338                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9339                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9340                }
9341            }
9342
9343            next_offset += envelope_size;
9344            _next_ordinal_to_read += 1;
9345            if next_offset >= end_offset {
9346                return Ok(());
9347            }
9348
9349            // Decode unknown envelopes for gaps in ordinals.
9350            while _next_ordinal_to_read < 2 {
9351                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9352                _next_ordinal_to_read += 1;
9353                next_offset += envelope_size;
9354            }
9355
9356            let next_out_of_line = decoder.next_out_of_line();
9357            let handles_before = decoder.remaining_handles();
9358            if let Some((inlined, num_bytes, num_handles)) =
9359                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9360            {
9361                let member_inline_size = <fidl_fuchsia_intl__common::TemperatureUnit as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9362                if inlined != (member_inline_size <= 4) {
9363                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9364                }
9365                let inner_offset;
9366                let mut inner_depth = depth.clone();
9367                if inlined {
9368                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9369                    inner_offset = next_offset;
9370                } else {
9371                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9372                    inner_depth.increment()?;
9373                }
9374                let val_ref = self.temperature_unit.get_or_insert_with(|| {
9375                    fidl::new_empty!(fidl_fuchsia_intl__common::TemperatureUnit, D)
9376                });
9377                fidl::decode!(
9378                    fidl_fuchsia_intl__common::TemperatureUnit,
9379                    D,
9380                    val_ref,
9381                    decoder,
9382                    inner_offset,
9383                    inner_depth
9384                )?;
9385                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9386                {
9387                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9388                }
9389                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9390                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9391                }
9392            }
9393
9394            next_offset += envelope_size;
9395            _next_ordinal_to_read += 1;
9396            if next_offset >= end_offset {
9397                return Ok(());
9398            }
9399
9400            // Decode unknown envelopes for gaps in ordinals.
9401            while _next_ordinal_to_read < 3 {
9402                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9403                _next_ordinal_to_read += 1;
9404                next_offset += envelope_size;
9405            }
9406
9407            let next_out_of_line = decoder.next_out_of_line();
9408            let handles_before = decoder.remaining_handles();
9409            if let Some((inlined, num_bytes, num_handles)) =
9410                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9411            {
9412                let member_inline_size = <fidl_fuchsia_intl__common::TimeZoneId as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9413                if inlined != (member_inline_size <= 4) {
9414                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9415                }
9416                let inner_offset;
9417                let mut inner_depth = depth.clone();
9418                if inlined {
9419                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9420                    inner_offset = next_offset;
9421                } else {
9422                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9423                    inner_depth.increment()?;
9424                }
9425                let val_ref = self.time_zone_id.get_or_insert_with(|| {
9426                    fidl::new_empty!(fidl_fuchsia_intl__common::TimeZoneId, D)
9427                });
9428                fidl::decode!(
9429                    fidl_fuchsia_intl__common::TimeZoneId,
9430                    D,
9431                    val_ref,
9432                    decoder,
9433                    inner_offset,
9434                    inner_depth
9435                )?;
9436                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9437                {
9438                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9439                }
9440                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9441                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9442                }
9443            }
9444
9445            next_offset += envelope_size;
9446            _next_ordinal_to_read += 1;
9447            if next_offset >= end_offset {
9448                return Ok(());
9449            }
9450
9451            // Decode unknown envelopes for gaps in ordinals.
9452            while _next_ordinal_to_read < 4 {
9453                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9454                _next_ordinal_to_read += 1;
9455                next_offset += envelope_size;
9456            }
9457
9458            let next_out_of_line = decoder.next_out_of_line();
9459            let handles_before = decoder.remaining_handles();
9460            if let Some((inlined, num_bytes, num_handles)) =
9461                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9462            {
9463                let member_inline_size =
9464                    <HourCycle as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9465                if inlined != (member_inline_size <= 4) {
9466                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9467                }
9468                let inner_offset;
9469                let mut inner_depth = depth.clone();
9470                if inlined {
9471                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9472                    inner_offset = next_offset;
9473                } else {
9474                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9475                    inner_depth.increment()?;
9476                }
9477                let val_ref = self.hour_cycle.get_or_insert_with(|| fidl::new_empty!(HourCycle, D));
9478                fidl::decode!(HourCycle, D, val_ref, decoder, inner_offset, inner_depth)?;
9479                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9480                {
9481                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9482                }
9483                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9484                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9485                }
9486            }
9487
9488            next_offset += envelope_size;
9489
9490            // Decode the remaining unknown envelopes.
9491            while next_offset < end_offset {
9492                _next_ordinal_to_read += 1;
9493                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9494                next_offset += envelope_size;
9495            }
9496
9497            Ok(())
9498        }
9499    }
9500
9501    impl KeyboardSettings {
9502        #[inline(always)]
9503        fn max_ordinal_present(&self) -> u64 {
9504            if let Some(_) = self.autorepeat {
9505                return 2;
9506            }
9507            if let Some(_) = self.keymap {
9508                return 1;
9509            }
9510            0
9511        }
9512    }
9513
9514    impl fidl::encoding::ValueTypeMarker for KeyboardSettings {
9515        type Borrowed<'a> = &'a Self;
9516        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9517            value
9518        }
9519    }
9520
9521    unsafe impl fidl::encoding::TypeMarker for KeyboardSettings {
9522        type Owned = Self;
9523
9524        #[inline(always)]
9525        fn inline_align(_context: fidl::encoding::Context) -> usize {
9526            8
9527        }
9528
9529        #[inline(always)]
9530        fn inline_size(_context: fidl::encoding::Context) -> usize {
9531            16
9532        }
9533    }
9534
9535    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<KeyboardSettings, D>
9536        for &KeyboardSettings
9537    {
9538        unsafe fn encode(
9539            self,
9540            encoder: &mut fidl::encoding::Encoder<'_, D>,
9541            offset: usize,
9542            mut depth: fidl::encoding::Depth,
9543        ) -> fidl::Result<()> {
9544            encoder.debug_check_bounds::<KeyboardSettings>(offset);
9545            // Vector header
9546            let max_ordinal: u64 = self.max_ordinal_present();
9547            encoder.write_num(max_ordinal, offset);
9548            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9549            // Calling encoder.out_of_line_offset(0) is not allowed.
9550            if max_ordinal == 0 {
9551                return Ok(());
9552            }
9553            depth.increment()?;
9554            let envelope_size = 8;
9555            let bytes_len = max_ordinal as usize * envelope_size;
9556            #[allow(unused_variables)]
9557            let offset = encoder.out_of_line_offset(bytes_len);
9558            let mut _prev_end_offset: usize = 0;
9559            if 1 > max_ordinal {
9560                return Ok(());
9561            }
9562
9563            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9564            // are envelope_size bytes.
9565            let cur_offset: usize = (1 - 1) * envelope_size;
9566
9567            // Zero reserved fields.
9568            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9569
9570            // Safety:
9571            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9572            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9573            //   envelope_size bytes, there is always sufficient room.
9574            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_input__common::KeymapId, D>(
9575            self.keymap.as_ref().map(<fidl_fuchsia_input__common::KeymapId as fidl::encoding::ValueTypeMarker>::borrow),
9576            encoder, offset + cur_offset, depth
9577        )?;
9578
9579            _prev_end_offset = cur_offset + envelope_size;
9580            if 2 > max_ordinal {
9581                return Ok(());
9582            }
9583
9584            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9585            // are envelope_size bytes.
9586            let cur_offset: usize = (2 - 1) * envelope_size;
9587
9588            // Zero reserved fields.
9589            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9590
9591            // Safety:
9592            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9593            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9594            //   envelope_size bytes, there is always sufficient room.
9595            fidl::encoding::encode_in_envelope_optional::<Autorepeat, D>(
9596                self.autorepeat
9597                    .as_ref()
9598                    .map(<Autorepeat as fidl::encoding::ValueTypeMarker>::borrow),
9599                encoder,
9600                offset + cur_offset,
9601                depth,
9602            )?;
9603
9604            _prev_end_offset = cur_offset + envelope_size;
9605
9606            Ok(())
9607        }
9608    }
9609
9610    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for KeyboardSettings {
9611        #[inline(always)]
9612        fn new_empty() -> Self {
9613            Self::default()
9614        }
9615
9616        unsafe fn decode(
9617            &mut self,
9618            decoder: &mut fidl::encoding::Decoder<'_, D>,
9619            offset: usize,
9620            mut depth: fidl::encoding::Depth,
9621        ) -> fidl::Result<()> {
9622            decoder.debug_check_bounds::<Self>(offset);
9623            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9624                None => return Err(fidl::Error::NotNullable),
9625                Some(len) => len,
9626            };
9627            // Calling decoder.out_of_line_offset(0) is not allowed.
9628            if len == 0 {
9629                return Ok(());
9630            };
9631            depth.increment()?;
9632            let envelope_size = 8;
9633            let bytes_len = len * envelope_size;
9634            let offset = decoder.out_of_line_offset(bytes_len)?;
9635            // Decode the envelope for each type.
9636            let mut _next_ordinal_to_read = 0;
9637            let mut next_offset = offset;
9638            let end_offset = offset + bytes_len;
9639            _next_ordinal_to_read += 1;
9640            if next_offset >= end_offset {
9641                return Ok(());
9642            }
9643
9644            // Decode unknown envelopes for gaps in ordinals.
9645            while _next_ordinal_to_read < 1 {
9646                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9647                _next_ordinal_to_read += 1;
9648                next_offset += envelope_size;
9649            }
9650
9651            let next_out_of_line = decoder.next_out_of_line();
9652            let handles_before = decoder.remaining_handles();
9653            if let Some((inlined, num_bytes, num_handles)) =
9654                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9655            {
9656                let member_inline_size = <fidl_fuchsia_input__common::KeymapId as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9657                if inlined != (member_inline_size <= 4) {
9658                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9659                }
9660                let inner_offset;
9661                let mut inner_depth = depth.clone();
9662                if inlined {
9663                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9664                    inner_offset = next_offset;
9665                } else {
9666                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9667                    inner_depth.increment()?;
9668                }
9669                let val_ref = self.keymap.get_or_insert_with(|| {
9670                    fidl::new_empty!(fidl_fuchsia_input__common::KeymapId, D)
9671                });
9672                fidl::decode!(
9673                    fidl_fuchsia_input__common::KeymapId,
9674                    D,
9675                    val_ref,
9676                    decoder,
9677                    inner_offset,
9678                    inner_depth
9679                )?;
9680                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9681                {
9682                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9683                }
9684                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9685                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9686                }
9687            }
9688
9689            next_offset += envelope_size;
9690            _next_ordinal_to_read += 1;
9691            if next_offset >= end_offset {
9692                return Ok(());
9693            }
9694
9695            // Decode unknown envelopes for gaps in ordinals.
9696            while _next_ordinal_to_read < 2 {
9697                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9698                _next_ordinal_to_read += 1;
9699                next_offset += envelope_size;
9700            }
9701
9702            let next_out_of_line = decoder.next_out_of_line();
9703            let handles_before = decoder.remaining_handles();
9704            if let Some((inlined, num_bytes, num_handles)) =
9705                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9706            {
9707                let member_inline_size =
9708                    <Autorepeat as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9709                if inlined != (member_inline_size <= 4) {
9710                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9711                }
9712                let inner_offset;
9713                let mut inner_depth = depth.clone();
9714                if inlined {
9715                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9716                    inner_offset = next_offset;
9717                } else {
9718                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9719                    inner_depth.increment()?;
9720                }
9721                let val_ref =
9722                    self.autorepeat.get_or_insert_with(|| fidl::new_empty!(Autorepeat, D));
9723                fidl::decode!(Autorepeat, D, val_ref, decoder, inner_offset, inner_depth)?;
9724                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9725                {
9726                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9727                }
9728                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9729                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9730                }
9731            }
9732
9733            next_offset += envelope_size;
9734
9735            // Decode the remaining unknown envelopes.
9736            while next_offset < end_offset {
9737                _next_ordinal_to_read += 1;
9738                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9739                next_offset += envelope_size;
9740            }
9741
9742            Ok(())
9743        }
9744    }
9745
9746    impl LightGroup {
9747        #[inline(always)]
9748        fn max_ordinal_present(&self) -> u64 {
9749            if let Some(_) = self.lights {
9750                return 4;
9751            }
9752            if let Some(_) = self.type_ {
9753                return 3;
9754            }
9755            if let Some(_) = self.enabled {
9756                return 2;
9757            }
9758            if let Some(_) = self.name {
9759                return 1;
9760            }
9761            0
9762        }
9763    }
9764
9765    impl fidl::encoding::ValueTypeMarker for LightGroup {
9766        type Borrowed<'a> = &'a Self;
9767        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9768            value
9769        }
9770    }
9771
9772    unsafe impl fidl::encoding::TypeMarker for LightGroup {
9773        type Owned = Self;
9774
9775        #[inline(always)]
9776        fn inline_align(_context: fidl::encoding::Context) -> usize {
9777            8
9778        }
9779
9780        #[inline(always)]
9781        fn inline_size(_context: fidl::encoding::Context) -> usize {
9782            16
9783        }
9784    }
9785
9786    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightGroup, D>
9787        for &LightGroup
9788    {
9789        unsafe fn encode(
9790            self,
9791            encoder: &mut fidl::encoding::Encoder<'_, D>,
9792            offset: usize,
9793            mut depth: fidl::encoding::Depth,
9794        ) -> fidl::Result<()> {
9795            encoder.debug_check_bounds::<LightGroup>(offset);
9796            // Vector header
9797            let max_ordinal: u64 = self.max_ordinal_present();
9798            encoder.write_num(max_ordinal, offset);
9799            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9800            // Calling encoder.out_of_line_offset(0) is not allowed.
9801            if max_ordinal == 0 {
9802                return Ok(());
9803            }
9804            depth.increment()?;
9805            let envelope_size = 8;
9806            let bytes_len = max_ordinal as usize * envelope_size;
9807            #[allow(unused_variables)]
9808            let offset = encoder.out_of_line_offset(bytes_len);
9809            let mut _prev_end_offset: usize = 0;
9810            if 1 > max_ordinal {
9811                return Ok(());
9812            }
9813
9814            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9815            // are envelope_size bytes.
9816            let cur_offset: usize = (1 - 1) * envelope_size;
9817
9818            // Zero reserved fields.
9819            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9820
9821            // Safety:
9822            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9823            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9824            //   envelope_size bytes, there is always sufficient room.
9825            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<32>, D>(
9826                self.name.as_ref().map(
9827                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow,
9828                ),
9829                encoder,
9830                offset + cur_offset,
9831                depth,
9832            )?;
9833
9834            _prev_end_offset = cur_offset + envelope_size;
9835            if 2 > max_ordinal {
9836                return Ok(());
9837            }
9838
9839            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9840            // are envelope_size bytes.
9841            let cur_offset: usize = (2 - 1) * envelope_size;
9842
9843            // Zero reserved fields.
9844            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9845
9846            // Safety:
9847            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9848            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9849            //   envelope_size bytes, there is always sufficient room.
9850            fidl::encoding::encode_in_envelope_optional::<bool, D>(
9851                self.enabled.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9852                encoder,
9853                offset + cur_offset,
9854                depth,
9855            )?;
9856
9857            _prev_end_offset = cur_offset + envelope_size;
9858            if 3 > max_ordinal {
9859                return Ok(());
9860            }
9861
9862            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9863            // are envelope_size bytes.
9864            let cur_offset: usize = (3 - 1) * envelope_size;
9865
9866            // Zero reserved fields.
9867            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9868
9869            // Safety:
9870            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9871            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9872            //   envelope_size bytes, there is always sufficient room.
9873            fidl::encoding::encode_in_envelope_optional::<LightType, D>(
9874                self.type_.as_ref().map(<LightType as fidl::encoding::ValueTypeMarker>::borrow),
9875                encoder,
9876                offset + cur_offset,
9877                depth,
9878            )?;
9879
9880            _prev_end_offset = cur_offset + envelope_size;
9881            if 4 > max_ordinal {
9882                return Ok(());
9883            }
9884
9885            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9886            // are envelope_size bytes.
9887            let cur_offset: usize = (4 - 1) * envelope_size;
9888
9889            // Zero reserved fields.
9890            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9891
9892            // Safety:
9893            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9894            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9895            //   envelope_size bytes, there is always sufficient room.
9896            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<LightState>, D>(
9897            self.lights.as_ref().map(<fidl::encoding::UnboundedVector<LightState> as fidl::encoding::ValueTypeMarker>::borrow),
9898            encoder, offset + cur_offset, depth
9899        )?;
9900
9901            _prev_end_offset = cur_offset + envelope_size;
9902
9903            Ok(())
9904        }
9905    }
9906
9907    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightGroup {
9908        #[inline(always)]
9909        fn new_empty() -> Self {
9910            Self::default()
9911        }
9912
9913        unsafe fn decode(
9914            &mut self,
9915            decoder: &mut fidl::encoding::Decoder<'_, D>,
9916            offset: usize,
9917            mut depth: fidl::encoding::Depth,
9918        ) -> fidl::Result<()> {
9919            decoder.debug_check_bounds::<Self>(offset);
9920            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9921                None => return Err(fidl::Error::NotNullable),
9922                Some(len) => len,
9923            };
9924            // Calling decoder.out_of_line_offset(0) is not allowed.
9925            if len == 0 {
9926                return Ok(());
9927            };
9928            depth.increment()?;
9929            let envelope_size = 8;
9930            let bytes_len = len * envelope_size;
9931            let offset = decoder.out_of_line_offset(bytes_len)?;
9932            // Decode the envelope for each type.
9933            let mut _next_ordinal_to_read = 0;
9934            let mut next_offset = offset;
9935            let end_offset = offset + bytes_len;
9936            _next_ordinal_to_read += 1;
9937            if next_offset >= end_offset {
9938                return Ok(());
9939            }
9940
9941            // Decode unknown envelopes for gaps in ordinals.
9942            while _next_ordinal_to_read < 1 {
9943                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9944                _next_ordinal_to_read += 1;
9945                next_offset += envelope_size;
9946            }
9947
9948            let next_out_of_line = decoder.next_out_of_line();
9949            let handles_before = decoder.remaining_handles();
9950            if let Some((inlined, num_bytes, num_handles)) =
9951                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9952            {
9953                let member_inline_size =
9954                    <fidl::encoding::BoundedString<32> as fidl::encoding::TypeMarker>::inline_size(
9955                        decoder.context,
9956                    );
9957                if inlined != (member_inline_size <= 4) {
9958                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9959                }
9960                let inner_offset;
9961                let mut inner_depth = depth.clone();
9962                if inlined {
9963                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9964                    inner_offset = next_offset;
9965                } else {
9966                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9967                    inner_depth.increment()?;
9968                }
9969                let val_ref = self
9970                    .name
9971                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<32>, D));
9972                fidl::decode!(
9973                    fidl::encoding::BoundedString<32>,
9974                    D,
9975                    val_ref,
9976                    decoder,
9977                    inner_offset,
9978                    inner_depth
9979                )?;
9980                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9981                {
9982                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9983                }
9984                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9985                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9986                }
9987            }
9988
9989            next_offset += envelope_size;
9990            _next_ordinal_to_read += 1;
9991            if next_offset >= end_offset {
9992                return Ok(());
9993            }
9994
9995            // Decode unknown envelopes for gaps in ordinals.
9996            while _next_ordinal_to_read < 2 {
9997                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9998                _next_ordinal_to_read += 1;
9999                next_offset += envelope_size;
10000            }
10001
10002            let next_out_of_line = decoder.next_out_of_line();
10003            let handles_before = decoder.remaining_handles();
10004            if let Some((inlined, num_bytes, num_handles)) =
10005                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10006            {
10007                let member_inline_size =
10008                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10009                if inlined != (member_inline_size <= 4) {
10010                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10011                }
10012                let inner_offset;
10013                let mut inner_depth = depth.clone();
10014                if inlined {
10015                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10016                    inner_offset = next_offset;
10017                } else {
10018                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10019                    inner_depth.increment()?;
10020                }
10021                let val_ref = self.enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
10022                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
10023                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10024                {
10025                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10026                }
10027                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10028                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10029                }
10030            }
10031
10032            next_offset += envelope_size;
10033            _next_ordinal_to_read += 1;
10034            if next_offset >= end_offset {
10035                return Ok(());
10036            }
10037
10038            // Decode unknown envelopes for gaps in ordinals.
10039            while _next_ordinal_to_read < 3 {
10040                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10041                _next_ordinal_to_read += 1;
10042                next_offset += envelope_size;
10043            }
10044
10045            let next_out_of_line = decoder.next_out_of_line();
10046            let handles_before = decoder.remaining_handles();
10047            if let Some((inlined, num_bytes, num_handles)) =
10048                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10049            {
10050                let member_inline_size =
10051                    <LightType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10052                if inlined != (member_inline_size <= 4) {
10053                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10054                }
10055                let inner_offset;
10056                let mut inner_depth = depth.clone();
10057                if inlined {
10058                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10059                    inner_offset = next_offset;
10060                } else {
10061                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10062                    inner_depth.increment()?;
10063                }
10064                let val_ref = self.type_.get_or_insert_with(|| fidl::new_empty!(LightType, D));
10065                fidl::decode!(LightType, D, val_ref, decoder, inner_offset, inner_depth)?;
10066                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10067                {
10068                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10069                }
10070                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10071                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10072                }
10073            }
10074
10075            next_offset += envelope_size;
10076            _next_ordinal_to_read += 1;
10077            if next_offset >= end_offset {
10078                return Ok(());
10079            }
10080
10081            // Decode unknown envelopes for gaps in ordinals.
10082            while _next_ordinal_to_read < 4 {
10083                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10084                _next_ordinal_to_read += 1;
10085                next_offset += envelope_size;
10086            }
10087
10088            let next_out_of_line = decoder.next_out_of_line();
10089            let handles_before = decoder.remaining_handles();
10090            if let Some((inlined, num_bytes, num_handles)) =
10091                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10092            {
10093                let member_inline_size = <fidl::encoding::UnboundedVector<LightState> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10094                if inlined != (member_inline_size <= 4) {
10095                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10096                }
10097                let inner_offset;
10098                let mut inner_depth = depth.clone();
10099                if inlined {
10100                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10101                    inner_offset = next_offset;
10102                } else {
10103                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10104                    inner_depth.increment()?;
10105                }
10106                let val_ref = self.lights.get_or_insert_with(|| {
10107                    fidl::new_empty!(fidl::encoding::UnboundedVector<LightState>, D)
10108                });
10109                fidl::decode!(
10110                    fidl::encoding::UnboundedVector<LightState>,
10111                    D,
10112                    val_ref,
10113                    decoder,
10114                    inner_offset,
10115                    inner_depth
10116                )?;
10117                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10118                {
10119                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10120                }
10121                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10122                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10123                }
10124            }
10125
10126            next_offset += envelope_size;
10127
10128            // Decode the remaining unknown envelopes.
10129            while next_offset < end_offset {
10130                _next_ordinal_to_read += 1;
10131                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10132                next_offset += envelope_size;
10133            }
10134
10135            Ok(())
10136        }
10137    }
10138
10139    impl LightState {
10140        #[inline(always)]
10141        fn max_ordinal_present(&self) -> u64 {
10142            if let Some(_) = self.value {
10143                return 1;
10144            }
10145            0
10146        }
10147    }
10148
10149    impl fidl::encoding::ValueTypeMarker for LightState {
10150        type Borrowed<'a> = &'a Self;
10151        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10152            value
10153        }
10154    }
10155
10156    unsafe impl fidl::encoding::TypeMarker for LightState {
10157        type Owned = Self;
10158
10159        #[inline(always)]
10160        fn inline_align(_context: fidl::encoding::Context) -> usize {
10161            8
10162        }
10163
10164        #[inline(always)]
10165        fn inline_size(_context: fidl::encoding::Context) -> usize {
10166            16
10167        }
10168    }
10169
10170    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightState, D>
10171        for &LightState
10172    {
10173        unsafe fn encode(
10174            self,
10175            encoder: &mut fidl::encoding::Encoder<'_, D>,
10176            offset: usize,
10177            mut depth: fidl::encoding::Depth,
10178        ) -> fidl::Result<()> {
10179            encoder.debug_check_bounds::<LightState>(offset);
10180            // Vector header
10181            let max_ordinal: u64 = self.max_ordinal_present();
10182            encoder.write_num(max_ordinal, offset);
10183            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10184            // Calling encoder.out_of_line_offset(0) is not allowed.
10185            if max_ordinal == 0 {
10186                return Ok(());
10187            }
10188            depth.increment()?;
10189            let envelope_size = 8;
10190            let bytes_len = max_ordinal as usize * envelope_size;
10191            #[allow(unused_variables)]
10192            let offset = encoder.out_of_line_offset(bytes_len);
10193            let mut _prev_end_offset: usize = 0;
10194            if 1 > max_ordinal {
10195                return Ok(());
10196            }
10197
10198            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10199            // are envelope_size bytes.
10200            let cur_offset: usize = (1 - 1) * envelope_size;
10201
10202            // Zero reserved fields.
10203            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10204
10205            // Safety:
10206            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10207            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10208            //   envelope_size bytes, there is always sufficient room.
10209            fidl::encoding::encode_in_envelope_optional::<LightValue, D>(
10210                self.value.as_ref().map(<LightValue as fidl::encoding::ValueTypeMarker>::borrow),
10211                encoder,
10212                offset + cur_offset,
10213                depth,
10214            )?;
10215
10216            _prev_end_offset = cur_offset + envelope_size;
10217
10218            Ok(())
10219        }
10220    }
10221
10222    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightState {
10223        #[inline(always)]
10224        fn new_empty() -> Self {
10225            Self::default()
10226        }
10227
10228        unsafe fn decode(
10229            &mut self,
10230            decoder: &mut fidl::encoding::Decoder<'_, D>,
10231            offset: usize,
10232            mut depth: fidl::encoding::Depth,
10233        ) -> fidl::Result<()> {
10234            decoder.debug_check_bounds::<Self>(offset);
10235            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10236                None => return Err(fidl::Error::NotNullable),
10237                Some(len) => len,
10238            };
10239            // Calling decoder.out_of_line_offset(0) is not allowed.
10240            if len == 0 {
10241                return Ok(());
10242            };
10243            depth.increment()?;
10244            let envelope_size = 8;
10245            let bytes_len = len * envelope_size;
10246            let offset = decoder.out_of_line_offset(bytes_len)?;
10247            // Decode the envelope for each type.
10248            let mut _next_ordinal_to_read = 0;
10249            let mut next_offset = offset;
10250            let end_offset = offset + bytes_len;
10251            _next_ordinal_to_read += 1;
10252            if next_offset >= end_offset {
10253                return Ok(());
10254            }
10255
10256            // Decode unknown envelopes for gaps in ordinals.
10257            while _next_ordinal_to_read < 1 {
10258                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10259                _next_ordinal_to_read += 1;
10260                next_offset += envelope_size;
10261            }
10262
10263            let next_out_of_line = decoder.next_out_of_line();
10264            let handles_before = decoder.remaining_handles();
10265            if let Some((inlined, num_bytes, num_handles)) =
10266                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10267            {
10268                let member_inline_size =
10269                    <LightValue as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10270                if inlined != (member_inline_size <= 4) {
10271                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10272                }
10273                let inner_offset;
10274                let mut inner_depth = depth.clone();
10275                if inlined {
10276                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10277                    inner_offset = next_offset;
10278                } else {
10279                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10280                    inner_depth.increment()?;
10281                }
10282                let val_ref = self.value.get_or_insert_with(|| fidl::new_empty!(LightValue, D));
10283                fidl::decode!(LightValue, D, val_ref, decoder, inner_offset, inner_depth)?;
10284                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10285                {
10286                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10287                }
10288                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10289                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10290                }
10291            }
10292
10293            next_offset += envelope_size;
10294
10295            // Decode the remaining unknown envelopes.
10296            while next_offset < end_offset {
10297                _next_ordinal_to_read += 1;
10298                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10299                next_offset += envelope_size;
10300            }
10301
10302            Ok(())
10303        }
10304    }
10305
10306    impl NightModeSettings {
10307        #[inline(always)]
10308        fn max_ordinal_present(&self) -> u64 {
10309            if let Some(_) = self.night_mode_enabled {
10310                return 1;
10311            }
10312            0
10313        }
10314    }
10315
10316    impl fidl::encoding::ValueTypeMarker for NightModeSettings {
10317        type Borrowed<'a> = &'a Self;
10318        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10319            value
10320        }
10321    }
10322
10323    unsafe impl fidl::encoding::TypeMarker for NightModeSettings {
10324        type Owned = Self;
10325
10326        #[inline(always)]
10327        fn inline_align(_context: fidl::encoding::Context) -> usize {
10328            8
10329        }
10330
10331        #[inline(always)]
10332        fn inline_size(_context: fidl::encoding::Context) -> usize {
10333            16
10334        }
10335    }
10336
10337    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NightModeSettings, D>
10338        for &NightModeSettings
10339    {
10340        unsafe fn encode(
10341            self,
10342            encoder: &mut fidl::encoding::Encoder<'_, D>,
10343            offset: usize,
10344            mut depth: fidl::encoding::Depth,
10345        ) -> fidl::Result<()> {
10346            encoder.debug_check_bounds::<NightModeSettings>(offset);
10347            // Vector header
10348            let max_ordinal: u64 = self.max_ordinal_present();
10349            encoder.write_num(max_ordinal, offset);
10350            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10351            // Calling encoder.out_of_line_offset(0) is not allowed.
10352            if max_ordinal == 0 {
10353                return Ok(());
10354            }
10355            depth.increment()?;
10356            let envelope_size = 8;
10357            let bytes_len = max_ordinal as usize * envelope_size;
10358            #[allow(unused_variables)]
10359            let offset = encoder.out_of_line_offset(bytes_len);
10360            let mut _prev_end_offset: usize = 0;
10361            if 1 > max_ordinal {
10362                return Ok(());
10363            }
10364
10365            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10366            // are envelope_size bytes.
10367            let cur_offset: usize = (1 - 1) * envelope_size;
10368
10369            // Zero reserved fields.
10370            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10371
10372            // Safety:
10373            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10374            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10375            //   envelope_size bytes, there is always sufficient room.
10376            fidl::encoding::encode_in_envelope_optional::<bool, D>(
10377                self.night_mode_enabled
10378                    .as_ref()
10379                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10380                encoder,
10381                offset + cur_offset,
10382                depth,
10383            )?;
10384
10385            _prev_end_offset = cur_offset + envelope_size;
10386
10387            Ok(())
10388        }
10389    }
10390
10391    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NightModeSettings {
10392        #[inline(always)]
10393        fn new_empty() -> Self {
10394            Self::default()
10395        }
10396
10397        unsafe fn decode(
10398            &mut self,
10399            decoder: &mut fidl::encoding::Decoder<'_, D>,
10400            offset: usize,
10401            mut depth: fidl::encoding::Depth,
10402        ) -> fidl::Result<()> {
10403            decoder.debug_check_bounds::<Self>(offset);
10404            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10405                None => return Err(fidl::Error::NotNullable),
10406                Some(len) => len,
10407            };
10408            // Calling decoder.out_of_line_offset(0) is not allowed.
10409            if len == 0 {
10410                return Ok(());
10411            };
10412            depth.increment()?;
10413            let envelope_size = 8;
10414            let bytes_len = len * envelope_size;
10415            let offset = decoder.out_of_line_offset(bytes_len)?;
10416            // Decode the envelope for each type.
10417            let mut _next_ordinal_to_read = 0;
10418            let mut next_offset = offset;
10419            let end_offset = offset + bytes_len;
10420            _next_ordinal_to_read += 1;
10421            if next_offset >= end_offset {
10422                return Ok(());
10423            }
10424
10425            // Decode unknown envelopes for gaps in ordinals.
10426            while _next_ordinal_to_read < 1 {
10427                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10428                _next_ordinal_to_read += 1;
10429                next_offset += envelope_size;
10430            }
10431
10432            let next_out_of_line = decoder.next_out_of_line();
10433            let handles_before = decoder.remaining_handles();
10434            if let Some((inlined, num_bytes, num_handles)) =
10435                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10436            {
10437                let member_inline_size =
10438                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10439                if inlined != (member_inline_size <= 4) {
10440                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10441                }
10442                let inner_offset;
10443                let mut inner_depth = depth.clone();
10444                if inlined {
10445                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10446                    inner_offset = next_offset;
10447                } else {
10448                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10449                    inner_depth.increment()?;
10450                }
10451                let val_ref =
10452                    self.night_mode_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
10453                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
10454                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10455                {
10456                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10457                }
10458                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10459                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10460                }
10461            }
10462
10463            next_offset += envelope_size;
10464
10465            // Decode the remaining unknown envelopes.
10466            while next_offset < end_offset {
10467                _next_ordinal_to_read += 1;
10468                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10469                next_offset += envelope_size;
10470            }
10471
10472            Ok(())
10473        }
10474    }
10475
10476    impl PrivacySettings {
10477        #[inline(always)]
10478        fn max_ordinal_present(&self) -> u64 {
10479            if let Some(_) = self.user_data_sharing_consent {
10480                return 1;
10481            }
10482            0
10483        }
10484    }
10485
10486    impl fidl::encoding::ValueTypeMarker for PrivacySettings {
10487        type Borrowed<'a> = &'a Self;
10488        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10489            value
10490        }
10491    }
10492
10493    unsafe impl fidl::encoding::TypeMarker for PrivacySettings {
10494        type Owned = Self;
10495
10496        #[inline(always)]
10497        fn inline_align(_context: fidl::encoding::Context) -> usize {
10498            8
10499        }
10500
10501        #[inline(always)]
10502        fn inline_size(_context: fidl::encoding::Context) -> usize {
10503            16
10504        }
10505    }
10506
10507    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PrivacySettings, D>
10508        for &PrivacySettings
10509    {
10510        unsafe fn encode(
10511            self,
10512            encoder: &mut fidl::encoding::Encoder<'_, D>,
10513            offset: usize,
10514            mut depth: fidl::encoding::Depth,
10515        ) -> fidl::Result<()> {
10516            encoder.debug_check_bounds::<PrivacySettings>(offset);
10517            // Vector header
10518            let max_ordinal: u64 = self.max_ordinal_present();
10519            encoder.write_num(max_ordinal, offset);
10520            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10521            // Calling encoder.out_of_line_offset(0) is not allowed.
10522            if max_ordinal == 0 {
10523                return Ok(());
10524            }
10525            depth.increment()?;
10526            let envelope_size = 8;
10527            let bytes_len = max_ordinal as usize * envelope_size;
10528            #[allow(unused_variables)]
10529            let offset = encoder.out_of_line_offset(bytes_len);
10530            let mut _prev_end_offset: usize = 0;
10531            if 1 > max_ordinal {
10532                return Ok(());
10533            }
10534
10535            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10536            // are envelope_size bytes.
10537            let cur_offset: usize = (1 - 1) * envelope_size;
10538
10539            // Zero reserved fields.
10540            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10541
10542            // Safety:
10543            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10544            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10545            //   envelope_size bytes, there is always sufficient room.
10546            fidl::encoding::encode_in_envelope_optional::<bool, D>(
10547                self.user_data_sharing_consent
10548                    .as_ref()
10549                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10550                encoder,
10551                offset + cur_offset,
10552                depth,
10553            )?;
10554
10555            _prev_end_offset = cur_offset + envelope_size;
10556
10557            Ok(())
10558        }
10559    }
10560
10561    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PrivacySettings {
10562        #[inline(always)]
10563        fn new_empty() -> Self {
10564            Self::default()
10565        }
10566
10567        unsafe fn decode(
10568            &mut self,
10569            decoder: &mut fidl::encoding::Decoder<'_, D>,
10570            offset: usize,
10571            mut depth: fidl::encoding::Depth,
10572        ) -> fidl::Result<()> {
10573            decoder.debug_check_bounds::<Self>(offset);
10574            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10575                None => return Err(fidl::Error::NotNullable),
10576                Some(len) => len,
10577            };
10578            // Calling decoder.out_of_line_offset(0) is not allowed.
10579            if len == 0 {
10580                return Ok(());
10581            };
10582            depth.increment()?;
10583            let envelope_size = 8;
10584            let bytes_len = len * envelope_size;
10585            let offset = decoder.out_of_line_offset(bytes_len)?;
10586            // Decode the envelope for each type.
10587            let mut _next_ordinal_to_read = 0;
10588            let mut next_offset = offset;
10589            let end_offset = offset + bytes_len;
10590            _next_ordinal_to_read += 1;
10591            if next_offset >= end_offset {
10592                return Ok(());
10593            }
10594
10595            // Decode unknown envelopes for gaps in ordinals.
10596            while _next_ordinal_to_read < 1 {
10597                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10598                _next_ordinal_to_read += 1;
10599                next_offset += envelope_size;
10600            }
10601
10602            let next_out_of_line = decoder.next_out_of_line();
10603            let handles_before = decoder.remaining_handles();
10604            if let Some((inlined, num_bytes, num_handles)) =
10605                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10606            {
10607                let member_inline_size =
10608                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10609                if inlined != (member_inline_size <= 4) {
10610                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10611                }
10612                let inner_offset;
10613                let mut inner_depth = depth.clone();
10614                if inlined {
10615                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10616                    inner_offset = next_offset;
10617                } else {
10618                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10619                    inner_depth.increment()?;
10620                }
10621                let val_ref =
10622                    self.user_data_sharing_consent.get_or_insert_with(|| fidl::new_empty!(bool, D));
10623                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
10624                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10625                {
10626                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10627                }
10628                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10629                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10630                }
10631            }
10632
10633            next_offset += envelope_size;
10634
10635            // Decode the remaining unknown envelopes.
10636            while next_offset < end_offset {
10637                _next_ordinal_to_read += 1;
10638                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10639                next_offset += envelope_size;
10640            }
10641
10642            Ok(())
10643        }
10644    }
10645
10646    impl SetupSettings {
10647        #[inline(always)]
10648        fn max_ordinal_present(&self) -> u64 {
10649            if let Some(_) = self.enabled_configuration_interfaces {
10650                return 1;
10651            }
10652            0
10653        }
10654    }
10655
10656    impl fidl::encoding::ValueTypeMarker for SetupSettings {
10657        type Borrowed<'a> = &'a Self;
10658        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10659            value
10660        }
10661    }
10662
10663    unsafe impl fidl::encoding::TypeMarker for SetupSettings {
10664        type Owned = Self;
10665
10666        #[inline(always)]
10667        fn inline_align(_context: fidl::encoding::Context) -> usize {
10668            8
10669        }
10670
10671        #[inline(always)]
10672        fn inline_size(_context: fidl::encoding::Context) -> usize {
10673            16
10674        }
10675    }
10676
10677    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetupSettings, D>
10678        for &SetupSettings
10679    {
10680        unsafe fn encode(
10681            self,
10682            encoder: &mut fidl::encoding::Encoder<'_, D>,
10683            offset: usize,
10684            mut depth: fidl::encoding::Depth,
10685        ) -> fidl::Result<()> {
10686            encoder.debug_check_bounds::<SetupSettings>(offset);
10687            // Vector header
10688            let max_ordinal: u64 = self.max_ordinal_present();
10689            encoder.write_num(max_ordinal, offset);
10690            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10691            // Calling encoder.out_of_line_offset(0) is not allowed.
10692            if max_ordinal == 0 {
10693                return Ok(());
10694            }
10695            depth.increment()?;
10696            let envelope_size = 8;
10697            let bytes_len = max_ordinal as usize * envelope_size;
10698            #[allow(unused_variables)]
10699            let offset = encoder.out_of_line_offset(bytes_len);
10700            let mut _prev_end_offset: usize = 0;
10701            if 1 > max_ordinal {
10702                return Ok(());
10703            }
10704
10705            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10706            // are envelope_size bytes.
10707            let cur_offset: usize = (1 - 1) * envelope_size;
10708
10709            // Zero reserved fields.
10710            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10711
10712            // Safety:
10713            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10714            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10715            //   envelope_size bytes, there is always sufficient room.
10716            fidl::encoding::encode_in_envelope_optional::<ConfigurationInterfaces, D>(
10717                self.enabled_configuration_interfaces
10718                    .as_ref()
10719                    .map(<ConfigurationInterfaces as fidl::encoding::ValueTypeMarker>::borrow),
10720                encoder,
10721                offset + cur_offset,
10722                depth,
10723            )?;
10724
10725            _prev_end_offset = cur_offset + envelope_size;
10726
10727            Ok(())
10728        }
10729    }
10730
10731    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetupSettings {
10732        #[inline(always)]
10733        fn new_empty() -> Self {
10734            Self::default()
10735        }
10736
10737        unsafe fn decode(
10738            &mut self,
10739            decoder: &mut fidl::encoding::Decoder<'_, D>,
10740            offset: usize,
10741            mut depth: fidl::encoding::Depth,
10742        ) -> fidl::Result<()> {
10743            decoder.debug_check_bounds::<Self>(offset);
10744            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10745                None => return Err(fidl::Error::NotNullable),
10746                Some(len) => len,
10747            };
10748            // Calling decoder.out_of_line_offset(0) is not allowed.
10749            if len == 0 {
10750                return Ok(());
10751            };
10752            depth.increment()?;
10753            let envelope_size = 8;
10754            let bytes_len = len * envelope_size;
10755            let offset = decoder.out_of_line_offset(bytes_len)?;
10756            // Decode the envelope for each type.
10757            let mut _next_ordinal_to_read = 0;
10758            let mut next_offset = offset;
10759            let end_offset = offset + bytes_len;
10760            _next_ordinal_to_read += 1;
10761            if next_offset >= end_offset {
10762                return Ok(());
10763            }
10764
10765            // Decode unknown envelopes for gaps in ordinals.
10766            while _next_ordinal_to_read < 1 {
10767                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10768                _next_ordinal_to_read += 1;
10769                next_offset += envelope_size;
10770            }
10771
10772            let next_out_of_line = decoder.next_out_of_line();
10773            let handles_before = decoder.remaining_handles();
10774            if let Some((inlined, num_bytes, num_handles)) =
10775                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10776            {
10777                let member_inline_size =
10778                    <ConfigurationInterfaces as fidl::encoding::TypeMarker>::inline_size(
10779                        decoder.context,
10780                    );
10781                if inlined != (member_inline_size <= 4) {
10782                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10783                }
10784                let inner_offset;
10785                let mut inner_depth = depth.clone();
10786                if inlined {
10787                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10788                    inner_offset = next_offset;
10789                } else {
10790                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10791                    inner_depth.increment()?;
10792                }
10793                let val_ref = self
10794                    .enabled_configuration_interfaces
10795                    .get_or_insert_with(|| fidl::new_empty!(ConfigurationInterfaces, D));
10796                fidl::decode!(
10797                    ConfigurationInterfaces,
10798                    D,
10799                    val_ref,
10800                    decoder,
10801                    inner_offset,
10802                    inner_depth
10803                )?;
10804                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10805                {
10806                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10807                }
10808                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10809                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10810                }
10811            }
10812
10813            next_offset += envelope_size;
10814
10815            // Decode the remaining unknown envelopes.
10816            while next_offset < end_offset {
10817                _next_ordinal_to_read += 1;
10818                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10819                next_offset += envelope_size;
10820            }
10821
10822            Ok(())
10823        }
10824    }
10825
10826    impl SourceState {
10827        #[inline(always)]
10828        fn max_ordinal_present(&self) -> u64 {
10829            if let Some(_) = self.state {
10830                return 2;
10831            }
10832            if let Some(_) = self.source {
10833                return 1;
10834            }
10835            0
10836        }
10837    }
10838
10839    impl fidl::encoding::ValueTypeMarker for SourceState {
10840        type Borrowed<'a> = &'a Self;
10841        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10842            value
10843        }
10844    }
10845
10846    unsafe impl fidl::encoding::TypeMarker for SourceState {
10847        type Owned = Self;
10848
10849        #[inline(always)]
10850        fn inline_align(_context: fidl::encoding::Context) -> usize {
10851            8
10852        }
10853
10854        #[inline(always)]
10855        fn inline_size(_context: fidl::encoding::Context) -> usize {
10856            16
10857        }
10858    }
10859
10860    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SourceState, D>
10861        for &SourceState
10862    {
10863        unsafe fn encode(
10864            self,
10865            encoder: &mut fidl::encoding::Encoder<'_, D>,
10866            offset: usize,
10867            mut depth: fidl::encoding::Depth,
10868        ) -> fidl::Result<()> {
10869            encoder.debug_check_bounds::<SourceState>(offset);
10870            // Vector header
10871            let max_ordinal: u64 = self.max_ordinal_present();
10872            encoder.write_num(max_ordinal, offset);
10873            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10874            // Calling encoder.out_of_line_offset(0) is not allowed.
10875            if max_ordinal == 0 {
10876                return Ok(());
10877            }
10878            depth.increment()?;
10879            let envelope_size = 8;
10880            let bytes_len = max_ordinal as usize * envelope_size;
10881            #[allow(unused_variables)]
10882            let offset = encoder.out_of_line_offset(bytes_len);
10883            let mut _prev_end_offset: usize = 0;
10884            if 1 > max_ordinal {
10885                return Ok(());
10886            }
10887
10888            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10889            // are envelope_size bytes.
10890            let cur_offset: usize = (1 - 1) * envelope_size;
10891
10892            // Zero reserved fields.
10893            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10894
10895            // Safety:
10896            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10897            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10898            //   envelope_size bytes, there is always sufficient room.
10899            fidl::encoding::encode_in_envelope_optional::<DeviceStateSource, D>(
10900                self.source
10901                    .as_ref()
10902                    .map(<DeviceStateSource as fidl::encoding::ValueTypeMarker>::borrow),
10903                encoder,
10904                offset + cur_offset,
10905                depth,
10906            )?;
10907
10908            _prev_end_offset = cur_offset + envelope_size;
10909            if 2 > max_ordinal {
10910                return Ok(());
10911            }
10912
10913            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10914            // are envelope_size bytes.
10915            let cur_offset: usize = (2 - 1) * envelope_size;
10916
10917            // Zero reserved fields.
10918            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10919
10920            // Safety:
10921            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10922            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10923            //   envelope_size bytes, there is always sufficient room.
10924            fidl::encoding::encode_in_envelope_optional::<DeviceState, D>(
10925                self.state.as_ref().map(<DeviceState as fidl::encoding::ValueTypeMarker>::borrow),
10926                encoder,
10927                offset + cur_offset,
10928                depth,
10929            )?;
10930
10931            _prev_end_offset = cur_offset + envelope_size;
10932
10933            Ok(())
10934        }
10935    }
10936
10937    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SourceState {
10938        #[inline(always)]
10939        fn new_empty() -> Self {
10940            Self::default()
10941        }
10942
10943        unsafe fn decode(
10944            &mut self,
10945            decoder: &mut fidl::encoding::Decoder<'_, D>,
10946            offset: usize,
10947            mut depth: fidl::encoding::Depth,
10948        ) -> fidl::Result<()> {
10949            decoder.debug_check_bounds::<Self>(offset);
10950            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10951                None => return Err(fidl::Error::NotNullable),
10952                Some(len) => len,
10953            };
10954            // Calling decoder.out_of_line_offset(0) is not allowed.
10955            if len == 0 {
10956                return Ok(());
10957            };
10958            depth.increment()?;
10959            let envelope_size = 8;
10960            let bytes_len = len * envelope_size;
10961            let offset = decoder.out_of_line_offset(bytes_len)?;
10962            // Decode the envelope for each type.
10963            let mut _next_ordinal_to_read = 0;
10964            let mut next_offset = offset;
10965            let end_offset = offset + bytes_len;
10966            _next_ordinal_to_read += 1;
10967            if next_offset >= end_offset {
10968                return Ok(());
10969            }
10970
10971            // Decode unknown envelopes for gaps in ordinals.
10972            while _next_ordinal_to_read < 1 {
10973                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10974                _next_ordinal_to_read += 1;
10975                next_offset += envelope_size;
10976            }
10977
10978            let next_out_of_line = decoder.next_out_of_line();
10979            let handles_before = decoder.remaining_handles();
10980            if let Some((inlined, num_bytes, num_handles)) =
10981                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10982            {
10983                let member_inline_size =
10984                    <DeviceStateSource as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10985                if inlined != (member_inline_size <= 4) {
10986                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10987                }
10988                let inner_offset;
10989                let mut inner_depth = depth.clone();
10990                if inlined {
10991                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10992                    inner_offset = next_offset;
10993                } else {
10994                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10995                    inner_depth.increment()?;
10996                }
10997                let val_ref =
10998                    self.source.get_or_insert_with(|| fidl::new_empty!(DeviceStateSource, D));
10999                fidl::decode!(DeviceStateSource, D, val_ref, decoder, inner_offset, inner_depth)?;
11000                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11001                {
11002                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11003                }
11004                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11005                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11006                }
11007            }
11008
11009            next_offset += envelope_size;
11010            _next_ordinal_to_read += 1;
11011            if next_offset >= end_offset {
11012                return Ok(());
11013            }
11014
11015            // Decode unknown envelopes for gaps in ordinals.
11016            while _next_ordinal_to_read < 2 {
11017                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11018                _next_ordinal_to_read += 1;
11019                next_offset += envelope_size;
11020            }
11021
11022            let next_out_of_line = decoder.next_out_of_line();
11023            let handles_before = decoder.remaining_handles();
11024            if let Some((inlined, num_bytes, num_handles)) =
11025                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11026            {
11027                let member_inline_size =
11028                    <DeviceState as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11029                if inlined != (member_inline_size <= 4) {
11030                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11031                }
11032                let inner_offset;
11033                let mut inner_depth = depth.clone();
11034                if inlined {
11035                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11036                    inner_offset = next_offset;
11037                } else {
11038                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11039                    inner_depth.increment()?;
11040                }
11041                let val_ref = self.state.get_or_insert_with(|| fidl::new_empty!(DeviceState, D));
11042                fidl::decode!(DeviceState, D, val_ref, decoder, inner_offset, inner_depth)?;
11043                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11044                {
11045                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11046                }
11047                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11048                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11049                }
11050            }
11051
11052            next_offset += envelope_size;
11053
11054            // Decode the remaining unknown envelopes.
11055            while next_offset < end_offset {
11056                _next_ordinal_to_read += 1;
11057                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11058                next_offset += envelope_size;
11059            }
11060
11061            Ok(())
11062        }
11063    }
11064
11065    impl Theme {
11066        #[inline(always)]
11067        fn max_ordinal_present(&self) -> u64 {
11068            if let Some(_) = self.theme_mode {
11069                return 2;
11070            }
11071            if let Some(_) = self.theme_type {
11072                return 1;
11073            }
11074            0
11075        }
11076    }
11077
11078    impl fidl::encoding::ValueTypeMarker for Theme {
11079        type Borrowed<'a> = &'a Self;
11080        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11081            value
11082        }
11083    }
11084
11085    unsafe impl fidl::encoding::TypeMarker for Theme {
11086        type Owned = Self;
11087
11088        #[inline(always)]
11089        fn inline_align(_context: fidl::encoding::Context) -> usize {
11090            8
11091        }
11092
11093        #[inline(always)]
11094        fn inline_size(_context: fidl::encoding::Context) -> usize {
11095            16
11096        }
11097    }
11098
11099    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Theme, D> for &Theme {
11100        unsafe fn encode(
11101            self,
11102            encoder: &mut fidl::encoding::Encoder<'_, D>,
11103            offset: usize,
11104            mut depth: fidl::encoding::Depth,
11105        ) -> fidl::Result<()> {
11106            encoder.debug_check_bounds::<Theme>(offset);
11107            // Vector header
11108            let max_ordinal: u64 = self.max_ordinal_present();
11109            encoder.write_num(max_ordinal, offset);
11110            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11111            // Calling encoder.out_of_line_offset(0) is not allowed.
11112            if max_ordinal == 0 {
11113                return Ok(());
11114            }
11115            depth.increment()?;
11116            let envelope_size = 8;
11117            let bytes_len = max_ordinal as usize * envelope_size;
11118            #[allow(unused_variables)]
11119            let offset = encoder.out_of_line_offset(bytes_len);
11120            let mut _prev_end_offset: usize = 0;
11121            if 1 > max_ordinal {
11122                return Ok(());
11123            }
11124
11125            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11126            // are envelope_size bytes.
11127            let cur_offset: usize = (1 - 1) * envelope_size;
11128
11129            // Zero reserved fields.
11130            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11131
11132            // Safety:
11133            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11134            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11135            //   envelope_size bytes, there is always sufficient room.
11136            fidl::encoding::encode_in_envelope_optional::<ThemeType, D>(
11137                self.theme_type
11138                    .as_ref()
11139                    .map(<ThemeType as fidl::encoding::ValueTypeMarker>::borrow),
11140                encoder,
11141                offset + cur_offset,
11142                depth,
11143            )?;
11144
11145            _prev_end_offset = cur_offset + envelope_size;
11146            if 2 > max_ordinal {
11147                return Ok(());
11148            }
11149
11150            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11151            // are envelope_size bytes.
11152            let cur_offset: usize = (2 - 1) * envelope_size;
11153
11154            // Zero reserved fields.
11155            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11156
11157            // Safety:
11158            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11159            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11160            //   envelope_size bytes, there is always sufficient room.
11161            fidl::encoding::encode_in_envelope_optional::<ThemeMode, D>(
11162                self.theme_mode
11163                    .as_ref()
11164                    .map(<ThemeMode as fidl::encoding::ValueTypeMarker>::borrow),
11165                encoder,
11166                offset + cur_offset,
11167                depth,
11168            )?;
11169
11170            _prev_end_offset = cur_offset + envelope_size;
11171
11172            Ok(())
11173        }
11174    }
11175
11176    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Theme {
11177        #[inline(always)]
11178        fn new_empty() -> Self {
11179            Self::default()
11180        }
11181
11182        unsafe fn decode(
11183            &mut self,
11184            decoder: &mut fidl::encoding::Decoder<'_, D>,
11185            offset: usize,
11186            mut depth: fidl::encoding::Depth,
11187        ) -> fidl::Result<()> {
11188            decoder.debug_check_bounds::<Self>(offset);
11189            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11190                None => return Err(fidl::Error::NotNullable),
11191                Some(len) => len,
11192            };
11193            // Calling decoder.out_of_line_offset(0) is not allowed.
11194            if len == 0 {
11195                return Ok(());
11196            };
11197            depth.increment()?;
11198            let envelope_size = 8;
11199            let bytes_len = len * envelope_size;
11200            let offset = decoder.out_of_line_offset(bytes_len)?;
11201            // Decode the envelope for each type.
11202            let mut _next_ordinal_to_read = 0;
11203            let mut next_offset = offset;
11204            let end_offset = offset + bytes_len;
11205            _next_ordinal_to_read += 1;
11206            if next_offset >= end_offset {
11207                return Ok(());
11208            }
11209
11210            // Decode unknown envelopes for gaps in ordinals.
11211            while _next_ordinal_to_read < 1 {
11212                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11213                _next_ordinal_to_read += 1;
11214                next_offset += envelope_size;
11215            }
11216
11217            let next_out_of_line = decoder.next_out_of_line();
11218            let handles_before = decoder.remaining_handles();
11219            if let Some((inlined, num_bytes, num_handles)) =
11220                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11221            {
11222                let member_inline_size =
11223                    <ThemeType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11224                if inlined != (member_inline_size <= 4) {
11225                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11226                }
11227                let inner_offset;
11228                let mut inner_depth = depth.clone();
11229                if inlined {
11230                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11231                    inner_offset = next_offset;
11232                } else {
11233                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11234                    inner_depth.increment()?;
11235                }
11236                let val_ref = self.theme_type.get_or_insert_with(|| fidl::new_empty!(ThemeType, D));
11237                fidl::decode!(ThemeType, D, val_ref, decoder, inner_offset, inner_depth)?;
11238                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11239                {
11240                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11241                }
11242                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11243                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11244                }
11245            }
11246
11247            next_offset += envelope_size;
11248            _next_ordinal_to_read += 1;
11249            if next_offset >= end_offset {
11250                return Ok(());
11251            }
11252
11253            // Decode unknown envelopes for gaps in ordinals.
11254            while _next_ordinal_to_read < 2 {
11255                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11256                _next_ordinal_to_read += 1;
11257                next_offset += envelope_size;
11258            }
11259
11260            let next_out_of_line = decoder.next_out_of_line();
11261            let handles_before = decoder.remaining_handles();
11262            if let Some((inlined, num_bytes, num_handles)) =
11263                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11264            {
11265                let member_inline_size =
11266                    <ThemeMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11267                if inlined != (member_inline_size <= 4) {
11268                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11269                }
11270                let inner_offset;
11271                let mut inner_depth = depth.clone();
11272                if inlined {
11273                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11274                    inner_offset = next_offset;
11275                } else {
11276                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11277                    inner_depth.increment()?;
11278                }
11279                let val_ref = self.theme_mode.get_or_insert_with(|| fidl::new_empty!(ThemeMode, D));
11280                fidl::decode!(ThemeMode, D, val_ref, decoder, inner_offset, inner_depth)?;
11281                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11282                {
11283                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11284                }
11285                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11286                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11287                }
11288            }
11289
11290            next_offset += envelope_size;
11291
11292            // Decode the remaining unknown envelopes.
11293            while next_offset < end_offset {
11294                _next_ordinal_to_read += 1;
11295                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11296                next_offset += envelope_size;
11297            }
11298
11299            Ok(())
11300        }
11301    }
11302
11303    impl Volume {
11304        #[inline(always)]
11305        fn max_ordinal_present(&self) -> u64 {
11306            if let Some(_) = self.muted {
11307                return 2;
11308            }
11309            if let Some(_) = self.level {
11310                return 1;
11311            }
11312            0
11313        }
11314    }
11315
11316    impl fidl::encoding::ValueTypeMarker for Volume {
11317        type Borrowed<'a> = &'a Self;
11318        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11319            value
11320        }
11321    }
11322
11323    unsafe impl fidl::encoding::TypeMarker for Volume {
11324        type Owned = Self;
11325
11326        #[inline(always)]
11327        fn inline_align(_context: fidl::encoding::Context) -> usize {
11328            8
11329        }
11330
11331        #[inline(always)]
11332        fn inline_size(_context: fidl::encoding::Context) -> usize {
11333            16
11334        }
11335    }
11336
11337    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Volume, D> for &Volume {
11338        unsafe fn encode(
11339            self,
11340            encoder: &mut fidl::encoding::Encoder<'_, D>,
11341            offset: usize,
11342            mut depth: fidl::encoding::Depth,
11343        ) -> fidl::Result<()> {
11344            encoder.debug_check_bounds::<Volume>(offset);
11345            // Vector header
11346            let max_ordinal: u64 = self.max_ordinal_present();
11347            encoder.write_num(max_ordinal, offset);
11348            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11349            // Calling encoder.out_of_line_offset(0) is not allowed.
11350            if max_ordinal == 0 {
11351                return Ok(());
11352            }
11353            depth.increment()?;
11354            let envelope_size = 8;
11355            let bytes_len = max_ordinal as usize * envelope_size;
11356            #[allow(unused_variables)]
11357            let offset = encoder.out_of_line_offset(bytes_len);
11358            let mut _prev_end_offset: usize = 0;
11359            if 1 > max_ordinal {
11360                return Ok(());
11361            }
11362
11363            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11364            // are envelope_size bytes.
11365            let cur_offset: usize = (1 - 1) * envelope_size;
11366
11367            // Zero reserved fields.
11368            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11369
11370            // Safety:
11371            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11372            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11373            //   envelope_size bytes, there is always sufficient room.
11374            fidl::encoding::encode_in_envelope_optional::<f32, D>(
11375                self.level.as_ref().map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
11376                encoder,
11377                offset + cur_offset,
11378                depth,
11379            )?;
11380
11381            _prev_end_offset = cur_offset + envelope_size;
11382            if 2 > max_ordinal {
11383                return Ok(());
11384            }
11385
11386            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11387            // are envelope_size bytes.
11388            let cur_offset: usize = (2 - 1) * envelope_size;
11389
11390            // Zero reserved fields.
11391            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11392
11393            // Safety:
11394            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11395            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11396            //   envelope_size bytes, there is always sufficient room.
11397            fidl::encoding::encode_in_envelope_optional::<bool, D>(
11398                self.muted.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
11399                encoder,
11400                offset + cur_offset,
11401                depth,
11402            )?;
11403
11404            _prev_end_offset = cur_offset + envelope_size;
11405
11406            Ok(())
11407        }
11408    }
11409
11410    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Volume {
11411        #[inline(always)]
11412        fn new_empty() -> Self {
11413            Self::default()
11414        }
11415
11416        unsafe fn decode(
11417            &mut self,
11418            decoder: &mut fidl::encoding::Decoder<'_, D>,
11419            offset: usize,
11420            mut depth: fidl::encoding::Depth,
11421        ) -> fidl::Result<()> {
11422            decoder.debug_check_bounds::<Self>(offset);
11423            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11424                None => return Err(fidl::Error::NotNullable),
11425                Some(len) => len,
11426            };
11427            // Calling decoder.out_of_line_offset(0) is not allowed.
11428            if len == 0 {
11429                return Ok(());
11430            };
11431            depth.increment()?;
11432            let envelope_size = 8;
11433            let bytes_len = len * envelope_size;
11434            let offset = decoder.out_of_line_offset(bytes_len)?;
11435            // Decode the envelope for each type.
11436            let mut _next_ordinal_to_read = 0;
11437            let mut next_offset = offset;
11438            let end_offset = offset + bytes_len;
11439            _next_ordinal_to_read += 1;
11440            if next_offset >= end_offset {
11441                return Ok(());
11442            }
11443
11444            // Decode unknown envelopes for gaps in ordinals.
11445            while _next_ordinal_to_read < 1 {
11446                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11447                _next_ordinal_to_read += 1;
11448                next_offset += envelope_size;
11449            }
11450
11451            let next_out_of_line = decoder.next_out_of_line();
11452            let handles_before = decoder.remaining_handles();
11453            if let Some((inlined, num_bytes, num_handles)) =
11454                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11455            {
11456                let member_inline_size =
11457                    <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11458                if inlined != (member_inline_size <= 4) {
11459                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11460                }
11461                let inner_offset;
11462                let mut inner_depth = depth.clone();
11463                if inlined {
11464                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11465                    inner_offset = next_offset;
11466                } else {
11467                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11468                    inner_depth.increment()?;
11469                }
11470                let val_ref = self.level.get_or_insert_with(|| fidl::new_empty!(f32, D));
11471                fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
11472                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11473                {
11474                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11475                }
11476                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11477                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11478                }
11479            }
11480
11481            next_offset += envelope_size;
11482            _next_ordinal_to_read += 1;
11483            if next_offset >= end_offset {
11484                return Ok(());
11485            }
11486
11487            // Decode unknown envelopes for gaps in ordinals.
11488            while _next_ordinal_to_read < 2 {
11489                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11490                _next_ordinal_to_read += 1;
11491                next_offset += envelope_size;
11492            }
11493
11494            let next_out_of_line = decoder.next_out_of_line();
11495            let handles_before = decoder.remaining_handles();
11496            if let Some((inlined, num_bytes, num_handles)) =
11497                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11498            {
11499                let member_inline_size =
11500                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11501                if inlined != (member_inline_size <= 4) {
11502                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11503                }
11504                let inner_offset;
11505                let mut inner_depth = depth.clone();
11506                if inlined {
11507                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11508                    inner_offset = next_offset;
11509                } else {
11510                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11511                    inner_depth.increment()?;
11512                }
11513                let val_ref = self.muted.get_or_insert_with(|| fidl::new_empty!(bool, D));
11514                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
11515                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11516                {
11517                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11518                }
11519                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11520                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11521                }
11522            }
11523
11524            next_offset += envelope_size;
11525
11526            // Decode the remaining unknown envelopes.
11527            while next_offset < end_offset {
11528                _next_ordinal_to_read += 1;
11529                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11530                next_offset += envelope_size;
11531            }
11532
11533            Ok(())
11534        }
11535    }
11536
11537    impl fidl::encoding::ValueTypeMarker for LightValue {
11538        type Borrowed<'a> = &'a Self;
11539        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11540            value
11541        }
11542    }
11543
11544    unsafe impl fidl::encoding::TypeMarker for LightValue {
11545        type Owned = Self;
11546
11547        #[inline(always)]
11548        fn inline_align(_context: fidl::encoding::Context) -> usize {
11549            8
11550        }
11551
11552        #[inline(always)]
11553        fn inline_size(_context: fidl::encoding::Context) -> usize {
11554            16
11555        }
11556    }
11557
11558    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightValue, D>
11559        for &LightValue
11560    {
11561        #[inline]
11562        unsafe fn encode(
11563            self,
11564            encoder: &mut fidl::encoding::Encoder<'_, D>,
11565            offset: usize,
11566            _depth: fidl::encoding::Depth,
11567        ) -> fidl::Result<()> {
11568            encoder.debug_check_bounds::<LightValue>(offset);
11569            encoder.write_num::<u64>(self.ordinal(), offset);
11570            match self {
11571            LightValue::On(ref val) => {
11572                fidl::encoding::encode_in_envelope::<bool, D>(
11573                    <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
11574                    encoder, offset + 8, _depth
11575                )
11576            }
11577            LightValue::Brightness(ref val) => {
11578                fidl::encoding::encode_in_envelope::<f64, D>(
11579                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(val),
11580                    encoder, offset + 8, _depth
11581                )
11582            }
11583            LightValue::Color(ref val) => {
11584                fidl::encoding::encode_in_envelope::<fidl_fuchsia_ui_types__common::ColorRgb, D>(
11585                    <fidl_fuchsia_ui_types__common::ColorRgb as fidl::encoding::ValueTypeMarker>::borrow(val),
11586                    encoder, offset + 8, _depth
11587                )
11588            }
11589        }
11590        }
11591    }
11592
11593    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightValue {
11594        #[inline(always)]
11595        fn new_empty() -> Self {
11596            Self::On(fidl::new_empty!(bool, D))
11597        }
11598
11599        #[inline]
11600        unsafe fn decode(
11601            &mut self,
11602            decoder: &mut fidl::encoding::Decoder<'_, D>,
11603            offset: usize,
11604            mut depth: fidl::encoding::Depth,
11605        ) -> fidl::Result<()> {
11606            decoder.debug_check_bounds::<Self>(offset);
11607            #[allow(unused_variables)]
11608            let next_out_of_line = decoder.next_out_of_line();
11609            let handles_before = decoder.remaining_handles();
11610            let (ordinal, inlined, num_bytes, num_handles) =
11611                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
11612
11613            let member_inline_size = match ordinal {
11614            1 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11615            2 => <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11616            3 => <fidl_fuchsia_ui_types__common::ColorRgb as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11617            _ => return Err(fidl::Error::UnknownUnionTag),
11618        };
11619
11620            if inlined != (member_inline_size <= 4) {
11621                return Err(fidl::Error::InvalidInlineBitInEnvelope);
11622            }
11623            let _inner_offset;
11624            if inlined {
11625                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
11626                _inner_offset = offset + 8;
11627            } else {
11628                depth.increment()?;
11629                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11630            }
11631            match ordinal {
11632                1 => {
11633                    #[allow(irrefutable_let_patterns)]
11634                    if let LightValue::On(_) = self {
11635                        // Do nothing, read the value into the object
11636                    } else {
11637                        // Initialize `self` to the right variant
11638                        *self = LightValue::On(fidl::new_empty!(bool, D));
11639                    }
11640                    #[allow(irrefutable_let_patterns)]
11641                    if let LightValue::On(ref mut val) = self {
11642                        fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
11643                    } else {
11644                        unreachable!()
11645                    }
11646                }
11647                2 => {
11648                    #[allow(irrefutable_let_patterns)]
11649                    if let LightValue::Brightness(_) = self {
11650                        // Do nothing, read the value into the object
11651                    } else {
11652                        // Initialize `self` to the right variant
11653                        *self = LightValue::Brightness(fidl::new_empty!(f64, D));
11654                    }
11655                    #[allow(irrefutable_let_patterns)]
11656                    if let LightValue::Brightness(ref mut val) = self {
11657                        fidl::decode!(f64, D, val, decoder, _inner_offset, depth)?;
11658                    } else {
11659                        unreachable!()
11660                    }
11661                }
11662                3 => {
11663                    #[allow(irrefutable_let_patterns)]
11664                    if let LightValue::Color(_) = self {
11665                        // Do nothing, read the value into the object
11666                    } else {
11667                        // Initialize `self` to the right variant
11668                        *self = LightValue::Color(fidl::new_empty!(
11669                            fidl_fuchsia_ui_types__common::ColorRgb,
11670                            D
11671                        ));
11672                    }
11673                    #[allow(irrefutable_let_patterns)]
11674                    if let LightValue::Color(ref mut val) = self {
11675                        fidl::decode!(
11676                            fidl_fuchsia_ui_types__common::ColorRgb,
11677                            D,
11678                            val,
11679                            decoder,
11680                            _inner_offset,
11681                            depth
11682                        )?;
11683                    } else {
11684                        unreachable!()
11685                    }
11686                }
11687                ordinal => panic!("unexpected ordinal {:?}", ordinal),
11688            }
11689            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
11690                return Err(fidl::Error::InvalidNumBytesInEnvelope);
11691            }
11692            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11693                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11694            }
11695            Ok(())
11696        }
11697    }
11698}