fidl_fuchsia_hardware_light__common/
fidl_fuchsia_hardware_light__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const LIGHT_NAME_LEN: u8 = 32;
12
13#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
14#[repr(u32)]
15pub enum Capability {
16    /// This capability indicates that the light supports setting brightness to a uint8_t value.
17    /// If this capability is not supported, the light only supports off and on state.
18    Brightness = 1,
19    /// This capability indicates that the light supports setting an RGB value.
20    Rgb = 2,
21    /// No capabilities
22    Simple = 3,
23}
24
25impl Capability {
26    #[inline]
27    pub fn from_primitive(prim: u32) -> Option<Self> {
28        match prim {
29            1 => Some(Self::Brightness),
30            2 => Some(Self::Rgb),
31            3 => Some(Self::Simple),
32            _ => None,
33        }
34    }
35
36    #[inline]
37    pub const fn into_primitive(self) -> u32 {
38        self as u32
39    }
40}
41
42#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
43#[repr(u32)]
44pub enum LightError {
45    Ok = 0,
46    NotSupported = 1,
47    InvalidIndex = 2,
48    Failed = 3,
49}
50
51impl LightError {
52    #[inline]
53    pub fn from_primitive(prim: u32) -> Option<Self> {
54        match prim {
55            0 => Some(Self::Ok),
56            1 => Some(Self::NotSupported),
57            2 => Some(Self::InvalidIndex),
58            3 => Some(Self::Failed),
59            _ => None,
60        }
61    }
62
63    #[inline]
64    pub const fn into_primitive(self) -> u32 {
65        self as u32
66    }
67}
68
69#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
70pub struct GroupInfo {
71    pub name: String,
72    pub count: u32,
73    pub capability: Capability,
74}
75
76impl fidl::Persistable for GroupInfo {}
77
78#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
79pub struct Info {
80    pub name: String,
81    pub capability: Capability,
82}
83
84impl fidl::Persistable for Info {}
85
86#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
87#[repr(C)]
88pub struct LightGetCurrentBrightnessValueRequest {
89    pub index: u32,
90}
91
92impl fidl::Persistable for LightGetCurrentBrightnessValueRequest {}
93
94#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
95#[repr(C)]
96pub struct LightGetCurrentRgbValueRequest {
97    pub index: u32,
98}
99
100impl fidl::Persistable for LightGetCurrentRgbValueRequest {}
101
102#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
103#[repr(C)]
104pub struct LightGetCurrentSimpleValueRequest {
105    pub index: u32,
106}
107
108impl fidl::Persistable for LightGetCurrentSimpleValueRequest {}
109
110#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
111#[repr(C)]
112pub struct LightGetGroupCurrentBrightnessValueRequest {
113    pub group_id: u32,
114}
115
116impl fidl::Persistable for LightGetGroupCurrentBrightnessValueRequest {}
117
118#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
119#[repr(C)]
120pub struct LightGetGroupCurrentRgbValueRequest {
121    pub group_id: u32,
122}
123
124impl fidl::Persistable for LightGetGroupCurrentRgbValueRequest {}
125
126#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
127#[repr(C)]
128pub struct LightGetGroupCurrentSimpleValueRequest {
129    pub group_id: u32,
130}
131
132impl fidl::Persistable for LightGetGroupCurrentSimpleValueRequest {}
133
134#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
135#[repr(C)]
136pub struct LightGetGroupInfoRequest {
137    pub group_id: u32,
138}
139
140impl fidl::Persistable for LightGetGroupInfoRequest {}
141
142#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
143#[repr(C)]
144pub struct LightGetInfoRequest {
145    pub index: u32,
146}
147
148impl fidl::Persistable for LightGetInfoRequest {}
149
150#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
151#[repr(C)]
152pub struct LightGetNumLightGroupsResponse {
153    pub count: u32,
154}
155
156impl fidl::Persistable for LightGetNumLightGroupsResponse {}
157
158#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
159#[repr(C)]
160pub struct LightGetNumLightsResponse {
161    pub count: u32,
162}
163
164impl fidl::Persistable for LightGetNumLightsResponse {}
165
166#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
167pub struct LightSetBrightnessValueRequest {
168    pub index: u32,
169    pub value: f64,
170}
171
172impl fidl::Persistable for LightSetBrightnessValueRequest {}
173
174#[derive(Clone, Debug, PartialEq, PartialOrd)]
175pub struct LightSetGroupBrightnessValueRequest {
176    pub group_id: u32,
177    pub values: Vec<f64>,
178}
179
180impl fidl::Persistable for LightSetGroupBrightnessValueRequest {}
181
182#[derive(Clone, Debug, PartialEq, PartialOrd)]
183pub struct LightSetGroupRgbValueRequest {
184    pub group_id: u32,
185    pub values: Vec<Rgb>,
186}
187
188impl fidl::Persistable for LightSetGroupRgbValueRequest {}
189
190#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
191pub struct LightSetGroupSimpleValueRequest {
192    pub group_id: u32,
193    pub values: Vec<bool>,
194}
195
196impl fidl::Persistable for LightSetGroupSimpleValueRequest {}
197
198#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
199pub struct LightSetRgbValueRequest {
200    pub index: u32,
201    pub value: Rgb,
202}
203
204impl fidl::Persistable for LightSetRgbValueRequest {}
205
206#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
207pub struct LightSetSimpleValueRequest {
208    pub index: u32,
209    pub value: bool,
210}
211
212impl fidl::Persistable for LightSetSimpleValueRequest {}
213
214#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
215pub struct LightGetCurrentBrightnessValueResponse {
216    pub value: f64,
217}
218
219impl fidl::Persistable for LightGetCurrentBrightnessValueResponse {}
220
221#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
222pub struct LightGetCurrentRgbValueResponse {
223    pub value: Rgb,
224}
225
226impl fidl::Persistable for LightGetCurrentRgbValueResponse {}
227
228#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
229pub struct LightGetCurrentSimpleValueResponse {
230    pub value: bool,
231}
232
233impl fidl::Persistable for LightGetCurrentSimpleValueResponse {}
234
235#[derive(Clone, Debug, PartialEq, PartialOrd)]
236pub struct LightGetGroupCurrentBrightnessValueResponse {
237    pub values: Option<Vec<f64>>,
238}
239
240impl fidl::Persistable for LightGetGroupCurrentBrightnessValueResponse {}
241
242#[derive(Clone, Debug, PartialEq, PartialOrd)]
243pub struct LightGetGroupCurrentRgbValueResponse {
244    pub values: Option<Vec<Rgb>>,
245}
246
247impl fidl::Persistable for LightGetGroupCurrentRgbValueResponse {}
248
249#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
250pub struct LightGetGroupCurrentSimpleValueResponse {
251    pub values: Option<Vec<bool>>,
252}
253
254impl fidl::Persistable for LightGetGroupCurrentSimpleValueResponse {}
255
256#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
257pub struct LightGetGroupInfoResponse {
258    pub info: GroupInfo,
259}
260
261impl fidl::Persistable for LightGetGroupInfoResponse {}
262
263#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
264pub struct LightGetInfoResponse {
265    pub info: Info,
266}
267
268impl fidl::Persistable for LightGetInfoResponse {}
269
270#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
271pub struct Rgb {
272    pub red: f64,
273    pub green: f64,
274    pub blue: f64,
275}
276
277impl fidl::Persistable for Rgb {}
278
279#[derive(Clone, Debug, Default, PartialEq)]
280pub struct Config {
281    pub name: Option<String>,
282    pub brightness: Option<bool>,
283    pub rgb: Option<bool>,
284    pub init_on: Option<bool>,
285    pub group_id: Option<i32>,
286    #[doc(hidden)]
287    pub __source_breaking: fidl::marker::SourceBreaking,
288}
289
290impl fidl::Persistable for Config {}
291
292#[derive(Clone, Debug, Default, PartialEq)]
293pub struct Metadata {
294    pub configs: Option<Vec<Config>>,
295    #[doc(hidden)]
296    pub __source_breaking: fidl::marker::SourceBreaking,
297}
298
299impl fidl::Persistable for Metadata {}
300impl fidl::Serializable for Metadata {
301    const SERIALIZABLE_NAME: &'static str = "fuchsia.hardware.light.Metadata";
302}
303
304pub mod light_ordinals {
305    pub const GET_NUM_LIGHTS: u64 = 0x7ae2bd2ef8062dbb;
306    pub const GET_NUM_LIGHT_GROUPS: u64 = 0x600895db5a7cbf0;
307    pub const GET_INFO: u64 = 0x4229b55c8c4bd529;
308    pub const GET_CURRENT_SIMPLE_VALUE: u64 = 0x183154896336c321;
309    pub const SET_SIMPLE_VALUE: u64 = 0x4fb33d84c1aad81d;
310    pub const GET_CURRENT_BRIGHTNESS_VALUE: u64 = 0x2d387e129fe84809;
311    pub const SET_BRIGHTNESS_VALUE: u64 = 0x17cada93c7c48661;
312    pub const GET_CURRENT_RGB_VALUE: u64 = 0x49965ac0d920f4ad;
313    pub const SET_RGB_VALUE: u64 = 0x2b354d18be0b70a4;
314    pub const GET_GROUP_INFO: u64 = 0x5b27b0ca755b470b;
315    pub const GET_GROUP_CURRENT_SIMPLE_VALUE: u64 = 0x659d9bdb5cc2201;
316    pub const SET_GROUP_SIMPLE_VALUE: u64 = 0x924234e74cc6dd8;
317    pub const GET_GROUP_CURRENT_BRIGHTNESS_VALUE: u64 = 0x3ab226120b0d0362;
318    pub const SET_GROUP_BRIGHTNESS_VALUE: u64 = 0x79e5f248fc5ec7ae;
319    pub const GET_GROUP_CURRENT_RGB_VALUE: u64 = 0x2a6014b41254f617;
320    pub const SET_GROUP_RGB_VALUE: u64 = 0x33c92316f251e4e4;
321}
322
323mod internal {
324    use super::*;
325    unsafe impl fidl::encoding::TypeMarker for Capability {
326        type Owned = Self;
327
328        #[inline(always)]
329        fn inline_align(_context: fidl::encoding::Context) -> usize {
330            std::mem::align_of::<u32>()
331        }
332
333        #[inline(always)]
334        fn inline_size(_context: fidl::encoding::Context) -> usize {
335            std::mem::size_of::<u32>()
336        }
337
338        #[inline(always)]
339        fn encode_is_copy() -> bool {
340            true
341        }
342
343        #[inline(always)]
344        fn decode_is_copy() -> bool {
345            false
346        }
347    }
348
349    impl fidl::encoding::ValueTypeMarker for Capability {
350        type Borrowed<'a> = Self;
351        #[inline(always)]
352        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
353            *value
354        }
355    }
356
357    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Capability {
358        #[inline]
359        unsafe fn encode(
360            self,
361            encoder: &mut fidl::encoding::Encoder<'_, D>,
362            offset: usize,
363            _depth: fidl::encoding::Depth,
364        ) -> fidl::Result<()> {
365            encoder.debug_check_bounds::<Self>(offset);
366            encoder.write_num(self.into_primitive(), offset);
367            Ok(())
368        }
369    }
370
371    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Capability {
372        #[inline(always)]
373        fn new_empty() -> Self {
374            Self::Brightness
375        }
376
377        #[inline]
378        unsafe fn decode(
379            &mut self,
380            decoder: &mut fidl::encoding::Decoder<'_, D>,
381            offset: usize,
382            _depth: fidl::encoding::Depth,
383        ) -> fidl::Result<()> {
384            decoder.debug_check_bounds::<Self>(offset);
385            let prim = decoder.read_num::<u32>(offset);
386
387            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
388            Ok(())
389        }
390    }
391    unsafe impl fidl::encoding::TypeMarker for LightError {
392        type Owned = Self;
393
394        #[inline(always)]
395        fn inline_align(_context: fidl::encoding::Context) -> usize {
396            std::mem::align_of::<u32>()
397        }
398
399        #[inline(always)]
400        fn inline_size(_context: fidl::encoding::Context) -> usize {
401            std::mem::size_of::<u32>()
402        }
403
404        #[inline(always)]
405        fn encode_is_copy() -> bool {
406            true
407        }
408
409        #[inline(always)]
410        fn decode_is_copy() -> bool {
411            false
412        }
413    }
414
415    impl fidl::encoding::ValueTypeMarker for LightError {
416        type Borrowed<'a> = Self;
417        #[inline(always)]
418        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
419            *value
420        }
421    }
422
423    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for LightError {
424        #[inline]
425        unsafe fn encode(
426            self,
427            encoder: &mut fidl::encoding::Encoder<'_, D>,
428            offset: usize,
429            _depth: fidl::encoding::Depth,
430        ) -> fidl::Result<()> {
431            encoder.debug_check_bounds::<Self>(offset);
432            encoder.write_num(self.into_primitive(), offset);
433            Ok(())
434        }
435    }
436
437    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightError {
438        #[inline(always)]
439        fn new_empty() -> Self {
440            Self::Ok
441        }
442
443        #[inline]
444        unsafe fn decode(
445            &mut self,
446            decoder: &mut fidl::encoding::Decoder<'_, D>,
447            offset: usize,
448            _depth: fidl::encoding::Depth,
449        ) -> fidl::Result<()> {
450            decoder.debug_check_bounds::<Self>(offset);
451            let prim = decoder.read_num::<u32>(offset);
452
453            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
454            Ok(())
455        }
456    }
457
458    impl fidl::encoding::ValueTypeMarker for GroupInfo {
459        type Borrowed<'a> = &'a Self;
460        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
461            value
462        }
463    }
464
465    unsafe impl fidl::encoding::TypeMarker for GroupInfo {
466        type Owned = Self;
467
468        #[inline(always)]
469        fn inline_align(_context: fidl::encoding::Context) -> usize {
470            8
471        }
472
473        #[inline(always)]
474        fn inline_size(_context: fidl::encoding::Context) -> usize {
475            24
476        }
477    }
478
479    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<GroupInfo, D>
480        for &GroupInfo
481    {
482        #[inline]
483        unsafe fn encode(
484            self,
485            encoder: &mut fidl::encoding::Encoder<'_, D>,
486            offset: usize,
487            _depth: fidl::encoding::Depth,
488        ) -> fidl::Result<()> {
489            encoder.debug_check_bounds::<GroupInfo>(offset);
490            // Delegate to tuple encoding.
491            fidl::encoding::Encode::<GroupInfo, D>::encode(
492                (
493                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
494                        &self.name,
495                    ),
496                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.count),
497                    <Capability as fidl::encoding::ValueTypeMarker>::borrow(&self.capability),
498                ),
499                encoder,
500                offset,
501                _depth,
502            )
503        }
504    }
505    unsafe impl<
506            D: fidl::encoding::ResourceDialect,
507            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
508            T1: fidl::encoding::Encode<u32, D>,
509            T2: fidl::encoding::Encode<Capability, D>,
510        > fidl::encoding::Encode<GroupInfo, D> for (T0, T1, T2)
511    {
512        #[inline]
513        unsafe fn encode(
514            self,
515            encoder: &mut fidl::encoding::Encoder<'_, D>,
516            offset: usize,
517            depth: fidl::encoding::Depth,
518        ) -> fidl::Result<()> {
519            encoder.debug_check_bounds::<GroupInfo>(offset);
520            // Zero out padding regions. There's no need to apply masks
521            // because the unmasked parts will be overwritten by fields.
522            // Write the fields.
523            self.0.encode(encoder, offset + 0, depth)?;
524            self.1.encode(encoder, offset + 16, depth)?;
525            self.2.encode(encoder, offset + 20, depth)?;
526            Ok(())
527        }
528    }
529
530    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GroupInfo {
531        #[inline(always)]
532        fn new_empty() -> Self {
533            Self {
534                name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D),
535                count: fidl::new_empty!(u32, D),
536                capability: fidl::new_empty!(Capability, D),
537            }
538        }
539
540        #[inline]
541        unsafe fn decode(
542            &mut self,
543            decoder: &mut fidl::encoding::Decoder<'_, D>,
544            offset: usize,
545            _depth: fidl::encoding::Depth,
546        ) -> fidl::Result<()> {
547            decoder.debug_check_bounds::<Self>(offset);
548            // Verify that padding bytes are zero.
549            fidl::decode!(
550                fidl::encoding::BoundedString<32>,
551                D,
552                &mut self.name,
553                decoder,
554                offset + 0,
555                _depth
556            )?;
557            fidl::decode!(u32, D, &mut self.count, decoder, offset + 16, _depth)?;
558            fidl::decode!(Capability, D, &mut self.capability, decoder, offset + 20, _depth)?;
559            Ok(())
560        }
561    }
562
563    impl fidl::encoding::ValueTypeMarker for Info {
564        type Borrowed<'a> = &'a Self;
565        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
566            value
567        }
568    }
569
570    unsafe impl fidl::encoding::TypeMarker for Info {
571        type Owned = Self;
572
573        #[inline(always)]
574        fn inline_align(_context: fidl::encoding::Context) -> usize {
575            8
576        }
577
578        #[inline(always)]
579        fn inline_size(_context: fidl::encoding::Context) -> usize {
580            24
581        }
582    }
583
584    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Info, D> for &Info {
585        #[inline]
586        unsafe fn encode(
587            self,
588            encoder: &mut fidl::encoding::Encoder<'_, D>,
589            offset: usize,
590            _depth: fidl::encoding::Depth,
591        ) -> fidl::Result<()> {
592            encoder.debug_check_bounds::<Info>(offset);
593            // Delegate to tuple encoding.
594            fidl::encoding::Encode::<Info, D>::encode(
595                (
596                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
597                        &self.name,
598                    ),
599                    <Capability as fidl::encoding::ValueTypeMarker>::borrow(&self.capability),
600                ),
601                encoder,
602                offset,
603                _depth,
604            )
605        }
606    }
607    unsafe impl<
608            D: fidl::encoding::ResourceDialect,
609            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
610            T1: fidl::encoding::Encode<Capability, D>,
611        > fidl::encoding::Encode<Info, D> for (T0, T1)
612    {
613        #[inline]
614        unsafe fn encode(
615            self,
616            encoder: &mut fidl::encoding::Encoder<'_, D>,
617            offset: usize,
618            depth: fidl::encoding::Depth,
619        ) -> fidl::Result<()> {
620            encoder.debug_check_bounds::<Info>(offset);
621            // Zero out padding regions. There's no need to apply masks
622            // because the unmasked parts will be overwritten by fields.
623            unsafe {
624                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
625                (ptr as *mut u64).write_unaligned(0);
626            }
627            // Write the fields.
628            self.0.encode(encoder, offset + 0, depth)?;
629            self.1.encode(encoder, offset + 16, depth)?;
630            Ok(())
631        }
632    }
633
634    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Info {
635        #[inline(always)]
636        fn new_empty() -> Self {
637            Self {
638                name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D),
639                capability: fidl::new_empty!(Capability, D),
640            }
641        }
642
643        #[inline]
644        unsafe fn decode(
645            &mut self,
646            decoder: &mut fidl::encoding::Decoder<'_, D>,
647            offset: usize,
648            _depth: fidl::encoding::Depth,
649        ) -> fidl::Result<()> {
650            decoder.debug_check_bounds::<Self>(offset);
651            // Verify that padding bytes are zero.
652            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
653            let padval = unsafe { (ptr as *const u64).read_unaligned() };
654            let mask = 0xffffffff00000000u64;
655            let maskedval = padval & mask;
656            if maskedval != 0 {
657                return Err(fidl::Error::NonZeroPadding {
658                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
659                });
660            }
661            fidl::decode!(
662                fidl::encoding::BoundedString<32>,
663                D,
664                &mut self.name,
665                decoder,
666                offset + 0,
667                _depth
668            )?;
669            fidl::decode!(Capability, D, &mut self.capability, decoder, offset + 16, _depth)?;
670            Ok(())
671        }
672    }
673
674    impl fidl::encoding::ValueTypeMarker for LightGetCurrentBrightnessValueRequest {
675        type Borrowed<'a> = &'a Self;
676        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
677            value
678        }
679    }
680
681    unsafe impl fidl::encoding::TypeMarker for LightGetCurrentBrightnessValueRequest {
682        type Owned = Self;
683
684        #[inline(always)]
685        fn inline_align(_context: fidl::encoding::Context) -> usize {
686            4
687        }
688
689        #[inline(always)]
690        fn inline_size(_context: fidl::encoding::Context) -> usize {
691            4
692        }
693        #[inline(always)]
694        fn encode_is_copy() -> bool {
695            true
696        }
697
698        #[inline(always)]
699        fn decode_is_copy() -> bool {
700            true
701        }
702    }
703
704    unsafe impl<D: fidl::encoding::ResourceDialect>
705        fidl::encoding::Encode<LightGetCurrentBrightnessValueRequest, D>
706        for &LightGetCurrentBrightnessValueRequest
707    {
708        #[inline]
709        unsafe fn encode(
710            self,
711            encoder: &mut fidl::encoding::Encoder<'_, D>,
712            offset: usize,
713            _depth: fidl::encoding::Depth,
714        ) -> fidl::Result<()> {
715            encoder.debug_check_bounds::<LightGetCurrentBrightnessValueRequest>(offset);
716            unsafe {
717                // Copy the object into the buffer.
718                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
719                (buf_ptr as *mut LightGetCurrentBrightnessValueRequest)
720                    .write_unaligned((self as *const LightGetCurrentBrightnessValueRequest).read());
721                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
722                // done second because the memcpy will write garbage to these bytes.
723            }
724            Ok(())
725        }
726    }
727    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
728        fidl::encoding::Encode<LightGetCurrentBrightnessValueRequest, D> for (T0,)
729    {
730        #[inline]
731        unsafe fn encode(
732            self,
733            encoder: &mut fidl::encoding::Encoder<'_, D>,
734            offset: usize,
735            depth: fidl::encoding::Depth,
736        ) -> fidl::Result<()> {
737            encoder.debug_check_bounds::<LightGetCurrentBrightnessValueRequest>(offset);
738            // Zero out padding regions. There's no need to apply masks
739            // because the unmasked parts will be overwritten by fields.
740            // Write the fields.
741            self.0.encode(encoder, offset + 0, depth)?;
742            Ok(())
743        }
744    }
745
746    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
747        for LightGetCurrentBrightnessValueRequest
748    {
749        #[inline(always)]
750        fn new_empty() -> Self {
751            Self { index: fidl::new_empty!(u32, D) }
752        }
753
754        #[inline]
755        unsafe fn decode(
756            &mut self,
757            decoder: &mut fidl::encoding::Decoder<'_, D>,
758            offset: usize,
759            _depth: fidl::encoding::Depth,
760        ) -> fidl::Result<()> {
761            decoder.debug_check_bounds::<Self>(offset);
762            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
763            // Verify that padding bytes are zero.
764            // Copy from the buffer into the object.
765            unsafe {
766                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
767            }
768            Ok(())
769        }
770    }
771
772    impl fidl::encoding::ValueTypeMarker for LightGetCurrentRgbValueRequest {
773        type Borrowed<'a> = &'a Self;
774        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
775            value
776        }
777    }
778
779    unsafe impl fidl::encoding::TypeMarker for LightGetCurrentRgbValueRequest {
780        type Owned = Self;
781
782        #[inline(always)]
783        fn inline_align(_context: fidl::encoding::Context) -> usize {
784            4
785        }
786
787        #[inline(always)]
788        fn inline_size(_context: fidl::encoding::Context) -> usize {
789            4
790        }
791        #[inline(always)]
792        fn encode_is_copy() -> bool {
793            true
794        }
795
796        #[inline(always)]
797        fn decode_is_copy() -> bool {
798            true
799        }
800    }
801
802    unsafe impl<D: fidl::encoding::ResourceDialect>
803        fidl::encoding::Encode<LightGetCurrentRgbValueRequest, D>
804        for &LightGetCurrentRgbValueRequest
805    {
806        #[inline]
807        unsafe fn encode(
808            self,
809            encoder: &mut fidl::encoding::Encoder<'_, D>,
810            offset: usize,
811            _depth: fidl::encoding::Depth,
812        ) -> fidl::Result<()> {
813            encoder.debug_check_bounds::<LightGetCurrentRgbValueRequest>(offset);
814            unsafe {
815                // Copy the object into the buffer.
816                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
817                (buf_ptr as *mut LightGetCurrentRgbValueRequest)
818                    .write_unaligned((self as *const LightGetCurrentRgbValueRequest).read());
819                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
820                // done second because the memcpy will write garbage to these bytes.
821            }
822            Ok(())
823        }
824    }
825    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
826        fidl::encoding::Encode<LightGetCurrentRgbValueRequest, D> for (T0,)
827    {
828        #[inline]
829        unsafe fn encode(
830            self,
831            encoder: &mut fidl::encoding::Encoder<'_, D>,
832            offset: usize,
833            depth: fidl::encoding::Depth,
834        ) -> fidl::Result<()> {
835            encoder.debug_check_bounds::<LightGetCurrentRgbValueRequest>(offset);
836            // Zero out padding regions. There's no need to apply masks
837            // because the unmasked parts will be overwritten by fields.
838            // Write the fields.
839            self.0.encode(encoder, offset + 0, depth)?;
840            Ok(())
841        }
842    }
843
844    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
845        for LightGetCurrentRgbValueRequest
846    {
847        #[inline(always)]
848        fn new_empty() -> Self {
849            Self { index: fidl::new_empty!(u32, D) }
850        }
851
852        #[inline]
853        unsafe fn decode(
854            &mut self,
855            decoder: &mut fidl::encoding::Decoder<'_, D>,
856            offset: usize,
857            _depth: fidl::encoding::Depth,
858        ) -> fidl::Result<()> {
859            decoder.debug_check_bounds::<Self>(offset);
860            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
861            // Verify that padding bytes are zero.
862            // Copy from the buffer into the object.
863            unsafe {
864                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
865            }
866            Ok(())
867        }
868    }
869
870    impl fidl::encoding::ValueTypeMarker for LightGetCurrentSimpleValueRequest {
871        type Borrowed<'a> = &'a Self;
872        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
873            value
874        }
875    }
876
877    unsafe impl fidl::encoding::TypeMarker for LightGetCurrentSimpleValueRequest {
878        type Owned = Self;
879
880        #[inline(always)]
881        fn inline_align(_context: fidl::encoding::Context) -> usize {
882            4
883        }
884
885        #[inline(always)]
886        fn inline_size(_context: fidl::encoding::Context) -> usize {
887            4
888        }
889        #[inline(always)]
890        fn encode_is_copy() -> bool {
891            true
892        }
893
894        #[inline(always)]
895        fn decode_is_copy() -> bool {
896            true
897        }
898    }
899
900    unsafe impl<D: fidl::encoding::ResourceDialect>
901        fidl::encoding::Encode<LightGetCurrentSimpleValueRequest, D>
902        for &LightGetCurrentSimpleValueRequest
903    {
904        #[inline]
905        unsafe fn encode(
906            self,
907            encoder: &mut fidl::encoding::Encoder<'_, D>,
908            offset: usize,
909            _depth: fidl::encoding::Depth,
910        ) -> fidl::Result<()> {
911            encoder.debug_check_bounds::<LightGetCurrentSimpleValueRequest>(offset);
912            unsafe {
913                // Copy the object into the buffer.
914                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
915                (buf_ptr as *mut LightGetCurrentSimpleValueRequest)
916                    .write_unaligned((self as *const LightGetCurrentSimpleValueRequest).read());
917                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
918                // done second because the memcpy will write garbage to these bytes.
919            }
920            Ok(())
921        }
922    }
923    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
924        fidl::encoding::Encode<LightGetCurrentSimpleValueRequest, D> for (T0,)
925    {
926        #[inline]
927        unsafe fn encode(
928            self,
929            encoder: &mut fidl::encoding::Encoder<'_, D>,
930            offset: usize,
931            depth: fidl::encoding::Depth,
932        ) -> fidl::Result<()> {
933            encoder.debug_check_bounds::<LightGetCurrentSimpleValueRequest>(offset);
934            // Zero out padding regions. There's no need to apply masks
935            // because the unmasked parts will be overwritten by fields.
936            // Write the fields.
937            self.0.encode(encoder, offset + 0, depth)?;
938            Ok(())
939        }
940    }
941
942    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
943        for LightGetCurrentSimpleValueRequest
944    {
945        #[inline(always)]
946        fn new_empty() -> Self {
947            Self { index: fidl::new_empty!(u32, D) }
948        }
949
950        #[inline]
951        unsafe fn decode(
952            &mut self,
953            decoder: &mut fidl::encoding::Decoder<'_, D>,
954            offset: usize,
955            _depth: fidl::encoding::Depth,
956        ) -> fidl::Result<()> {
957            decoder.debug_check_bounds::<Self>(offset);
958            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
959            // Verify that padding bytes are zero.
960            // Copy from the buffer into the object.
961            unsafe {
962                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
963            }
964            Ok(())
965        }
966    }
967
968    impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentBrightnessValueRequest {
969        type Borrowed<'a> = &'a Self;
970        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
971            value
972        }
973    }
974
975    unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentBrightnessValueRequest {
976        type Owned = Self;
977
978        #[inline(always)]
979        fn inline_align(_context: fidl::encoding::Context) -> usize {
980            4
981        }
982
983        #[inline(always)]
984        fn inline_size(_context: fidl::encoding::Context) -> usize {
985            4
986        }
987        #[inline(always)]
988        fn encode_is_copy() -> bool {
989            true
990        }
991
992        #[inline(always)]
993        fn decode_is_copy() -> bool {
994            true
995        }
996    }
997
998    unsafe impl<D: fidl::encoding::ResourceDialect>
999        fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueRequest, D>
1000        for &LightGetGroupCurrentBrightnessValueRequest
1001    {
1002        #[inline]
1003        unsafe fn encode(
1004            self,
1005            encoder: &mut fidl::encoding::Encoder<'_, D>,
1006            offset: usize,
1007            _depth: fidl::encoding::Depth,
1008        ) -> fidl::Result<()> {
1009            encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueRequest>(offset);
1010            unsafe {
1011                // Copy the object into the buffer.
1012                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1013                (buf_ptr as *mut LightGetGroupCurrentBrightnessValueRequest).write_unaligned(
1014                    (self as *const LightGetGroupCurrentBrightnessValueRequest).read(),
1015                );
1016                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1017                // done second because the memcpy will write garbage to these bytes.
1018            }
1019            Ok(())
1020        }
1021    }
1022    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1023        fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueRequest, D> for (T0,)
1024    {
1025        #[inline]
1026        unsafe fn encode(
1027            self,
1028            encoder: &mut fidl::encoding::Encoder<'_, D>,
1029            offset: usize,
1030            depth: fidl::encoding::Depth,
1031        ) -> fidl::Result<()> {
1032            encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueRequest>(offset);
1033            // Zero out padding regions. There's no need to apply masks
1034            // because the unmasked parts will be overwritten by fields.
1035            // Write the fields.
1036            self.0.encode(encoder, offset + 0, depth)?;
1037            Ok(())
1038        }
1039    }
1040
1041    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1042        for LightGetGroupCurrentBrightnessValueRequest
1043    {
1044        #[inline(always)]
1045        fn new_empty() -> Self {
1046            Self { group_id: fidl::new_empty!(u32, D) }
1047        }
1048
1049        #[inline]
1050        unsafe fn decode(
1051            &mut self,
1052            decoder: &mut fidl::encoding::Decoder<'_, D>,
1053            offset: usize,
1054            _depth: fidl::encoding::Depth,
1055        ) -> fidl::Result<()> {
1056            decoder.debug_check_bounds::<Self>(offset);
1057            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1058            // Verify that padding bytes are zero.
1059            // Copy from the buffer into the object.
1060            unsafe {
1061                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1062            }
1063            Ok(())
1064        }
1065    }
1066
1067    impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentRgbValueRequest {
1068        type Borrowed<'a> = &'a Self;
1069        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1070            value
1071        }
1072    }
1073
1074    unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentRgbValueRequest {
1075        type Owned = Self;
1076
1077        #[inline(always)]
1078        fn inline_align(_context: fidl::encoding::Context) -> usize {
1079            4
1080        }
1081
1082        #[inline(always)]
1083        fn inline_size(_context: fidl::encoding::Context) -> usize {
1084            4
1085        }
1086        #[inline(always)]
1087        fn encode_is_copy() -> bool {
1088            true
1089        }
1090
1091        #[inline(always)]
1092        fn decode_is_copy() -> bool {
1093            true
1094        }
1095    }
1096
1097    unsafe impl<D: fidl::encoding::ResourceDialect>
1098        fidl::encoding::Encode<LightGetGroupCurrentRgbValueRequest, D>
1099        for &LightGetGroupCurrentRgbValueRequest
1100    {
1101        #[inline]
1102        unsafe fn encode(
1103            self,
1104            encoder: &mut fidl::encoding::Encoder<'_, D>,
1105            offset: usize,
1106            _depth: fidl::encoding::Depth,
1107        ) -> fidl::Result<()> {
1108            encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueRequest>(offset);
1109            unsafe {
1110                // Copy the object into the buffer.
1111                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1112                (buf_ptr as *mut LightGetGroupCurrentRgbValueRequest)
1113                    .write_unaligned((self as *const LightGetGroupCurrentRgbValueRequest).read());
1114                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1115                // done second because the memcpy will write garbage to these bytes.
1116            }
1117            Ok(())
1118        }
1119    }
1120    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1121        fidl::encoding::Encode<LightGetGroupCurrentRgbValueRequest, D> for (T0,)
1122    {
1123        #[inline]
1124        unsafe fn encode(
1125            self,
1126            encoder: &mut fidl::encoding::Encoder<'_, D>,
1127            offset: usize,
1128            depth: fidl::encoding::Depth,
1129        ) -> fidl::Result<()> {
1130            encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueRequest>(offset);
1131            // Zero out padding regions. There's no need to apply masks
1132            // because the unmasked parts will be overwritten by fields.
1133            // Write the fields.
1134            self.0.encode(encoder, offset + 0, depth)?;
1135            Ok(())
1136        }
1137    }
1138
1139    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1140        for LightGetGroupCurrentRgbValueRequest
1141    {
1142        #[inline(always)]
1143        fn new_empty() -> Self {
1144            Self { group_id: fidl::new_empty!(u32, D) }
1145        }
1146
1147        #[inline]
1148        unsafe fn decode(
1149            &mut self,
1150            decoder: &mut fidl::encoding::Decoder<'_, D>,
1151            offset: usize,
1152            _depth: fidl::encoding::Depth,
1153        ) -> fidl::Result<()> {
1154            decoder.debug_check_bounds::<Self>(offset);
1155            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1156            // Verify that padding bytes are zero.
1157            // Copy from the buffer into the object.
1158            unsafe {
1159                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1160            }
1161            Ok(())
1162        }
1163    }
1164
1165    impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentSimpleValueRequest {
1166        type Borrowed<'a> = &'a Self;
1167        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1168            value
1169        }
1170    }
1171
1172    unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentSimpleValueRequest {
1173        type Owned = Self;
1174
1175        #[inline(always)]
1176        fn inline_align(_context: fidl::encoding::Context) -> usize {
1177            4
1178        }
1179
1180        #[inline(always)]
1181        fn inline_size(_context: fidl::encoding::Context) -> usize {
1182            4
1183        }
1184        #[inline(always)]
1185        fn encode_is_copy() -> bool {
1186            true
1187        }
1188
1189        #[inline(always)]
1190        fn decode_is_copy() -> bool {
1191            true
1192        }
1193    }
1194
1195    unsafe impl<D: fidl::encoding::ResourceDialect>
1196        fidl::encoding::Encode<LightGetGroupCurrentSimpleValueRequest, D>
1197        for &LightGetGroupCurrentSimpleValueRequest
1198    {
1199        #[inline]
1200        unsafe fn encode(
1201            self,
1202            encoder: &mut fidl::encoding::Encoder<'_, D>,
1203            offset: usize,
1204            _depth: fidl::encoding::Depth,
1205        ) -> fidl::Result<()> {
1206            encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueRequest>(offset);
1207            unsafe {
1208                // Copy the object into the buffer.
1209                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1210                (buf_ptr as *mut LightGetGroupCurrentSimpleValueRequest).write_unaligned(
1211                    (self as *const LightGetGroupCurrentSimpleValueRequest).read(),
1212                );
1213                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1214                // done second because the memcpy will write garbage to these bytes.
1215            }
1216            Ok(())
1217        }
1218    }
1219    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1220        fidl::encoding::Encode<LightGetGroupCurrentSimpleValueRequest, D> for (T0,)
1221    {
1222        #[inline]
1223        unsafe fn encode(
1224            self,
1225            encoder: &mut fidl::encoding::Encoder<'_, D>,
1226            offset: usize,
1227            depth: fidl::encoding::Depth,
1228        ) -> fidl::Result<()> {
1229            encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueRequest>(offset);
1230            // Zero out padding regions. There's no need to apply masks
1231            // because the unmasked parts will be overwritten by fields.
1232            // Write the fields.
1233            self.0.encode(encoder, offset + 0, depth)?;
1234            Ok(())
1235        }
1236    }
1237
1238    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1239        for LightGetGroupCurrentSimpleValueRequest
1240    {
1241        #[inline(always)]
1242        fn new_empty() -> Self {
1243            Self { group_id: fidl::new_empty!(u32, D) }
1244        }
1245
1246        #[inline]
1247        unsafe fn decode(
1248            &mut self,
1249            decoder: &mut fidl::encoding::Decoder<'_, D>,
1250            offset: usize,
1251            _depth: fidl::encoding::Depth,
1252        ) -> fidl::Result<()> {
1253            decoder.debug_check_bounds::<Self>(offset);
1254            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1255            // Verify that padding bytes are zero.
1256            // Copy from the buffer into the object.
1257            unsafe {
1258                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1259            }
1260            Ok(())
1261        }
1262    }
1263
1264    impl fidl::encoding::ValueTypeMarker for LightGetGroupInfoRequest {
1265        type Borrowed<'a> = &'a Self;
1266        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1267            value
1268        }
1269    }
1270
1271    unsafe impl fidl::encoding::TypeMarker for LightGetGroupInfoRequest {
1272        type Owned = Self;
1273
1274        #[inline(always)]
1275        fn inline_align(_context: fidl::encoding::Context) -> usize {
1276            4
1277        }
1278
1279        #[inline(always)]
1280        fn inline_size(_context: fidl::encoding::Context) -> usize {
1281            4
1282        }
1283        #[inline(always)]
1284        fn encode_is_copy() -> bool {
1285            true
1286        }
1287
1288        #[inline(always)]
1289        fn decode_is_copy() -> bool {
1290            true
1291        }
1292    }
1293
1294    unsafe impl<D: fidl::encoding::ResourceDialect>
1295        fidl::encoding::Encode<LightGetGroupInfoRequest, D> for &LightGetGroupInfoRequest
1296    {
1297        #[inline]
1298        unsafe fn encode(
1299            self,
1300            encoder: &mut fidl::encoding::Encoder<'_, D>,
1301            offset: usize,
1302            _depth: fidl::encoding::Depth,
1303        ) -> fidl::Result<()> {
1304            encoder.debug_check_bounds::<LightGetGroupInfoRequest>(offset);
1305            unsafe {
1306                // Copy the object into the buffer.
1307                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1308                (buf_ptr as *mut LightGetGroupInfoRequest)
1309                    .write_unaligned((self as *const LightGetGroupInfoRequest).read());
1310                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1311                // done second because the memcpy will write garbage to these bytes.
1312            }
1313            Ok(())
1314        }
1315    }
1316    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1317        fidl::encoding::Encode<LightGetGroupInfoRequest, D> for (T0,)
1318    {
1319        #[inline]
1320        unsafe fn encode(
1321            self,
1322            encoder: &mut fidl::encoding::Encoder<'_, D>,
1323            offset: usize,
1324            depth: fidl::encoding::Depth,
1325        ) -> fidl::Result<()> {
1326            encoder.debug_check_bounds::<LightGetGroupInfoRequest>(offset);
1327            // Zero out padding regions. There's no need to apply masks
1328            // because the unmasked parts will be overwritten by fields.
1329            // Write the fields.
1330            self.0.encode(encoder, offset + 0, depth)?;
1331            Ok(())
1332        }
1333    }
1334
1335    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1336        for LightGetGroupInfoRequest
1337    {
1338        #[inline(always)]
1339        fn new_empty() -> Self {
1340            Self { group_id: fidl::new_empty!(u32, D) }
1341        }
1342
1343        #[inline]
1344        unsafe fn decode(
1345            &mut self,
1346            decoder: &mut fidl::encoding::Decoder<'_, D>,
1347            offset: usize,
1348            _depth: fidl::encoding::Depth,
1349        ) -> fidl::Result<()> {
1350            decoder.debug_check_bounds::<Self>(offset);
1351            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1352            // Verify that padding bytes are zero.
1353            // Copy from the buffer into the object.
1354            unsafe {
1355                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1356            }
1357            Ok(())
1358        }
1359    }
1360
1361    impl fidl::encoding::ValueTypeMarker for LightGetInfoRequest {
1362        type Borrowed<'a> = &'a Self;
1363        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1364            value
1365        }
1366    }
1367
1368    unsafe impl fidl::encoding::TypeMarker for LightGetInfoRequest {
1369        type Owned = Self;
1370
1371        #[inline(always)]
1372        fn inline_align(_context: fidl::encoding::Context) -> usize {
1373            4
1374        }
1375
1376        #[inline(always)]
1377        fn inline_size(_context: fidl::encoding::Context) -> usize {
1378            4
1379        }
1380        #[inline(always)]
1381        fn encode_is_copy() -> bool {
1382            true
1383        }
1384
1385        #[inline(always)]
1386        fn decode_is_copy() -> bool {
1387            true
1388        }
1389    }
1390
1391    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightGetInfoRequest, D>
1392        for &LightGetInfoRequest
1393    {
1394        #[inline]
1395        unsafe fn encode(
1396            self,
1397            encoder: &mut fidl::encoding::Encoder<'_, D>,
1398            offset: usize,
1399            _depth: fidl::encoding::Depth,
1400        ) -> fidl::Result<()> {
1401            encoder.debug_check_bounds::<LightGetInfoRequest>(offset);
1402            unsafe {
1403                // Copy the object into the buffer.
1404                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1405                (buf_ptr as *mut LightGetInfoRequest)
1406                    .write_unaligned((self as *const LightGetInfoRequest).read());
1407                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1408                // done second because the memcpy will write garbage to these bytes.
1409            }
1410            Ok(())
1411        }
1412    }
1413    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1414        fidl::encoding::Encode<LightGetInfoRequest, D> for (T0,)
1415    {
1416        #[inline]
1417        unsafe fn encode(
1418            self,
1419            encoder: &mut fidl::encoding::Encoder<'_, D>,
1420            offset: usize,
1421            depth: fidl::encoding::Depth,
1422        ) -> fidl::Result<()> {
1423            encoder.debug_check_bounds::<LightGetInfoRequest>(offset);
1424            // Zero out padding regions. There's no need to apply masks
1425            // because the unmasked parts will be overwritten by fields.
1426            // Write the fields.
1427            self.0.encode(encoder, offset + 0, depth)?;
1428            Ok(())
1429        }
1430    }
1431
1432    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightGetInfoRequest {
1433        #[inline(always)]
1434        fn new_empty() -> Self {
1435            Self { index: fidl::new_empty!(u32, D) }
1436        }
1437
1438        #[inline]
1439        unsafe fn decode(
1440            &mut self,
1441            decoder: &mut fidl::encoding::Decoder<'_, D>,
1442            offset: usize,
1443            _depth: fidl::encoding::Depth,
1444        ) -> fidl::Result<()> {
1445            decoder.debug_check_bounds::<Self>(offset);
1446            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1447            // Verify that padding bytes are zero.
1448            // Copy from the buffer into the object.
1449            unsafe {
1450                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1451            }
1452            Ok(())
1453        }
1454    }
1455
1456    impl fidl::encoding::ValueTypeMarker for LightGetNumLightGroupsResponse {
1457        type Borrowed<'a> = &'a Self;
1458        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1459            value
1460        }
1461    }
1462
1463    unsafe impl fidl::encoding::TypeMarker for LightGetNumLightGroupsResponse {
1464        type Owned = Self;
1465
1466        #[inline(always)]
1467        fn inline_align(_context: fidl::encoding::Context) -> usize {
1468            4
1469        }
1470
1471        #[inline(always)]
1472        fn inline_size(_context: fidl::encoding::Context) -> usize {
1473            4
1474        }
1475        #[inline(always)]
1476        fn encode_is_copy() -> bool {
1477            true
1478        }
1479
1480        #[inline(always)]
1481        fn decode_is_copy() -> bool {
1482            true
1483        }
1484    }
1485
1486    unsafe impl<D: fidl::encoding::ResourceDialect>
1487        fidl::encoding::Encode<LightGetNumLightGroupsResponse, D>
1488        for &LightGetNumLightGroupsResponse
1489    {
1490        #[inline]
1491        unsafe fn encode(
1492            self,
1493            encoder: &mut fidl::encoding::Encoder<'_, D>,
1494            offset: usize,
1495            _depth: fidl::encoding::Depth,
1496        ) -> fidl::Result<()> {
1497            encoder.debug_check_bounds::<LightGetNumLightGroupsResponse>(offset);
1498            unsafe {
1499                // Copy the object into the buffer.
1500                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1501                (buf_ptr as *mut LightGetNumLightGroupsResponse)
1502                    .write_unaligned((self as *const LightGetNumLightGroupsResponse).read());
1503                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1504                // done second because the memcpy will write garbage to these bytes.
1505            }
1506            Ok(())
1507        }
1508    }
1509    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1510        fidl::encoding::Encode<LightGetNumLightGroupsResponse, D> for (T0,)
1511    {
1512        #[inline]
1513        unsafe fn encode(
1514            self,
1515            encoder: &mut fidl::encoding::Encoder<'_, D>,
1516            offset: usize,
1517            depth: fidl::encoding::Depth,
1518        ) -> fidl::Result<()> {
1519            encoder.debug_check_bounds::<LightGetNumLightGroupsResponse>(offset);
1520            // Zero out padding regions. There's no need to apply masks
1521            // because the unmasked parts will be overwritten by fields.
1522            // Write the fields.
1523            self.0.encode(encoder, offset + 0, depth)?;
1524            Ok(())
1525        }
1526    }
1527
1528    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1529        for LightGetNumLightGroupsResponse
1530    {
1531        #[inline(always)]
1532        fn new_empty() -> Self {
1533            Self { count: fidl::new_empty!(u32, D) }
1534        }
1535
1536        #[inline]
1537        unsafe fn decode(
1538            &mut self,
1539            decoder: &mut fidl::encoding::Decoder<'_, D>,
1540            offset: usize,
1541            _depth: fidl::encoding::Depth,
1542        ) -> fidl::Result<()> {
1543            decoder.debug_check_bounds::<Self>(offset);
1544            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1545            // Verify that padding bytes are zero.
1546            // Copy from the buffer into the object.
1547            unsafe {
1548                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1549            }
1550            Ok(())
1551        }
1552    }
1553
1554    impl fidl::encoding::ValueTypeMarker for LightGetNumLightsResponse {
1555        type Borrowed<'a> = &'a Self;
1556        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1557            value
1558        }
1559    }
1560
1561    unsafe impl fidl::encoding::TypeMarker for LightGetNumLightsResponse {
1562        type Owned = Self;
1563
1564        #[inline(always)]
1565        fn inline_align(_context: fidl::encoding::Context) -> usize {
1566            4
1567        }
1568
1569        #[inline(always)]
1570        fn inline_size(_context: fidl::encoding::Context) -> usize {
1571            4
1572        }
1573        #[inline(always)]
1574        fn encode_is_copy() -> bool {
1575            true
1576        }
1577
1578        #[inline(always)]
1579        fn decode_is_copy() -> bool {
1580            true
1581        }
1582    }
1583
1584    unsafe impl<D: fidl::encoding::ResourceDialect>
1585        fidl::encoding::Encode<LightGetNumLightsResponse, D> for &LightGetNumLightsResponse
1586    {
1587        #[inline]
1588        unsafe fn encode(
1589            self,
1590            encoder: &mut fidl::encoding::Encoder<'_, D>,
1591            offset: usize,
1592            _depth: fidl::encoding::Depth,
1593        ) -> fidl::Result<()> {
1594            encoder.debug_check_bounds::<LightGetNumLightsResponse>(offset);
1595            unsafe {
1596                // Copy the object into the buffer.
1597                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1598                (buf_ptr as *mut LightGetNumLightsResponse)
1599                    .write_unaligned((self as *const LightGetNumLightsResponse).read());
1600                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1601                // done second because the memcpy will write garbage to these bytes.
1602            }
1603            Ok(())
1604        }
1605    }
1606    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1607        fidl::encoding::Encode<LightGetNumLightsResponse, D> for (T0,)
1608    {
1609        #[inline]
1610        unsafe fn encode(
1611            self,
1612            encoder: &mut fidl::encoding::Encoder<'_, D>,
1613            offset: usize,
1614            depth: fidl::encoding::Depth,
1615        ) -> fidl::Result<()> {
1616            encoder.debug_check_bounds::<LightGetNumLightsResponse>(offset);
1617            // Zero out padding regions. There's no need to apply masks
1618            // because the unmasked parts will be overwritten by fields.
1619            // Write the fields.
1620            self.0.encode(encoder, offset + 0, depth)?;
1621            Ok(())
1622        }
1623    }
1624
1625    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1626        for LightGetNumLightsResponse
1627    {
1628        #[inline(always)]
1629        fn new_empty() -> Self {
1630            Self { count: fidl::new_empty!(u32, D) }
1631        }
1632
1633        #[inline]
1634        unsafe fn decode(
1635            &mut self,
1636            decoder: &mut fidl::encoding::Decoder<'_, D>,
1637            offset: usize,
1638            _depth: fidl::encoding::Depth,
1639        ) -> fidl::Result<()> {
1640            decoder.debug_check_bounds::<Self>(offset);
1641            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1642            // Verify that padding bytes are zero.
1643            // Copy from the buffer into the object.
1644            unsafe {
1645                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1646            }
1647            Ok(())
1648        }
1649    }
1650
1651    impl fidl::encoding::ValueTypeMarker for LightSetBrightnessValueRequest {
1652        type Borrowed<'a> = &'a Self;
1653        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1654            value
1655        }
1656    }
1657
1658    unsafe impl fidl::encoding::TypeMarker for LightSetBrightnessValueRequest {
1659        type Owned = Self;
1660
1661        #[inline(always)]
1662        fn inline_align(_context: fidl::encoding::Context) -> usize {
1663            8
1664        }
1665
1666        #[inline(always)]
1667        fn inline_size(_context: fidl::encoding::Context) -> usize {
1668            16
1669        }
1670    }
1671
1672    unsafe impl<D: fidl::encoding::ResourceDialect>
1673        fidl::encoding::Encode<LightSetBrightnessValueRequest, D>
1674        for &LightSetBrightnessValueRequest
1675    {
1676        #[inline]
1677        unsafe fn encode(
1678            self,
1679            encoder: &mut fidl::encoding::Encoder<'_, D>,
1680            offset: usize,
1681            _depth: fidl::encoding::Depth,
1682        ) -> fidl::Result<()> {
1683            encoder.debug_check_bounds::<LightSetBrightnessValueRequest>(offset);
1684            // Delegate to tuple encoding.
1685            fidl::encoding::Encode::<LightSetBrightnessValueRequest, D>::encode(
1686                (
1687                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
1688                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
1689                ),
1690                encoder,
1691                offset,
1692                _depth,
1693            )
1694        }
1695    }
1696    unsafe impl<
1697            D: fidl::encoding::ResourceDialect,
1698            T0: fidl::encoding::Encode<u32, D>,
1699            T1: fidl::encoding::Encode<f64, D>,
1700        > fidl::encoding::Encode<LightSetBrightnessValueRequest, D> for (T0, T1)
1701    {
1702        #[inline]
1703        unsafe fn encode(
1704            self,
1705            encoder: &mut fidl::encoding::Encoder<'_, D>,
1706            offset: usize,
1707            depth: fidl::encoding::Depth,
1708        ) -> fidl::Result<()> {
1709            encoder.debug_check_bounds::<LightSetBrightnessValueRequest>(offset);
1710            // Zero out padding regions. There's no need to apply masks
1711            // because the unmasked parts will be overwritten by fields.
1712            unsafe {
1713                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1714                (ptr as *mut u64).write_unaligned(0);
1715            }
1716            // Write the fields.
1717            self.0.encode(encoder, offset + 0, depth)?;
1718            self.1.encode(encoder, offset + 8, depth)?;
1719            Ok(())
1720        }
1721    }
1722
1723    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1724        for LightSetBrightnessValueRequest
1725    {
1726        #[inline(always)]
1727        fn new_empty() -> Self {
1728            Self { index: fidl::new_empty!(u32, D), value: fidl::new_empty!(f64, D) }
1729        }
1730
1731        #[inline]
1732        unsafe fn decode(
1733            &mut self,
1734            decoder: &mut fidl::encoding::Decoder<'_, D>,
1735            offset: usize,
1736            _depth: fidl::encoding::Depth,
1737        ) -> fidl::Result<()> {
1738            decoder.debug_check_bounds::<Self>(offset);
1739            // Verify that padding bytes are zero.
1740            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1741            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1742            let mask = 0xffffffff00000000u64;
1743            let maskedval = padval & mask;
1744            if maskedval != 0 {
1745                return Err(fidl::Error::NonZeroPadding {
1746                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1747                });
1748            }
1749            fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
1750            fidl::decode!(f64, D, &mut self.value, decoder, offset + 8, _depth)?;
1751            Ok(())
1752        }
1753    }
1754
1755    impl fidl::encoding::ValueTypeMarker for LightSetGroupBrightnessValueRequest {
1756        type Borrowed<'a> = &'a Self;
1757        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1758            value
1759        }
1760    }
1761
1762    unsafe impl fidl::encoding::TypeMarker for LightSetGroupBrightnessValueRequest {
1763        type Owned = Self;
1764
1765        #[inline(always)]
1766        fn inline_align(_context: fidl::encoding::Context) -> usize {
1767            8
1768        }
1769
1770        #[inline(always)]
1771        fn inline_size(_context: fidl::encoding::Context) -> usize {
1772            24
1773        }
1774    }
1775
1776    unsafe impl<D: fidl::encoding::ResourceDialect>
1777        fidl::encoding::Encode<LightSetGroupBrightnessValueRequest, D>
1778        for &LightSetGroupBrightnessValueRequest
1779    {
1780        #[inline]
1781        unsafe fn encode(
1782            self,
1783            encoder: &mut fidl::encoding::Encoder<'_, D>,
1784            offset: usize,
1785            _depth: fidl::encoding::Depth,
1786        ) -> fidl::Result<()> {
1787            encoder.debug_check_bounds::<LightSetGroupBrightnessValueRequest>(offset);
1788            // Delegate to tuple encoding.
1789            fidl::encoding::Encode::<LightSetGroupBrightnessValueRequest, D>::encode(
1790                (
1791                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.group_id),
1792                    <fidl::encoding::UnboundedVector<f64> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
1793                ),
1794                encoder, offset, _depth
1795            )
1796        }
1797    }
1798    unsafe impl<
1799            D: fidl::encoding::ResourceDialect,
1800            T0: fidl::encoding::Encode<u32, D>,
1801            T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<f64>, D>,
1802        > fidl::encoding::Encode<LightSetGroupBrightnessValueRequest, D> for (T0, T1)
1803    {
1804        #[inline]
1805        unsafe fn encode(
1806            self,
1807            encoder: &mut fidl::encoding::Encoder<'_, D>,
1808            offset: usize,
1809            depth: fidl::encoding::Depth,
1810        ) -> fidl::Result<()> {
1811            encoder.debug_check_bounds::<LightSetGroupBrightnessValueRequest>(offset);
1812            // Zero out padding regions. There's no need to apply masks
1813            // because the unmasked parts will be overwritten by fields.
1814            unsafe {
1815                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1816                (ptr as *mut u64).write_unaligned(0);
1817            }
1818            // Write the fields.
1819            self.0.encode(encoder, offset + 0, depth)?;
1820            self.1.encode(encoder, offset + 8, depth)?;
1821            Ok(())
1822        }
1823    }
1824
1825    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1826        for LightSetGroupBrightnessValueRequest
1827    {
1828        #[inline(always)]
1829        fn new_empty() -> Self {
1830            Self {
1831                group_id: fidl::new_empty!(u32, D),
1832                values: fidl::new_empty!(fidl::encoding::UnboundedVector<f64>, D),
1833            }
1834        }
1835
1836        #[inline]
1837        unsafe fn decode(
1838            &mut self,
1839            decoder: &mut fidl::encoding::Decoder<'_, D>,
1840            offset: usize,
1841            _depth: fidl::encoding::Depth,
1842        ) -> fidl::Result<()> {
1843            decoder.debug_check_bounds::<Self>(offset);
1844            // Verify that padding bytes are zero.
1845            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1846            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1847            let mask = 0xffffffff00000000u64;
1848            let maskedval = padval & mask;
1849            if maskedval != 0 {
1850                return Err(fidl::Error::NonZeroPadding {
1851                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1852                });
1853            }
1854            fidl::decode!(u32, D, &mut self.group_id, decoder, offset + 0, _depth)?;
1855            fidl::decode!(
1856                fidl::encoding::UnboundedVector<f64>,
1857                D,
1858                &mut self.values,
1859                decoder,
1860                offset + 8,
1861                _depth
1862            )?;
1863            Ok(())
1864        }
1865    }
1866
1867    impl fidl::encoding::ValueTypeMarker for LightSetGroupRgbValueRequest {
1868        type Borrowed<'a> = &'a Self;
1869        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1870            value
1871        }
1872    }
1873
1874    unsafe impl fidl::encoding::TypeMarker for LightSetGroupRgbValueRequest {
1875        type Owned = Self;
1876
1877        #[inline(always)]
1878        fn inline_align(_context: fidl::encoding::Context) -> usize {
1879            8
1880        }
1881
1882        #[inline(always)]
1883        fn inline_size(_context: fidl::encoding::Context) -> usize {
1884            24
1885        }
1886    }
1887
1888    unsafe impl<D: fidl::encoding::ResourceDialect>
1889        fidl::encoding::Encode<LightSetGroupRgbValueRequest, D> for &LightSetGroupRgbValueRequest
1890    {
1891        #[inline]
1892        unsafe fn encode(
1893            self,
1894            encoder: &mut fidl::encoding::Encoder<'_, D>,
1895            offset: usize,
1896            _depth: fidl::encoding::Depth,
1897        ) -> fidl::Result<()> {
1898            encoder.debug_check_bounds::<LightSetGroupRgbValueRequest>(offset);
1899            // Delegate to tuple encoding.
1900            fidl::encoding::Encode::<LightSetGroupRgbValueRequest, D>::encode(
1901                (
1902                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.group_id),
1903                    <fidl::encoding::UnboundedVector<Rgb> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
1904                ),
1905                encoder, offset, _depth
1906            )
1907        }
1908    }
1909    unsafe impl<
1910            D: fidl::encoding::ResourceDialect,
1911            T0: fidl::encoding::Encode<u32, D>,
1912            T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Rgb>, D>,
1913        > fidl::encoding::Encode<LightSetGroupRgbValueRequest, D> for (T0, T1)
1914    {
1915        #[inline]
1916        unsafe fn encode(
1917            self,
1918            encoder: &mut fidl::encoding::Encoder<'_, D>,
1919            offset: usize,
1920            depth: fidl::encoding::Depth,
1921        ) -> fidl::Result<()> {
1922            encoder.debug_check_bounds::<LightSetGroupRgbValueRequest>(offset);
1923            // Zero out padding regions. There's no need to apply masks
1924            // because the unmasked parts will be overwritten by fields.
1925            unsafe {
1926                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1927                (ptr as *mut u64).write_unaligned(0);
1928            }
1929            // Write the fields.
1930            self.0.encode(encoder, offset + 0, depth)?;
1931            self.1.encode(encoder, offset + 8, depth)?;
1932            Ok(())
1933        }
1934    }
1935
1936    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1937        for LightSetGroupRgbValueRequest
1938    {
1939        #[inline(always)]
1940        fn new_empty() -> Self {
1941            Self {
1942                group_id: fidl::new_empty!(u32, D),
1943                values: fidl::new_empty!(fidl::encoding::UnboundedVector<Rgb>, D),
1944            }
1945        }
1946
1947        #[inline]
1948        unsafe fn decode(
1949            &mut self,
1950            decoder: &mut fidl::encoding::Decoder<'_, D>,
1951            offset: usize,
1952            _depth: fidl::encoding::Depth,
1953        ) -> fidl::Result<()> {
1954            decoder.debug_check_bounds::<Self>(offset);
1955            // Verify that padding bytes are zero.
1956            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1957            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1958            let mask = 0xffffffff00000000u64;
1959            let maskedval = padval & mask;
1960            if maskedval != 0 {
1961                return Err(fidl::Error::NonZeroPadding {
1962                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1963                });
1964            }
1965            fidl::decode!(u32, D, &mut self.group_id, decoder, offset + 0, _depth)?;
1966            fidl::decode!(
1967                fidl::encoding::UnboundedVector<Rgb>,
1968                D,
1969                &mut self.values,
1970                decoder,
1971                offset + 8,
1972                _depth
1973            )?;
1974            Ok(())
1975        }
1976    }
1977
1978    impl fidl::encoding::ValueTypeMarker for LightSetGroupSimpleValueRequest {
1979        type Borrowed<'a> = &'a Self;
1980        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1981            value
1982        }
1983    }
1984
1985    unsafe impl fidl::encoding::TypeMarker for LightSetGroupSimpleValueRequest {
1986        type Owned = Self;
1987
1988        #[inline(always)]
1989        fn inline_align(_context: fidl::encoding::Context) -> usize {
1990            8
1991        }
1992
1993        #[inline(always)]
1994        fn inline_size(_context: fidl::encoding::Context) -> usize {
1995            24
1996        }
1997    }
1998
1999    unsafe impl<D: fidl::encoding::ResourceDialect>
2000        fidl::encoding::Encode<LightSetGroupSimpleValueRequest, D>
2001        for &LightSetGroupSimpleValueRequest
2002    {
2003        #[inline]
2004        unsafe fn encode(
2005            self,
2006            encoder: &mut fidl::encoding::Encoder<'_, D>,
2007            offset: usize,
2008            _depth: fidl::encoding::Depth,
2009        ) -> fidl::Result<()> {
2010            encoder.debug_check_bounds::<LightSetGroupSimpleValueRequest>(offset);
2011            // Delegate to tuple encoding.
2012            fidl::encoding::Encode::<LightSetGroupSimpleValueRequest, D>::encode(
2013                (
2014                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.group_id),
2015                    <fidl::encoding::UnboundedVector<bool> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
2016                ),
2017                encoder, offset, _depth
2018            )
2019        }
2020    }
2021    unsafe impl<
2022            D: fidl::encoding::ResourceDialect,
2023            T0: fidl::encoding::Encode<u32, D>,
2024            T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<bool>, D>,
2025        > fidl::encoding::Encode<LightSetGroupSimpleValueRequest, D> for (T0, T1)
2026    {
2027        #[inline]
2028        unsafe fn encode(
2029            self,
2030            encoder: &mut fidl::encoding::Encoder<'_, D>,
2031            offset: usize,
2032            depth: fidl::encoding::Depth,
2033        ) -> fidl::Result<()> {
2034            encoder.debug_check_bounds::<LightSetGroupSimpleValueRequest>(offset);
2035            // Zero out padding regions. There's no need to apply masks
2036            // because the unmasked parts will be overwritten by fields.
2037            unsafe {
2038                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2039                (ptr as *mut u64).write_unaligned(0);
2040            }
2041            // Write the fields.
2042            self.0.encode(encoder, offset + 0, depth)?;
2043            self.1.encode(encoder, offset + 8, depth)?;
2044            Ok(())
2045        }
2046    }
2047
2048    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2049        for LightSetGroupSimpleValueRequest
2050    {
2051        #[inline(always)]
2052        fn new_empty() -> Self {
2053            Self {
2054                group_id: fidl::new_empty!(u32, D),
2055                values: fidl::new_empty!(fidl::encoding::UnboundedVector<bool>, D),
2056            }
2057        }
2058
2059        #[inline]
2060        unsafe fn decode(
2061            &mut self,
2062            decoder: &mut fidl::encoding::Decoder<'_, D>,
2063            offset: usize,
2064            _depth: fidl::encoding::Depth,
2065        ) -> fidl::Result<()> {
2066            decoder.debug_check_bounds::<Self>(offset);
2067            // Verify that padding bytes are zero.
2068            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2069            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2070            let mask = 0xffffffff00000000u64;
2071            let maskedval = padval & mask;
2072            if maskedval != 0 {
2073                return Err(fidl::Error::NonZeroPadding {
2074                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2075                });
2076            }
2077            fidl::decode!(u32, D, &mut self.group_id, decoder, offset + 0, _depth)?;
2078            fidl::decode!(
2079                fidl::encoding::UnboundedVector<bool>,
2080                D,
2081                &mut self.values,
2082                decoder,
2083                offset + 8,
2084                _depth
2085            )?;
2086            Ok(())
2087        }
2088    }
2089
2090    impl fidl::encoding::ValueTypeMarker for LightSetRgbValueRequest {
2091        type Borrowed<'a> = &'a Self;
2092        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2093            value
2094        }
2095    }
2096
2097    unsafe impl fidl::encoding::TypeMarker for LightSetRgbValueRequest {
2098        type Owned = Self;
2099
2100        #[inline(always)]
2101        fn inline_align(_context: fidl::encoding::Context) -> usize {
2102            8
2103        }
2104
2105        #[inline(always)]
2106        fn inline_size(_context: fidl::encoding::Context) -> usize {
2107            32
2108        }
2109    }
2110
2111    unsafe impl<D: fidl::encoding::ResourceDialect>
2112        fidl::encoding::Encode<LightSetRgbValueRequest, D> for &LightSetRgbValueRequest
2113    {
2114        #[inline]
2115        unsafe fn encode(
2116            self,
2117            encoder: &mut fidl::encoding::Encoder<'_, D>,
2118            offset: usize,
2119            _depth: fidl::encoding::Depth,
2120        ) -> fidl::Result<()> {
2121            encoder.debug_check_bounds::<LightSetRgbValueRequest>(offset);
2122            // Delegate to tuple encoding.
2123            fidl::encoding::Encode::<LightSetRgbValueRequest, D>::encode(
2124                (
2125                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
2126                    <Rgb as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
2127                ),
2128                encoder,
2129                offset,
2130                _depth,
2131            )
2132        }
2133    }
2134    unsafe impl<
2135            D: fidl::encoding::ResourceDialect,
2136            T0: fidl::encoding::Encode<u32, D>,
2137            T1: fidl::encoding::Encode<Rgb, D>,
2138        > fidl::encoding::Encode<LightSetRgbValueRequest, D> for (T0, T1)
2139    {
2140        #[inline]
2141        unsafe fn encode(
2142            self,
2143            encoder: &mut fidl::encoding::Encoder<'_, D>,
2144            offset: usize,
2145            depth: fidl::encoding::Depth,
2146        ) -> fidl::Result<()> {
2147            encoder.debug_check_bounds::<LightSetRgbValueRequest>(offset);
2148            // Zero out padding regions. There's no need to apply masks
2149            // because the unmasked parts will be overwritten by fields.
2150            unsafe {
2151                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2152                (ptr as *mut u64).write_unaligned(0);
2153            }
2154            // Write the fields.
2155            self.0.encode(encoder, offset + 0, depth)?;
2156            self.1.encode(encoder, offset + 8, depth)?;
2157            Ok(())
2158        }
2159    }
2160
2161    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2162        for LightSetRgbValueRequest
2163    {
2164        #[inline(always)]
2165        fn new_empty() -> Self {
2166            Self { index: fidl::new_empty!(u32, D), value: fidl::new_empty!(Rgb, D) }
2167        }
2168
2169        #[inline]
2170        unsafe fn decode(
2171            &mut self,
2172            decoder: &mut fidl::encoding::Decoder<'_, D>,
2173            offset: usize,
2174            _depth: fidl::encoding::Depth,
2175        ) -> fidl::Result<()> {
2176            decoder.debug_check_bounds::<Self>(offset);
2177            // Verify that padding bytes are zero.
2178            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2179            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2180            let mask = 0xffffffff00000000u64;
2181            let maskedval = padval & mask;
2182            if maskedval != 0 {
2183                return Err(fidl::Error::NonZeroPadding {
2184                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2185                });
2186            }
2187            fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
2188            fidl::decode!(Rgb, D, &mut self.value, decoder, offset + 8, _depth)?;
2189            Ok(())
2190        }
2191    }
2192
2193    impl fidl::encoding::ValueTypeMarker for LightSetSimpleValueRequest {
2194        type Borrowed<'a> = &'a Self;
2195        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2196            value
2197        }
2198    }
2199
2200    unsafe impl fidl::encoding::TypeMarker for LightSetSimpleValueRequest {
2201        type Owned = Self;
2202
2203        #[inline(always)]
2204        fn inline_align(_context: fidl::encoding::Context) -> usize {
2205            4
2206        }
2207
2208        #[inline(always)]
2209        fn inline_size(_context: fidl::encoding::Context) -> usize {
2210            8
2211        }
2212    }
2213
2214    unsafe impl<D: fidl::encoding::ResourceDialect>
2215        fidl::encoding::Encode<LightSetSimpleValueRequest, D> for &LightSetSimpleValueRequest
2216    {
2217        #[inline]
2218        unsafe fn encode(
2219            self,
2220            encoder: &mut fidl::encoding::Encoder<'_, D>,
2221            offset: usize,
2222            _depth: fidl::encoding::Depth,
2223        ) -> fidl::Result<()> {
2224            encoder.debug_check_bounds::<LightSetSimpleValueRequest>(offset);
2225            // Delegate to tuple encoding.
2226            fidl::encoding::Encode::<LightSetSimpleValueRequest, D>::encode(
2227                (
2228                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
2229                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
2230                ),
2231                encoder,
2232                offset,
2233                _depth,
2234            )
2235        }
2236    }
2237    unsafe impl<
2238            D: fidl::encoding::ResourceDialect,
2239            T0: fidl::encoding::Encode<u32, D>,
2240            T1: fidl::encoding::Encode<bool, D>,
2241        > fidl::encoding::Encode<LightSetSimpleValueRequest, D> for (T0, T1)
2242    {
2243        #[inline]
2244        unsafe fn encode(
2245            self,
2246            encoder: &mut fidl::encoding::Encoder<'_, D>,
2247            offset: usize,
2248            depth: fidl::encoding::Depth,
2249        ) -> fidl::Result<()> {
2250            encoder.debug_check_bounds::<LightSetSimpleValueRequest>(offset);
2251            // Zero out padding regions. There's no need to apply masks
2252            // because the unmasked parts will be overwritten by fields.
2253            unsafe {
2254                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
2255                (ptr as *mut u32).write_unaligned(0);
2256            }
2257            // Write the fields.
2258            self.0.encode(encoder, offset + 0, depth)?;
2259            self.1.encode(encoder, offset + 4, depth)?;
2260            Ok(())
2261        }
2262    }
2263
2264    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2265        for LightSetSimpleValueRequest
2266    {
2267        #[inline(always)]
2268        fn new_empty() -> Self {
2269            Self { index: fidl::new_empty!(u32, D), value: fidl::new_empty!(bool, D) }
2270        }
2271
2272        #[inline]
2273        unsafe fn decode(
2274            &mut self,
2275            decoder: &mut fidl::encoding::Decoder<'_, D>,
2276            offset: usize,
2277            _depth: fidl::encoding::Depth,
2278        ) -> fidl::Result<()> {
2279            decoder.debug_check_bounds::<Self>(offset);
2280            // Verify that padding bytes are zero.
2281            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
2282            let padval = unsafe { (ptr as *const u32).read_unaligned() };
2283            let mask = 0xffffff00u32;
2284            let maskedval = padval & mask;
2285            if maskedval != 0 {
2286                return Err(fidl::Error::NonZeroPadding {
2287                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
2288                });
2289            }
2290            fidl::decode!(u32, D, &mut self.index, decoder, offset + 0, _depth)?;
2291            fidl::decode!(bool, D, &mut self.value, decoder, offset + 4, _depth)?;
2292            Ok(())
2293        }
2294    }
2295
2296    impl fidl::encoding::ValueTypeMarker for LightGetCurrentBrightnessValueResponse {
2297        type Borrowed<'a> = &'a Self;
2298        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2299            value
2300        }
2301    }
2302
2303    unsafe impl fidl::encoding::TypeMarker for LightGetCurrentBrightnessValueResponse {
2304        type Owned = Self;
2305
2306        #[inline(always)]
2307        fn inline_align(_context: fidl::encoding::Context) -> usize {
2308            8
2309        }
2310
2311        #[inline(always)]
2312        fn inline_size(_context: fidl::encoding::Context) -> usize {
2313            8
2314        }
2315    }
2316
2317    unsafe impl<D: fidl::encoding::ResourceDialect>
2318        fidl::encoding::Encode<LightGetCurrentBrightnessValueResponse, D>
2319        for &LightGetCurrentBrightnessValueResponse
2320    {
2321        #[inline]
2322        unsafe fn encode(
2323            self,
2324            encoder: &mut fidl::encoding::Encoder<'_, D>,
2325            offset: usize,
2326            _depth: fidl::encoding::Depth,
2327        ) -> fidl::Result<()> {
2328            encoder.debug_check_bounds::<LightGetCurrentBrightnessValueResponse>(offset);
2329            // Delegate to tuple encoding.
2330            fidl::encoding::Encode::<LightGetCurrentBrightnessValueResponse, D>::encode(
2331                (<f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
2332                encoder,
2333                offset,
2334                _depth,
2335            )
2336        }
2337    }
2338    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f64, D>>
2339        fidl::encoding::Encode<LightGetCurrentBrightnessValueResponse, D> for (T0,)
2340    {
2341        #[inline]
2342        unsafe fn encode(
2343            self,
2344            encoder: &mut fidl::encoding::Encoder<'_, D>,
2345            offset: usize,
2346            depth: fidl::encoding::Depth,
2347        ) -> fidl::Result<()> {
2348            encoder.debug_check_bounds::<LightGetCurrentBrightnessValueResponse>(offset);
2349            // Zero out padding regions. There's no need to apply masks
2350            // because the unmasked parts will be overwritten by fields.
2351            // Write the fields.
2352            self.0.encode(encoder, offset + 0, depth)?;
2353            Ok(())
2354        }
2355    }
2356
2357    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2358        for LightGetCurrentBrightnessValueResponse
2359    {
2360        #[inline(always)]
2361        fn new_empty() -> Self {
2362            Self { value: fidl::new_empty!(f64, D) }
2363        }
2364
2365        #[inline]
2366        unsafe fn decode(
2367            &mut self,
2368            decoder: &mut fidl::encoding::Decoder<'_, D>,
2369            offset: usize,
2370            _depth: fidl::encoding::Depth,
2371        ) -> fidl::Result<()> {
2372            decoder.debug_check_bounds::<Self>(offset);
2373            // Verify that padding bytes are zero.
2374            fidl::decode!(f64, D, &mut self.value, decoder, offset + 0, _depth)?;
2375            Ok(())
2376        }
2377    }
2378
2379    impl fidl::encoding::ValueTypeMarker for LightGetCurrentRgbValueResponse {
2380        type Borrowed<'a> = &'a Self;
2381        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2382            value
2383        }
2384    }
2385
2386    unsafe impl fidl::encoding::TypeMarker for LightGetCurrentRgbValueResponse {
2387        type Owned = Self;
2388
2389        #[inline(always)]
2390        fn inline_align(_context: fidl::encoding::Context) -> usize {
2391            8
2392        }
2393
2394        #[inline(always)]
2395        fn inline_size(_context: fidl::encoding::Context) -> usize {
2396            24
2397        }
2398    }
2399
2400    unsafe impl<D: fidl::encoding::ResourceDialect>
2401        fidl::encoding::Encode<LightGetCurrentRgbValueResponse, D>
2402        for &LightGetCurrentRgbValueResponse
2403    {
2404        #[inline]
2405        unsafe fn encode(
2406            self,
2407            encoder: &mut fidl::encoding::Encoder<'_, D>,
2408            offset: usize,
2409            _depth: fidl::encoding::Depth,
2410        ) -> fidl::Result<()> {
2411            encoder.debug_check_bounds::<LightGetCurrentRgbValueResponse>(offset);
2412            // Delegate to tuple encoding.
2413            fidl::encoding::Encode::<LightGetCurrentRgbValueResponse, D>::encode(
2414                (<Rgb as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
2415                encoder,
2416                offset,
2417                _depth,
2418            )
2419        }
2420    }
2421    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Rgb, D>>
2422        fidl::encoding::Encode<LightGetCurrentRgbValueResponse, D> for (T0,)
2423    {
2424        #[inline]
2425        unsafe fn encode(
2426            self,
2427            encoder: &mut fidl::encoding::Encoder<'_, D>,
2428            offset: usize,
2429            depth: fidl::encoding::Depth,
2430        ) -> fidl::Result<()> {
2431            encoder.debug_check_bounds::<LightGetCurrentRgbValueResponse>(offset);
2432            // Zero out padding regions. There's no need to apply masks
2433            // because the unmasked parts will be overwritten by fields.
2434            // Write the fields.
2435            self.0.encode(encoder, offset + 0, depth)?;
2436            Ok(())
2437        }
2438    }
2439
2440    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2441        for LightGetCurrentRgbValueResponse
2442    {
2443        #[inline(always)]
2444        fn new_empty() -> Self {
2445            Self { value: fidl::new_empty!(Rgb, D) }
2446        }
2447
2448        #[inline]
2449        unsafe fn decode(
2450            &mut self,
2451            decoder: &mut fidl::encoding::Decoder<'_, D>,
2452            offset: usize,
2453            _depth: fidl::encoding::Depth,
2454        ) -> fidl::Result<()> {
2455            decoder.debug_check_bounds::<Self>(offset);
2456            // Verify that padding bytes are zero.
2457            fidl::decode!(Rgb, D, &mut self.value, decoder, offset + 0, _depth)?;
2458            Ok(())
2459        }
2460    }
2461
2462    impl fidl::encoding::ValueTypeMarker for LightGetCurrentSimpleValueResponse {
2463        type Borrowed<'a> = &'a Self;
2464        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2465            value
2466        }
2467    }
2468
2469    unsafe impl fidl::encoding::TypeMarker for LightGetCurrentSimpleValueResponse {
2470        type Owned = Self;
2471
2472        #[inline(always)]
2473        fn inline_align(_context: fidl::encoding::Context) -> usize {
2474            1
2475        }
2476
2477        #[inline(always)]
2478        fn inline_size(_context: fidl::encoding::Context) -> usize {
2479            1
2480        }
2481    }
2482
2483    unsafe impl<D: fidl::encoding::ResourceDialect>
2484        fidl::encoding::Encode<LightGetCurrentSimpleValueResponse, D>
2485        for &LightGetCurrentSimpleValueResponse
2486    {
2487        #[inline]
2488        unsafe fn encode(
2489            self,
2490            encoder: &mut fidl::encoding::Encoder<'_, D>,
2491            offset: usize,
2492            _depth: fidl::encoding::Depth,
2493        ) -> fidl::Result<()> {
2494            encoder.debug_check_bounds::<LightGetCurrentSimpleValueResponse>(offset);
2495            // Delegate to tuple encoding.
2496            fidl::encoding::Encode::<LightGetCurrentSimpleValueResponse, D>::encode(
2497                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
2498                encoder,
2499                offset,
2500                _depth,
2501            )
2502        }
2503    }
2504    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2505        fidl::encoding::Encode<LightGetCurrentSimpleValueResponse, D> for (T0,)
2506    {
2507        #[inline]
2508        unsafe fn encode(
2509            self,
2510            encoder: &mut fidl::encoding::Encoder<'_, D>,
2511            offset: usize,
2512            depth: fidl::encoding::Depth,
2513        ) -> fidl::Result<()> {
2514            encoder.debug_check_bounds::<LightGetCurrentSimpleValueResponse>(offset);
2515            // Zero out padding regions. There's no need to apply masks
2516            // because the unmasked parts will be overwritten by fields.
2517            // Write the fields.
2518            self.0.encode(encoder, offset + 0, depth)?;
2519            Ok(())
2520        }
2521    }
2522
2523    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2524        for LightGetCurrentSimpleValueResponse
2525    {
2526        #[inline(always)]
2527        fn new_empty() -> Self {
2528            Self { value: fidl::new_empty!(bool, D) }
2529        }
2530
2531        #[inline]
2532        unsafe fn decode(
2533            &mut self,
2534            decoder: &mut fidl::encoding::Decoder<'_, D>,
2535            offset: usize,
2536            _depth: fidl::encoding::Depth,
2537        ) -> fidl::Result<()> {
2538            decoder.debug_check_bounds::<Self>(offset);
2539            // Verify that padding bytes are zero.
2540            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
2541            Ok(())
2542        }
2543    }
2544
2545    impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentBrightnessValueResponse {
2546        type Borrowed<'a> = &'a Self;
2547        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2548            value
2549        }
2550    }
2551
2552    unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentBrightnessValueResponse {
2553        type Owned = Self;
2554
2555        #[inline(always)]
2556        fn inline_align(_context: fidl::encoding::Context) -> usize {
2557            8
2558        }
2559
2560        #[inline(always)]
2561        fn inline_size(_context: fidl::encoding::Context) -> usize {
2562            16
2563        }
2564    }
2565
2566    unsafe impl<D: fidl::encoding::ResourceDialect>
2567        fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueResponse, D>
2568        for &LightGetGroupCurrentBrightnessValueResponse
2569    {
2570        #[inline]
2571        unsafe fn encode(
2572            self,
2573            encoder: &mut fidl::encoding::Encoder<'_, D>,
2574            offset: usize,
2575            _depth: fidl::encoding::Depth,
2576        ) -> fidl::Result<()> {
2577            encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueResponse>(offset);
2578            // Delegate to tuple encoding.
2579            fidl::encoding::Encode::<LightGetGroupCurrentBrightnessValueResponse, D>::encode(
2580                (
2581                    <fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
2582                ),
2583                encoder, offset, _depth
2584            )
2585        }
2586    }
2587    unsafe impl<
2588            D: fidl::encoding::ResourceDialect,
2589            T0: fidl::encoding::Encode<
2590                fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>>,
2591                D,
2592            >,
2593        > fidl::encoding::Encode<LightGetGroupCurrentBrightnessValueResponse, D> for (T0,)
2594    {
2595        #[inline]
2596        unsafe fn encode(
2597            self,
2598            encoder: &mut fidl::encoding::Encoder<'_, D>,
2599            offset: usize,
2600            depth: fidl::encoding::Depth,
2601        ) -> fidl::Result<()> {
2602            encoder.debug_check_bounds::<LightGetGroupCurrentBrightnessValueResponse>(offset);
2603            // Zero out padding regions. There's no need to apply masks
2604            // because the unmasked parts will be overwritten by fields.
2605            // Write the fields.
2606            self.0.encode(encoder, offset + 0, depth)?;
2607            Ok(())
2608        }
2609    }
2610
2611    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2612        for LightGetGroupCurrentBrightnessValueResponse
2613    {
2614        #[inline(always)]
2615        fn new_empty() -> Self {
2616            Self {
2617                values: fidl::new_empty!(
2618                    fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>>,
2619                    D
2620                ),
2621            }
2622        }
2623
2624        #[inline]
2625        unsafe fn decode(
2626            &mut self,
2627            decoder: &mut fidl::encoding::Decoder<'_, D>,
2628            offset: usize,
2629            _depth: fidl::encoding::Depth,
2630        ) -> fidl::Result<()> {
2631            decoder.debug_check_bounds::<Self>(offset);
2632            // Verify that padding bytes are zero.
2633            fidl::decode!(
2634                fidl::encoding::Optional<fidl::encoding::UnboundedVector<f64>>,
2635                D,
2636                &mut self.values,
2637                decoder,
2638                offset + 0,
2639                _depth
2640            )?;
2641            Ok(())
2642        }
2643    }
2644
2645    impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentRgbValueResponse {
2646        type Borrowed<'a> = &'a Self;
2647        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2648            value
2649        }
2650    }
2651
2652    unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentRgbValueResponse {
2653        type Owned = Self;
2654
2655        #[inline(always)]
2656        fn inline_align(_context: fidl::encoding::Context) -> usize {
2657            8
2658        }
2659
2660        #[inline(always)]
2661        fn inline_size(_context: fidl::encoding::Context) -> usize {
2662            16
2663        }
2664    }
2665
2666    unsafe impl<D: fidl::encoding::ResourceDialect>
2667        fidl::encoding::Encode<LightGetGroupCurrentRgbValueResponse, D>
2668        for &LightGetGroupCurrentRgbValueResponse
2669    {
2670        #[inline]
2671        unsafe fn encode(
2672            self,
2673            encoder: &mut fidl::encoding::Encoder<'_, D>,
2674            offset: usize,
2675            _depth: fidl::encoding::Depth,
2676        ) -> fidl::Result<()> {
2677            encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueResponse>(offset);
2678            // Delegate to tuple encoding.
2679            fidl::encoding::Encode::<LightGetGroupCurrentRgbValueResponse, D>::encode(
2680                (
2681                    <fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
2682                ),
2683                encoder, offset, _depth
2684            )
2685        }
2686    }
2687    unsafe impl<
2688            D: fidl::encoding::ResourceDialect,
2689            T0: fidl::encoding::Encode<
2690                fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>>,
2691                D,
2692            >,
2693        > fidl::encoding::Encode<LightGetGroupCurrentRgbValueResponse, D> for (T0,)
2694    {
2695        #[inline]
2696        unsafe fn encode(
2697            self,
2698            encoder: &mut fidl::encoding::Encoder<'_, D>,
2699            offset: usize,
2700            depth: fidl::encoding::Depth,
2701        ) -> fidl::Result<()> {
2702            encoder.debug_check_bounds::<LightGetGroupCurrentRgbValueResponse>(offset);
2703            // Zero out padding regions. There's no need to apply masks
2704            // because the unmasked parts will be overwritten by fields.
2705            // Write the fields.
2706            self.0.encode(encoder, offset + 0, depth)?;
2707            Ok(())
2708        }
2709    }
2710
2711    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2712        for LightGetGroupCurrentRgbValueResponse
2713    {
2714        #[inline(always)]
2715        fn new_empty() -> Self {
2716            Self {
2717                values: fidl::new_empty!(
2718                    fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>>,
2719                    D
2720                ),
2721            }
2722        }
2723
2724        #[inline]
2725        unsafe fn decode(
2726            &mut self,
2727            decoder: &mut fidl::encoding::Decoder<'_, D>,
2728            offset: usize,
2729            _depth: fidl::encoding::Depth,
2730        ) -> fidl::Result<()> {
2731            decoder.debug_check_bounds::<Self>(offset);
2732            // Verify that padding bytes are zero.
2733            fidl::decode!(
2734                fidl::encoding::Optional<fidl::encoding::UnboundedVector<Rgb>>,
2735                D,
2736                &mut self.values,
2737                decoder,
2738                offset + 0,
2739                _depth
2740            )?;
2741            Ok(())
2742        }
2743    }
2744
2745    impl fidl::encoding::ValueTypeMarker for LightGetGroupCurrentSimpleValueResponse {
2746        type Borrowed<'a> = &'a Self;
2747        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2748            value
2749        }
2750    }
2751
2752    unsafe impl fidl::encoding::TypeMarker for LightGetGroupCurrentSimpleValueResponse {
2753        type Owned = Self;
2754
2755        #[inline(always)]
2756        fn inline_align(_context: fidl::encoding::Context) -> usize {
2757            8
2758        }
2759
2760        #[inline(always)]
2761        fn inline_size(_context: fidl::encoding::Context) -> usize {
2762            16
2763        }
2764    }
2765
2766    unsafe impl<D: fidl::encoding::ResourceDialect>
2767        fidl::encoding::Encode<LightGetGroupCurrentSimpleValueResponse, D>
2768        for &LightGetGroupCurrentSimpleValueResponse
2769    {
2770        #[inline]
2771        unsafe fn encode(
2772            self,
2773            encoder: &mut fidl::encoding::Encoder<'_, D>,
2774            offset: usize,
2775            _depth: fidl::encoding::Depth,
2776        ) -> fidl::Result<()> {
2777            encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueResponse>(offset);
2778            // Delegate to tuple encoding.
2779            fidl::encoding::Encode::<LightGetGroupCurrentSimpleValueResponse, D>::encode(
2780                (
2781                    <fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),
2782                ),
2783                encoder, offset, _depth
2784            )
2785        }
2786    }
2787    unsafe impl<
2788            D: fidl::encoding::ResourceDialect,
2789            T0: fidl::encoding::Encode<
2790                fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>>,
2791                D,
2792            >,
2793        > fidl::encoding::Encode<LightGetGroupCurrentSimpleValueResponse, D> for (T0,)
2794    {
2795        #[inline]
2796        unsafe fn encode(
2797            self,
2798            encoder: &mut fidl::encoding::Encoder<'_, D>,
2799            offset: usize,
2800            depth: fidl::encoding::Depth,
2801        ) -> fidl::Result<()> {
2802            encoder.debug_check_bounds::<LightGetGroupCurrentSimpleValueResponse>(offset);
2803            // Zero out padding regions. There's no need to apply masks
2804            // because the unmasked parts will be overwritten by fields.
2805            // Write the fields.
2806            self.0.encode(encoder, offset + 0, depth)?;
2807            Ok(())
2808        }
2809    }
2810
2811    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2812        for LightGetGroupCurrentSimpleValueResponse
2813    {
2814        #[inline(always)]
2815        fn new_empty() -> Self {
2816            Self {
2817                values: fidl::new_empty!(
2818                    fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>>,
2819                    D
2820                ),
2821            }
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            // Verify that padding bytes are zero.
2833            fidl::decode!(
2834                fidl::encoding::Optional<fidl::encoding::UnboundedVector<bool>>,
2835                D,
2836                &mut self.values,
2837                decoder,
2838                offset + 0,
2839                _depth
2840            )?;
2841            Ok(())
2842        }
2843    }
2844
2845    impl fidl::encoding::ValueTypeMarker for LightGetGroupInfoResponse {
2846        type Borrowed<'a> = &'a Self;
2847        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2848            value
2849        }
2850    }
2851
2852    unsafe impl fidl::encoding::TypeMarker for LightGetGroupInfoResponse {
2853        type Owned = Self;
2854
2855        #[inline(always)]
2856        fn inline_align(_context: fidl::encoding::Context) -> usize {
2857            8
2858        }
2859
2860        #[inline(always)]
2861        fn inline_size(_context: fidl::encoding::Context) -> usize {
2862            24
2863        }
2864    }
2865
2866    unsafe impl<D: fidl::encoding::ResourceDialect>
2867        fidl::encoding::Encode<LightGetGroupInfoResponse, D> for &LightGetGroupInfoResponse
2868    {
2869        #[inline]
2870        unsafe fn encode(
2871            self,
2872            encoder: &mut fidl::encoding::Encoder<'_, D>,
2873            offset: usize,
2874            _depth: fidl::encoding::Depth,
2875        ) -> fidl::Result<()> {
2876            encoder.debug_check_bounds::<LightGetGroupInfoResponse>(offset);
2877            // Delegate to tuple encoding.
2878            fidl::encoding::Encode::<LightGetGroupInfoResponse, D>::encode(
2879                (<GroupInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
2880                encoder,
2881                offset,
2882                _depth,
2883            )
2884        }
2885    }
2886    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<GroupInfo, D>>
2887        fidl::encoding::Encode<LightGetGroupInfoResponse, D> for (T0,)
2888    {
2889        #[inline]
2890        unsafe fn encode(
2891            self,
2892            encoder: &mut fidl::encoding::Encoder<'_, D>,
2893            offset: usize,
2894            depth: fidl::encoding::Depth,
2895        ) -> fidl::Result<()> {
2896            encoder.debug_check_bounds::<LightGetGroupInfoResponse>(offset);
2897            // Zero out padding regions. There's no need to apply masks
2898            // because the unmasked parts will be overwritten by fields.
2899            // Write the fields.
2900            self.0.encode(encoder, offset + 0, depth)?;
2901            Ok(())
2902        }
2903    }
2904
2905    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2906        for LightGetGroupInfoResponse
2907    {
2908        #[inline(always)]
2909        fn new_empty() -> Self {
2910            Self { info: fidl::new_empty!(GroupInfo, D) }
2911        }
2912
2913        #[inline]
2914        unsafe fn decode(
2915            &mut self,
2916            decoder: &mut fidl::encoding::Decoder<'_, D>,
2917            offset: usize,
2918            _depth: fidl::encoding::Depth,
2919        ) -> fidl::Result<()> {
2920            decoder.debug_check_bounds::<Self>(offset);
2921            // Verify that padding bytes are zero.
2922            fidl::decode!(GroupInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
2923            Ok(())
2924        }
2925    }
2926
2927    impl fidl::encoding::ValueTypeMarker for LightGetInfoResponse {
2928        type Borrowed<'a> = &'a Self;
2929        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2930            value
2931        }
2932    }
2933
2934    unsafe impl fidl::encoding::TypeMarker for LightGetInfoResponse {
2935        type Owned = Self;
2936
2937        #[inline(always)]
2938        fn inline_align(_context: fidl::encoding::Context) -> usize {
2939            8
2940        }
2941
2942        #[inline(always)]
2943        fn inline_size(_context: fidl::encoding::Context) -> usize {
2944            24
2945        }
2946    }
2947
2948    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LightGetInfoResponse, D>
2949        for &LightGetInfoResponse
2950    {
2951        #[inline]
2952        unsafe fn encode(
2953            self,
2954            encoder: &mut fidl::encoding::Encoder<'_, D>,
2955            offset: usize,
2956            _depth: fidl::encoding::Depth,
2957        ) -> fidl::Result<()> {
2958            encoder.debug_check_bounds::<LightGetInfoResponse>(offset);
2959            // Delegate to tuple encoding.
2960            fidl::encoding::Encode::<LightGetInfoResponse, D>::encode(
2961                (<Info as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
2962                encoder,
2963                offset,
2964                _depth,
2965            )
2966        }
2967    }
2968    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Info, D>>
2969        fidl::encoding::Encode<LightGetInfoResponse, D> for (T0,)
2970    {
2971        #[inline]
2972        unsafe fn encode(
2973            self,
2974            encoder: &mut fidl::encoding::Encoder<'_, D>,
2975            offset: usize,
2976            depth: fidl::encoding::Depth,
2977        ) -> fidl::Result<()> {
2978            encoder.debug_check_bounds::<LightGetInfoResponse>(offset);
2979            // Zero out padding regions. There's no need to apply masks
2980            // because the unmasked parts will be overwritten by fields.
2981            // Write the fields.
2982            self.0.encode(encoder, offset + 0, depth)?;
2983            Ok(())
2984        }
2985    }
2986
2987    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LightGetInfoResponse {
2988        #[inline(always)]
2989        fn new_empty() -> Self {
2990            Self { info: fidl::new_empty!(Info, D) }
2991        }
2992
2993        #[inline]
2994        unsafe fn decode(
2995            &mut self,
2996            decoder: &mut fidl::encoding::Decoder<'_, D>,
2997            offset: usize,
2998            _depth: fidl::encoding::Depth,
2999        ) -> fidl::Result<()> {
3000            decoder.debug_check_bounds::<Self>(offset);
3001            // Verify that padding bytes are zero.
3002            fidl::decode!(Info, D, &mut self.info, decoder, offset + 0, _depth)?;
3003            Ok(())
3004        }
3005    }
3006
3007    impl fidl::encoding::ValueTypeMarker for Rgb {
3008        type Borrowed<'a> = &'a Self;
3009        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3010            value
3011        }
3012    }
3013
3014    unsafe impl fidl::encoding::TypeMarker for Rgb {
3015        type Owned = Self;
3016
3017        #[inline(always)]
3018        fn inline_align(_context: fidl::encoding::Context) -> usize {
3019            8
3020        }
3021
3022        #[inline(always)]
3023        fn inline_size(_context: fidl::encoding::Context) -> usize {
3024            24
3025        }
3026    }
3027
3028    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Rgb, D> for &Rgb {
3029        #[inline]
3030        unsafe fn encode(
3031            self,
3032            encoder: &mut fidl::encoding::Encoder<'_, D>,
3033            offset: usize,
3034            _depth: fidl::encoding::Depth,
3035        ) -> fidl::Result<()> {
3036            encoder.debug_check_bounds::<Rgb>(offset);
3037            // Delegate to tuple encoding.
3038            fidl::encoding::Encode::<Rgb, D>::encode(
3039                (
3040                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.red),
3041                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.green),
3042                    <f64 as fidl::encoding::ValueTypeMarker>::borrow(&self.blue),
3043                ),
3044                encoder,
3045                offset,
3046                _depth,
3047            )
3048        }
3049    }
3050    unsafe impl<
3051            D: fidl::encoding::ResourceDialect,
3052            T0: fidl::encoding::Encode<f64, D>,
3053            T1: fidl::encoding::Encode<f64, D>,
3054            T2: fidl::encoding::Encode<f64, D>,
3055        > fidl::encoding::Encode<Rgb, D> for (T0, T1, T2)
3056    {
3057        #[inline]
3058        unsafe fn encode(
3059            self,
3060            encoder: &mut fidl::encoding::Encoder<'_, D>,
3061            offset: usize,
3062            depth: fidl::encoding::Depth,
3063        ) -> fidl::Result<()> {
3064            encoder.debug_check_bounds::<Rgb>(offset);
3065            // Zero out padding regions. There's no need to apply masks
3066            // because the unmasked parts will be overwritten by fields.
3067            // Write the fields.
3068            self.0.encode(encoder, offset + 0, depth)?;
3069            self.1.encode(encoder, offset + 8, depth)?;
3070            self.2.encode(encoder, offset + 16, depth)?;
3071            Ok(())
3072        }
3073    }
3074
3075    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Rgb {
3076        #[inline(always)]
3077        fn new_empty() -> Self {
3078            Self {
3079                red: fidl::new_empty!(f64, D),
3080                green: fidl::new_empty!(f64, D),
3081                blue: fidl::new_empty!(f64, D),
3082            }
3083        }
3084
3085        #[inline]
3086        unsafe fn decode(
3087            &mut self,
3088            decoder: &mut fidl::encoding::Decoder<'_, D>,
3089            offset: usize,
3090            _depth: fidl::encoding::Depth,
3091        ) -> fidl::Result<()> {
3092            decoder.debug_check_bounds::<Self>(offset);
3093            // Verify that padding bytes are zero.
3094            fidl::decode!(f64, D, &mut self.red, decoder, offset + 0, _depth)?;
3095            fidl::decode!(f64, D, &mut self.green, decoder, offset + 8, _depth)?;
3096            fidl::decode!(f64, D, &mut self.blue, decoder, offset + 16, _depth)?;
3097            Ok(())
3098        }
3099    }
3100
3101    impl Config {
3102        #[inline(always)]
3103        fn max_ordinal_present(&self) -> u64 {
3104            if let Some(_) = self.group_id {
3105                return 5;
3106            }
3107            if let Some(_) = self.init_on {
3108                return 4;
3109            }
3110            if let Some(_) = self.rgb {
3111                return 3;
3112            }
3113            if let Some(_) = self.brightness {
3114                return 2;
3115            }
3116            if let Some(_) = self.name {
3117                return 1;
3118            }
3119            0
3120        }
3121    }
3122
3123    impl fidl::encoding::ValueTypeMarker for Config {
3124        type Borrowed<'a> = &'a Self;
3125        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3126            value
3127        }
3128    }
3129
3130    unsafe impl fidl::encoding::TypeMarker for Config {
3131        type Owned = Self;
3132
3133        #[inline(always)]
3134        fn inline_align(_context: fidl::encoding::Context) -> usize {
3135            8
3136        }
3137
3138        #[inline(always)]
3139        fn inline_size(_context: fidl::encoding::Context) -> usize {
3140            16
3141        }
3142    }
3143
3144    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Config, D> for &Config {
3145        unsafe fn encode(
3146            self,
3147            encoder: &mut fidl::encoding::Encoder<'_, D>,
3148            offset: usize,
3149            mut depth: fidl::encoding::Depth,
3150        ) -> fidl::Result<()> {
3151            encoder.debug_check_bounds::<Config>(offset);
3152            // Vector header
3153            let max_ordinal: u64 = self.max_ordinal_present();
3154            encoder.write_num(max_ordinal, offset);
3155            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3156            // Calling encoder.out_of_line_offset(0) is not allowed.
3157            if max_ordinal == 0 {
3158                return Ok(());
3159            }
3160            depth.increment()?;
3161            let envelope_size = 8;
3162            let bytes_len = max_ordinal as usize * envelope_size;
3163            #[allow(unused_variables)]
3164            let offset = encoder.out_of_line_offset(bytes_len);
3165            let mut _prev_end_offset: usize = 0;
3166            if 1 > max_ordinal {
3167                return Ok(());
3168            }
3169
3170            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3171            // are envelope_size bytes.
3172            let cur_offset: usize = (1 - 1) * envelope_size;
3173
3174            // Zero reserved fields.
3175            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3176
3177            // Safety:
3178            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3179            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3180            //   envelope_size bytes, there is always sufficient room.
3181            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
3182                self.name.as_ref().map(
3183                    <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
3184                ),
3185                encoder,
3186                offset + cur_offset,
3187                depth,
3188            )?;
3189
3190            _prev_end_offset = cur_offset + envelope_size;
3191            if 2 > max_ordinal {
3192                return Ok(());
3193            }
3194
3195            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3196            // are envelope_size bytes.
3197            let cur_offset: usize = (2 - 1) * envelope_size;
3198
3199            // Zero reserved fields.
3200            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3201
3202            // Safety:
3203            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3204            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3205            //   envelope_size bytes, there is always sufficient room.
3206            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3207                self.brightness.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3208                encoder,
3209                offset + cur_offset,
3210                depth,
3211            )?;
3212
3213            _prev_end_offset = cur_offset + envelope_size;
3214            if 3 > max_ordinal {
3215                return Ok(());
3216            }
3217
3218            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3219            // are envelope_size bytes.
3220            let cur_offset: usize = (3 - 1) * envelope_size;
3221
3222            // Zero reserved fields.
3223            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3224
3225            // Safety:
3226            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3227            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3228            //   envelope_size bytes, there is always sufficient room.
3229            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3230                self.rgb.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3231                encoder,
3232                offset + cur_offset,
3233                depth,
3234            )?;
3235
3236            _prev_end_offset = cur_offset + envelope_size;
3237            if 4 > max_ordinal {
3238                return Ok(());
3239            }
3240
3241            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3242            // are envelope_size bytes.
3243            let cur_offset: usize = (4 - 1) * envelope_size;
3244
3245            // Zero reserved fields.
3246            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3247
3248            // Safety:
3249            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3250            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3251            //   envelope_size bytes, there is always sufficient room.
3252            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3253                self.init_on.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3254                encoder,
3255                offset + cur_offset,
3256                depth,
3257            )?;
3258
3259            _prev_end_offset = cur_offset + envelope_size;
3260            if 5 > max_ordinal {
3261                return Ok(());
3262            }
3263
3264            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3265            // are envelope_size bytes.
3266            let cur_offset: usize = (5 - 1) * envelope_size;
3267
3268            // Zero reserved fields.
3269            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3270
3271            // Safety:
3272            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3273            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3274            //   envelope_size bytes, there is always sufficient room.
3275            fidl::encoding::encode_in_envelope_optional::<i32, D>(
3276                self.group_id.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
3277                encoder,
3278                offset + cur_offset,
3279                depth,
3280            )?;
3281
3282            _prev_end_offset = cur_offset + envelope_size;
3283
3284            Ok(())
3285        }
3286    }
3287
3288    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Config {
3289        #[inline(always)]
3290        fn new_empty() -> Self {
3291            Self::default()
3292        }
3293
3294        unsafe fn decode(
3295            &mut self,
3296            decoder: &mut fidl::encoding::Decoder<'_, D>,
3297            offset: usize,
3298            mut depth: fidl::encoding::Depth,
3299        ) -> fidl::Result<()> {
3300            decoder.debug_check_bounds::<Self>(offset);
3301            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3302                None => return Err(fidl::Error::NotNullable),
3303                Some(len) => len,
3304            };
3305            // Calling decoder.out_of_line_offset(0) is not allowed.
3306            if len == 0 {
3307                return Ok(());
3308            };
3309            depth.increment()?;
3310            let envelope_size = 8;
3311            let bytes_len = len * envelope_size;
3312            let offset = decoder.out_of_line_offset(bytes_len)?;
3313            // Decode the envelope for each type.
3314            let mut _next_ordinal_to_read = 0;
3315            let mut next_offset = offset;
3316            let end_offset = offset + bytes_len;
3317            _next_ordinal_to_read += 1;
3318            if next_offset >= end_offset {
3319                return Ok(());
3320            }
3321
3322            // Decode unknown envelopes for gaps in ordinals.
3323            while _next_ordinal_to_read < 1 {
3324                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3325                _next_ordinal_to_read += 1;
3326                next_offset += envelope_size;
3327            }
3328
3329            let next_out_of_line = decoder.next_out_of_line();
3330            let handles_before = decoder.remaining_handles();
3331            if let Some((inlined, num_bytes, num_handles)) =
3332                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3333            {
3334                let member_inline_size =
3335                    <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
3336                        decoder.context,
3337                    );
3338                if inlined != (member_inline_size <= 4) {
3339                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3340                }
3341                let inner_offset;
3342                let mut inner_depth = depth.clone();
3343                if inlined {
3344                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3345                    inner_offset = next_offset;
3346                } else {
3347                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3348                    inner_depth.increment()?;
3349                }
3350                let val_ref = self
3351                    .name
3352                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
3353                fidl::decode!(
3354                    fidl::encoding::UnboundedString,
3355                    D,
3356                    val_ref,
3357                    decoder,
3358                    inner_offset,
3359                    inner_depth
3360                )?;
3361                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3362                {
3363                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3364                }
3365                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3366                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3367                }
3368            }
3369
3370            next_offset += envelope_size;
3371            _next_ordinal_to_read += 1;
3372            if next_offset >= end_offset {
3373                return Ok(());
3374            }
3375
3376            // Decode unknown envelopes for gaps in ordinals.
3377            while _next_ordinal_to_read < 2 {
3378                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3379                _next_ordinal_to_read += 1;
3380                next_offset += envelope_size;
3381            }
3382
3383            let next_out_of_line = decoder.next_out_of_line();
3384            let handles_before = decoder.remaining_handles();
3385            if let Some((inlined, num_bytes, num_handles)) =
3386                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3387            {
3388                let member_inline_size =
3389                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3390                if inlined != (member_inline_size <= 4) {
3391                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3392                }
3393                let inner_offset;
3394                let mut inner_depth = depth.clone();
3395                if inlined {
3396                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3397                    inner_offset = next_offset;
3398                } else {
3399                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3400                    inner_depth.increment()?;
3401                }
3402                let val_ref = self.brightness.get_or_insert_with(|| fidl::new_empty!(bool, D));
3403                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3404                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3405                {
3406                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3407                }
3408                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3409                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3410                }
3411            }
3412
3413            next_offset += envelope_size;
3414            _next_ordinal_to_read += 1;
3415            if next_offset >= end_offset {
3416                return Ok(());
3417            }
3418
3419            // Decode unknown envelopes for gaps in ordinals.
3420            while _next_ordinal_to_read < 3 {
3421                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3422                _next_ordinal_to_read += 1;
3423                next_offset += envelope_size;
3424            }
3425
3426            let next_out_of_line = decoder.next_out_of_line();
3427            let handles_before = decoder.remaining_handles();
3428            if let Some((inlined, num_bytes, num_handles)) =
3429                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3430            {
3431                let member_inline_size =
3432                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3433                if inlined != (member_inline_size <= 4) {
3434                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3435                }
3436                let inner_offset;
3437                let mut inner_depth = depth.clone();
3438                if inlined {
3439                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3440                    inner_offset = next_offset;
3441                } else {
3442                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3443                    inner_depth.increment()?;
3444                }
3445                let val_ref = self.rgb.get_or_insert_with(|| fidl::new_empty!(bool, D));
3446                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3447                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3448                {
3449                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3450                }
3451                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3452                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3453                }
3454            }
3455
3456            next_offset += envelope_size;
3457            _next_ordinal_to_read += 1;
3458            if next_offset >= end_offset {
3459                return Ok(());
3460            }
3461
3462            // Decode unknown envelopes for gaps in ordinals.
3463            while _next_ordinal_to_read < 4 {
3464                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3465                _next_ordinal_to_read += 1;
3466                next_offset += envelope_size;
3467            }
3468
3469            let next_out_of_line = decoder.next_out_of_line();
3470            let handles_before = decoder.remaining_handles();
3471            if let Some((inlined, num_bytes, num_handles)) =
3472                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3473            {
3474                let member_inline_size =
3475                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3476                if inlined != (member_inline_size <= 4) {
3477                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3478                }
3479                let inner_offset;
3480                let mut inner_depth = depth.clone();
3481                if inlined {
3482                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3483                    inner_offset = next_offset;
3484                } else {
3485                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3486                    inner_depth.increment()?;
3487                }
3488                let val_ref = self.init_on.get_or_insert_with(|| fidl::new_empty!(bool, D));
3489                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3490                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3491                {
3492                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3493                }
3494                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3495                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3496                }
3497            }
3498
3499            next_offset += envelope_size;
3500            _next_ordinal_to_read += 1;
3501            if next_offset >= end_offset {
3502                return Ok(());
3503            }
3504
3505            // Decode unknown envelopes for gaps in ordinals.
3506            while _next_ordinal_to_read < 5 {
3507                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3508                _next_ordinal_to_read += 1;
3509                next_offset += envelope_size;
3510            }
3511
3512            let next_out_of_line = decoder.next_out_of_line();
3513            let handles_before = decoder.remaining_handles();
3514            if let Some((inlined, num_bytes, num_handles)) =
3515                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3516            {
3517                let member_inline_size =
3518                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3519                if inlined != (member_inline_size <= 4) {
3520                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3521                }
3522                let inner_offset;
3523                let mut inner_depth = depth.clone();
3524                if inlined {
3525                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3526                    inner_offset = next_offset;
3527                } else {
3528                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3529                    inner_depth.increment()?;
3530                }
3531                let val_ref = self.group_id.get_or_insert_with(|| fidl::new_empty!(i32, D));
3532                fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
3533                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3534                {
3535                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3536                }
3537                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3538                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3539                }
3540            }
3541
3542            next_offset += envelope_size;
3543
3544            // Decode the remaining unknown envelopes.
3545            while next_offset < end_offset {
3546                _next_ordinal_to_read += 1;
3547                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3548                next_offset += envelope_size;
3549            }
3550
3551            Ok(())
3552        }
3553    }
3554
3555    impl Metadata {
3556        #[inline(always)]
3557        fn max_ordinal_present(&self) -> u64 {
3558            if let Some(_) = self.configs {
3559                return 1;
3560            }
3561            0
3562        }
3563    }
3564
3565    impl fidl::encoding::ValueTypeMarker for Metadata {
3566        type Borrowed<'a> = &'a Self;
3567        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3568            value
3569        }
3570    }
3571
3572    unsafe impl fidl::encoding::TypeMarker for Metadata {
3573        type Owned = Self;
3574
3575        #[inline(always)]
3576        fn inline_align(_context: fidl::encoding::Context) -> usize {
3577            8
3578        }
3579
3580        #[inline(always)]
3581        fn inline_size(_context: fidl::encoding::Context) -> usize {
3582            16
3583        }
3584    }
3585
3586    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Metadata, D> for &Metadata {
3587        unsafe fn encode(
3588            self,
3589            encoder: &mut fidl::encoding::Encoder<'_, D>,
3590            offset: usize,
3591            mut depth: fidl::encoding::Depth,
3592        ) -> fidl::Result<()> {
3593            encoder.debug_check_bounds::<Metadata>(offset);
3594            // Vector header
3595            let max_ordinal: u64 = self.max_ordinal_present();
3596            encoder.write_num(max_ordinal, offset);
3597            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3598            // Calling encoder.out_of_line_offset(0) is not allowed.
3599            if max_ordinal == 0 {
3600                return Ok(());
3601            }
3602            depth.increment()?;
3603            let envelope_size = 8;
3604            let bytes_len = max_ordinal as usize * envelope_size;
3605            #[allow(unused_variables)]
3606            let offset = encoder.out_of_line_offset(bytes_len);
3607            let mut _prev_end_offset: usize = 0;
3608            if 1 > max_ordinal {
3609                return Ok(());
3610            }
3611
3612            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3613            // are envelope_size bytes.
3614            let cur_offset: usize = (1 - 1) * envelope_size;
3615
3616            // Zero reserved fields.
3617            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3618
3619            // Safety:
3620            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3621            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3622            //   envelope_size bytes, there is always sufficient room.
3623            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Config>, D>(
3624            self.configs.as_ref().map(<fidl::encoding::UnboundedVector<Config> as fidl::encoding::ValueTypeMarker>::borrow),
3625            encoder, offset + cur_offset, depth
3626        )?;
3627
3628            _prev_end_offset = cur_offset + envelope_size;
3629
3630            Ok(())
3631        }
3632    }
3633
3634    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Metadata {
3635        #[inline(always)]
3636        fn new_empty() -> Self {
3637            Self::default()
3638        }
3639
3640        unsafe fn decode(
3641            &mut self,
3642            decoder: &mut fidl::encoding::Decoder<'_, D>,
3643            offset: usize,
3644            mut depth: fidl::encoding::Depth,
3645        ) -> fidl::Result<()> {
3646            decoder.debug_check_bounds::<Self>(offset);
3647            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3648                None => return Err(fidl::Error::NotNullable),
3649                Some(len) => len,
3650            };
3651            // Calling decoder.out_of_line_offset(0) is not allowed.
3652            if len == 0 {
3653                return Ok(());
3654            };
3655            depth.increment()?;
3656            let envelope_size = 8;
3657            let bytes_len = len * envelope_size;
3658            let offset = decoder.out_of_line_offset(bytes_len)?;
3659            // Decode the envelope for each type.
3660            let mut _next_ordinal_to_read = 0;
3661            let mut next_offset = offset;
3662            let end_offset = offset + bytes_len;
3663            _next_ordinal_to_read += 1;
3664            if next_offset >= end_offset {
3665                return Ok(());
3666            }
3667
3668            // Decode unknown envelopes for gaps in ordinals.
3669            while _next_ordinal_to_read < 1 {
3670                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3671                _next_ordinal_to_read += 1;
3672                next_offset += envelope_size;
3673            }
3674
3675            let next_out_of_line = decoder.next_out_of_line();
3676            let handles_before = decoder.remaining_handles();
3677            if let Some((inlined, num_bytes, num_handles)) =
3678                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3679            {
3680                let member_inline_size = <fidl::encoding::UnboundedVector<Config> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3681                if inlined != (member_inline_size <= 4) {
3682                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3683                }
3684                let inner_offset;
3685                let mut inner_depth = depth.clone();
3686                if inlined {
3687                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3688                    inner_offset = next_offset;
3689                } else {
3690                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3691                    inner_depth.increment()?;
3692                }
3693                let val_ref = self.configs.get_or_insert_with(|| {
3694                    fidl::new_empty!(fidl::encoding::UnboundedVector<Config>, D)
3695                });
3696                fidl::decode!(
3697                    fidl::encoding::UnboundedVector<Config>,
3698                    D,
3699                    val_ref,
3700                    decoder,
3701                    inner_offset,
3702                    inner_depth
3703                )?;
3704                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3705                {
3706                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3707                }
3708                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3709                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3710                }
3711            }
3712
3713            next_offset += envelope_size;
3714
3715            // Decode the remaining unknown envelopes.
3716            while next_offset < end_offset {
3717                _next_ordinal_to_read += 1;
3718                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3719                next_offset += envelope_size;
3720            }
3721
3722            Ok(())
3723        }
3724    }
3725}