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