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