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